From c52827ed55d6b1cda54c8a36e7ece393da32c102 Mon Sep 17 00:00:00 2001 From: Lightmann Date: Mon, 29 Jun 2026 15:38:28 -0700 Subject: [PATCH 1/2] .clang-format based on WebKit --- .clang-format | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..d7e21718 --- /dev/null +++ b/.clang-format @@ -0,0 +1,49 @@ +BasedOnStyle: WebKit + +PointerAlignment: Right +DerivePointerAlignment: false + +SpaceAfterCStyleCast: false +SpaceBeforeParens: ControlStatements +SpacesInParentheses: false +SpacesInAngles: false +SpacesInSquareBrackets: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpaceInEmptyParentheses: false +SpaceInEmptyBlock: true + +SortIncludes: false +ColumnLimit: 0 +UseTab: Never + +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: false + +BraceWrapping: + AfterClass: false + AfterStruct: false + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + BeforeElse: false + BeforeCatch: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true + +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 + +IncludeCategories: + - Regex: '^"config\.h"' + Priority: -1 + - Regex: '^<.*SoftLink.h>' + Priority: 1 \ No newline at end of file From 0986dff6491771b1ed6fb379e63f27245987b2ca Mon Sep 17 00:00:00 2001 From: Lightmann Date: Mon, 29 Jun 2026 16:07:35 -0700 Subject: [PATCH 2/2] First pass with .clang-format --- AddressBookUI/ABMonogrammer.h | 8 +- AlienBlue/AlienBlueAppDelegate.h | 2 +- Anemone/ANEMSettingsManager.h | 2 +- AppList/ALApplicationList.h | 8 +- AppList/ALApplicationTableDataSource.h | 10 +- AppList/ALValueCell.h | 7 +- ApplePushService/APSMessage.h | 8 +- AssertionServices/BKSProcessAssertion.h | 106 +- Availability2.h | 686 +++---- BaseBoard/BSAction.h | 2 +- BaseBoard/BSAuditToken.h | 2 +- BaseBoard/BSPlatform.h | 10 +- BaseBoard/BSSettings.h | 2 +- BaseBoardUI/UIViewController+BaseBoardUI.h | 4 +- BatteryCenter/BCBatteryDevice.h | 22 +- BatteryCenter/BCBatteryDeviceController.h | 2 +- BiometricKit/BiometricKit.h | 2 +- BiometricKit/BiometricKitDelegate.h | 2 +- BiometricKit/BiometricKitIdentity.h | 2 +- BluetoothManager/BluetoothDevice.h | 2 +- BluetoothManager/BluetoothManager.h | 6 +- BulletinBoard/BBBulletin.h | 9 +- BulletinBoard/BBDataProvider.h | 8 +- BulletinBoard/BBDataProviderIdentity.h | 2 +- BulletinBoard/BBLocalDataProviderStore.h | 4 +- BulletinBoard/BBSectionIcon.h | 2 +- BulletinBoard/BBSectionInfo.h | 8 +- BulletinBoard/BBSectionInfoSettings.h | 6 +- BulletinBoard/BBSectionParameters.h | 2 +- CaptainHook/CaptainHook.h | 1115 +++++------ Celestial/AVSystemController.h | 52 +- ChatKit/CKConversationList.h | 2 +- ChatKit/CKConversationListCell.h | 2 +- Contacts/CN.h | 2 +- .../CCUIContentModule-Protocol.h | 6 +- ...tentModuleContentViewController-Protocol.h | 2 +- .../CCUILabeledRoundButtonViewController.h | 1 - ControlCenterUIKit/CCUIRoundButton.h | 2 +- ControlCenterUIKit/CCUIToggleModule.h | 4 +- CoreFoundation/CFLogUtilities.h | 3 +- CoreFoundation/CFUserNotification.h | 38 +- Flipswitch/FSSwitchDataSource.h | 4 +- Flipswitch/FSSwitchPanel.h | 12 +- Flipswitch/FSSwitchSettingsViewController.h | 2 +- Flipswitch/FSSwitchState.h | 6 +- Foundation/NSXPCConnection.h | 10 +- FrontBoard/FBSceneClient.h | 2 +- FrontBoard/FBSceneClientProvider.h | 2 +- FrontBoard/FBSystemGestureManager.h | 2 +- FrontBoard/FBWorkspaceEvent.h | 2 +- .../FBSOpenApplicationOptions.h | 2 +- FrontBoardServices/FBSSceneSettings.h | 2 +- FrontBoardServices/FBSSystemService.h | 4 +- GraphicsServices/GSCapability.h | 7 +- GraphicsServices/GSColor.h | 12 +- GraphicsServices/GSEvent.h | 90 +- GraphicsServices/GSFont.h | 21 +- GraphicsServices/GSHeartbeat.h | 1 - GraphicsServices/GSKeyboard.h | 34 +- HBLog.h | 64 +- IMCore/IMHandle.h | 2 +- IMCore/IMServiceImpl.h | 4 +- IMDaemonCore/IMDChat.h | 6 +- IMDaemonCore/IMDChatRegistry.h | 2 +- IMFoundation/IMMessageItem.h | 2 +- IOKit/IOKitKeys.h | 135 +- IOKit/IOKitLib.h | 830 ++++----- IOKit/IOMessage.h | 63 +- IOKit/IOReturn.h | 158 +- IOKit/IOTypes.h | 154 +- IOKit/OSKext.h | 416 ++--- IOKit/OSMessageNotification.h | 75 +- IOKit/hid/IOHIDDisplay.h | 91 +- IOKit/hid/IOHIDEvent.h | 228 +-- IOKit/hid/IOHIDEventData.h | 1660 ++++++++--------- IOKit/hid/IOHIDEventQueue.h | 38 +- IOKit/hid/IOHIDEventSystem.h | 47 +- IOKit/hid/IOHIDEventSystemClient.h | 35 +- IOKit/hid/IOHIDEventTypes.h | 88 +- IOKit/hid/IOHIDNotification.h | 43 +- IOKit/hid/IOHIDService.h | 66 +- IOKit/hid/IOHIDSession.h | 96 +- IOKit/hid/IOHIDUserDevice.h | 13 +- IOKit/ps/IOPSKeys.h | 159 +- IOKit/ps/IOPowerSources.h | 23 +- IOKit/ps/IOUPSPlugIn.h | 74 +- IOKit/pwr_mgt/IOPM.h | 476 +++-- IOKit/pwr_mgt/IOPMKeys.h | 22 +- IOKit/pwr_mgt/IOPMLib.h | 228 +-- IOKit/pwr_mgt/IOPMLibDefs.h | 23 +- LightMessaging/LightMessaging.h | 644 +++---- LightMessaging/bootstrap.h | 76 +- LowPowerMode/_PLLowPowerMode.h | 1 - MapKit/MKMapItem+Private.h | 2 +- MaterialKit/MTLumaDodgePillView.h | 16 +- MediaPlayer/MPAVRoutingController.h | 1 - MediaPlayerUI/MPUNowPlayingController.h | 4 +- MobileCoreServices/LSAppLink.h | 8 +- MobileCoreServices/LSApplicationProxy.h | 22 +- MobileCoreServices/LSApplicationWorkspace.h | 43 +- MobileCoreServices/LSBundleProxy.h | 8 +- MobileCoreServices/LSDocumentProxy.h | 8 +- MobileCoreServices/_LSQueryResult.h | 2 +- MobileGestalt/MobileGestalt.h | 20 +- MobileIcons/MobileIcons.h | 58 +- OnBoardingKit/OBWelcomeController.h | 2 +- PassKitUI/PKGlyphViewDelegate.h | 2 +- PersonaKit/PRLikeness.h | 3 +- PersonaUI/PRMonogram.h | 4 +- PersonaUI/PRMonogramView.h | 2 +- PhotoLibrary/PLWallpaperImageViewController.h | 6 +- Preferences/PSEditableTableCell.h | 6 +- Preferences/PSHeaderFooterView.h | 2 +- Preferences/PSListController.h | 4 +- Preferences/PSSpecifier.h | 2 +- Preferences/PSSwitchTableCell.h | 2 +- Preferences/PSSystemPolicyForApp.h | 12 +- Preferences/PSTableCell.h | 32 +- Preferences/PreferencesAppController.h | 2 +- PreferencesUI/DevicePINControllerDelegate.h | 2 +- PreferencesUI/PSUIPrefsListController.h | 4 +- QuartzCore/CAFilter.h | 4 +- QuartzCore/CARenderValue.h | 1 - QuartzCore/QuartzCore-Structs.h | 308 ++- SparkAppItem.h | 6 +- SparkAppList.h | 17 +- SparkAppListTableViewController.h | 12 +- SparkColourPickerUtils.h | 24 +- SparkColourPickerView.h | 12 +- SpringBoard/SBActivationSettings.h | 106 +- SpringBoard/SBAppSliderController.h | 2 +- SpringBoard/SBAppSwitcherController.h | 2 +- SpringBoard/SBAppSwitcherPeopleDataSource.h | 2 +- .../SBAppSwitcherPeopleScrollViewDelegate.h | 2 +- SpringBoard/SBAppViewController.h | 2 +- SpringBoard/SBAppViewControllerDelegate.h | 2 +- SpringBoard/SBApplicationHosting.h | 2 +- SpringBoard/SBApplicationIcon.h | 3 +- SpringBoard/SBBannerView.h | 3 +- SpringBoard/SBBulletinBannerView.h | 3 +- SpringBoard/SBBulletinListCell.h | 4 +- SpringBoard/SBBulletinListSection.h | 2 +- SpringBoard/SBControlCenterController.h | 4 +- SpringBoard/SBFolder.h | 2 +- SpringBoard/SBIconController.h | 9 +- SpringBoard/SBIconList.h | 3 +- SpringBoard/SBIconListView.h | 8 +- SpringBoard/SBIconModel.h | 3 +- SpringBoard/SBLockScreenManager.h | 3 +- SpringBoard/SBMainWorkspace.h | 4 +- SpringBoard/SBNotificationCenterController.h | 2 +- SpringBoard/SBPreciseClockTimer.h | 2 +- SpringBoard/SBSystemGestureManager.h | 30 +- .../SBSystemGestureRecognizerDelegate.h | 2 +- SpringBoard/SBUIController.h | 2 +- SpringBoard/SBWallpaperEffectView.h | 64 +- .../SBWorkspaceApplicationTransitionContext.h | 6 +- SpringBoard/VolumeControl.h | 2 +- SpringBoardHome/SBHIconGridSize.h | 4 +- .../SBSApplicationShortcutItem.h | 2 +- SpringBoardServices/SBSRelaunchAction.h | 8 +- .../_SBUIWidgetViewController.h | 4 +- TechSupport/TSContactViewController.h | 12 +- TechSupport/TSEmailInstruction.h | 8 +- TechSupport/TSHTMLViewController.h | 2 +- TechSupport/TSIncludeInstruction.h | 10 +- TechSupport/TSInstruction.h | 4 +- TechSupport/TSLinkInstruction.h | 10 +- TechSupport/TSPackage.h | 24 +- TextInput/NSString+TIExtras.h | 2 +- TextInput/TIKeyboardLayoutFactory.h | 4 +- UIFoundation/_UICache.h | 2 +- UIKit/UIAlertAction+Private.h | 1 - UIKit/UIApplication+Private.h | 10 +- UIKit/UIKBTree.h | 1 - UIKit/UIKeyboardImpl.h | 4 +- UIKit/UIKeyboardInputModeController.h | 2 +- UIKit/UIPeripheralHost.h | 2 +- ...UIScreenEdgePanGestureRecognizer+Private.h | 2 +- UIKit/UIStatusBar.h | 8 +- UIKit/UIStatusBarForegroundStyleAttributes.h | 1 - UIKit/UIStatusBarHideAnimationParameters.h | 6 +- UIKit/UIStatusBarItem.h | 2 +- UIKit/UIStatusBarItemView.h | 4 +- UIKit/UITextInputTraits+Private.h | 2 +- UIKit/_UIBackdropView.h | 8 +- UIKit/_UIHostedWindowHostingHandle.h | 2 +- UIKit/_UIRemoteView.h | 2 +- .../NCNotificationStaticContentProviding.h | 2 +- .../NCNotificationViewController.h | 2 +- bootstrap.h | 76 +- installd/MIBundle.h | 16 +- launch.h | 160 +- libactivator/LAActivator.h | 18 +- libactivator/LAEvent.h | 227 +-- libactivator/LAEventDataSource.h | 3 +- libactivator/LAListener.h | 2 +- libactivator/LASettingsViewController.h | 21 +- libcolorpicker.h | 2 +- libhooker/libhooker.h | 6 +- libpackageinfo/PIApplePackage.h | 2 +- libpackageinfo/PIPackage.h | 21 +- libprefs/prefs.h | 6 +- libroot/libroot.h | 47 +- libstatusbar/LSStatusBarItem.h | 48 +- libundirect/libundirect.h | 29 +- libundirect/libundirect_dynamic.h | 281 ++- libundirect/libundirect_hookoverwrite.h | 2 +- rocketbootstrap/rocketbootstrap.h | 1 - rocketbootstrap/rocketbootstrap_dynamic.h | 126 +- rootless.h | 11 +- sandbox.h | 22 +- theos/BackwardsCompat.h | 43 +- 213 files changed, 5192 insertions(+), 5501 deletions(-) diff --git a/AddressBookUI/ABMonogrammer.h b/AddressBookUI/ABMonogrammer.h index 0e260e22..a8643fb7 100644 --- a/AddressBookUI/ABMonogrammer.h +++ b/AddressBookUI/ABMonogrammer.h @@ -1,10 +1,10 @@ #import typedef NS_ENUM(NSUInteger, ABMonogrammerStyle) { - ABMonogrammerStyleLightGray, - ABMonogrammerStyleWhite, - ABMonogrammerStyleDarkGraySemitransparent, - ABMonogrammerStyleLightGraySemitransparent, + ABMonogrammerStyleLightGray, + ABMonogrammerStyleWhite, + ABMonogrammerStyleDarkGraySemitransparent, + ABMonogrammerStyleLightGraySemitransparent, }; /* Removed in iOS 11 diff --git a/AlienBlue/AlienBlueAppDelegate.h b/AlienBlue/AlienBlueAppDelegate.h index 25810c60..c8f570f0 100644 --- a/AlienBlue/AlienBlueAppDelegate.h +++ b/AlienBlue/AlienBlueAppDelegate.h @@ -1,7 +1,7 @@ #import #import -@interface AlienBlueAppDelegate : NSObject +@interface AlienBlueAppDelegate : NSObject @property (nonatomic, retain) UIWindow *window; diff --git a/Anemone/ANEMSettingsManager.h b/Anemone/ANEMSettingsManager.h index f3ac59fa..baf1dadf 100644 --- a/Anemone/ANEMSettingsManager.h +++ b/Anemone/ANEMSettingsManager.h @@ -5,6 +5,6 @@ + (instancetype)sharedManager; -@property (nonatomic, retain, readonly) NSArray *themeSettings; +@property (nonatomic, retain, readonly) NSArray *themeSettings; @end diff --git a/AppList/ALApplicationList.h b/AppList/ALApplicationList.h index 28bdf46a..e315ea07 100644 --- a/AppList/ALApplicationList.h +++ b/AppList/ALApplicationList.h @@ -2,15 +2,15 @@ #import enum { - ALApplicationIconSizeSmall = 29, - ALApplicationIconSizeLarge = 59 + ALApplicationIconSizeSmall = 29, + ALApplicationIconSizeLarge = 59 }; typedef NSUInteger ALApplicationIconSize; @interface ALApplicationList : NSObject { @private - NSMutableDictionary *cachedIcons; - OSSpinLock spinLock; + NSMutableDictionary *cachedIcons; + OSSpinLock spinLock; } + (ALApplicationList *)sharedApplicationList; diff --git a/AppList/ALApplicationTableDataSource.h b/AppList/ALApplicationTableDataSource.h index 1fd38ce1..8448c43e 100644 --- a/AppList/ALApplicationTableDataSource.h +++ b/AppList/ALApplicationTableDataSource.h @@ -3,12 +3,12 @@ @class ALApplicationList; -@interface ALApplicationTableDataSource : NSObject { +@interface ALApplicationTableDataSource : NSObject { @private - NSMutableArray *_sectionDescriptors; - UITableView *_tableView; - NSBundle *_localizationBundle; - BOOL _loadsAsynchronously; + NSMutableArray *_sectionDescriptors; + UITableView *_tableView; + NSBundle *_localizationBundle; + BOOL _loadsAsynchronously; } + (NSArray *)standardSectionDescriptors; diff --git a/AppList/ALValueCell.h b/AppList/ALValueCell.h index bd07c9fa..ce98835a 100644 --- a/AppList/ALValueCell.h +++ b/AppList/ALValueCell.h @@ -4,7 +4,7 @@ @interface ALValueCell : UITableViewCell { @private - id delegate; + id delegate; } @property (nonatomic, assign) id delegate; @@ -16,14 +16,14 @@ @end -@protocol ALValueCellDelegate +@protocol ALValueCellDelegate @required - (void)valueCell:(ALValueCell *)valueCell didChangeToValue:(id)newValue; @end @interface ALSwitchCell : ALValueCell { @private - UISwitch *switchView; + UISwitch *switchView; } @property (nonatomic, readonly) UISwitch *switchView; @@ -37,4 +37,3 @@ @interface ALDisclosureIndicatedCell : ALValueCell @end - diff --git a/ApplePushService/APSMessage.h b/ApplePushService/APSMessage.h index 19b1e17a..201cd782 100644 --- a/ApplePushService/APSMessage.h +++ b/ApplePushService/APSMessage.h @@ -3,7 +3,7 @@ #import #import -@interface APSMessage : NSObject +@interface APSMessage : NSObject - (id)initWithDictionary:(NSDictionary *)dictionary; - (id)initWithDictionary:(NSDictionary *)dictionary xpcMessage:(id)xpcMessage; @@ -13,8 +13,8 @@ @property (nonatomic, retain) NSString *topic; @property (nonatomic, retain) NSDictionary *userInfo; -- (NSDictionary *)dictionaryRepresentation; -- (id )objectForKey:(NSString *)key; -- (void)setObject:(id )object forKey:(NSString *)key; +- (NSDictionary *)dictionaryRepresentation; +- (id)objectForKey:(NSString *)key; +- (void)setObject:(id)object forKey:(NSString *)key; @end diff --git a/AssertionServices/BKSProcessAssertion.h b/AssertionServices/BKSProcessAssertion.h index 3a82c21b..9ac0f921 100644 --- a/AssertionServices/BKSProcessAssertion.h +++ b/AssertionServices/BKSProcessAssertion.h @@ -3,64 +3,64 @@ #import #define kBKSBackgroundModeUnboundedTaskCompletion @"unboundedTaskCompletion" -#define kBKSBackgroundModeContinuous @"continuous" -#define kBKSBackgroundModeFetch @"fetch" -#define kBKSBackgroundModeRemoteNotification @"remote-notification" -#define kBKSBackgroundModeExternalAccessory @"external-accessory" -#define kBKSBackgroundModeVoIP @"voip" -#define kBKSBackgroundModeLocation @"location" -#define kBKSBackgroundModeAudio @"audio" -#define kBKSBackgroundModeBluetoothCentral @"bluetooth-central" -#define kBKSBackgroundModeBluetoothPeripheral @"bluetooth-peripheral" +#define kBKSBackgroundModeContinuous @"continuous" +#define kBKSBackgroundModeFetch @"fetch" +#define kBKSBackgroundModeRemoteNotification @"remote-notification" +#define kBKSBackgroundModeExternalAccessory @"external-accessory" +#define kBKSBackgroundModeVoIP @"voip" +#define kBKSBackgroundModeLocation @"location" +#define kBKSBackgroundModeAudio @"audio" +#define kBKSBackgroundModeBluetoothCentral @"bluetooth-central" +#define kBKSBackgroundModeBluetoothPeripheral @"bluetooth-peripheral" typedef NS_ENUM(NSUInteger, BKSProcessAssertionReason) { - BKSProcessAssertionReasonNone = 0, - BKSProcessAssertionReasonAudio = 1, - BKSProcessAssertionReasonLocation = 2, - BKSProcessAssertionReasonExternalAccessory = 3, - BKSProcessAssertionReasonFinishTask = 4, - BKSProcessAssertionReasonBluetooth = 5, - BKSProcessAssertionReasonNetworkAuthentication = 6, - BKSProcessAssertionReasonBackgroundUI = 7, - BKSProcessAssertionReasonInterAppAudioStreaming = 8, - BKSProcessAssertionReasonViewServices = 9, - BKSProcessAssertionReasonNewsstandDownload = 10, - BKSProcessAssertionReasonBackgroundDownload = 11, - BKSProcessAssertionReasonVOiP = 12, - BKSProcessAssertionReasonExtension = 13, - BKSProcessAssertionReasonContinuityStreams = 14, - BKSProcessAssertionReasonHealthKit = 15, - BKSProcessAssertionReasonWatchConnectivity = 16, - BKSProcessAssertionReasonSnapshot = 17, - BKSProcessAssertionReasonComplicationUpdate = 18, - BKSProcessAssertionReasonWorkoutProcessing = 19, - BKSProcessAssertionReasonComplicationPushUpdate = 20, - // 21-9999 unknown - BKSProcessAssertionReasonActivation = 10000, - BKSProcessAssertionReasonSuspend = 10001, - BKSProcessAssertionReasonTransientWakeup = 10002, - BKSProcessAssertionReasonVOiP_PreiOS8 = 10003, - BKSProcessAssertionReasonPeriodicTask_iOS8 = BKSProcessAssertionReasonVOiP_PreiOS8, - BKSProcessAssertionReasonFinishTaskUnbounded = 10004, - BKSProcessAssertionReasonContinuous = 10005, - BKSProcessAssertionReasonBackgroundContentFetching = 10006, - BKSProcessAssertionReasonNotificationAction = 10007, - BKSProcessAssertionReasonPIP = 10008, - // 10009-49999 unknown - BKSProcessAssertionReasonFinishTaskAfterBackgroundContentFetching = 50000, - BKSProcessAssertionReasonFinishTaskAfterBackgroundDownload = 50001, - BKSProcessAssertionReasonFinishTaskAfterPeriodicTask = 50002, - BKSProcessAssertionReasonAfterNoficationAction = 50003, - BKSProcessAssertionReasonFinishTaskAfterWatchConnectivity = 50004, - // 50005+ unknown + BKSProcessAssertionReasonNone = 0, + BKSProcessAssertionReasonAudio = 1, + BKSProcessAssertionReasonLocation = 2, + BKSProcessAssertionReasonExternalAccessory = 3, + BKSProcessAssertionReasonFinishTask = 4, + BKSProcessAssertionReasonBluetooth = 5, + BKSProcessAssertionReasonNetworkAuthentication = 6, + BKSProcessAssertionReasonBackgroundUI = 7, + BKSProcessAssertionReasonInterAppAudioStreaming = 8, + BKSProcessAssertionReasonViewServices = 9, + BKSProcessAssertionReasonNewsstandDownload = 10, + BKSProcessAssertionReasonBackgroundDownload = 11, + BKSProcessAssertionReasonVOiP = 12, + BKSProcessAssertionReasonExtension = 13, + BKSProcessAssertionReasonContinuityStreams = 14, + BKSProcessAssertionReasonHealthKit = 15, + BKSProcessAssertionReasonWatchConnectivity = 16, + BKSProcessAssertionReasonSnapshot = 17, + BKSProcessAssertionReasonComplicationUpdate = 18, + BKSProcessAssertionReasonWorkoutProcessing = 19, + BKSProcessAssertionReasonComplicationPushUpdate = 20, + // 21-9999 unknown + BKSProcessAssertionReasonActivation = 10000, + BKSProcessAssertionReasonSuspend = 10001, + BKSProcessAssertionReasonTransientWakeup = 10002, + BKSProcessAssertionReasonVOiP_PreiOS8 = 10003, + BKSProcessAssertionReasonPeriodicTask_iOS8 = BKSProcessAssertionReasonVOiP_PreiOS8, + BKSProcessAssertionReasonFinishTaskUnbounded = 10004, + BKSProcessAssertionReasonContinuous = 10005, + BKSProcessAssertionReasonBackgroundContentFetching = 10006, + BKSProcessAssertionReasonNotificationAction = 10007, + BKSProcessAssertionReasonPIP = 10008, + // 10009-49999 unknown + BKSProcessAssertionReasonFinishTaskAfterBackgroundContentFetching = 50000, + BKSProcessAssertionReasonFinishTaskAfterBackgroundDownload = 50001, + BKSProcessAssertionReasonFinishTaskAfterPeriodicTask = 50002, + BKSProcessAssertionReasonAfterNoficationAction = 50003, + BKSProcessAssertionReasonFinishTaskAfterWatchConnectivity = 50004, + // 50005+ unknown }; typedef NS_ENUM(NSUInteger, ProcessAssertionFlags) { - BKSProcessAssertionFlagNone = 0, - BKSProcessAssertionFlagPreventSuspend = 1 << 0, - BKSProcessAssertionFlagPreventThrottleDownCPU = 1 << 1, - BKSProcessAssertionFlagAllowIdleSleep = 1 << 2, - BKSProcessAssertionFlagWantsForegroundResourcePriority = 1 << 3 + BKSProcessAssertionFlagNone = 0, + BKSProcessAssertionFlagPreventSuspend = 1 << 0, + BKSProcessAssertionFlagPreventThrottleDownCPU = 1 << 1, + BKSProcessAssertionFlagAllowIdleSleep = 1 << 2, + BKSProcessAssertionFlagWantsForegroundResourcePriority = 1 << 3 }; @interface BKSProcessAssertion : NSObject diff --git a/Availability2.h b/Availability2.h index 3b13f314..42f6ff07 100644 --- a/Availability2.h +++ b/Availability2.h @@ -3,361 +3,361 @@ #include #ifndef __IPHONE_2_1 - #define __IPHONE_2_1 20100 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_2_1 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_2_1 20100 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_2_1 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_1 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #ifndef __IPHONE_2_2 - #define __IPHONE_2_2 20200 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_2_2 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_2_2 20200 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_2_2 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_2_2 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #ifndef __IPHONE_3_0 - #define __IPHONE_3_0 30000 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_0 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_3_0 30000 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_0 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_0 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #ifndef __IPHONE_3_1 - #define __IPHONE_3_1 30100 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_1 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_3_1 30100 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_1 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_1 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #ifndef __IPHONE_3_2 - #define __IPHONE_3_2 30200 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_2 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_3_2 30200 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_2 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_2 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #ifndef __IPHONE_3_3 - #define __IPHONE_3_3 30300 - #define __AVAILABILITY_INTERNAL__IPHONE_3_3 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_3 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_3_3 30300 +#define __AVAILABILITY_INTERNAL__IPHONE_3_3 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_3_3 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_3_3 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #ifndef __IPHONE_4_0 - #define __IPHONE_4_0 40000 - #define __AVAILABILITY_INTERNAL__IPHONE_4_0 __AVAILABILITY_INTERNAL_UNAVAILABLE - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_4_0 - #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_2 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_3 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT - #else - #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED - #endif +#define __IPHONE_4_0 40000 +#define __AVAILABILITY_INTERNAL__IPHONE_4_0 __AVAILABILITY_INTERNAL_UNAVAILABLE +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_NA __AVAILABILITY_INTERNAL__IPHONE_4_0 +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_2_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_1 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_2 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_3_3 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_WEAK_IMPORT +#else +#define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_1_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_3_3_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0 __AVAILABILITY_INTERNAL_DEPRECATED +#endif #endif #endif diff --git a/BaseBoard/BSAction.h b/BaseBoard/BSAction.h index 55d1c40c..fd09817f 100644 --- a/BaseBoard/BSAction.h +++ b/BaseBoard/BSAction.h @@ -3,6 +3,6 @@ #import "BSXPCCoding.h" #import -@interface BSAction : NSObject +@interface BSAction : NSObject @end diff --git a/BaseBoard/BSAuditToken.h b/BaseBoard/BSAuditToken.h index 802e1fcf..0fde9346 100644 --- a/BaseBoard/BSAuditToken.h +++ b/BaseBoard/BSAuditToken.h @@ -1,7 +1,7 @@ #import #import -@interface BSAuditToken : NSObject +@interface BSAuditToken : NSObject @property (nonatomic, copy, readonly) NSString *bundleID; @property (nonatomic, readonly) pid_t pid; diff --git a/BaseBoard/BSPlatform.h b/BaseBoard/BSPlatform.h index 3e087e50..3bea6532 100644 --- a/BaseBoard/BSPlatform.h +++ b/BaseBoard/BSPlatform.h @@ -3,14 +3,14 @@ #import typedef NS_ENUM(NSUInteger, BSDeviceClass) { - BSDeviceClassIPhone, - BSDeviceClassIPod, - BSDeviceClassIPad + BSDeviceClassIPhone, + BSDeviceClassIPod, + BSDeviceClassIPad }; typedef NS_ENUM(NSUInteger, BSHomeButtonType) { - BSHomeButtonTypeButton = 0, - BSHomeButtonTypeBorderless = 2 + BSHomeButtonTypeButton = 0, + BSHomeButtonTypeBorderless = 2 }; @interface BSPlatform : NSObject diff --git a/BaseBoard/BSSettings.h b/BaseBoard/BSSettings.h index ef78cf1a..1411f108 100644 --- a/BaseBoard/BSSettings.h +++ b/BaseBoard/BSSettings.h @@ -3,7 +3,7 @@ #import typedef NS_ENUM(NSUInteger, BSSettingType) { - BSSettingTypeThisIsAReminderToFillOutTheseEnumNames = 8 + BSSettingTypeThisIsAReminderToFillOutTheseEnumNames = 8 }; @interface BSSettings : NSObject diff --git a/BaseBoardUI/UIViewController+BaseBoardUI.h b/BaseBoardUI/UIViewController+BaseBoardUI.h index 92688e20..067e6c76 100644 --- a/BaseBoardUI/UIViewController+BaseBoardUI.h +++ b/BaseBoardUI/UIViewController+BaseBoardUI.h @@ -3,9 +3,9 @@ @interface UIViewController (BaseBoardUI) - (BOOL)bs_addChildViewController:(UIViewController *)childController; -- (BOOL)bs_addChildViewController:(UIViewController *)childController animated:(BOOL)animated transitionBlock:(void(^)())block; +- (BOOL)bs_addChildViewController:(UIViewController *)childController animated:(BOOL)animated transitionBlock:(void (^)())block; - (BOOL)bs_removeChildViewController:(UIViewController *)childController; -- (BOOL)bs_removeChildViewController:(UIViewController *)childController animated:(BOOL)animated transitionBlock:(void(^)())block; +- (BOOL)bs_removeChildViewController:(UIViewController *)childController animated:(BOOL)animated transitionBlock:(void (^)())block; @end diff --git a/BatteryCenter/BCBatteryDevice.h b/BatteryCenter/BCBatteryDevice.h index a35ee02e..0df9cd4e 100644 --- a/BatteryCenter/BCBatteryDevice.h +++ b/BatteryCenter/BCBatteryDevice.h @@ -29,24 +29,24 @@ typedef NS_ENUM(NSUInteger, BCBatteryDeviceAccessoryCategory) { typedef NS_OPTIONS(NSUInteger, BCBatteryDevicePart) { BCBatteryDevicePartNone, - BCBatteryDevicePartLeft = 1 << 0, + BCBatteryDevicePartLeft = 1 << 0, BCBatteryDevicePartRight = 1 << 1, - BCBatteryDevicePartCase = 1 << 2, + BCBatteryDevicePartCase = 1 << 2, }; typedef NS_ENUM(NSInteger, BCBatteryDeviceTransportType) { - BCBatteryDeviceTransportTypeUnknown = 0, - BCBatteryDeviceTransportTypeInternal = 1, - BCBatteryDeviceTransportTypeSerial = 2, - BCBatteryDeviceTransportTypeUSB = 2, - BCBatteryDeviceTransportTypeAID = 2, - BCBatteryDeviceTransportTypeBluetooth = 3, - BCBatteryDeviceTransportTypeBluetoothLE = 3, + BCBatteryDeviceTransportTypeUnknown = 0, + BCBatteryDeviceTransportTypeInternal = 1, + BCBatteryDeviceTransportTypeSerial = 2, + BCBatteryDeviceTransportTypeUSB = 2, + BCBatteryDeviceTransportTypeAID = 2, + BCBatteryDeviceTransportTypeBluetooth = 3, + BCBatteryDeviceTransportTypeBluetoothLE = 3, BCBatteryDeviceTransportTypeInductiveInBand = 3, }; API_AVAILABLE(ios(9.0)) -@interface BCBatteryDevice : NSObject // NSSecureCoding in 11.4 +@interface BCBatteryDevice : NSObject // NSSecureCoding in 11.4 @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *identifier; @@ -57,7 +57,7 @@ API_AVAILABLE(ios(9.0)) @property (nonatomic, copy) NSString *groupName API_AVAILABLE(ios(9.3)); @property (nonatomic) BCBatteryDeviceAccessoryCategory accessoryCategory API_AVAILABLE(ios(11.4)); -@property (nonatomic, copy) NSString *accessoryIdentifier API_AVAILABLE(ios(11.4)); +@property (nonatomic, copy) NSString *accessoryIdentifier API_AVAILABLE(ios(11.4)); @property (nonatomic) BOOL approximatesPercentCharge API_AVAILABLE(ios(10.0)); diff --git a/BatteryCenter/BCBatteryDeviceController.h b/BatteryCenter/BCBatteryDeviceController.h index 2c1e6f7e..d5cec12b 100644 --- a/BatteryCenter/BCBatteryDeviceController.h +++ b/BatteryCenter/BCBatteryDeviceController.h @@ -3,7 +3,7 @@ API_AVAILABLE(ios(9.0)) @interface BCBatteryDeviceController : NSObject -@property (nonatomic, readonly) NSArray *connectedDevices; +@property (nonatomic, readonly) NSArray *connectedDevices; @property (nonatomic, readonly) NSString *connectedDevicesDidChangeNotificationName; + (instancetype)sharedInstance; diff --git a/BiometricKit/BiometricKit.h b/BiometricKit/BiometricKit.h index cbd09a52..efba8a07 100644 --- a/BiometricKit/BiometricKit.h +++ b/BiometricKit/BiometricKit.h @@ -10,7 +10,7 @@ API_AVAILABLE(ios(7.0)) @property (assign) BOOL inUse; // research on iOS 10.2 shows `options` supports { "BKFilterIdentity" : BiometricKitIdentity } -- (NSArray *)identities:(NSDictionary *)options; +- (NSArray *)identities:(NSDictionary *)options; - (float)getModulationRatio; diff --git a/BiometricKit/BiometricKitDelegate.h b/BiometricKit/BiometricKitDelegate.h index 5bb742fc..851ad322 100644 --- a/BiometricKit/BiometricKitDelegate.h +++ b/BiometricKit/BiometricKitDelegate.h @@ -2,7 +2,7 @@ @class BiometricKitEnrollProgressInfo, BiometricKitIdentity; -@protocol BiometricKitDelegate +@protocol BiometricKitDelegate @optional - (void)enrollProgress:(BiometricKitEnrollProgressInfo *)progress; diff --git a/BiometricKit/BiometricKitIdentity.h b/BiometricKit/BiometricKitIdentity.h index 7b84ff3c..869b2387 100644 --- a/BiometricKit/BiometricKitIdentity.h +++ b/BiometricKit/BiometricKitIdentity.h @@ -1,7 +1,7 @@ #import API_AVAILABLE(ios(7.0)) -@interface BiometricKitIdentity : NSObject +@interface BiometricKitIdentity : NSObject + (instancetype)biometricKitIdentity; diff --git a/BluetoothManager/BluetoothDevice.h b/BluetoothManager/BluetoothDevice.h index db901afa..3387d173 100644 --- a/BluetoothManager/BluetoothDevice.h +++ b/BluetoothManager/BluetoothDevice.h @@ -3,7 +3,7 @@ typedef struct BTDeviceImpl *BTDeviceImplRef; API_AVAILABLE(ios(5.0)) -@interface BluetoothDevice : NSObject +@interface BluetoothDevice : NSObject - (instancetype)initWithDevice:(BTDeviceImplRef)device address:(NSString *)address; diff --git a/BluetoothManager/BluetoothManager.h b/BluetoothManager/BluetoothManager.h index 9f745adb..6818512a 100644 --- a/BluetoothManager/BluetoothManager.h +++ b/BluetoothManager/BluetoothManager.h @@ -47,9 +47,9 @@ API_AVAILABLE(ios(5.0)) - (BOOL)isDiscoverable; - (void)setDiscoverable:(BOOL)discoverable; -- (NSArray *)pairedDevices; -- (NSArray *)connectedDevices; -- (NSArray *)connectingDevices; +- (NSArray *)pairedDevices; +- (NSArray *)connectedDevices; +- (NSArray *)connectingDevices; - (void)disconnectDevice:(BluetoothDevice *)device; - (void)unpairDevice:(BluetoothDevice *)device; diff --git a/BulletinBoard/BBBulletin.h b/BulletinBoard/BBBulletin.h index 436adbeb..6e8ec856 100644 --- a/BulletinBoard/BBBulletin.h +++ b/BulletinBoard/BBBulletin.h @@ -4,15 +4,16 @@ @class BBAction, BBContent, BBSectionIcon, BBSectionParameters, BBSectionSubtypeParameters, BBImage; typedef NS_ENUM(NSUInteger, BBBulletinAccessoryStyle) { - BBBulletinAccessoryStyleNone, - BBBulletinAccessoryStyleVIP = 4 + BBBulletinAccessoryStyleNone, + BBBulletinAccessoryStyleVIP = 4 }; typedef NS_ENUM(NSInteger, BBAttachmentMetadataType) { - BBAttachmentMetadataTypeImage = 1 + BBAttachmentMetadataTypeImage = 1 }; -API_AVAILABLE(ios(5.0)) @interface BBBulletin : NSObject +API_AVAILABLE(ios(5.0)) +@interface BBBulletin : NSObject @property (nonatomic, copy) NSString *section; @property (nonatomic, copy) NSString *sectionID; diff --git a/BulletinBoard/BBDataProvider.h b/BulletinBoard/BBDataProvider.h index 427f6015..199bf98b 100644 --- a/BulletinBoard/BBDataProvider.h +++ b/BulletinBoard/BBDataProvider.h @@ -3,7 +3,7 @@ @class BBActionResponse, BBBulletinRequestParameters, BBDataProviderIdentity, BBSectionIcon, BBSectionInfo, BBSectionParameters, BBThumbnailSizeConstraints; -@protocol BBSectionIdentity +@protocol BBSectionIdentity @required @@ -22,7 +22,7 @@ @end -@protocol BBDataProvider +@protocol BBDataProvider - (NSArray *)sortDescriptors; @@ -35,7 +35,7 @@ - (BOOL)migrateSectionInfo:(BBSectionInfo *)sectionInfo oldSectionInfo:(BBSectionInfo *)sectionInfo; - (BOOL)syncsBulletinDismissal; -- (NSArray *)defaultSubsectionInfos; +- (NSArray *)defaultSubsectionInfos; - (NSString *)displayNameForSubsectionID:(NSString *)subsectionID; - (void)noteSectionInfoDidChange:(BBSectionInfo *)sectionInfo; @@ -64,7 +64,7 @@ @end -@interface BBDataProvider : NSObject +@interface BBDataProvider : NSObject @property (nonatomic, retain) BBDataProviderIdentity *identity; diff --git a/BulletinBoard/BBDataProviderIdentity.h b/BulletinBoard/BBDataProviderIdentity.h index 62427765..2c6830be 100644 --- a/BulletinBoard/BBDataProviderIdentity.h +++ b/BulletinBoard/BBDataProviderIdentity.h @@ -12,7 +12,7 @@ @property (nonatomic, retain) NSString *sectionDisplayName; @property (nonatomic, retain) BBSectionInfo *defaultSectionInfo; -@property (nonatomic, retain) NSArray *defaultSubsectionInfos; +@property (nonatomic, retain) NSArray *defaultSubsectionInfos; @property (nonatomic, retain) BBSectionParameters *sectionParameters; diff --git a/BulletinBoard/BBLocalDataProviderStore.h b/BulletinBoard/BBLocalDataProviderStore.h index 5e39de5b..343cd58a 100644 --- a/BulletinBoard/BBLocalDataProviderStore.h +++ b/BulletinBoard/BBLocalDataProviderStore.h @@ -4,8 +4,8 @@ @interface BBLocalDataProviderStore : NSObject -- (void)addDataProvider:(id )provider performMigration:(BOOL)performMigration; -- (void)addDataProvider:(id )provider; +- (void)addDataProvider:(id)provider performMigration:(BOOL)performMigration; +- (void)addDataProvider:(id)provider; - (void)_addDataProviderClass:(Class)providerClass performMigration:(BOOL)performMigration; diff --git a/BulletinBoard/BBSectionIcon.h b/BulletinBoard/BBSectionIcon.h index 606992e8..f6f73e81 100644 --- a/BulletinBoard/BBSectionIcon.h +++ b/BulletinBoard/BBSectionIcon.h @@ -5,6 +5,6 @@ @interface BBSectionIcon : NSObject - (void)addVariant:(BBSectionIconVariant *)variant; -- (void)setVariants:(NSSet *)variants; +- (void)setVariants:(NSSet *)variants; @end diff --git a/BulletinBoard/BBSectionInfo.h b/BulletinBoard/BBSectionInfo.h index 2231e14b..0d2a6020 100644 --- a/BulletinBoard/BBSectionInfo.h +++ b/BulletinBoard/BBSectionInfo.h @@ -1,9 +1,9 @@ #import "BBSectionInfoSettings.h" typedef NS_ENUM(NSUInteger, BBSectionInfoAlertType) { - BBSectionInfoAlertTypeNone, - BBSectionInfoAlertTypeBanner, - BBSectionInfoAlertTypeAlert + BBSectionInfoAlertTypeNone, + BBSectionInfoAlertTypeBanner, + BBSectionInfoAlertTypeAlert }; @protocol BBDataProvider; @@ -11,7 +11,7 @@ typedef NS_ENUM(NSUInteger, BBSectionInfoAlertType) { @interface BBSectionInfo : NSObject + (instancetype)defaultSectionInfoForType:(NSUInteger)type; -+ (instancetype)defaultSectionInfoForSection:(id )section; ++ (instancetype)defaultSectionInfoForSection:(id)section; @property (nonatomic, retain) NSString *sectionID; @property (nonatomic, retain) NSString *subsectionID; diff --git a/BulletinBoard/BBSectionInfoSettings.h b/BulletinBoard/BBSectionInfoSettings.h index d80298cc..ead92bb3 100644 --- a/BulletinBoard/BBSectionInfoSettings.h +++ b/BulletinBoard/BBSectionInfoSettings.h @@ -2,9 +2,9 @@ #import typedef NS_OPTIONS(NSUInteger, BBSectionInfoPushSettings) { - BBSectionInfoPushSettingsBadges = 1 << 0, - BBSectionInfoPushSettingsSounds = 1 << 1, - BBSectionInfoPushSettingsAlerts = 1 << 2 + BBSectionInfoPushSettingsBadges = 1 << 0, + BBSectionInfoPushSettingsSounds = 1 << 1, + BBSectionInfoPushSettingsAlerts = 1 << 2 }; @interface BBSectionInfoSettings : NSObject diff --git a/BulletinBoard/BBSectionParameters.h b/BulletinBoard/BBSectionParameters.h index 864b931d..cf759b9c 100644 --- a/BulletinBoard/BBSectionParameters.h +++ b/BulletinBoard/BBSectionParameters.h @@ -6,6 +6,6 @@ @interface BBSectionParameters : NSObject @property (nonatomic, retain) BBSectionSubtypeParameters *defaultSubtypeParameters; -@property (nonatomic, retain) NSMutableDictionary *allSubtypeParameters; +@property (nonatomic, retain) NSMutableDictionary *allSubtypeParameters; @end diff --git a/CaptainHook/CaptainHook.h b/CaptainHook/CaptainHook.h index bd1adfd0..1f48af3e 100644 --- a/CaptainHook/CaptainHook.h +++ b/CaptainHook/CaptainHook.h @@ -23,22 +23,24 @@ #define CHStringify_(x) #x #define CHStringify(x) CHStringify_(x) -#define CHConcat_(a, b) a ## b +#define CHConcat_(a, b) a##b #define CHConcat(a, b) CHConcat_(a, b) -#define CHNothing() do { } while(0) +#define CHNothing() \ + do { \ + } while (0) #define CHLocationInSource [NSString stringWithFormat:@CHStringify(__LINE__) " in %s", __FUNCTION__] -#define CHLog(args...) NSLog(@CHAppName ": %@", [NSString stringWithFormat:args]) -#define CHLogSource(args...) NSLog(@CHAppName " @ " CHStringify(__LINE__) " in %s: %@", __FUNCTION__, [NSString stringWithFormat:args]) +#define CHLog(args...) NSLog(@CHAppName ": %@", [NSString stringWithFormat:args]) +#define CHLogSource(args...) NSLog(@CHAppName " @ " CHStringify(__LINE__) " in %s: %@", __FUNCTION__, [NSString stringWithFormat:args]) #ifdef CHDebug - #define CHDebugLog(args...) CHLog(args) - #define CHDebugLogSource(args...) CHLogSource(args) +#define CHDebugLog(args...) CHLog(args) +#define CHDebugLogSource(args...) CHLogSource(args) #else - #define CHDebugLog(args...) CHNothing() - #define CHDebugLogSource(args...) CHNothing() +#define CHDebugLog(args...) CHNothing() +#define CHDebugLogSource(args...) CHNothing() #endif // Constructor @@ -47,636 +49,638 @@ // Cached Class Declaration (allows hooking methods, and fast lookup of classes) struct CHClassDeclaration_ { - Class class_; - Class metaClass_; - Class superClass_; + Class class_; + Class metaClass_; + Class superClass_; }; typedef struct CHClassDeclaration_ CHClassDeclaration_; #define CHDeclareClass(name) \ - @class name; \ - static CHClassDeclaration_ name ## $; + @class name; \ + static CHClassDeclaration_ name##$; // Loading Cached Classes (use CHLoadClass when class is linkable, CHLoadLateClass when it isn't) static inline Class CHLoadClass_(CHClassDeclaration_ *declaration, Class value) { - declaration->class_ = value; - declaration->metaClass_ = object_getClass(value); - declaration->superClass_ = class_getSuperclass(value); - return value; + declaration->class_ = value; + declaration->metaClass_ = object_getClass(value); + declaration->superClass_ = class_getSuperclass(value); + return value; } -#define CHLoadLateClass(name) CHLoadClass_(&name ## $, objc_getClass(#name)) -#define CHLoadClass(name) CHLoadClass_(&name ## $, [name class]) +#define CHLoadLateClass(name) CHLoadClass_(&name##$, objc_getClass(#name)) +#define CHLoadClass(name) CHLoadClass_(&name##$, [name class]) // Quick Lookup of cached classes, and common methods on them -#define CHClass(name) name ## $.class_ -#define CHMetaClass(name) name ## $.metaClass_ -#define CHSuperClass(name) name ## $.superClass_ +#define CHClass(name) name##$.class_ +#define CHMetaClass(name) name##$.metaClass_ +#define CHSuperClass(name) name##$.superClass_ #define CHAlloc(name) ((name *)[CHClass(name) alloc]) #define CHSharedInstance(name) ((name *)[CHClass(name) sharedInstance]) #define CHIsClass(obj, name) [obj isKindOfClass:CHClass(name)] #define CHRespondsTo(obj, sel) [obj respondsToSelector:@selector(sel)] // Replacement Method Definition -#define CHDeclareSig0_(return_type) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - char sig[return_len+2+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - sig[return_len+2] = '\0'; -#define CHDeclareSig1_(return_type, type1) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - char sig[return_len+2+type1_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - sig[return_len+type1_len+2] = '\0'; -#define CHDeclareSig2_(return_type, type1, type2) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - char sig[return_len+2+type1_len+type2_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - sig[return_len+type1_len+type2_len+2] = '\0'; -#define CHDeclareSig3_(return_type, type1, type2, type3) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - sig[return_len+type1_len+type2_len+type3_len+2] = '\0'; -#define CHDeclareSig4_(return_type, type1, type2, type3, type4) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - const char *type4_ = @encode(type4); \ - size_t type4_len = __builtin_strlen(type4_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+type4_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len], type4_, type4_len); \ - sig[return_len+type1_len+type2_len+type3_len+type4_len+2] = '\0'; -#define CHDeclareSig5_(return_type, type1, type2, type3, type4, type5) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - const char *type4_ = @encode(type4); \ - size_t type4_len = __builtin_strlen(type4_); \ - const char *type5_ = @encode(type5); \ - size_t type5_len = __builtin_strlen(type5_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len], type4_, type4_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len], type5_, type5_len); \ - sig[return_len+type1_len+type2_len+type3_len+type4_len+type5_len+2] = '\0'; -#define CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - const char *type4_ = @encode(type4); \ - size_t type4_len = __builtin_strlen(type4_); \ - const char *type5_ = @encode(type5); \ - size_t type5_len = __builtin_strlen(type5_); \ - const char *type6_ = @encode(type6); \ - size_t type6_len = __builtin_strlen(type6_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len], type4_, type4_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len], type5_, type5_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len], type6_, type6_len); \ - sig[return_len+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+2] = '\0'; -#define CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - const char *type4_ = @encode(type4); \ - size_t type4_len = __builtin_strlen(type4_); \ - const char *type5_ = @encode(type5); \ - size_t type5_len = __builtin_strlen(type5_); \ - const char *type6_ = @encode(type6); \ - size_t type6_len = __builtin_strlen(type6_); \ - const char *type7_ = @encode(type7); \ - size_t type7_len = __builtin_strlen(type7_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len], type4_, type4_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len], type5_, type5_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len], type6_, type6_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len], type7_, type7_len); \ - sig[return_len+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+2] = '\0'; -#define CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - const char *type4_ = @encode(type4); \ - size_t type4_len = __builtin_strlen(type4_); \ - const char *type5_ = @encode(type5); \ - size_t type5_len = __builtin_strlen(type5_); \ - const char *type6_ = @encode(type6); \ - size_t type6_len = __builtin_strlen(type6_); \ - const char *type7_ = @encode(type7); \ - size_t type7_len = __builtin_strlen(type7_); \ - const char *type8_ = @encode(type8); \ - size_t type8_len = __builtin_strlen(type8_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+type8_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len], type4_, type4_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len], type5_, type5_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len], type6_, type6_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len], type7_, type7_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len], type8_, type8_len); \ - sig[return_len+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+type8_len+2] = '\0'; -#define CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9) \ - const char *return_ = @encode(return_type); \ - size_t return_len = __builtin_strlen(return_); \ - const char *type1_ = @encode(type1); \ - size_t type1_len = __builtin_strlen(type1_); \ - const char *type2_ = @encode(type2); \ - size_t type2_len = __builtin_strlen(type2_); \ - const char *type3_ = @encode(type3); \ - size_t type3_len = __builtin_strlen(type3_); \ - const char *type4_ = @encode(type4); \ - size_t type4_len = __builtin_strlen(type4_); \ - const char *type5_ = @encode(type5); \ - size_t type5_len = __builtin_strlen(type5_); \ - const char *type6_ = @encode(type6); \ - size_t type6_len = __builtin_strlen(type6_); \ - const char *type7_ = @encode(type7); \ - size_t type7_len = __builtin_strlen(type7_); \ - const char *type8_ = @encode(type8); \ - size_t type8_len = __builtin_strlen(type8_); \ - const char *type9_ = @encode(type9); \ - size_t type9_len = __builtin_strlen(type9_); \ - char sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+type8_len+type9_len+1]; \ - __builtin_memcpy(sig, return_, return_len); \ - sig[return_len] = _C_ID; \ - sig[return_len+1] = _C_SEL; \ - __builtin_memcpy(&sig[return_len+2], type1_, type1_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len], type2_, type2_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len], type3_, type3_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len], type4_, type4_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len], type5_, type5_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len], type6_, type6_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len], type7_, type7_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len], type8_, type8_len); \ - __builtin_memcpy(&sig[return_len+2+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+type8_len], type9_, type9_len); \ - sig[return_len+type1_len+type2_len+type3_len+type4_len+type5_len+type6_len+type7_len+type8_len+type9_len+2] = '\0'; +#define CHDeclareSig0_(return_type) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + char sig[return_len + 2 + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + sig[return_len + 2] = '\0'; +#define CHDeclareSig1_(return_type, type1) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + char sig[return_len + 2 + type1_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + sig[return_len + type1_len + 2] = '\0'; +#define CHDeclareSig2_(return_type, type1, type2) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + char sig[return_len + 2 + type1_len + type2_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + sig[return_len + type1_len + type2_len + 2] = '\0'; +#define CHDeclareSig3_(return_type, type1, type2, type3) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + sig[return_len + type1_len + type2_len + type3_len + 2] = '\0'; +#define CHDeclareSig4_(return_type, type1, type2, type3, type4) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + const char *type4_ = @encode(type4); \ + size_t type4_len = __builtin_strlen(type4_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len], type4_, type4_len); \ + sig[return_len + type1_len + type2_len + type3_len + type4_len + 2] = '\0'; +#define CHDeclareSig5_(return_type, type1, type2, type3, type4, type5) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + const char *type4_ = @encode(type4); \ + size_t type4_len = __builtin_strlen(type4_); \ + const char *type5_ = @encode(type5); \ + size_t type5_len = __builtin_strlen(type5_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len], type4_, type4_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len], type5_, type5_len); \ + sig[return_len + type1_len + type2_len + type3_len + type4_len + type5_len + 2] = '\0'; +#define CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + const char *type4_ = @encode(type4); \ + size_t type4_len = __builtin_strlen(type4_); \ + const char *type5_ = @encode(type5); \ + size_t type5_len = __builtin_strlen(type5_); \ + const char *type6_ = @encode(type6); \ + size_t type6_len = __builtin_strlen(type6_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len], type4_, type4_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len], type5_, type5_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len], type6_, type6_len); \ + sig[return_len + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + 2] = '\0'; +#define CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + const char *type4_ = @encode(type4); \ + size_t type4_len = __builtin_strlen(type4_); \ + const char *type5_ = @encode(type5); \ + size_t type5_len = __builtin_strlen(type5_); \ + const char *type6_ = @encode(type6); \ + size_t type6_len = __builtin_strlen(type6_); \ + const char *type7_ = @encode(type7); \ + size_t type7_len = __builtin_strlen(type7_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len], type4_, type4_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len], type5_, type5_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len], type6_, type6_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len], type7_, type7_len); \ + sig[return_len + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + 2] = '\0'; +#define CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + const char *type4_ = @encode(type4); \ + size_t type4_len = __builtin_strlen(type4_); \ + const char *type5_ = @encode(type5); \ + size_t type5_len = __builtin_strlen(type5_); \ + const char *type6_ = @encode(type6); \ + size_t type6_len = __builtin_strlen(type6_); \ + const char *type7_ = @encode(type7); \ + size_t type7_len = __builtin_strlen(type7_); \ + const char *type8_ = @encode(type8); \ + size_t type8_len = __builtin_strlen(type8_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + type8_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len], type4_, type4_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len], type5_, type5_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len], type6_, type6_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len], type7_, type7_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len], type8_, type8_len); \ + sig[return_len + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + type8_len + 2] = '\0'; +#define CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9) \ + const char *return_ = @encode(return_type); \ + size_t return_len = __builtin_strlen(return_); \ + const char *type1_ = @encode(type1); \ + size_t type1_len = __builtin_strlen(type1_); \ + const char *type2_ = @encode(type2); \ + size_t type2_len = __builtin_strlen(type2_); \ + const char *type3_ = @encode(type3); \ + size_t type3_len = __builtin_strlen(type3_); \ + const char *type4_ = @encode(type4); \ + size_t type4_len = __builtin_strlen(type4_); \ + const char *type5_ = @encode(type5); \ + size_t type5_len = __builtin_strlen(type5_); \ + const char *type6_ = @encode(type6); \ + size_t type6_len = __builtin_strlen(type6_); \ + const char *type7_ = @encode(type7); \ + size_t type7_len = __builtin_strlen(type7_); \ + const char *type8_ = @encode(type8); \ + size_t type8_len = __builtin_strlen(type8_); \ + const char *type9_ = @encode(type9); \ + size_t type9_len = __builtin_strlen(type9_); \ + char sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + type8_len + type9_len + 1]; \ + __builtin_memcpy(sig, return_, return_len); \ + sig[return_len] = _C_ID; \ + sig[return_len + 1] = _C_SEL; \ + __builtin_memcpy(&sig[return_len + 2], type1_, type1_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len], type2_, type2_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len], type3_, type3_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len], type4_, type4_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len], type5_, type5_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len], type6_, type6_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len], type7_, type7_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len], type8_, type8_len); \ + __builtin_memcpy(&sig[return_len + 2 + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + type8_len], type9_, type9_len); \ + sig[return_len + type1_len + type2_len + type3_len + type4_len + type5_len + type6_len + type7_len + type8_len + type9_len + 2] = '\0'; #ifdef CHUseSubstrate #import -#define CHMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type (*$ ## class_name ## _ ## name ## _super)(class_type self, SEL _cmd, ##args); \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - if (class_val) { \ - MSHookMessageEx(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, (IMP *)&$ ## class_name ## _ ## name ## _super); \ - if (!$ ## class_name ## _ ## name ## _super) { \ - sigdef; \ - class_addMethod(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, sig); \ - } \ - } \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) +#define CHMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ + static return_type (*$##class_name##_##name##_super)(class_type self, SEL _cmd, ##args); \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + if (class_val) { \ + MSHookMessageEx(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, (IMP *)&$##class_name##_##name##_super); \ + if (!$##class_name##_##name##_super) { \ + sigdef; \ + class_addMethod(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, sig); \ + } \ + } \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) #define CHMethod_new_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - sigdef; \ - class_addMethod(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, sig); \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) -#define CHMethod_super_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type (*$ ## class_name ## _ ## name ## _super)(class_type self, SEL _cmd, ##args); \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - if (class_val) { \ - MSHookMessageEx(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, (IMP *)&$ ## class_name ## _ ## name ## _super); \ - } \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) -#define CHMethod_self_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type (*$ ## class_name ## _ ## name ## _super)(class_type self, SEL _cmd, ##args); \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - if (class_val) { \ - MSHookMessageEx(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, (IMP *)&$ ## class_name ## _ ## name ## _super); \ - } \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + sigdef; \ + class_addMethod(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, sig); \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) +#define CHMethod_super_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ + static return_type (*$##class_name##_##name##_super)(class_type self, SEL _cmd, ##args); \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + if (class_val) { \ + MSHookMessageEx(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, (IMP *)&$##class_name##_##name##_super); \ + } \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) +#define CHMethod_self_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ + static return_type (*$##class_name##_##name##_super)(class_type self, SEL _cmd, ##args); \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + if (class_val) { \ + MSHookMessageEx(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, (IMP *)&$##class_name##_##name##_super); \ + } \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) #else -#define CHMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type (*$ ## class_name ## _ ## name ## _super)(class_type self, SEL _cmd, ##args); \ - static return_type $ ## class_name ## _ ## name ## _closure(class_type self, SEL _cmd, ##args) { \ - typedef return_type (*supType)(class_type, SEL, ## args); \ - supType supFn = (supType)class_getMethodImplementation(super_class_val, _cmd); \ - return supFn supercall; \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - Method method = class_getInstanceMethod(class_val, @selector(sel)); \ - if (method) { \ - $ ## class_name ## _ ## name ## _super = (__typeof__($ ## class_name ## _ ## name ## _super))method_getImplementation(method); \ - if (class_addMethod(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, method_getTypeEncoding(method))) { \ - $ ## class_name ## _ ## name ## _super = &$ ## class_name ## _ ## name ## _closure; \ - } else { \ - method_setImplementation(method, (IMP)&$ ## class_name ## _ ## name ## _method); \ - } \ - } else { \ - sigdef; \ - class_addMethod(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, sig); \ - } \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) +#define CHMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ + static return_type (*$##class_name##_##name##_super)(class_type self, SEL _cmd, ##args); \ + static return_type $##class_name##_##name##_closure(class_type self, SEL _cmd, ##args) \ + { \ + typedef return_type (*supType)(class_type, SEL, ##args); \ + supType supFn = (supType)class_getMethodImplementation(super_class_val, _cmd); \ + return supFn supercall; \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + Method method = class_getInstanceMethod(class_val, @selector(sel)); \ + if (method) { \ + $##class_name##_##name##_super = (__typeof__($##class_name##_##name##_super))method_getImplementation(method); \ + if (class_addMethod(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, method_getTypeEncoding(method))) { \ + $##class_name##_##name##_super = &$##class_name##_##name##_closure; \ + } else { \ + method_setImplementation(method, (IMP)&$##class_name##_##name##_method); \ + } \ + } else { \ + sigdef; \ + class_addMethod(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, sig); \ + } \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) #define CHMethod_new_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - sigdef; \ - class_addMethod(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, sig); \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) -#define CHMethod_super_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type (*$ ## class_name ## _ ## name ## _super)(class_type self, SEL _cmd, ##args); \ - static return_type $ ## class_name ## _ ## name ## _closure(class_type self, SEL _cmd, ##args) { \ - typedef return_type (*supType)(class_type, SEL, ## args); \ - supType supFn = (supType)class_getMethodImplementation(super_class_val, _cmd); \ - return supFn supercall; \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - Method method = class_getInstanceMethod(class_val, @selector(sel)); \ - if (method) { \ - $ ## class_name ## _ ## name ## _super = (__typeof__($ ## class_name ## _ ## name ## _super))method_getImplementation(method); \ - if (class_addMethod(class_val, @selector(sel), (IMP)&$ ## class_name ## _ ## name ## _method, method_getTypeEncoding(method))) { \ - $ ## class_name ## _ ## name ## _super = &$ ## class_name ## _ ## name ## _closure; \ - } else { \ - method_setImplementation(method, (IMP)&$ ## class_name ## _ ## name ## _method); \ - } \ - } \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + sigdef; \ + class_addMethod(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, sig); \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) +#define CHMethod_super_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ + static return_type (*$##class_name##_##name##_super)(class_type self, SEL _cmd, ##args); \ + static return_type $##class_name##_##name##_closure(class_type self, SEL _cmd, ##args) \ + { \ + typedef return_type (*supType)(class_type, SEL, ##args); \ + supType supFn = (supType)class_getMethodImplementation(super_class_val, _cmd); \ + return supFn supercall; \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + Method method = class_getInstanceMethod(class_val, @selector(sel)); \ + if (method) { \ + $##class_name##_##name##_super = (__typeof__($##class_name##_##name##_super))method_getImplementation(method); \ + if (class_addMethod(class_val, @selector(sel), (IMP)&$##class_name##_##name##_method, method_getTypeEncoding(method))) { \ + $##class_name##_##name##_super = &$##class_name##_##name##_closure; \ + } else { \ + method_setImplementation(method, (IMP)&$##class_name##_##name##_method); \ + } \ + } \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) #define CHMethod_self_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static return_type (*$ ## class_name ## _ ## name ## _super)(class_type self, SEL _cmd, ##args); \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args); \ - __attribute__((always_inline)) \ - static inline void $ ## class_name ## _ ## name ## _register() { \ - Method method = class_getInstanceMethod(class_val, @selector(sel)); \ - if (method) { \ - $ ## class_name ## _ ## name ## _super = (__typeof__($ ## class_name ## _ ## name ## _super))method_getImplementation(method); \ - method_setImplementation(method, (IMP)&$ ## class_name ## _ ## name ## _method); \ - } \ - } \ - static return_type $ ## class_name ## _ ## name ## _method(class_type self, SEL _cmd, ##args) + static return_type (*$##class_name##_##name##_super)(class_type self, SEL _cmd, ##args); \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args); \ + __attribute__((always_inline)) static inline void $##class_name##_##name##_register() \ + { \ + Method method = class_getInstanceMethod(class_val, @selector(sel)); \ + if (method) { \ + $##class_name##_##name##_super = (__typeof__($##class_name##_##name##_super))method_getImplementation(method); \ + method_setImplementation(method, (IMP)&$##class_name##_##name##_method); \ + } \ + } \ + static return_type $##class_name##_##name##_method(class_type self, SEL _cmd, ##args) #endif #define CHMethod(count, args...) \ - CHMethod ## count(args) + CHMethod##count(args) #define CHMethod0(return_type, class_type, name) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name, name, CHDeclareSig0_(return_type), (self, _cmd)) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name, name, CHDeclareSig0_(return_type), (self, _cmd)) #define CHMethod1(return_type, class_type, name1, type1, arg1) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) #define CHMethod2(return_type, class_type, name1, type1, arg1, name2, type2, arg2) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) #define CHMethod3(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) #define CHMethod4(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) #define CHMethod5(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) #define CHMethod6(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) #define CHMethod7(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) #define CHMethod8(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) #define CHMethod9(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8, name9, type9, arg9) \ - CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) + CHMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) #define CHClassMethod(count, args...) \ - CHClassMethod ## count(args) + CHClassMethod##count(args) #define CHClassMethod0(return_type, class_type, name) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name, name, CHDeclareSig0_(return_type), (self, _cmd)) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name, name, CHDeclareSig0_(return_type), (self, _cmd)) #define CHClassMethod1(return_type, class_type, name1, type1, arg1) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) #define CHClassMethod2(return_type, class_type, name1, type1, arg1, name2, type2, arg2) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) #define CHClassMethod3(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) #define CHClassMethod4(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) #define CHClassMethod5(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) #define CHClassMethod6(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) #define CHClassMethod7(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) #define CHClassMethod8(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) #define CHClassMethod9(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8, name9, type9, arg9) \ - CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) + CHMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) #define CHOptimizedMethod(count, args...) \ - CHOptimizedMethod ## count(args) + CHOptimizedMethod##count(args) #define CHOptimizedMethod0(optimization, return_type, class_type, name) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name, name, CHDeclareSig0_(return_type), (self, _cmd)) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name, name, CHDeclareSig0_(return_type), (self, _cmd)) #define CHOptimizedMethod1(optimization, return_type, class_type, name1, type1, arg1) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) #define CHOptimizedMethod2(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) #define CHOptimizedMethod3(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) #define CHOptimizedMethod4(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) #define CHOptimizedMethod5(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) #define CHOptimizedMethod6(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) #define CHOptimizedMethod7(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) #define CHOptimizedMethod8(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) #define CHOptimizedMethod9(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8, name9, type9, arg9) \ - CHMethod_ ## optimization ## _(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) + CHMethod_##optimization##_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) #define CHOptimizedClassMethod(count, args...) \ - CHOptimizedClassMethod ## count(args) + CHOptimizedClassMethod##count(args) #define CHOptimizedClassMethod0(optimization, return_type, class_type, name) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name, name, CHDeclareSig0_(return_type), (self, _cmd)) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name, name, CHDeclareSig0_(return_type), (self, _cmd)) #define CHOptimizedClassMethod1(optimization, return_type, class_type, name1, type1, arg1) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) #define CHOptimizedClassMethod2(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) #define CHOptimizedClassMethod3(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) #define CHOptimizedClassMethod4(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) #define CHOptimizedClassMethod5(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) #define CHOptimizedClassMethod6(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) #define CHOptimizedClassMethod7(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) #define CHOptimizedClassMethod8(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) #define CHOptimizedClassMethod9(optimization, return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8, name9, type9, arg9) \ - CHMethod_ ## optimization ## _(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) + CHMethod_##optimization##_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) // Replacement Method Registration #define CHHook_(class_name, name) \ - $ ## class_name ## _ ## name ## _register() -#define CHHook(count, args...) CHHook ## count(args) + $##class_name##_##name##_register() +#define CHHook(count, args...) CHHook##count(args) #define CHHook0(class, name) CHHook_(class, name) -#define CHHook1(class, name1) CHHook_(class, name1 ## $) -#define CHHook2(class, name1, name2) CHHook_(class, name1 ## $ ## name2 ## $) -#define CHHook3(class, name1, name2, name3) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $) -#define CHHook4(class, name1, name2, name3, name4) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $) -#define CHHook5(class, name1, name2, name3, name4, name5) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $) -#define CHHook6(class, name1, name2, name3, name4, name5, name6) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $) -#define CHHook7(class, name1, name2, name3, name4, name5, name6, name7) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $) -#define CHHook8(class, name1, name2, name3, name4, name5, name6, name7, name8) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $) -#define CHHook9(class, name1, name2, name3, name4, name5, name6, name7, name8, name9) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $) -#define CHClassHook(count, args...) CHClassHook ## count(args) +#define CHHook1(class, name1) CHHook_(class, name1##$) +#define CHHook2(class, name1, name2) CHHook_(class, name1##$##name2##$) +#define CHHook3(class, name1, name2, name3) CHHook_(class, name1##$##name2##$##name3##$) +#define CHHook4(class, name1, name2, name3, name4) CHHook_(class, name1##$##name2##$##name3##$##name4##$) +#define CHHook5(class, name1, name2, name3, name4, name5) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$) +#define CHHook6(class, name1, name2, name3, name4, name5, name6) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$) +#define CHHook7(class, name1, name2, name3, name4, name5, name6, name7) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$) +#define CHHook8(class, name1, name2, name3, name4, name5, name6, name7, name8) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$) +#define CHHook9(class, name1, name2, name3, name4, name5, name6, name7, name8, name9) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$) +#define CHClassHook(count, args...) CHClassHook##count(args) #define CHClassHook0(class, name) CHHook_(class, name) -#define CHClassHook1(class, name1) CHHook_(class, name1 ## $) -#define CHClassHook2(class, name1, name2) CHHook_(class, name1 ## $ ## name2 ## $) -#define CHClassHook3(class, name1, name2, name3) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $) -#define CHClassHook4(class, name1, name2, name3, name4) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $) -#define CHClassHook5(class, name1, name2, name3, name4, name5) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $) -#define CHClassHook6(class, name1, name2, name3, name4, name5, name6) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $) -#define CHClassHook7(class, name1, name2, name3, name4, name5, name6, name7) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $) -#define CHClassHook8(class, name1, name2, name3, name4, name5, name6, name7, name8) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $) -#define CHClassHook9(class, name1, name2, name3, name4, name5, name6, name7, name8, name9) CHHook_(class, name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $) +#define CHClassHook1(class, name1) CHHook_(class, name1##$) +#define CHClassHook2(class, name1, name2) CHHook_(class, name1##$##name2##$) +#define CHClassHook3(class, name1, name2, name3) CHHook_(class, name1##$##name2##$##name3##$) +#define CHClassHook4(class, name1, name2, name3, name4) CHHook_(class, name1##$##name2##$##name3##$##name4##$) +#define CHClassHook5(class, name1, name2, name3, name4, name5) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$) +#define CHClassHook6(class, name1, name2, name3, name4, name5, name6) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$) +#define CHClassHook7(class, name1, name2, name3, name4, name5, name6, name7) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$) +#define CHClassHook8(class, name1, name2, name3, name4, name5, name6, name7, name8) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$) +#define CHClassHook9(class, name1, name2, name3, name4, name5, name6, name7, name8, name9) CHHook_(class, name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$) // Declarative style methods (automatically calls CHHook) #define CHDeclareMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, args...) \ - static inline void $ ## class_name ## _ ## name ## _register(); \ - __attribute__((constructor)) \ - static inline void $ ## class_name ## _ ## name ## _constructor() { \ - CHLoadLateClass(class_name); \ - $ ## class_name ## _ ## name ## _register(); \ - } \ - CHMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, ##args) + static inline void $##class_name##_##name##_register(); \ + __attribute__((constructor)) static inline void $##class_name##_##name##_constructor() \ + { \ + CHLoadLateClass(class_name); \ + $##class_name##_##name##_register(); \ + } \ + CHMethod_(return_type, class_type, class_name, class_val, super_class_val, name, sel, sigdef, supercall, ##args) #define CHDeclareMethod(count, args...) \ - CHDeclareMethod ## count(args) + CHDeclareMethod##count(args) #define CHDeclareMethod0(return_type, class_type, name) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name, name, CHDeclareSig0_(return_type), (self, _cmd)) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name, name, CHDeclareSig0_(return_type), (self, _cmd)) #define CHDeclareMethod1(return_type, class_type, name1, type1, arg1) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) #define CHDeclareMethod2(return_type, class_type, name1, type1, arg1, name2, type2, arg2) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) #define CHDeclareMethod3(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) #define CHDeclareMethod4(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) #define CHDeclareMethod5(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## arg5 ## $, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##arg5##$, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) #define CHDeclareMethod6(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) #define CHDeclareMethod7(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) #define CHDeclareMethod8(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) #define CHDeclareMethod9(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8, name9, type9, arg9) \ - CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) + CHDeclareMethod_(return_type, class_type *, class_type, CHClass(class_type), CHSuperClass(class_type), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) #define CHDeclareClassMethod(count, args...) \ - CHDeclareClassMethod ## count(args) + CHDeclareClassMethod##count(args) #define CHDeclareClassMethod0(return_type, class_type, name) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name, name, CHDeclareSig0_(return_type), (self, _cmd)) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name, name, CHDeclareSig0_(return_type), (self, _cmd)) #define CHDeclareClassMethod1(return_type, class_type, name1, type1, arg1) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$, name1:, CHDeclareSig1_(return_type, type1), (self, _cmd, arg1), type1 arg1) #define CHDeclareClassMethod2(return_type, class_type, name1, type1, arg1, name2, type2, arg2) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$, name1:name2:, CHDeclareSig2_(return_type, type1, type2), (self, _cmd, arg1, arg2), type1 arg1, type2 arg2) #define CHDeclareClassMethod3(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$, name1:name2:name3:, CHDeclareSig3_(return_type, type1, type2, type3), (self, _cmd, arg1, arg2, arg3), type1 arg1, type2 arg2, type3 arg3) #define CHDeclareClassMethod4(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$, name1:name2:name3:name4:, CHDeclareSig4_(return_type, type1, type2, type3, type4), (self, _cmd, arg1, arg2, arg3, arg4), type1 arg1, type2 arg2, type3 arg3, type4 arg4) #define CHDeclareClassMethod5(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$, name1:name2:name3:name4:name5:, CHDeclareSig5_(return_type, type1, type2, type3, type4, type5), (self, _cmd, arg1, arg2, arg3, arg4, arg5), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) #define CHDeclareClassMethod6(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, name1:name2:name3:name4:name5:name6:, CHDeclareSig6_(return_type, type1, type2, type3, type4, type5, type6), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) #define CHDeclareClassMethod7(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, name1:name2:name3:name4:name5:name6:name7:, CHDeclareSig7_(return_type, type1, type2, type3, type4, type5, type6, type7), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7) #define CHDeclareClassMethod8(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, name1:name2:name3:name4:name5:name6:name7:name8:, CHDeclareSig8_(return_type, type1, type2, type3, type4, type5, type6, type7, type8), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8) #define CHDeclareClassMethod9(return_type, class_type, name1, type1, arg1, name2, type2, arg2, name3, type3, arg3, name4, type4, arg4, name5, type5, arg5, name6, type6, arg6, name7, type7, arg7, name8, type8, arg8, name9, type9, arg9) \ - CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) + CHDeclareMethod_(return_type, id, class_type, CHMetaClass(class_type), object_getClass(CHMetaClass(class_type)), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, name1:name2:name3:name4:name5:name6:name7:name8:name9:, CHDeclareSig9_(return_type, type1, type2, type3, type4, type5, type6, type7, type8, type9), (self, _cmd, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, type7 arg7, type8 arg8, type9 arg9) // Calling super class (or the old method as the case may be) #define CHSuper_(class_type, _cmd, name, args...) \ - $ ## class_type ## _ ## name ## _super(self, _cmd, ##args) + $##class_type##_##name##_super(self, _cmd, ##args) #define CHSuper(count, args...) \ - CHSuper ## count(args) + CHSuper##count(args) #define CHSuper0(class_type, name) \ - CHSuper_(class_type, @selector(name), name) + CHSuper_(class_type, @selector(name), name) #define CHSuper1(class_type, name1, val1) \ - CHSuper_(class_type, @selector(name1:), name1 ## $, val1) + CHSuper_(class_type, @selector(name1:), name1##$, val1) #define CHSuper2(class_type, name1, val1, name2, val2) \ - CHSuper_(class_type, @selector(name1:name2:), name1 ## $ ## name2 ## $, val1, val2) + CHSuper_(class_type, @selector(name1:name2:), name1##$##name2##$, val1, val2) #define CHSuper3(class_type, name1, val1, name2, val2, name3, val3) \ - CHSuper_(class_type, @selector(name1:name2:name3:), name1 ## $ ## name2 ## $ ## name3 ## $, val1, val2, val3) + CHSuper_(class_type, @selector(name1:name2:name3:), name1##$##name2##$##name3##$, val1, val2, val3) #define CHSuper4(class_type, name1, val1, name2, val2, name3, val3, name4, val4) \ - CHSuper_(class_type, @selector(name1:name2:name3:name4:), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $, val1, val2, val3, val4) + CHSuper_(class_type, @selector(name1:name2:name3:name4:), name1##$##name2##$##name3##$##name4##$, val1, val2, val3, val4) #define CHSuper5(class_type, name1, val1, name2, val2, name3, val3, name4, val4, name5, val5) \ - CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $, val1, val2, val3, val4, val5) + CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:), name1##$##name2##$##name3##$##name4##$##name5##$, val1, val2, val3, val4, val5) #define CHSuper6(class_type, name1, val1, name2, val2, name3, val3, name4, val4, name5, val5, name6, val6) \ - CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $, val1, val2, val3, val4, val5, val6) + CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$, val1, val2, val3, val4, val5, val6) #define CHSuper7(class_type, name1, val1, name2, val2, name3, val3, name4, val4, name5, val5, name6, val6, name7, val7) \ - CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:name7:), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $, val1, val2, val3, val4, val5, val6, val7) + CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:name7:), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$, val1, val2, val3, val4, val5, val6, val7) #define CHSuper8(class_type, name1, val1, name2, val2, name3, val3, name4, val4, name5, val5, name6, val6, name7, val7, name8, val8) \ - CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:name7:name8:), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $, val1, val2, val3, val4, val5, val6, val7, val8) + CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:name7:name8:), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$, val1, val2, val3, val4, val5, val6, val7, val8) #define CHSuper9(class_type, name1, val1, name2, val2, name3, val3, name4, val4, name5, val5, name6, val6, name7, val7, name8, val8, name9, val9) \ - CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:name7:name8:name9:), name1 ## $ ## name2 ## $ ## name3 ## $ ## name4 ## $ ## name5 ## $ ## name6 ## $ ## name7 ## $ ## name8 ## $ ## name9 ## $, val1, val2, val3, val4, val5, val6, val7, val8, val9) + CHSuper_(class_type, @selector(name1:name2:name3:name4:name5:name6:name7:name8:name9:), name1##$##name2##$##name3##$##name4##$##name5##$##name6##$##name7##$##name8##$##name9##$, val1, val2, val3, val4, val5, val6, val7, val8, val9) // Create Class at Runtime (useful for creating subclasses of classes that can't be linked) #define CHRegisterClass(name, superName) for (int _tmp = ({ CHClass(name) = objc_allocateClassPair(CHClass(superName), #name, 0); CHMetaClass(name) = object_getClass(CHClass(name)); CHSuperClass(name) = class_getSuperclass(CHClass(name)); 1; }); _tmp; _tmp = ({ objc_registerClassPair(CHClass(name)), 0; })) -#define CHAlignmentForSize_(size) ({ \ - size_t s = size; \ - __builtin_constant_p(s) ? ( \ - (s) & (1 << 31) ? 31 : \ - (s) & (1 << 30) ? 30 : \ - (s) & (1 << 29) ? 29 : \ - (s) & (1 << 28) ? 28 : \ - (s) & (1 << 27) ? 27 : \ - (s) & (1 << 26) ? 26 : \ - (s) & (1 << 25) ? 25 : \ - (s) & (1 << 24) ? 24 : \ - (s) & (1 << 23) ? 23 : \ - (s) & (1 << 22) ? 22 : \ - (s) & (1 << 21) ? 21 : \ - (s) & (1 << 20) ? 20 : \ - (s) & (1 << 19) ? 19 : \ - (s) & (1 << 18) ? 18 : \ - (s) & (1 << 17) ? 17 : \ - (s) & (1 << 16) ? 16 : \ - (s) & (1 << 15) ? 15 : \ - (s) & (1 << 14) ? 14 : \ - (s) & (1 << 13) ? 13 : \ - (s) & (1 << 12) ? 12 : \ - (s) & (1 << 11) ? 11 : \ - (s) & (1 << 10) ? 10 : \ - (s) & (1 << 9) ? 9 : \ - (s) & (1 << 8) ? 8 : \ - (s) & (1 << 7) ? 7 : \ - (s) & (1 << 6) ? 6 : \ - (s) & (1 << 5) ? 5 : \ - (s) & (1 << 4) ? 4 : \ - (s) & (1 << 3) ? 3 : \ - (s) & (1 << 2) ? 2 : \ - (s) & (1 << 1) ? 1 : \ - (s) & (1 << 0) ? 0 : \ - 0 \ - ) : (uint32_t)log2f(s); \ +#define CHAlignmentForSize_(size) ({ \ + size_t s = size; \ + __builtin_constant_p(s) ? ( \ + (s) & (1 << 31) ? 31 : (s) & (1 << 30) ? 30 \ + : (s) & (1 << 29) ? 29 \ + : (s) & (1 << 28) ? 28 \ + : (s) & (1 << 27) ? 27 \ + : (s) & (1 << 26) ? 26 \ + : (s) & (1 << 25) ? 25 \ + : (s) & (1 << 24) ? 24 \ + : (s) & (1 << 23) ? 23 \ + : (s) & (1 << 22) ? 22 \ + : (s) & (1 << 21) ? 21 \ + : (s) & (1 << 20) ? 20 \ + : (s) & (1 << 19) ? 19 \ + : (s) & (1 << 18) ? 18 \ + : (s) & (1 << 17) ? 17 \ + : (s) & (1 << 16) ? 16 \ + : (s) & (1 << 15) ? 15 \ + : (s) & (1 << 14) ? 14 \ + : (s) & (1 << 13) ? 13 \ + : (s) & (1 << 12) ? 12 \ + : (s) & (1 << 11) ? 11 \ + : (s) & (1 << 10) ? 10 \ + : (s) & (1 << 9) ? 9 \ + : (s) & (1 << 8) ? 8 \ + : (s) & (1 << 7) ? 7 \ + : (s) & (1 << 6) ? 6 \ + : (s) & (1 << 5) ? 5 \ + : (s) & (1 << 4) ? 4 \ + : (s) & (1 << 3) ? 3 \ + : (s) & (1 << 2) ? 2 \ + : (s) & (1 << 1) ? 1 \ + : (s) & (1 << 0) ? 0 \ + : 0) \ + : (uint32_t)log2f(s); \ }) #define CHAddIvar(targetClass, name, type) \ - class_addIvar(targetClass, #name, sizeof(type), CHAlignmentForSize_(sizeof(type)), @encode(type)) + class_addIvar(targetClass, #name, sizeof(type), CHAlignmentForSize_(sizeof(type)), @encode(type)) // Retrieve reference to an Ivar value (can read and assign) -__attribute__((unused)) CHInline -static void *CHIvar_(id object, const char *name) +__attribute__((unused)) CHInline static void *CHIvar_(id object, const char *name) { - Ivar ivar = class_getInstanceVariable(object_getClass(object), name); - if (ivar) + Ivar ivar = class_getInstanceVariable(object_getClass(object), name); + if (ivar) #ifdef CHHasARC - return (void *)&((char *)(__bridge void *)object)[ivar_getOffset(ivar)]; + return (void *)&((char *)(__bridge void *)object)[ivar_getOffset(ivar)]; #else - return (void *)&((char *)object)[ivar_getOffset(ivar)]; + return (void *)&((char *)object)[ivar_getOffset(ivar)]; #endif - return NULL; + return NULL; } #define CHIvarRef(object, name, type) \ - ((type *)CHIvar_(object, #name)) + ((type *)CHIvar_(object, #name)) #define CHIvar(object, name, type) \ - (*CHIvarRef(object, name, type)) - // Warning: Dereferences NULL if object is nil or name isn't found. To avoid this save CHIvarRef(...) and test if != NULL + (*CHIvarRef(object, name, type)) +// Warning: Dereferences NULL if object is nil or name isn't found. To avoid this save CHIvarRef(...) and test if != NULL -#define CHDeclareProperty(class, name) static const char k ## class ## _ ## name; -#define CHPropertyGetValue(class, name) objc_getAssociatedObject(self, &k ## class ## _ ## name ) -#define CHPropertySetValue(class, name, value, policy) objc_setAssociatedObject(self, &k ## class ## _ ## name , value, policy) +#define CHDeclareProperty(class, name) static const char k##class##_##name; +#define CHPropertyGetValue(class, name) objc_getAssociatedObject(self, &k##class##_##name) +#define CHPropertySetValue(class, name, value, policy) objc_setAssociatedObject(self, &k##class##_##name, value, policy) #define CHPropertyGetter(class, getter, type) CHOptimizedMethod0(new, type, class, getter) #define CHPropertySetter(class, setter, type, value) CHOptimizedMethod1(new, void, class, setter, type, value) // Obj-C dynamic property declaration (objects) -#define CHProperty(class, type, getter, setter, policy) \ - CHDeclareProperty(class, getter) \ - CHPropertyGetter(class, getter, type) { \ - return CHPropertyGetValue(class, getter); \ - } \ - CHPropertySetter(class, setter, type, getter) { \ - CHPropertySetValue(class, getter, getter, policy); \ - } +#define CHProperty(class, type, getter, setter, policy) \ + CHDeclareProperty(class, getter) \ + CHPropertyGetter(class, getter, type) \ + { \ + return CHPropertyGetValue(class, getter); \ + } \ + CHPropertySetter(class, setter, type, getter) \ + { \ + CHPropertySetValue(class, getter, getter, policy); \ + } #define CHPropertyRetain(class, type, getter, setter) CHProperty(class, type, getter, setter, OBJC_ASSOCIATION_RETAIN) #define CHPropertyRetainNonatomic(class, type, getter, setter) CHProperty(class, type, getter, setter, OBJC_ASSOCIATION_RETAIN_NONATOMIC) #define CHPropertyCopy(class, type, getter, setter) CHProperty(class, type, getter, setter, OBJC_ASSOCIATION_COPY) @@ -684,76 +688,75 @@ static void *CHIvar_(id object, const char *name) #define CHPropertyAssign(class, type, getter, setter) CHProperty(class, type, getter, setter, OBJC_ASSOCIATION_ASSIGN) #define CHPrimitivePropertyGetValue(class, name, type, val, default) \ - type val = default; \ - do { \ - NSNumber * objVal = CHPropertyGetValue(class, name); \ - [objVal getValue:& val ]; \ - } while(0) -#define CHPrimitivePropertySetValue(class, name, type, val) \ - do { \ - NSValue *objVal = [NSValue value:& val withObjCType:@encode( type )]; \ - CHPropertySetValue(class, name, objVal, OBJC_ASSOCIATION_RETAIN_NONATOMIC); \ - } while(0) + type val = default; \ + do { \ + NSNumber *objVal = CHPropertyGetValue(class, name); \ + [objVal getValue:&val]; \ + } while (0) +#define CHPrimitivePropertySetValue(class, name, type, val) \ + do { \ + NSValue *objVal = [NSValue value:&val withObjCType:@encode(type)]; \ + CHPropertySetValue(class, name, objVal, OBJC_ASSOCIATION_RETAIN_NONATOMIC); \ + } while (0) // Primitive property equivalent (ie. BOOL, int, structs) -#define CHPrimitiveProperty(class, type, getter, setter, default) \ - CHDeclareProperty(class, getter) \ - CHOptimizedMethod0(new, type, class, getter) { \ - CHPrimitivePropertyGetValue( class , getter , type , val , default ); \ - return val; \ - } \ - CHOptimizedMethod1(new, void, class, setter, type, getter) { \ - CHPrimitivePropertySetValue( class , getter, type , getter ); \ - } +#define CHPrimitiveProperty(class, type, getter, setter, default) \ + CHDeclareProperty(class, getter) \ + CHOptimizedMethod0(new, type, class, getter) \ + { \ + CHPrimitivePropertyGetValue(class, getter, type, val, default); \ + return val; \ + } \ + CHOptimizedMethod1(new, void, class, setter, type, getter) \ + { \ + CHPrimitivePropertySetValue(class, getter, type, getter); \ + } #define CHHookProperty(class, getter, setter) \ - do { \ - CHHook0(class, getter); \ - CHHook1(class, setter); \ - } while(0) + do { \ + CHHook0(class, getter); \ + CHHook1(class, setter); \ + } while (0) #ifndef CHHasARC // Scope Autorelease -__attribute__((unused)) CHInline -static void CHScopeReleased(id *sro) +__attribute__((unused)) CHInline static void CHScopeReleased(id *sro) { - [*sro release]; + [*sro release]; } #define CHScopeReleased \ - __attribute__((cleanup(CHScopeReleased))) + __attribute__((cleanup(CHScopeReleased))) #define CHAutoreleasePoolForScope() \ - NSAutoreleasePool *CHAutoreleasePoolForScope __attribute__((unused)) CHScopeReleased = [[NSAutoreleasePool alloc] init] + NSAutoreleasePool *CHAutoreleasePoolForScope __attribute__((unused)) CHScopeReleased = [[NSAutoreleasePool alloc] init] #endif // Build Assertion #define CHBuildAssert(condition) \ - ((void)sizeof(char[1 - 2*!!(condition)])) + ((void)sizeof(char[1 - 2 * !!(condition)])) // Profiling #ifdef CHEnableProfiling - #import - struct CHProfileData - { - NSString *message; - uint64_t startTime; - }; - __attribute__((unused)) CHInline - static void CHProfileCalculateDurationAndLog_(struct CHProfileData *profileData) - { - uint64_t duration = mach_absolute_time() - profileData->startTime; - mach_timebase_info_data_t info; - mach_timebase_info(&info); - duration = (duration * info.numer) / info.denom; - CHLog(@"Profile time: %lldns; %@", duration, profileData->message); - } - #define CHProfileScopeWithString(string) \ - struct CHProfileData _profileData __attribute__((cleanup(CHProfileCalculateDurationAndLog_))) = ({ struct CHProfileData _tmp; _tmp.message = (string); _tmp.startTime = mach_absolute_time(); _tmp; }) +#import +struct CHProfileData { + NSString *message; + uint64_t startTime; +}; +__attribute__((unused)) CHInline static void CHProfileCalculateDurationAndLog_(struct CHProfileData *profileData) +{ + uint64_t duration = mach_absolute_time() - profileData->startTime; + mach_timebase_info_data_t info; + mach_timebase_info(&info); + duration = (duration * info.numer) / info.denom; + CHLog(@"Profile time: %lldns; %@", duration, profileData->message); +} +#define CHProfileScopeWithString(string) \ + struct CHProfileData _profileData __attribute__((cleanup(CHProfileCalculateDurationAndLog_))) = ({ struct CHProfileData _tmp; _tmp.message = (string); _tmp.startTime = mach_absolute_time(); _tmp; }) #else - #define CHProfileScopeWithString(string) \ - CHNothing() +#define CHProfileScopeWithString(string) \ + CHNothing() #endif #define CHProfileScopeWithFormat(args...) \ - CHProfileScopeWithString(([NSString stringWithFormat:args])) + CHProfileScopeWithString(([NSString stringWithFormat:args])) #define CHProfileScope() \ - CHProfileScopeWithFormat(@CHStringify(__LINE__) " in %s", __FUNCTION__) + CHProfileScopeWithFormat(@CHStringify(__LINE__) " in %s", __FUNCTION__) diff --git a/Celestial/AVSystemController.h b/Celestial/AVSystemController.h index a1906b54..032b6c3c 100644 --- a/Celestial/AVSystemController.h +++ b/Celestial/AVSystemController.h @@ -37,39 +37,39 @@ FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_VibeIntensityDi FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_ActiveAudioRouteAttribute; FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_ActiveInputRouteForPlayAndRecordNoBluetoothAttribute; /* NSString */ FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_AllowAppToInitiatePlaybackTemporarilyAttribute; -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_AppWantsVolumeChangesAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_AudioIsPlayingSomewhereAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CanBeNowPlayingAppAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CarPlayIsConnectedAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CurrentExternalScreenAttribute; /* NSString */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CurrentlyActiveCategoryAttribute; /* NSString */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CurrentlyActiveModeAttribute; /* NSString */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_DisableAutoPauseOnHeadphoneJackDisconnectAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_DiscoveryModeAttribute; /* NSString */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_DownlinkMuteAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_EUVolumeLimitAttribute; /* NSNumber, float */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_EUVolumeLimitEnforcedAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_FullMuteAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_HeadphoneJackHasInputAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_HeadphoneJackIsConnectedAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_HeadphoneVolumeLimitAttribute; /* NSNumber, float */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_AppWantsVolumeChangesAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_AudioIsPlayingSomewhereAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CanBeNowPlayingAppAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CarPlayIsConnectedAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CurrentExternalScreenAttribute; /* NSString */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CurrentlyActiveCategoryAttribute; /* NSString */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_CurrentlyActiveModeAttribute; /* NSString */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_DisableAutoPauseOnHeadphoneJackDisconnectAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_DiscoveryModeAttribute; /* NSString */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_DownlinkMuteAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_EUVolumeLimitAttribute; /* NSNumber, float */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_EUVolumeLimitEnforcedAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_FullMuteAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_HeadphoneJackHasInputAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_HeadphoneJackIsConnectedAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_HeadphoneVolumeLimitAttribute; /* NSNumber, float */ FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_IAmTheiPodAppAttribute; -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_IsSomeoneRecordingAttribute; /* NSNumber, int */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppDisplayIDAttribute; /* NSString */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_IsSomeoneRecordingAttribute; /* NSNumber, int */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppDisplayIDAttribute; /* NSString */ FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppIsInterruptedAttribute; -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppIsPlayingAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppPIDAttribute; /* NSNumber, pid_t */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppShouldPlayOnCarPlayConnectAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_ParentalVolumeCappedToEUVolumeLimitAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppIsPlayingAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppPIDAttribute; /* NSNumber, pid_t */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_NowPlayingAppShouldPlayOnCarPlayConnectAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_ParentalVolumeCappedToEUVolumeLimitAttribute; /* NSNumber, BOOL */ FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_PickableRoutesAttribute; FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_PickedRouteAttribute; FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_RouteAwayFromAirPlayAttribute; FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_RouteAwayFromWirelessRouteAttribute; -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_ShouldIgnorePlayCommandsFromAccessoryAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_SomeClientIsPlayingLongFormAudioAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_ShouldIgnorePlayCommandsFromAccessoryAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_SomeClientIsPlayingLongFormAudioAttribute; /* NSNumber, BOOL */ FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_SystemHasAudioInputDeviceExcludingBluetoothAttribute; /* NSNumber, BOOL */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_SystemSoundVolumeMultiplierAttribute; /* NSNumber, float */ -FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_UplinkMuteAttribute; /* NSNumber, BOOL */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_SystemSoundVolumeMultiplierAttribute; /* NSNumber, float */ +FOUNDATION_EXPORT AVSystemControllerKey const AVSystemController_UplinkMuteAttribute; /* NSNumber, BOOL */ @interface AVSystemController : NSObject diff --git a/ChatKit/CKConversationList.h b/ChatKit/CKConversationList.h index 28e52df1..5d4e062b 100644 --- a/ChatKit/CKConversationList.h +++ b/ChatKit/CKConversationList.h @@ -2,7 +2,7 @@ #import @interface CKConversationList : NSObject { - NSMutableArray *_trackedConversations; + NSMutableArray *_trackedConversations; } @end diff --git a/ChatKit/CKConversationListCell.h b/ChatKit/CKConversationListCell.h index 2a0bb58f..ecdb0780 100644 --- a/ChatKit/CKConversationListCell.h +++ b/ChatKit/CKConversationListCell.h @@ -4,7 +4,7 @@ @class CKConversation; @interface CKConversationListCell : UITableViewCell { - UILabel *_summaryLabel; + UILabel *_summaryLabel; } @property (nonatomic, retain) CKConversation *conversation; diff --git a/Contacts/CN.h b/Contacts/CN.h index 6839e3f0..4f635f9c 100644 --- a/Contacts/CN.h +++ b/Contacts/CN.h @@ -5,6 +5,6 @@ @interface CN : NSObject -+ (NSArray *)allNameComponentRelatedProperties; ++ (NSArray *)allNameComponentRelatedProperties; @end diff --git a/ControlCenterUIKit/CCUIContentModule-Protocol.h b/ControlCenterUIKit/CCUIContentModule-Protocol.h index a29fd34e..789e8598 100644 --- a/ControlCenterUIKit/CCUIContentModule-Protocol.h +++ b/ControlCenterUIKit/CCUIContentModule-Protocol.h @@ -1,9 +1,9 @@ #import #import "CCUIContentModuleContentViewController-Protocol.h" -@protocol CCUIContentModule +@protocol CCUIContentModule -@property (nonatomic, readonly) UIViewController *contentViewController; +@property (nonatomic, readonly) UIViewController *contentViewController; @property (nonatomic, readonly) UIViewController *backgroundViewController; @optional @@ -11,6 +11,6 @@ - (UIViewController *)backgroundViewController; @required -- (UIViewController *)contentViewController; +- (UIViewController *)contentViewController; @end diff --git a/ControlCenterUIKit/CCUIContentModuleContentViewController-Protocol.h b/ControlCenterUIKit/CCUIContentModuleContentViewController-Protocol.h index 5abd6fcd..e0acef2e 100644 --- a/ControlCenterUIKit/CCUIContentModuleContentViewController-Protocol.h +++ b/ControlCenterUIKit/CCUIContentModuleContentViewController-Protocol.h @@ -1,7 +1,7 @@ #import #import -@protocol CCUIContentModuleContentViewController +@protocol CCUIContentModuleContentViewController @property (nonatomic, readonly) CGFloat preferredExpandedContentHeight; @property (nonatomic, readonly) CGFloat preferredExpandedContentWidth; diff --git a/ControlCenterUIKit/CCUILabeledRoundButtonViewController.h b/ControlCenterUIKit/CCUILabeledRoundButtonViewController.h index 63c1f3f8..caf36d66 100644 --- a/ControlCenterUIKit/CCUILabeledRoundButtonViewController.h +++ b/ControlCenterUIKit/CCUILabeledRoundButtonViewController.h @@ -31,4 +31,3 @@ API_AVAILABLE(ios(11.0)) - (instancetype)initWithGlyphPackageDescription:(CCUICAPackageDescription *)glyphPackageDescription highlightColor:(UIColor *)highlightColor useLightStyle:(BOOL)useLightStyle; @end - diff --git a/ControlCenterUIKit/CCUIRoundButton.h b/ControlCenterUIKit/CCUIRoundButton.h index 1b041392..590accfc 100644 --- a/ControlCenterUIKit/CCUIRoundButton.h +++ b/ControlCenterUIKit/CCUIRoundButton.h @@ -3,7 +3,7 @@ #import "CCUICAPackageDescription.h" API_AVAILABLE(ios(11.0)) -@interface CCUIRoundButton : UIControl +@interface CCUIRoundButton : UIControl @property (nonatomic, retain) UIColor *highlightColor; diff --git a/ControlCenterUIKit/CCUIToggleModule.h b/ControlCenterUIKit/CCUIToggleModule.h index 9065b594..af07bb47 100644 --- a/ControlCenterUIKit/CCUIToggleModule.h +++ b/ControlCenterUIKit/CCUIToggleModule.h @@ -2,7 +2,7 @@ #import "CCUIContentModule-Protocol.h" API_AVAILABLE(ios(11.0)) -@interface CCUIToggleModule : NSObject +@interface CCUIToggleModule : NSObject @property (assign, getter=isSelected, nonatomic) BOOL selected; @@ -17,7 +17,7 @@ API_AVAILABLE(ios(11.0)) @property (nonatomic, copy, readonly) CCUICAPackageDescription *glyphPackageDescription; -@property (nonatomic, readonly) UIViewController *contentViewController; +@property (nonatomic, readonly) UIViewController *contentViewController; @property (nonatomic, readonly) UIViewController *backgroundViewController; - (void)refreshState; // Force a refresh of the switch state diff --git a/CoreFoundation/CFLogUtilities.h b/CoreFoundation/CFLogUtilities.h index 834cd1b0..2d19420d 100644 --- a/CoreFoundation/CFLogUtilities.h +++ b/CoreFoundation/CFLogUtilities.h @@ -37,8 +37,7 @@ CF_EXTERN_C_BEGIN - -enum { // Legal level values for CFLog() +enum { // Legal level values for CFLog() kCFLogLevelEmergency = 0, kCFLogLevelAlert = 1, kCFLogLevelCritical = 2, diff --git a/CoreFoundation/CFUserNotification.h b/CoreFoundation/CFUserNotification.h index 3214506f..29008802 100644 --- a/CoreFoundation/CFUserNotification.h +++ b/CoreFoundation/CFUserNotification.h @@ -38,7 +38,7 @@ CF_IMPLICIT_BRIDGING_ENABLED CF_EXTERN_C_BEGIN -typedef struct __CFUserNotification * CFUserNotificationRef; +typedef struct __CFUserNotification *CFUserNotificationRef; /* A CFUserNotification is a notification intended to be presented to a user at the console (if one is present). This is for the use of processes @@ -83,7 +83,7 @@ which button was used to dismiss the notification, which checkboxes or radio buttons were checked, and what the selection of the popup was. It also carries a response dictionary, which describes the contents of the textfields. */ - + typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags); CF_EXPORT @@ -112,39 +112,37 @@ CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocato /* Convenience functions for handling the simplest and most common cases: a one-way notification, and a notification with up to three buttons. */ - + CF_EXPORT SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle); CF_EXPORT SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags); - /* Flags */ enum { - kCFUserNotificationStopAlertLevel = 0, - kCFUserNotificationNoteAlertLevel = 1, - kCFUserNotificationCautionAlertLevel = 2, - kCFUserNotificationPlainAlertLevel = 3 + kCFUserNotificationStopAlertLevel = 0, + kCFUserNotificationNoteAlertLevel = 1, + kCFUserNotificationCautionAlertLevel = 2, + kCFUserNotificationPlainAlertLevel = 3 }; enum { - kCFUserNotificationDefaultResponse = 0, - kCFUserNotificationAlternateResponse = 1, - kCFUserNotificationOtherResponse = 2, - kCFUserNotificationCancelResponse = 3 + kCFUserNotificationDefaultResponse = 0, + kCFUserNotificationAlternateResponse = 1, + kCFUserNotificationOtherResponse = 2, + kCFUserNotificationCancelResponse = 3 }; enum { - kCFUserNotificationNoDefaultButtonFlag = (1UL << 5), - kCFUserNotificationUseRadioButtonsFlag = (1UL << 6) + kCFUserNotificationNoDefaultButtonFlag = (1UL << 5), + kCFUserNotificationUseRadioButtonsFlag = (1UL << 6) }; -CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) {return ((CFOptionFlags)(1UL << (8 + i)));} -CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) {return ((CFOptionFlags)(1UL << (16 + i)));} -CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) {return ((CFOptionFlags)(n << 24));} - +CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) { return ((CFOptionFlags)(1UL << (8 + i))); } +CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) { return ((CFOptionFlags)(1UL << (16 + i))); } +CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) { return ((CFOptionFlags)(n << 24)); } /* Keys */ @@ -188,12 +186,12 @@ CF_EXPORT const CFStringRef kCFUserNotificationTextFieldValuesKey; CF_EXPORT -const CFStringRef kCFUserNotificationPopUpSelectionKey CF_AVAILABLE(10_3, NA); +const CFStringRef kCFUserNotificationPopUpSelectionKey CF_AVAILABLE(10_3, NA); #if (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) CF_EXPORT const CFStringRef kCFUserNotificationAlertTopMostKey; - + CF_EXPORT const CFStringRef kCFUserNotificationKeyboardTypesKey; #endif diff --git a/Flipswitch/FSSwitchDataSource.h b/Flipswitch/FSSwitchDataSource.h index 81798bb6..ef41b37d 100644 --- a/Flipswitch/FSSwitchDataSource.h +++ b/Flipswitch/FSSwitchDataSource.h @@ -4,7 +4,7 @@ @class UIColor; -@protocol FSSwitchDataSource +@protocol FSSwitchDataSource @optional - (FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier; @@ -71,7 +71,7 @@ - (NSString *)descriptionOfState:(FSSwitchState)state forSwitchIdentifier:(NSString *)switchIdentifier; // Requests a description of a specific state, in the context of a specific switch identifier (1.0.3 or later) -- (Class )settingsViewControllerClassForSwitchIdentifier:(NSString *)switchIdentifier; +- (Class)settingsViewControllerClassForSwitchIdentifier:(NSString *)switchIdentifier; // Requests the class to handle configuration for the specified switch (1.0.3) - (BOOL)switchWithIdentifierIsSimpleAction:(NSString *)switchIdentifier; diff --git a/Flipswitch/FSSwitchPanel.h b/Flipswitch/FSSwitchPanel.h index c96496e3..90412938 100644 --- a/Flipswitch/FSSwitchPanel.h +++ b/Flipswitch/FSSwitchPanel.h @@ -56,10 +56,10 @@ - (NSString *)descriptionOfState:(FSSwitchState)state forSwitchIdentifier:(NSString *)switchIdentifier; // Requests a description of a specific state, in the context of a specific switch identifier (1.0.3 or later) -- (Class )settingsViewControllerClassForSwitchIdentifier:(NSString *)switchIdentifier; +- (Class)settingsViewControllerClassForSwitchIdentifier:(NSString *)switchIdentifier; // Retrieves the settings view controller class for a specific switch identifier (1.0.3 or later) -- (UIViewController *)settingsViewControllerForSwitchIdentifier:(NSString *)switchIdentifier; +- (UIViewController *)settingsViewControllerForSwitchIdentifier:(NSString *)switchIdentifier; // Retrieves a settings view controller for a specific switch identifier (1.0.3 or later) - (BOOL)switchWithIdentifierIsSimpleAction:(NSString *)switchIdentifier; @@ -89,12 +89,12 @@ // Informs the system when a switch changes its state. This will trigger any switch buttons to update their style @end -extern NSString * const FSSwitchPanelSwitchesChangedNotification; +extern NSString *const FSSwitchPanelSwitchesChangedNotification; -extern NSString * const FSSwitchPanelSwitchStateChangedNotification; -extern NSString * const FSSwitchPanelSwitchIdentifierKey; +extern NSString *const FSSwitchPanelSwitchStateChangedNotification; +extern NSString *const FSSwitchPanelSwitchIdentifierKey; -extern NSString * const FSSwitchPanelSwitchWillOpenURLNotification; +extern NSString *const FSSwitchPanelSwitchWillOpenURLNotification; @interface FSSwitchPanel (LayerEffects) - (void)applyEffectsToLayer:(CALayer *)layer forSwitchState:(FSSwitchState)state controlState:(UIControlState)controlState usingTemplate:(NSBundle *)templateBundle; diff --git a/Flipswitch/FSSwitchSettingsViewController.h b/Flipswitch/FSSwitchSettingsViewController.h index 656a76f4..f406a312 100644 --- a/Flipswitch/FSSwitchSettingsViewController.h +++ b/Flipswitch/FSSwitchSettingsViewController.h @@ -1,6 +1,6 @@ #import -@protocol FSSwitchSettingsViewController // Must be a UIViewController subclass +@protocol FSSwitchSettingsViewController // Must be a UIViewController subclass @optional - (instancetype)initWithSwitchIdentifier:(NSString *)switchIdentifier; @end diff --git a/Flipswitch/FSSwitchState.h b/Flipswitch/FSSwitchState.h index 64ba457a..f68b4d52 100644 --- a/Flipswitch/FSSwitchState.h +++ b/Flipswitch/FSSwitchState.h @@ -1,9 +1,9 @@ #import typedef enum { - FSSwitchStateOff = 0, - FSSwitchStateOn = 1, - FSSwitchStateIndeterminate = -1 + FSSwitchStateOff = 0, + FSSwitchStateOn = 1, + FSSwitchStateIndeterminate = -1 } FSSwitchState; extern NSString *NSStringFromFSSwitchState(FSSwitchState state); diff --git a/Foundation/NSXPCConnection.h b/Foundation/NSXPCConnection.h index a53d918c..3d838eed 100644 --- a/Foundation/NSXPCConnection.h +++ b/Foundation/NSXPCConnection.h @@ -3,7 +3,7 @@ #import #if __has_include() - #import +#import #endif @class NSXPCConnection, NSXPCListener, NSXPCInterface, NSXPCListenerEndpoint; @@ -60,7 +60,7 @@ typedef NS_OPTIONS(NSUInteger, NSXPCConnectionOptions) { NSXPCConnectionPrivileg @interface NSXPCListener : NSObject -@property (nullable, weak) id delegate; +@property (nullable, weak) id delegate; @property (readonly, retain) NSXPCListenerEndpoint *endpoint; + (NSXPCListener *)serviceListener; @@ -76,7 +76,7 @@ typedef NS_OPTIONS(NSUInteger, NSXPCConnectionOptions) { NSXPCConnectionPrivileg // --- // -@protocol NSXPCListenerDelegate +@protocol NSXPCListenerDelegate @optional - (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection; @end @@ -102,12 +102,12 @@ typedef NS_OPTIONS(NSUInteger, NSXPCConnectionOptions) { NSXPCConnectionPrivileg // -- // -@interface NSXPCListenerEndpoint : NSObject +@interface NSXPCListenerEndpoint : NSObject @end @interface NSXPCCoder : NSCoder -@property (nullable, retain) id userInfo; +@property (nullable, retain) id userInfo; @property (nullable, readonly, strong) NSXPCConnection *connection API_AVAILABLE(ios(10.0)); #if __has_include() diff --git a/FrontBoard/FBSceneClient.h b/FrontBoard/FBSceneClient.h index 77f157e7..4917cb4b 100644 --- a/FrontBoard/FBSceneClient.h +++ b/FrontBoard/FBSceneClient.h @@ -2,7 +2,7 @@ @class FBScene, FBSSceneSettings, FBSSceneSettingsDiff, FBSSceneTransitionContext; -@protocol FBSceneClient +@protocol FBSceneClient @required diff --git a/FrontBoard/FBSceneClientProvider.h b/FrontBoard/FBSceneClientProvider.h index 69fb61db..45eda2ff 100644 --- a/FrontBoard/FBSceneClientProvider.h +++ b/FrontBoard/FBSceneClientProvider.h @@ -1,6 +1,6 @@ #import -@protocol FBSceneClientProvider +@protocol FBSceneClientProvider @required diff --git a/FrontBoard/FBSystemGestureManager.h b/FrontBoard/FBSystemGestureManager.h index 8468ab9a..51462c0b 100644 --- a/FrontBoard/FBSystemGestureManager.h +++ b/FrontBoard/FBSystemGestureManager.h @@ -2,7 +2,7 @@ @class FBSDisplay; -@interface FBSystemGestureManager : NSObject +@interface FBSystemGestureManager : NSObject + (instancetype)sharedInstance; diff --git a/FrontBoard/FBWorkspaceEvent.h b/FrontBoard/FBWorkspaceEvent.h index d7ba8385..e02dbcdb 100644 --- a/FrontBoard/FBWorkspaceEvent.h +++ b/FrontBoard/FBWorkspaceEvent.h @@ -2,7 +2,7 @@ @interface FBWorkspaceEvent : NSObject -+ (instancetype)eventWithName:(NSString *)name handler:(/*^block*/id)handler; ++ (instancetype)eventWithName:(NSString *)name handler:(/*^block*/ id)handler; - (void)execute; diff --git a/FrontBoardServices/FBSOpenApplicationOptions.h b/FrontBoardServices/FBSOpenApplicationOptions.h index ad114b78..708c2ffc 100644 --- a/FrontBoardServices/FBSOpenApplicationOptions.h +++ b/FrontBoardServices/FBSOpenApplicationOptions.h @@ -2,7 +2,7 @@ #import #import -@interface FBSOpenApplicationOptions : NSObject +@interface FBSOpenApplicationOptions : NSObject @property (nonatomic, copy) NSDictionary *dictionary; @property (nonatomic, retain, readonly) NSURL *url; diff --git a/FrontBoardServices/FBSSceneSettings.h b/FrontBoardServices/FBSSceneSettings.h index 9c44aa8a..f9e359fe 100644 --- a/FrontBoardServices/FBSSceneSettings.h +++ b/FrontBoardServices/FBSSceneSettings.h @@ -1,6 +1,6 @@ #import -@interface FBSSceneSettings : NSObject +@interface FBSSceneSettings : NSObject @property (nonatomic, readonly, getter=isBackgrounded) BOOL backgrounded; diff --git a/FrontBoardServices/FBSSystemService.h b/FrontBoardServices/FBSSystemService.h index 1e4ad49b..7f2ce19c 100644 --- a/FrontBoardServices/FBSSystemService.h +++ b/FrontBoardServices/FBSSystemService.h @@ -13,8 +13,8 @@ FOUNDATION_EXPORT NSString *const FBSOpenApplicationOptionKeyActivateSuspended; - (mach_port_t)createClientPort; -- (void)sendActions:(NSSet *)actions withResult:(FBSSystemServiceResultCallback)result; -- (void)openURL:(NSURL *)url application:(NSString *)bundleIdentifier options:(NSDictionary *)options clientPort:(mach_port_t)clientPort withResult:(FBSSystemServiceResultCallback)callback; +- (void)sendActions:(NSSet *)actions withResult:(FBSSystemServiceResultCallback)result; +- (void)openURL:(NSURL *)url application:(NSString *)bundleIdentifier options:(NSDictionary *)options clientPort:(mach_port_t)clientPort withResult:(FBSSystemServiceResultCallback)callback; - (void)openApplication:(NSString *)app options:(NSDictionary *)options withResult:(void (^)(void))result; - (void)shutdown API_AVAILABLE(ios(8.0)); - (void)reboot API_AVAILABLE(ios(8.0)); diff --git a/GraphicsServices/GSCapability.h b/GraphicsServices/GSCapability.h index 420beed1..9cc5dea3 100644 --- a/GraphicsServices/GSCapability.h +++ b/GraphicsServices/GSCapability.h @@ -44,18 +44,17 @@ __BEGIN_DECLS */ CFPropertyListRef _getCapability(CFStringRef capability); -CFStringRef GSGetLocalizedDeviceName(); ///< Get the localized device name (which is the "device-name-localized" capability). -CFStringRef GSGetDeviceName(); ///< Get the device name (which is the "device-name" capability). +CFStringRef GSGetLocalizedDeviceName(); ///< Get the localized device name (which is the "device-name-localized" capability). +CFStringRef GSGetDeviceName(); ///< Get the device name (which is the "device-name" capability). Boolean GSSystemHasCapability(CFStringRef capability); ///< Check if the system has the specified capability. - Boolean GSSystemCanTakePhoto(); ///< Returns if the device can take photos (i.e. have "still-camera" but not "cameraRestriction" capabilities). #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 Boolean GSSystemHasTelephonyCapability(); ///< Returns if the device has "telephony" capability. #endif #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 Boolean GSSystemGetCellularDataCapability(void); ///< Returns if the device has "cellular-data" capability. -Boolean GSSystemGetTelephonyCapability(void); ///< Returns if the device has "telephony" capability. +Boolean GSSystemGetTelephonyCapability(void); ///< Returns if the device has "telephony" capability. #endif /// If the capability is a dictionary (e.g. the "screen-dimensions" capability), copy the value of a key in that dictionary. diff --git a/GraphicsServices/GSColor.h b/GraphicsServices/GSColor.h index f2a516f0..7f9b6785 100644 --- a/GraphicsServices/GSColor.h +++ b/GraphicsServices/GSColor.h @@ -61,16 +61,16 @@ void GSColorSetColor(CGContextRef context, CGColorRef color); void GSColorGetRGBAComponents(CGColorRef color, CGFloat *r, CGFloat *g, CGFloat *b, CGFloat *a); CGFloat GSColorGetAlphaComponent(CGColorRef color); ///< Get the alpha component. -CGFloat GSColorGetBlueComponent(CGColorRef color); ///< Get the blue component. +CGFloat GSColorGetBlueComponent(CGColorRef color); ///< Get the blue component. CGFloat GSColorGetGreenComponent(CGColorRef color); ///< Get the green component. -CGFloat GSColorGetRedComponent(CGColorRef color); ///< Get the red component. +CGFloat GSColorGetRedComponent(CGColorRef color); ///< Get the red component. typedef enum GSSystemColor { kGSBlackColor, kGSWhiteColor, - kGSGrayColor, // 50% + kGSGrayColor, // 50% kGSLightGrayColor, // 70% - kGSDarkGrayColor, // 30% + kGSDarkGrayColor, // 30% kGSRedColor, kGSGreenColor, kGSBlueColor, @@ -79,14 +79,14 @@ typedef enum GSSystemColor { kGSYellowColor, kGSOrangeColor, // #FF8000 kGSPurpleColor, // #800080 - kGSBrownColor, // #996633 + kGSBrownColor, // #996633 kGSClearColor } GSSystemColor; /// Get a "system color". The color will be cached by the system. CGColorRef GSColorForSystemColor(GSSystemColor colorType); -CGColorRef GSColorGetShadowColor(); ///< Get the shadow color, i.e. black. +CGColorRef GSColorGetShadowColor(); ///< Get the shadow color, i.e. black. CGColorRef GSColorGetHighlightColor(); ///< Get the highlight color, i.e. white. /// Set the fill and stroke color of the context to the specified system color. diff --git a/GraphicsServices/GSEvent.h b/GraphicsServices/GSEvent.h index 317ac0d5..2819d567 100644 --- a/GraphicsServices/GSEvent.h +++ b/GraphicsServices/GSEvent.h @@ -45,14 +45,14 @@ __BEGIN_DECLS typedef struct __GSEvent *GSEventRef; typedef struct GSPathInfo { - unsigned char pathIndex; // 0x0 = 0x5C - unsigned char pathIdentity; // 0x1 = 0x5D + unsigned char pathIndex; // 0x0 = 0x5C + unsigned char pathIdentity; // 0x1 = 0x5D unsigned char pathProximity; // 0x2 = 0x5E - CGFloat pathPressure; // 0x4 = 0x60 - CGFloat pathMajorRadius; // 0x8 = 0x64 - CGPoint pathLocation; // 0xC = 0x68 - GSWindowRef pathWindow; // 0x14 = 0x70 -} GSPathInfo; // sizeof = 0x18. + CGFloat pathPressure; // 0x4 = 0x60 + CGFloat pathMajorRadius; // 0x8 = 0x64 + CGPoint pathLocation; // 0xC = 0x68 + GSWindowRef pathWindow; // 0x14 = 0x70 +} GSPathInfo; // sizeof = 0x18. typedef enum __GSHandInfoType { kGSHandInfoTypeTouchDown = 0, @@ -64,7 +64,7 @@ typedef enum __GSHandInfoType { // A.k.a. XXStruct_$jUSvD typedef struct GSHandInfo { - GSHandInfoType type; // 0x0 == 0x3C + GSHandInfoType type; // 0x0 == 0x3C short deltaX, deltaY; // 2, 4 = 0x40, 0x42 float _0x44; float _0x48; @@ -74,8 +74,8 @@ typedef struct GSHandInfo { float _0x58; unsigned char _0x5C; unsigned char pathInfosCount; // 0x22 == 0x5D - GSPathInfo pathInfos[0]; // 0x60 -} GSHandInfo; // sizeof = 0x24. + GSPathInfo pathInfos[0]; // 0x60 +} GSHandInfo; // sizeof = 0x24. typedef struct __GSScrollWheelInfo { int deltaY; @@ -92,19 +92,19 @@ typedef struct __GSDeviceOrientationInfo { typedef struct __GSKeyInfo { UniChar keyCode, characterIgnoringModifier, charCode; // 0x3C, 0x3E, 0x40 - unsigned short characterSet; // 0x42 - Boolean isKeyRepeating; // 0x44 + unsigned short characterSet; // 0x42 + Boolean isKeyRepeating; // 0x44 } GSKeyInfo; typedef struct __GSHardwareKeyInfo { - UniChar keyCode; // 3c - UniChar characterIgnoringModifier; // 3e - UniChar charCode; // 40 - unsigned short characterSet; // 42 - uint16_t characters_length; // 44 - UniChar characters[32]; // 46 .. 84 + UniChar keyCode; // 3c + UniChar characterIgnoringModifier; // 3e + UniChar charCode; // 40 + unsigned short characterSet; // 42 + uint16_t characters_length; // 44 + UniChar characters[32]; // 46 .. 84 uint16_t unmodified_characters_length; // 86 - UniChar unmodified_characters[32]; // 88 .. C6 + UniChar unmodified_characters[32]; // 88 .. C6 int unknown0 : 1; int isKeyVariant : 1; int unknown2 : 14; @@ -176,7 +176,7 @@ typedef enum __GSEventType { kGSEventMotionBegin = 1020, kGSEventHeadsetAvailabilityChanged = 1021, kGSEventMediaKeyDown = 1022, // ≥3.2 - kGSEventMediaKeyUp = 1023, // ≥3.2 + kGSEventMediaKeyUp = 1023, // ≥3.2 kGSEventVibrate = 1100, kGSEventSetBacklightFactor = 1102, @@ -221,16 +221,16 @@ typedef enum GSEventFlags { } GSEventFlags; typedef struct GSEventRecord { - GSEventType type; // 0x8 + GSEventType type; // 0x8 GSEventSubType subtype; // 0xC - CGPoint location; // 0x10 + CGPoint location; // 0x10 CGPoint windowLocation; // 0x18 - int windowContextId; // 0x20 - uint64_t timestamp; // 0x24, from mach_absolute_time - GSWindowRef window; // 0x2C - GSEventFlags flags; // 0x30 - unsigned senderPID; // 0x34 - CFIndex infoSize; // 0x38 + int windowContextId; // 0x20 + uint64_t timestamp; // 0x24, from mach_absolute_time + GSWindowRef window; // 0x2C + GSEventFlags flags; // 0x30 + unsigned senderPID; // 0x34 + CFIndex infoSize; // 0x38 } GSEventRecord; #pragma mark - @@ -287,7 +287,7 @@ mach_port_name_t GSRegisterPurpleNamedPort(const char *service_name); mach_port_name_t GSCopyPurpleNamedPort(const char *service_name); mach_port_name_t GSGetPurpleSystemEventPort() __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0); -void GSEventPopRunLoopMode(CFStringRef mode); ///< Stop the event run loop, and remove "mode" from the run loop mode stack if it is at the top. +void GSEventPopRunLoopMode(CFStringRef mode); ///< Stop the event run loop, and remove "mode" from the run loop mode stack if it is at the top. void GSEventPushRunLoopMode(CFStringRef mode); ///< Stop the event run loop and push "mode" to the top of run loop mode stack. void GSEventStopModal(); @@ -300,7 +300,7 @@ void GSEventInitialize(Boolean registerPurple); #pragma mark Sending events void GSSendEvent(const GSEventRecord *record, mach_port_t port); void GSSendSimpleEvent(GSEventType type, mach_port_t port) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0); ///< This calls GSSendEvent with an empty record. -void GSSendSystemEvent(const GSEventRecord *record); ///< Send event to the PurpleSystemEventPort. +void GSSendSystemEvent(const GSEventRecord *record); ///< Send event to the PurpleSystemEventPort. #pragma mark - #pragma mark Callback functions @@ -421,8 +421,8 @@ void _GSEventPlayAlertOrSystemSoundAtPath(CFStringRef path, Boolean loop, Boolea SInt32 GSEventPrimeSoundAtPath(CFStringRef path); void GSEventStopSoundAtPath(CFStringRef path, Boolean unknown); void GSEventPlayAlertSoundAtPath(CFStringRef path); // Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 0, 1) -void GSEventLoopSoundAtPath(CFStringRef path); // Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 1, 0) -void GSEventPlaySoundAtPath(CFStringRef path); // Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 0, 0) +void GSEventLoopSoundAtPath(CFStringRef path); // Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 1, 0) +void GSEventPlaySoundAtPath(CFStringRef path); // Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 0, 0) void GSEventVibrateForDuration(float secs); void GSEventStopVibrator(); ///< Equivalent to GSEventVibrateForDuration(0) @@ -436,20 +436,20 @@ void GSEventSetHardwareKeyboardAttached(Boolean attached); // "type" must be 10 or 14. GSEventRef GSEventCreateKeyEvent(GSEventType type, - CGPoint windowLocation, - CFStringRef characters, - CFStringRef unmodifiedCharacters, - GSEventFlags modifiers, - uint16_t usagePage, - unsigned options7, unsigned options8); + CGPoint windowLocation, + CFStringRef characters, + CFStringRef unmodifiedCharacters, + GSEventFlags modifiers, + uint16_t usagePage, + unsigned options7, unsigned options8); void GSSendKeyEvent(GSEventType type, - CGPoint windowLocation, - CFStringRef characters, - CFStringRef unmodifiedCharacters, - GSEventFlags modifiers, - uint16_t usagePage, - unsigned short options7, - unsigned short options8); + CGPoint windowLocation, + CFStringRef characters, + CFStringRef unmodifiedCharacters, + GSEventFlags modifiers, + uint16_t usagePage, + unsigned short options7, + unsigned short options8); uint16_t GSEventGetUsagePage(GSEventRef event); void GSEventSetCharCode(GSEventRef event, UniChar charCode); diff --git a/GraphicsServices/GSFont.h b/GraphicsServices/GSFont.h index 1b6ef1d0..72ec75fc 100644 --- a/GraphicsServices/GSFont.h +++ b/GraphicsServices/GSFont.h @@ -51,7 +51,6 @@ GSFont is a "mid-level" wrapper of many CGFont operations. It includes functions - Creating common fonts by a font family, traits and size. */ - typedef struct __GSFont *GSFontRef; typedef enum __GSFontTraitMask { @@ -83,9 +82,9 @@ struct __GSFont { } */ -CFHashCode GSFontHash(GSFontRef font); ///< Compute the font's hash value. +CFHashCode GSFontHash(GSFontRef font); ///< Compute the font's hash value. Boolean GSFontEqual(GSFontRef a, GSFontRef b); ///< Determine if two fonts are equal. -CFTypeID GSFontGetTypeID(); ///< Get the CoreFoundation type identifier of GSFont. +CFTypeID GSFontGetTypeID(); ///< Get the CoreFoundation type identifier of GSFont. /*! @brief Set to use legacy font metrics or not. @@ -98,15 +97,15 @@ nearest integers (floor(0.5+x)). There may be some other differences in the algo void GSFontSetUseLegacyFontMetrics(Boolean useLegacyFontMetrics); Boolean GSFontGetUseLegacyFontMetrics(); ///< Get whether legacy font metrics is used. -CGFontRef GSFontGetCGFont(GSFontRef font); ///< Get CGFont from a GSFont. -Boolean GSFontIsBold(GSFontRef font); ///< Check whether a font is bold. -GSFontTraitMask GSFontGetTraits(GSFontRef font); ///< Get the traits mask of the font. +CGFontRef GSFontGetCGFont(GSFontRef font); ///< Get CGFont from a GSFont. +Boolean GSFontIsBold(GSFontRef font); ///< Check whether a font is bold. +GSFontTraitMask GSFontGetTraits(GSFontRef font); ///< Get the traits mask of the font. GSFontTraitMask GSFontGetSynthesizedTraits(GSFontRef font); ///< Get the synthesized traits mask of the font. -CGFloat GSFontGetSize(GSFontRef font); ///< Get the font's point size -CGFloat GSFontGetAscent(GSFontRef font); ///< Get the font's ascent. -CGFloat GSFontGetDescent(GSFontRef font); ///< Get the font's descent. -CGFloat GSFontGetLineSpacing(GSFontRef font); ///< Get the font's line spacing. -CGFloat GSFontGetLineGap(GSFontRef font); ///< Get the font's line gap. +CGFloat GSFontGetSize(GSFontRef font); ///< Get the font's point size +CGFloat GSFontGetAscent(GSFontRef font); ///< Get the font's ascent. +CGFloat GSFontGetDescent(GSFontRef font); ///< Get the font's descent. +CGFloat GSFontGetLineSpacing(GSFontRef font); ///< Get the font's line spacing. +CGFloat GSFontGetLineGap(GSFontRef font); ///< Get the font's line gap. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 CGFloat GSFontGetMaximumAdvanceWidth(GSFontRef font); ///< Get the font's maximum advance width. #endif diff --git a/GraphicsServices/GSHeartbeat.h b/GraphicsServices/GSHeartbeat.h index 67ed44aa..ad7bba66 100644 --- a/GraphicsServices/GSHeartbeat.h +++ b/GraphicsServices/GSHeartbeat.h @@ -66,7 +66,6 @@ struct __GSHeartbeat { } */ - GSHeartbeatTime GSHeartbeatGetCurrentTime(); CFTypeID GSHeartbeatGetTypeID(); diff --git a/GraphicsServices/GSKeyboard.h b/GraphicsServices/GSKeyboard.h index d14c8514..3a50dc72 100644 --- a/GraphicsServices/GSKeyboard.h +++ b/GraphicsServices/GSKeyboard.h @@ -84,25 +84,25 @@ GSEventFlags GSKeyboardGetModifierState(GSKeyboardRef keyboard); // ref: http://developer.apple.com/mac/library/documentation/Carbon/Reference/Unicode_Utilities_Ref/Reference/reference.html#//apple_ref/doc/uid/TP30000122-CH1g-F10792 OSStatus GSKeyTranslate(GSKeyboardRef keyboard, - UInt16 virtualKeyCode, - UInt16 keyAction, - UInt32 modifierKeyState, - UInt32 keyboardType, - OptionBits keyTranslateOptions, - UInt32 *deadKeyState, - UniCharCount maxStringLength, - UniCharCount *actualStringLength, - UniChar unicodeString[]); + UInt16 virtualKeyCode, + UInt16 keyAction, + UInt32 modifierKeyState, + UInt32 keyboardType, + OptionBits keyTranslateOptions, + UInt32 *deadKeyState, + UniCharCount maxStringLength, + UniCharCount *actualStringLength, + UniChar unicodeString[]); OSStatus GSKeyboardTranslateKey(GSKeyboardRef keyboard, - UInt16 virtualKeyCode, - UInt16 unknown, - OptionBits keyTranslateOptions, - UniCharCount maxStringLength, - UniCharCount *actualStringLength, - UniChar unicodeString[], - UniCharCount *actualStringLength2, - UniChar unicodeString2[]); + UInt16 virtualKeyCode, + UInt16 unknown, + OptionBits keyTranslateOptions, + UniCharCount maxStringLength, + UniCharCount *actualStringLength, + UniChar unicodeString[], + UniCharCount *actualStringLength2, + UniChar unicodeString2[]); __END_DECLS diff --git a/HBLog.h b/HBLog.h index 05809bdc..4b33af75 100644 --- a/HBLog.h +++ b/HBLog.h @@ -1,44 +1,44 @@ #import #ifndef HB_LOG_USE_COLOR - #if defined(__DEBUG__) || defined(__IPHONE_10_0) - #define HB_LOG_USE_COLOR 0 - #else - #define HB_LOG_USE_COLOR 1 - #endif +#if defined(__DEBUG__) || defined(__IPHONE_10_0) +#define HB_LOG_USE_COLOR 0 +#else +#define HB_LOG_USE_COLOR 1 +#endif #endif #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0 && __has_include() - #import - - #define HB_LOG_INTERNAL(level, type, ...) os_log_with_type(OS_LOG_DEFAULT, level, "[%{public}s:%{public}d] %{public}@", __BASE_FILE__, __LINE__, [NSString stringWithFormat:__VA_ARGS__]) - - #ifdef __DEBUG__ - #define HBLogDebug(...) HB_LOG_INTERNAL(OS_LOG_TYPE_DEBUG, "DEBUG", __VA_ARGS__) - #else - #define HBLogDebug(...) - #endif - #define HBLogInfo(...) HB_LOG_INTERNAL(OS_LOG_TYPE_INFO, "INFO", __VA_ARGS__) - #define HBLogWarn(...) HB_LOG_INTERNAL(OS_LOG_TYPE_DEFAULT, "WARN", __VA_ARGS__) - #define HBLogError(...) HB_LOG_INTERNAL(OS_LOG_TYPE_ERROR, "ERROR", __VA_ARGS__) +#import + +#define HB_LOG_INTERNAL(level, type, ...) os_log_with_type(OS_LOG_DEFAULT, level, "[%{public}s:%{public}d] %{public}@", __BASE_FILE__, __LINE__, [NSString stringWithFormat:__VA_ARGS__]) + +#ifdef __DEBUG__ +#define HBLogDebug(...) HB_LOG_INTERNAL(OS_LOG_TYPE_DEBUG, "DEBUG", __VA_ARGS__) +#else +#define HBLogDebug(...) +#endif +#define HBLogInfo(...) HB_LOG_INTERNAL(OS_LOG_TYPE_INFO, "INFO", __VA_ARGS__) +#define HBLogWarn(...) HB_LOG_INTERNAL(OS_LOG_TYPE_DEFAULT, "WARN", __VA_ARGS__) +#define HBLogError(...) HB_LOG_INTERNAL(OS_LOG_TYPE_ERROR, "ERROR", __VA_ARGS__) #else - #include +#include - #ifdef HB_LOG_USE_COLOR - #define HB_LOG_FORMAT(color) CFSTR("\e[1;3" #color "m[%s] \e[m\e[0;3" #color "m%s:%d\e[m \e[0;30;4" #color "m%s:\e[m %@") - #else - #define HB_LOG_FORMAT(color) CFSTR("[%s: %s:%d] %s: %@") - #endif +#ifdef HB_LOG_USE_COLOR +#define HB_LOG_FORMAT(color) CFSTR("\e[1;3" #color "m[%s] \e[m\e[0;3" #color "m%s:%d\e[m \e[0;30;4" #color "m%s:\e[m %@") +#else +#define HB_LOG_FORMAT(color) CFSTR("[%s: %s:%d] %s: %@") +#endif - #define HB_LOG_INTERNAL(color, level, type, ...) CFLog(level, HB_LOG_FORMAT(color), THEOS_INSTANCE_NAME, __BASE_FILE__, __LINE__, type, (__bridge CFStringRef)[NSString stringWithFormat:__VA_ARGS__]) +#define HB_LOG_INTERNAL(color, level, type, ...) CFLog(level, HB_LOG_FORMAT(color), THEOS_INSTANCE_NAME, __BASE_FILE__, __LINE__, type, (__bridge CFStringRef)[NSString stringWithFormat:__VA_ARGS__]) - #ifdef __DEBUG__ - #define HBLogDebug(...) HB_LOG_INTERNAL(6, kCFLogLevelNotice, "DEBUG", __VA_ARGS__) - #else - #define HBLogDebug(...) - #endif +#ifdef __DEBUG__ +#define HBLogDebug(...) HB_LOG_INTERNAL(6, kCFLogLevelNotice, "DEBUG", __VA_ARGS__) +#else +#define HBLogDebug(...) +#endif - #define HBLogInfo(...) HB_LOG_INTERNAL(2, kCFLogLevelNotice, "INFO", __VA_ARGS__) - #define HBLogWarn(...) HB_LOG_INTERNAL(3, kCFLogLevelWarning, "WARN", __VA_ARGS__) - #define HBLogError(...) HB_LOG_INTERNAL(1, kCFLogLevelError, "ERROR", __VA_ARGS__) +#define HBLogInfo(...) HB_LOG_INTERNAL(2, kCFLogLevelNotice, "INFO", __VA_ARGS__) +#define HBLogWarn(...) HB_LOG_INTERNAL(3, kCFLogLevelWarning, "WARN", __VA_ARGS__) +#define HBLogError(...) HB_LOG_INTERNAL(1, kCFLogLevelError, "ERROR", __VA_ARGS__) #endif diff --git a/IMCore/IMHandle.h b/IMCore/IMHandle.h index f739ebb9..7e38fc05 100644 --- a/IMCore/IMHandle.h +++ b/IMCore/IMHandle.h @@ -6,7 +6,7 @@ @interface IMHandle : NSObject -+ (NSArray *)imHandlesForIMPerson:(IMPerson *)person; ++ (NSArray *)imHandlesForIMPerson:(IMPerson *)person; @property (nonatomic, retain, readonly) NSString *ID; diff --git a/IMCore/IMServiceImpl.h b/IMCore/IMServiceImpl.h index 4e187124..14888db9 100644 --- a/IMCore/IMServiceImpl.h +++ b/IMCore/IMServiceImpl.h @@ -8,7 +8,7 @@ + (instancetype)iMessageService; -- (NSArray *)imABPeopleWithScreenName:(NSString *)screenName; -- (NSArray *)imABPeopleWithScreenName:(NSString *)screenName countryCode:(NSString *)countryCode identifier:(NSString *)identifier; +- (NSArray *)imABPeopleWithScreenName:(NSString *)screenName; +- (NSArray *)imABPeopleWithScreenName:(NSString *)screenName countryCode:(NSString *)countryCode identifier:(NSString *)identifier; @end diff --git a/IMDaemonCore/IMDChat.h b/IMDaemonCore/IMDChat.h index ec5cfcad..a5485943 100644 --- a/IMDaemonCore/IMDChat.h +++ b/IMDaemonCore/IMDChat.h @@ -7,10 +7,10 @@ @interface IMDChat : NSObject -@property (nonatomic, retain) NSDictionary *properties; +@property (nonatomic, retain) NSDictionary *properties; -- (void)updateProperties:(NSDictionary *)properties; +- (void)updateProperties:(NSDictionary *)properties; -@property (nonatomic, retain) NSArray *participants; +@property (nonatomic, retain) NSArray *participants; @end diff --git a/IMDaemonCore/IMDChatRegistry.h b/IMDaemonCore/IMDChatRegistry.h index 1dfeeb7d..847ba49e 100644 --- a/IMDaemonCore/IMDChatRegistry.h +++ b/IMDaemonCore/IMDChatRegistry.h @@ -7,6 +7,6 @@ + (instancetype)sharedInstance; -- (NSArray *)chats; +- (NSArray *)chats; @end diff --git a/IMFoundation/IMMessageItem.h b/IMFoundation/IMMessageItem.h index 554e8192..848bc718 100644 --- a/IMFoundation/IMMessageItem.h +++ b/IMFoundation/IMMessageItem.h @@ -1,7 +1,7 @@ #import "IMItem.h" typedef NS_OPTIONS(unsigned long long, IMMessageItemFlags) { - IMMessageItemFlagsFinished = 0x1 + IMMessageItemFlagsFinished = 0x1 }; @interface IMMessageItem : IMItem diff --git a/IOKit/IOKitKeys.h b/IOKit/IOKitKeys.h index 62395d54..6bbbc36f 100644 --- a/IOKit/IOKitKeys.h +++ b/IOKit/IOKitKeys.h @@ -34,102 +34,101 @@ * */ - #ifndef _IOKIT_IOKITKEYS_H #define _IOKIT_IOKITKEYS_H // properties found in the registry root -#define kIOKitBuildVersionKey "IOKitBuildVersion" -#define kIOKitDiagnosticsKey "IOKitDiagnostics" - // a dictionary keyed by plane name -#define kIORegistryPlanesKey "IORegistryPlanes" -#define kIOCatalogueKey "IOCatalogue" +#define kIOKitBuildVersionKey "IOKitBuildVersion" +#define kIOKitDiagnosticsKey "IOKitDiagnostics" +// a dictionary keyed by plane name +#define kIORegistryPlanesKey "IORegistryPlanes" +#define kIOCatalogueKey "IOCatalogue" // registry plane names -#define kIOServicePlane "IOService" -#define kIOPowerPlane "IOPower" -#define kIODeviceTreePlane "IODeviceTree" -#define kIOAudioPlane "IOAudio" -#define kIOFireWirePlane "IOFireWire" -#define kIOUSBPlane "IOUSB" +#define kIOServicePlane "IOService" +#define kIOPowerPlane "IOPower" +#define kIODeviceTreePlane "IODeviceTree" +#define kIOAudioPlane "IOAudio" +#define kIOFireWirePlane "IOFireWire" +#define kIOUSBPlane "IOUSB" // registry ID number -#define kIORegistryEntryIDKey "IORegistryEntryID" +#define kIORegistryEntryIDKey "IORegistryEntryID" // IOService class name -#define kIOServiceClass "IOService" +#define kIOServiceClass "IOService" // IOResources class name -#define kIOResourcesClass "IOResources" +#define kIOResourcesClass "IOResources" // IOService driver probing property names -#define kIOClassKey "IOClass" -#define kIOProbeScoreKey "IOProbeScore" -#define kIOKitDebugKey "IOKitDebug" +#define kIOClassKey "IOClass" +#define kIOProbeScoreKey "IOProbeScore" +#define kIOKitDebugKey "IOKitDebug" // IOService matching property names -#define kIOProviderClassKey "IOProviderClass" -#define kIONameMatchKey "IONameMatch" -#define kIOPropertyMatchKey "IOPropertyMatch" -#define kIOPathMatchKey "IOPathMatch" -#define kIOLocationMatchKey "IOLocationMatch" -#define kIOParentMatchKey "IOParentMatch" -#define kIOResourceMatchKey "IOResourceMatch" -#define kIOMatchedServiceCountKey "IOMatchedServiceCountMatch" +#define kIOProviderClassKey "IOProviderClass" +#define kIONameMatchKey "IONameMatch" +#define kIOPropertyMatchKey "IOPropertyMatch" +#define kIOPathMatchKey "IOPathMatch" +#define kIOLocationMatchKey "IOLocationMatch" +#define kIOParentMatchKey "IOParentMatch" +#define kIOResourceMatchKey "IOResourceMatch" +#define kIOMatchedServiceCountKey "IOMatchedServiceCountMatch" -#define kIONameMatchedKey "IONameMatched" +#define kIONameMatchedKey "IONameMatched" -#define kIOMatchCategoryKey "IOMatchCategory" -#define kIODefaultMatchCategoryKey "IODefaultMatchCategory" +#define kIOMatchCategoryKey "IOMatchCategory" +#define kIODefaultMatchCategoryKey "IODefaultMatchCategory" // IOService default user client class, for loadable user clients -#define kIOUserClientClassKey "IOUserClientClass" +#define kIOUserClientClassKey "IOUserClientClass" // key to find IOMappers -#define kIOMapperIDKey "IOMapperID" +#define kIOMapperIDKey "IOMapperID" -#define kIOUserClientCrossEndianKey "IOUserClientCrossEndian" -#define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible" -#define kIOUserClientSharedInstanceKey "IOUserClientSharedInstance" +#define kIOUserClientCrossEndianKey "IOUserClientCrossEndian" +#define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible" +#define kIOUserClientSharedInstanceKey "IOUserClientSharedInstance" // diagnostic string describing the creating task -#define kIOUserClientCreatorKey "IOUserClientCreator" +#define kIOUserClientCreatorKey "IOUserClientCreator" // IOService notification types -#define kIOPublishNotification "IOServicePublish" -#define kIOFirstPublishNotification "IOServiceFirstPublish" -#define kIOMatchedNotification "IOServiceMatched" -#define kIOFirstMatchNotification "IOServiceFirstMatch" -#define kIOTerminatedNotification "IOServiceTerminate" +#define kIOPublishNotification "IOServicePublish" +#define kIOFirstPublishNotification "IOServiceFirstPublish" +#define kIOMatchedNotification "IOServiceMatched" +#define kIOFirstMatchNotification "IOServiceFirstMatch" +#define kIOTerminatedNotification "IOServiceTerminate" // IOService interest notification types -#define kIOGeneralInterest "IOGeneralInterest" -#define kIOBusyInterest "IOBusyInterest" -#define kIOAppPowerStateInterest "IOAppPowerStateInterest" -#define kIOPriorityPowerStateInterest "IOPriorityPowerStateInterest" +#define kIOGeneralInterest "IOGeneralInterest" +#define kIOBusyInterest "IOBusyInterest" +#define kIOAppPowerStateInterest "IOAppPowerStateInterest" +#define kIOPriorityPowerStateInterest "IOPriorityPowerStateInterest" -#define kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" +#define kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" // IOService interest notification types -#define kIOCFPlugInTypesKey "IOCFPlugInTypes" +#define kIOCFPlugInTypesKey "IOCFPlugInTypes" // properties found in services that implement command pooling -#define kIOCommandPoolSizeKey "IOCommandPoolSize" // (OSNumber) +#define kIOCommandPoolSizeKey "IOCommandPoolSize" // (OSNumber) // properties found in services that have transfer constraints -#define kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" // (OSNumber) -#define kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" // (OSNumber) -#define kIOMaximumByteCountReadKey "IOMaximumByteCountRead" // (OSNumber) -#define kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" // (OSNumber) -#define kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" // (OSNumber) -#define kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" // (OSNumber) -#define kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" // (OSNumber) -#define kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" // (OSNumber) -#define kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" // (OSNumber) +#define kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" // (OSNumber) +#define kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" // (OSNumber) +#define kIOMaximumByteCountReadKey "IOMaximumByteCountRead" // (OSNumber) +#define kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" // (OSNumber) +#define kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" // (OSNumber) +#define kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" // (OSNumber) +#define kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" // (OSNumber) +#define kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" // (OSNumber) +#define kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" // (OSNumber) #define kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount" // (OSNumber) // properties found in services that wish to describe an icon // -// IOIcon = +// IOIcon = // { // CFBundleIdentifier = "com.example.driver.example"; // IOBundleResourceFile = "example.icns"; @@ -137,28 +136,28 @@ // // where IOBundleResourceFile is the filename of the resource -#define kIOIconKey "IOIcon" // (OSDictionary) +#define kIOIconKey "IOIcon" // (OSDictionary) #define kIOBundleResourceFileKey "IOBundleResourceFile" // (OSString) -#define kIOBusBadgeKey "IOBusBadge" // (OSDictionary) -#define kIODeviceIconKey "IODeviceIcon" // (OSDictionary) +#define kIOBusBadgeKey "IOBusBadge" // (OSDictionary) +#define kIODeviceIconKey "IODeviceIcon" // (OSDictionary) // property of root that describes the machine's serial number as a string -#define kIOPlatformSerialNumberKey "IOPlatformSerialNumber" // (OSString) +#define kIOPlatformSerialNumberKey "IOPlatformSerialNumber" // (OSString) // property of root that describes the machine's UUID as a string -#define kIOPlatformUUIDKey "IOPlatformUUID" // (OSString) +#define kIOPlatformUUIDKey "IOPlatformUUID" // (OSString) // IODTNVRAM property keys -#define kIONVRAMDeletePropertyKey "IONVRAM-DELETE-PROPERTY" -#define kIODTNVRAMPanicInfoKey "aapl,panic-info" +#define kIONVRAMDeletePropertyKey "IONVRAM-DELETE-PROPERTY" +#define kIODTNVRAMPanicInfoKey "aapl,panic-info" // keys for complex boot information -#define kIOBootDeviceKey "IOBootDevice" // dict | array of dicts -#define kIOBootDevicePathKey "IOBootDevicePath" // arch-neutral OSString -#define kIOBootDeviceSizeKey "IOBootDeviceSize" // OSNumber of bytes +#define kIOBootDeviceKey "IOBootDevice" // dict | array of dicts +#define kIOBootDevicePathKey "IOBootDevicePath" // arch-neutral OSString +#define kIOBootDeviceSizeKey "IOBootDeviceSize" // OSNumber of bytes // keys for OS Version information -#define kOSBuildVersionKey "OS Build Version" +#define kOSBuildVersionKey "OS Build Version" #endif /* ! _IOKIT_IOKITKEYS_H */ diff --git a/IOKit/IOKitLib.h b/IOKit/IOKitLib.h index 9827f420..16062117 100644 --- a/IOKit/IOKitLib.h +++ b/IOKit/IOKitLib.h @@ -61,18 +61,16 @@ IOKit objects returned by all functions should be released with IOObjectRelease. */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -typedef struct IONotificationPort * IONotificationPortRef; - +typedef struct IONotificationPort *IONotificationPortRef; /*! @typedef IOServiceMatchingCallback @abstract Callback function to be notified of IOService publication. @param refcon The refcon passed when the notification was installed. @param iterator The notification iterator which now has new objects. */ -typedef void -(*IOServiceMatchingCallback)( - void * refcon, - io_iterator_t iterator ); +typedef void (*IOServiceMatchingCallback)( + void *refcon, + io_iterator_t iterator); /*! @typedef IOServiceInterestCallback @abstract Callback function to be notified of changes in state of an IOService. @@ -82,12 +80,11 @@ typedef void @param messageArgument An argument for the message, dependent on the messageType. */ -typedef void -(*IOServiceInterestCallback)( - void * refcon, - io_service_t service, - uint32_t messageType, - void * messageArgument ); +typedef void (*IOServiceInterestCallback)( + void *refcon, + io_service_t service, + uint32_t messageType, + void *messageArgument); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -96,8 +93,7 @@ typedef void @discussion When specifying a master port to IOKit functions, the NULL argument indicates "use the default". This is a synonym for NULL, if you'd rather use a named constant. */ -extern -const mach_port_t kIOMasterPortDefault; +extern const mach_port_t kIOMasterPortDefault; /*! @function IOMasterPort @abstract Returns the mach port used to initiate communication with IOKit. @@ -107,9 +103,8 @@ const mach_port_t kIOMasterPortDefault; @result A kern_return_t error code. */ kern_return_t -IOMasterPort( mach_port_t bootstrapPort, - mach_port_t * masterPort ); - +IOMasterPort(mach_port_t bootstrapPort, + mach_port_t *masterPort); /*! @function IONotificationPortCreate @abstract Creates and returns a notification object for receiving IOKit notifications of new devices or state changes. @@ -119,15 +114,14 @@ IOMasterPort( mach_port_t bootstrapPort, IONotificationPortRef IONotificationPortCreate( - mach_port_t masterPort ); + mach_port_t masterPort); /*! @function IONotificationPortDestroy @abstract Destroys a notification object created with IONotificationPortCreate. @param notify A reference to the notification object. */ -void -IONotificationPortDestroy( - IONotificationPortRef notify ); +void IONotificationPortDestroy( + IONotificationPortRef notify); /*! @function IONotificationPortGetRunLoopSource @abstract Returns a CFRunLoopSource to be used to listen for notifications. @@ -137,7 +131,7 @@ IONotificationPortDestroy( CFRunLoopSourceRef IONotificationPortGetRunLoopSource( - IONotificationPortRef notify ); + IONotificationPortRef notify); /*! @function IONotificationPortGetMachPort @abstract Returns a mach_port to be used to listen for notifications. @@ -147,7 +141,7 @@ IONotificationPortGetRunLoopSource( mach_port_t IONotificationPortGetMachPort( - IONotificationPortRef notify ); + IONotificationPortRef notify); /*! @function IODispatchCalloutFromMessage @abstract Dispatches callback notifications from a mach message. @@ -156,11 +150,10 @@ IONotificationPortGetMachPort( @param msg A pointer to the message received. @param reference Pass the IONotificationPortRef for the object. */ -void -IODispatchCalloutFromMessage( - void *unused, - mach_msg_header_t *msg, - void *reference ); +void IODispatchCalloutFromMessage( + void *unused, + mach_msg_header_t *msg, + void *reference); /*! @function IOCreateReceivePort @abstract Creates and returns a mach port suitable for receiving IOKit messages of the specified type. @@ -174,7 +167,7 @@ IODispatchCalloutFromMessage( @result A kern_return_t error code. */ kern_return_t -IOCreateReceivePort( uint32_t msgType, mach_port_t * recvPort ); +IOCreateReceivePort(uint32_t msgType, mach_port_t *recvPort); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -190,7 +183,7 @@ IOCreateReceivePort( uint32_t msgType, mach_port_t * recvPort ); kern_return_t IOObjectRelease( - io_object_t object ); + io_object_t object); /*! @function IOObjectRetain @abstract Retains an object handle previously returned by IOKitLib. @@ -200,7 +193,7 @@ IOObjectRelease( kern_return_t IOObjectRetain( - io_object_t object ); + io_object_t object); /*! @function IOObjectGetClass @abstract Return the class name of an IOKit object. @@ -211,18 +204,18 @@ IOObjectRetain( kern_return_t IOObjectGetClass( - io_object_t object, - io_name_t className ); - + io_object_t object, + io_name_t className); + /*! @function CFStringRef IOObjectCopyClass @abstract Return the class name of an IOKit object. @discussion This function does the same thing as IOObjectGetClass, but returns the result as a CFStringRef. @param object The IOKit object. @result The resulting CFStringRef. This should be released by the caller. If a valid object is not passed in, then NULL is returned.*/ - -CFStringRef + +CFStringRef IOObjectCopyClass(io_object_t object) -AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; /*! @function CFStringRef IOObjectCopySuperclassForClass @abstract Return the superclass name of the given class. @@ -230,9 +223,9 @@ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; @param classname The name of the class as a CFString. @result The resulting CFStringRef. This should be released by the caller. If there is no superclass, or a valid class name is not passed in, then NULL is returned.*/ -CFStringRef +CFStringRef IOObjectCopySuperclassForClass(CFStringRef classname) -AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; /*! @function CFStringRef IOObjectCopyBundleIdentifierForClass @abstract Return the bundle identifier of the given class. @@ -240,9 +233,9 @@ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; @param classname The name of the class as a CFString. @result The resulting CFStringRef. This should be released by the caller. If a valid class name is not passed in, then NULL is returned.*/ -CFStringRef +CFStringRef IOObjectCopyBundleIdentifierForClass(CFStringRef classname) -AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; /*! @function IOObjectConformsTo @abstract Performs an OSDynamicCast operation on an IOKit object. @@ -253,8 +246,8 @@ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; boolean_t IOObjectConformsTo( - io_object_t object, - const io_name_t className ); + io_object_t object, + const io_name_t className); /*! @function IOObjectIsEqualTo @abstract Checks two object handles to see if they represent the same kernel object. @@ -265,8 +258,8 @@ IOObjectConformsTo( boolean_t IOObjectIsEqualTo( - io_object_t object, - io_object_t anObject ); + io_object_t object, + io_object_t anObject); /*! @function IOObjectGetRetainCount @abstract Returns kernel retain count of an IOKit object. @@ -276,7 +269,7 @@ IOObjectIsEqualTo( uint32_t IOObjectGetRetainCount( - io_object_t object ); + io_object_t object); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -292,16 +285,15 @@ IOObjectGetRetainCount( io_object_t IOIteratorNext( - io_iterator_t iterator ); + io_iterator_t iterator); /*! @function IOIteratorReset @abstract Resets an iteration back to the beginning. @discussion If an iterator is invalid, or if the caller wants to start over, IOIteratorReset will set the iteration back to the beginning. @param iterator An IOKit iterator handle. */ -void -IOIteratorReset( - io_iterator_t iterator ); +void IOIteratorReset( + io_iterator_t iterator); /*! @function IOIteratorIsValid @abstract Checks an iterator is still valid. @@ -311,7 +303,7 @@ IOIteratorReset( boolean_t IOIteratorIsValid( - io_iterator_t iterator ); + io_iterator_t iterator); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -330,8 +322,8 @@ IOIteratorIsValid( io_service_t IOServiceGetMatchingService( - mach_port_t masterPort, - CFDictionaryRef matching ); + mach_port_t masterPort, + CFDictionaryRef matching); /*! @function IOServiceGetMatchingServices @abstract Look up registered IOService objects that match a matching dictionary. @@ -343,19 +335,18 @@ IOServiceGetMatchingService( kern_return_t IOServiceGetMatchingServices( - mach_port_t masterPort, - CFDictionaryRef matching, - io_iterator_t * existing ); - + mach_port_t masterPort, + CFDictionaryRef matching, + io_iterator_t *existing); kern_return_t IOServiceAddNotification( - mach_port_t masterPort, - const io_name_t notificationType, - CFDictionaryRef matching, - mach_port_t wakePort, - uintptr_t reference, - io_iterator_t * notification ) DEPRECATED_ATTRIBUTE; + mach_port_t masterPort, + const io_name_t notificationType, + CFDictionaryRef matching, + mach_port_t wakePort, + uintptr_t reference, + io_iterator_t *notification) DEPRECATED_ATTRIBUTE; /*! @function IOServiceAddMatchingNotification @abstract Look up registered IOService objects that match a matching dictionary, and install a notification request of new IOServices that match. @@ -375,12 +366,12 @@ IOServiceAddNotification( kern_return_t IOServiceAddMatchingNotification( - IONotificationPortRef notifyPort, - const io_name_t notificationType, - CFDictionaryRef matching, - IOServiceMatchingCallback callback, - void * refCon, - io_iterator_t * notification ); + IONotificationPortRef notifyPort, + const io_name_t notificationType, + CFDictionaryRef matching, + IOServiceMatchingCallback callback, + void *refCon, + io_iterator_t *notification); /*! @function IOServiceAddInterestNotification @abstract Register for notification of state changes in an IOService. @@ -396,12 +387,12 @@ IOServiceAddMatchingNotification( kern_return_t IOServiceAddInterestNotification( - IONotificationPortRef notifyPort, - io_service_t service, - const io_name_t interestType, - IOServiceInterestCallback callback, - void * refCon, - io_object_t * notification ); + IONotificationPortRef notifyPort, + io_service_t service, + const io_name_t interestType, + IOServiceInterestCallback callback, + void *refCon, + io_object_t *notification); /*! @function IOServiceMatchPropertyTable @abstract Match an IOService objects with matching dictionary. @@ -413,9 +404,9 @@ IOServiceAddInterestNotification( kern_return_t IOServiceMatchPropertyTable( - io_service_t service, - CFDictionaryRef matching, - boolean_t * matches ); + io_service_t service, + CFDictionaryRef matching, + boolean_t *matches); /*! @function IOServiceGetBusyState @abstract Returns the busyState of an IOService. @@ -426,8 +417,8 @@ IOServiceMatchPropertyTable( kern_return_t IOServiceGetBusyState( - io_service_t service, - uint32_t * busyState ); + io_service_t service, + uint32_t *busyState); /*! @function IOServiceWaitQuiet @abstract Wait for an IOService's busyState to be zero. @@ -438,8 +429,8 @@ IOServiceGetBusyState( kern_return_t IOServiceWaitQuiet( - io_service_t service, - mach_timespec_t * waitTime ); + io_service_t service, + mach_timespec_t *waitTime); /*! @function IOKitGetBusyState @abstract Returns the busyState of all IOServices. @@ -450,8 +441,8 @@ IOServiceWaitQuiet( kern_return_t IOKitGetBusyState( - mach_port_t masterPort, - uint32_t * busyState ); + mach_port_t masterPort, + uint32_t *busyState); /*! @function IOKitWaitQuiet @abstract Wait for a all IOServices' busyState to be zero. @@ -462,8 +453,8 @@ IOKitGetBusyState( kern_return_t IOKitWaitQuiet( - mach_port_t masterPort, - mach_timespec_t * waitTime ); + mach_port_t masterPort, + mach_timespec_t *waitTime); /*! @function IOServiceOpen @abstract A request to create a connection to an IOService. @@ -476,10 +467,10 @@ IOKitWaitQuiet( kern_return_t IOServiceOpen( - io_service_t service, - task_port_t owningTask, - uint32_t type, - io_connect_t * connect ); + io_service_t service, + task_port_t owningTask, + uint32_t type, + io_connect_t *connect); /*! @function IOServiceRequestProbe @abstract A request to rescan a bus for device changes. @@ -490,8 +481,8 @@ IOServiceOpen( kern_return_t IOServiceRequestProbe( - io_service_t service, - uint32_t options ); + io_service_t service, + uint32_t options); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -507,7 +498,7 @@ IOServiceRequestProbe( kern_return_t IOServiceClose( - io_connect_t connect ); + io_connect_t connect); /*! @function IOConnectAddRef @abstract Adds a reference to the connect handle. @@ -517,7 +508,7 @@ IOServiceClose( kern_return_t IOConnectAddRef( - io_connect_t connect ); + io_connect_t connect); /*! @function IOConnectRelease @abstract Remove a reference to the connect handle. @@ -527,7 +518,7 @@ IOConnectAddRef( kern_return_t IOConnectRelease( - io_connect_t connect ); + io_connect_t connect); /*! @function IOConnectGetService @abstract Returns the IOService a connect handle was opened on. @@ -538,8 +529,8 @@ IOConnectRelease( kern_return_t IOConnectGetService( - io_connect_t connect, - io_service_t * service ); + io_connect_t connect, + io_service_t *service); /*! @function IOConnectSetNotificationPort @abstract Set a port to receive family specific notifications. @@ -552,10 +543,10 @@ IOConnectGetService( kern_return_t IOConnectSetNotificationPort( - io_connect_t connect, - uint32_t type, - mach_port_t port, - uintptr_t reference ); + io_connect_t connect, + uint32_t type, + mach_port_t port, + uintptr_t reference); /*! @function IOConnectMapMemory @abstract Map hardware or shared memory into the caller's task. @@ -570,23 +561,23 @@ IOConnectSetNotificationPort( #if !__LP64__ kern_return_t IOConnectMapMemory( - io_connect_t connect, - uint32_t memoryType, - task_port_t intoTask, - vm_address_t *atAddress, - vm_size_t *ofSize, - IOOptionBits options ); + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + vm_address_t *atAddress, + vm_size_t *ofSize, + IOOptionBits options); kern_return_t IOConnectMapMemory64 #else kern_return_t IOConnectMapMemory #endif - (io_connect_t connect, - uint32_t memoryType, - task_port_t intoTask, - mach_vm_address_t *atAddress, - mach_vm_size_t *ofSize, - IOOptionBits options ); + (io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + mach_vm_address_t *atAddress, + mach_vm_size_t *ofSize, + IOOptionBits options); /*! @function IOConnectUnmapMemory @abstract Remove a mapping made with IOConnectMapMemory. @@ -600,19 +591,19 @@ kern_return_t IOConnectMapMemory #if !__LP64__ kern_return_t IOConnectUnmapMemory( - io_connect_t connect, - uint32_t memoryType, - task_port_t fromTask, - vm_address_t atAddress ); + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + vm_address_t atAddress); kern_return_t IOConnectUnmapMemory64 #else kern_return_t IOConnectUnmapMemory #endif - (io_connect_t connect, - uint32_t memoryType, - task_port_t fromTask, - mach_vm_address_t atAddress ); + (io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + mach_vm_address_t atAddress); /*! @function IOConnectSetCFProperties @abstract Set CF container based properties on a connection. @@ -623,8 +614,8 @@ kern_return_t IOConnectUnmapMemory kern_return_t IOConnectSetCFProperties( - io_connect_t connect, - CFTypeRef properties ); + io_connect_t connect, + CFTypeRef properties); /*! @function IOConnectSetCFProperty @abstract Set a CF container based property on a connection. @@ -636,9 +627,9 @@ IOConnectSetCFProperties( kern_return_t IOConnectSetCFProperty( - io_connect_t connect, - CFStringRef propertyName, - CFTypeRef property ); + io_connect_t connect, + CFStringRef propertyName, + CFTypeRef property); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -646,131 +637,131 @@ IOConnectSetCFProperty( kern_return_t IOConnectCallMethod( - mach_port_t connection, // In - uint32_t selector, // In - const uint64_t *input, // In - uint32_t inputCnt, // In - const void *inputStruct, // In - size_t inputStructCnt, // In - uint64_t *output, // Out - uint32_t *outputCnt, // In/Out - void *outputStruct, // Out - size_t *outputStructCnt) // In/Out -AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + mach_port_t connection, // In + uint32_t selector, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt, // In/Out + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; kern_return_t IOConnectCallAsyncMethod( - mach_port_t connection, // In - uint32_t selector, // In - mach_port_t wake_port, // In - uint64_t *reference, // In - uint32_t referenceCnt, // In - const uint64_t *input, // In - uint32_t inputCnt, // In - const void *inputStruct, // In - size_t inputStructCnt, // In - uint64_t *output, // Out - uint32_t *outputCnt, // In/Out - void *outputStruct, // Out - size_t *outputStructCnt) // In/Out -AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + mach_port_t connection, // In + uint32_t selector, // In + mach_port_t wake_port, // In + uint64_t *reference, // In + uint32_t referenceCnt, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt, // In/Out + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; kern_return_t IOConnectCallStructMethod( - mach_port_t connection, // In - uint32_t selector, // In - const void *inputStruct, // In - size_t inputStructCnt, // In - void *outputStruct, // Out - size_t *outputStructCnt) // In/Out -AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + mach_port_t connection, // In + uint32_t selector, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; kern_return_t IOConnectCallAsyncStructMethod( - mach_port_t connection, // In - uint32_t selector, // In - mach_port_t wake_port, // In - uint64_t *reference, // In - uint32_t referenceCnt, // In - const void *inputStruct, // In - size_t inputStructCnt, // In - void *outputStruct, // Out - size_t *outputStructCnt) // In/Out -AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + mach_port_t connection, // In + uint32_t selector, // In + mach_port_t wake_port, // In + uint64_t *reference, // In + uint32_t referenceCnt, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; kern_return_t IOConnectCallScalarMethod( - mach_port_t connection, // In - uint32_t selector, // In - const uint64_t *input, // In - uint32_t inputCnt, // In - uint64_t *output, // Out - uint32_t *outputCnt) // In/Out -AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + mach_port_t connection, // In + uint32_t selector, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt) // In/Out + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; kern_return_t IOConnectCallAsyncScalarMethod( - mach_port_t connection, // In - uint32_t selector, // In - mach_port_t wake_port, // In - uint64_t *reference, // In - uint32_t referenceCnt, // In - const uint64_t *input, // In - uint32_t inputCnt, // In - uint64_t *output, // Out - uint32_t *outputCnt) // In/Out -AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + mach_port_t connection, // In + uint32_t selector, // In + mach_port_t wake_port, // In + uint64_t *reference, // In + uint32_t referenceCnt, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt) // In/Out + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ kern_return_t -IOConnectTrap0(io_connect_t connect, - uint32_t index ); +IOConnectTrap0(io_connect_t connect, + uint32_t index); kern_return_t -IOConnectTrap1(io_connect_t connect, - uint32_t index, - uintptr_t p1 ); +IOConnectTrap1(io_connect_t connect, + uint32_t index, + uintptr_t p1); kern_return_t -IOConnectTrap2(io_connect_t connect, - uint32_t index, - uintptr_t p1, - uintptr_t p2); +IOConnectTrap2(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2); kern_return_t -IOConnectTrap3(io_connect_t connect, - uint32_t index, - uintptr_t p1, - uintptr_t p2, - uintptr_t p3); +IOConnectTrap3(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3); kern_return_t -IOConnectTrap4(io_connect_t connect, - uint32_t index, - uintptr_t p1, - uintptr_t p2, - uintptr_t p3, - uintptr_t p4); +IOConnectTrap4(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4); kern_return_t -IOConnectTrap5(io_connect_t connect, - uint32_t index, - uintptr_t p1, - uintptr_t p2, - uintptr_t p3, - uintptr_t p4, - uintptr_t p5); +IOConnectTrap5(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4, + uintptr_t p5); kern_return_t -IOConnectTrap6(io_connect_t connect, - uint32_t index, - uintptr_t p1, - uintptr_t p2, - uintptr_t p3, - uintptr_t p4, - uintptr_t p5, - uintptr_t p6); +IOConnectTrap6(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4, + uintptr_t p5, + uintptr_t p6); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -783,8 +774,8 @@ IOConnectTrap6(io_connect_t connect, kern_return_t IOConnectAddClient( - io_connect_t connect, - io_connect_t client ); + io_connect_t connect, + io_connect_t client); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -800,7 +791,7 @@ IOConnectAddClient( io_registry_entry_t IORegistryGetRootEntry( - mach_port_t masterPort ); + mach_port_t masterPort); /*! @function IORegistryEntryFromPath @abstract Looks up a registry entry by path. @@ -811,13 +802,13 @@ IORegistryGetRootEntry( io_registry_entry_t IORegistryEntryFromPath( - mach_port_t masterPort, - const io_string_t path ); + mach_port_t masterPort, + const io_string_t path); // options for IORegistryCreateIterator(), IORegistryEntryCreateIterator, IORegistryEntrySearchCFProperty() enum { - kIORegistryIterateRecursively = 0x00000001, - kIORegistryIterateParents = 0x00000002 + kIORegistryIterateRecursively = 0x00000001, + kIORegistryIterateParents = 0x00000002 }; /*! @function IORegistryCreateIterator @@ -831,10 +822,10 @@ enum { kern_return_t IORegistryCreateIterator( - mach_port_t masterPort, - const io_name_t plane, - IOOptionBits options, - io_iterator_t * iterator ); + mach_port_t masterPort, + const io_name_t plane, + IOOptionBits options, + io_iterator_t *iterator); /*! @function IORegistryEntryCreateIterator @abstract Create an iterator rooted at a given registry entry. @@ -847,10 +838,10 @@ IORegistryCreateIterator( kern_return_t IORegistryEntryCreateIterator( - io_registry_entry_t entry, - const io_name_t plane, - IOOptionBits options, - io_iterator_t * iterator ); + io_registry_entry_t entry, + const io_name_t plane, + IOOptionBits options, + io_iterator_t *iterator); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -865,7 +856,7 @@ IORegistryEntryCreateIterator( kern_return_t IORegistryIteratorEnterEntry( - io_iterator_t iterator ); + io_iterator_t iterator); /*! @function IORegistryIteratorExitEntry @abstract Exits a level of recursion, restoring the current entry. @@ -874,7 +865,7 @@ IORegistryIteratorEnterEntry( kern_return_t IORegistryIteratorExitEntry( - io_iterator_t iterator ); + io_iterator_t iterator); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -891,8 +882,8 @@ IORegistryIteratorExitEntry( kern_return_t IORegistryEntryGetName( - io_registry_entry_t entry, - io_name_t name ); + io_registry_entry_t entry, + io_name_t name); /*! @function IORegistryEntryGetNameInPlane @abstract Returns a C-string name assigned to a registry entry, in a specified plane. @@ -904,9 +895,9 @@ IORegistryEntryGetName( kern_return_t IORegistryEntryGetNameInPlane( - io_registry_entry_t entry, - const io_name_t plane, - io_name_t name ); + io_registry_entry_t entry, + const io_name_t plane, + io_name_t name); /*! @function IORegistryEntryGetLocationInPlane @abstract Returns a C-string location assigned to a registry entry, in a specified plane. @@ -918,9 +909,9 @@ IORegistryEntryGetNameInPlane( kern_return_t IORegistryEntryGetLocationInPlane( - io_registry_entry_t entry, - const io_name_t plane, - io_name_t location ); + io_registry_entry_t entry, + const io_name_t plane, + io_name_t location); /*! @function IORegistryEntryGetPath @abstract Create a path for a registry entry. @@ -932,9 +923,9 @@ IORegistryEntryGetLocationInPlane( kern_return_t IORegistryEntryGetPath( - io_registry_entry_t entry, - const io_name_t plane, - io_string_t path ); + io_registry_entry_t entry, + const io_name_t plane, + io_string_t path); /*! @function IORegistryEntryCreateCFProperties @abstract Create a CF dictionary representation of a registry entry's property table. @@ -947,10 +938,10 @@ IORegistryEntryGetPath( kern_return_t IORegistryEntryCreateCFProperties( - io_registry_entry_t entry, - CFMutableDictionaryRef * properties, - CFAllocatorRef allocator, - IOOptionBits options ); + io_registry_entry_t entry, + CFMutableDictionaryRef *properties, + CFAllocatorRef allocator, + IOOptionBits options); /*! @function IORegistryEntryCreateCFProperty @abstract Create a CF representation of a registry entry's property. @@ -963,10 +954,10 @@ IORegistryEntryCreateCFProperties( CFTypeRef IORegistryEntryCreateCFProperty( - io_registry_entry_t entry, - CFStringRef key, - CFAllocatorRef allocator, - IOOptionBits options ); + io_registry_entry_t entry, + CFStringRef key, + CFAllocatorRef allocator, + IOOptionBits options); /*! @function IORegistryEntrySearchCFProperty @abstract Create a CF representation of a registry entry's property. @@ -981,21 +972,21 @@ This function will search for a property, starting first with specified registry CFTypeRef IORegistryEntrySearchCFProperty( - io_registry_entry_t entry, - const io_name_t plane, - CFStringRef key, - CFAllocatorRef allocator, - IOOptionBits options ); + io_registry_entry_t entry, + const io_name_t plane, + CFStringRef key, + CFAllocatorRef allocator, + IOOptionBits options); /* @function IORegistryEntryGetProperty - deprecated, use IORegistryEntryCreateCFProperty */ kern_return_t IORegistryEntryGetProperty( - io_registry_entry_t entry, - const io_name_t propertyName, - io_struct_inband_t buffer, - uint32_t * size ); + io_registry_entry_t entry, + const io_name_t propertyName, + io_struct_inband_t buffer, + uint32_t *size); /*! @function IORegistryEntrySetCFProperties @abstract Set CF container based properties in a registry entry. @@ -1006,8 +997,8 @@ IORegistryEntryGetProperty( kern_return_t IORegistryEntrySetCFProperties( - io_registry_entry_t entry, - CFTypeRef properties ); + io_registry_entry_t entry, + CFTypeRef properties); /*! @function IORegistryEntrySetCFProperty @abstract Set a CF container based property in a registry entry. @@ -1019,9 +1010,9 @@ IORegistryEntrySetCFProperties( kern_return_t IORegistryEntrySetCFProperty( - io_registry_entry_t entry, - CFStringRef propertyName, - CFTypeRef property ); + io_registry_entry_t entry, + CFStringRef propertyName, + CFTypeRef property); /*! @function IORegistryEntryGetChildIterator @abstract Returns an iterator over an registry entry's child entries in a plane. @@ -1033,9 +1024,9 @@ IORegistryEntrySetCFProperty( kern_return_t IORegistryEntryGetChildIterator( - io_registry_entry_t entry, - const io_name_t plane, - io_iterator_t * iterator ); + io_registry_entry_t entry, + const io_name_t plane, + io_iterator_t *iterator); /*! @function IORegistryEntryGetChildEntry @abstract Returns the first child of a registry entry in a plane. @@ -1047,9 +1038,9 @@ IORegistryEntryGetChildIterator( kern_return_t IORegistryEntryGetChildEntry( - io_registry_entry_t entry, - const io_name_t plane, - io_registry_entry_t * child ); + io_registry_entry_t entry, + const io_name_t plane, + io_registry_entry_t *child); /*! @function IORegistryEntryGetParentIterator @abstract Returns an iterator over an registry entry's parent entries in a plane. @@ -1061,9 +1052,9 @@ IORegistryEntryGetChildEntry( kern_return_t IORegistryEntryGetParentIterator( - io_registry_entry_t entry, - const io_name_t plane, - io_iterator_t * iterator ); + io_registry_entry_t entry, + const io_name_t plane, + io_iterator_t *iterator); /*! @function IORegistryEntryGetParentEntry @abstract Returns the first parent of a registry entry in a plane. @@ -1075,9 +1066,9 @@ IORegistryEntryGetParentIterator( kern_return_t IORegistryEntryGetParentEntry( - io_registry_entry_t entry, - const io_name_t plane, - io_registry_entry_t * parent ); + io_registry_entry_t entry, + const io_name_t plane, + io_registry_entry_t *parent); /*! @function IORegistryEntryInPlane @abstract Determines if the registry entry is attached in a plane. @@ -1088,8 +1079,8 @@ IORegistryEntryGetParentEntry( boolean_t IORegistryEntryInPlane( - io_registry_entry_t entry, - const io_name_t plane ); + io_registry_entry_t entry, + const io_name_t plane); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -1105,7 +1096,7 @@ IORegistryEntryInPlane( CFMutableDictionaryRef IOServiceMatching( - const char * name ); + const char *name); /*! @function IOServiceNameMatching @abstract Create a matching dictionary that specifies an IOService name match. @@ -1115,7 +1106,7 @@ IOServiceMatching( CFMutableDictionaryRef IOServiceNameMatching( - const char * name ); + const char *name); /*! @function IOBSDNameMatching @abstract Create a matching dictionary that specifies an IOService match based on BSD device name. @@ -1127,9 +1118,9 @@ IOServiceNameMatching( CFMutableDictionaryRef IOBSDNameMatching( - mach_port_t masterPort, - uint32_t options, - const char * bsdName ); + mach_port_t masterPort, + uint32_t options, + const char *bsdName); /*! @function IOOpenFirmwarePathMatching @abstract Create a matching dictionary that specifies an IOService match based on an OpenFirmware device path. @@ -1141,9 +1132,9 @@ IOBSDNameMatching( CFMutableDictionaryRef IOOpenFirmwarePathMatching( - mach_port_t masterPort, - uint32_t options, - const char * path ); + mach_port_t masterPort, + uint32_t options, + const char *path); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -1156,10 +1147,10 @@ IOOpenFirmwarePathMatching( @result A kern_return_t error code. */ kern_return_t -IOServiceOFPathToBSDName(mach_port_t masterPort, - const io_name_t openFirmwarePath, - io_name_t bsdName); - +IOServiceOFPathToBSDName(mach_port_t masterPort, + const io_name_t openFirmwarePath, + io_name_t bsdName); + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*! @typedef IOAsyncCallback0 @@ -1199,19 +1190,18 @@ typedef void (*IOAsyncCallback2)(void *refcon, IOReturn result, void *arg0, void @param numArgs Number of extra arguments */ typedef void (*IOAsyncCallback)(void *refcon, IOReturn result, void **args, - uint32_t numArgs); - + uint32_t numArgs); /* Internal use */ kern_return_t OSGetNotificationFromMessage( - mach_msg_header_t * msg, - uint32_t index, - uint32_t * type, - uintptr_t * reference, - void ** content, - vm_size_t * size ); + mach_msg_header_t *msg, + uint32_t index, + uint32_t *type, + uintptr_t *reference, + void **content, + vm_size_t *size); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -1219,33 +1209,33 @@ OSGetNotificationFromMessage( kern_return_t IOCatalogueSendData( - mach_port_t masterPort, - uint32_t flag, - const char *buffer, - uint32_t size ); + mach_port_t masterPort, + uint32_t flag, + const char *buffer, + uint32_t size); kern_return_t IOCatalogueTerminate( - mach_port_t masterPort, - uint32_t flag, - io_name_t description ); + mach_port_t masterPort, + uint32_t flag, + io_name_t description); kern_return_t IOCatalogueGetData( - mach_port_t masterPort, - uint32_t flag, - char **buffer, - uint32_t *size ); + mach_port_t masterPort, + uint32_t flag, + char **buffer, + uint32_t *size); kern_return_t IOCatalogueModuleLoaded( - mach_port_t masterPort, - io_name_t name ); + mach_port_t masterPort, + io_name_t name); kern_return_t IOCatalogueReset( - mach_port_t masterPort, - uint32_t flag ); + mach_port_t masterPort, + uint32_t flag); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -1261,160 +1251,160 @@ typedef struct IOObject IOObject; kern_return_t IORegistryDisposeEnumerator( - io_enumerator_t enumerator ) DEPRECATED_ATTRIBUTE; + io_enumerator_t enumerator) DEPRECATED_ATTRIBUTE; kern_return_t IOMapMemory( - io_connect_t connect, - uint32_t memoryType, - task_port_t intoTask, - vm_address_t * atAddress, - vm_size_t * ofSize, - uint32_t flags ) DEPRECATED_ATTRIBUTE; + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + vm_address_t *atAddress, + vm_size_t *ofSize, + uint32_t flags) DEPRECATED_ATTRIBUTE; // for CGS kern_return_t IOCompatibiltyNumber( - mach_port_t connect, - uint32_t * objectNumber ) DEPRECATED_ATTRIBUTE; + mach_port_t connect, + uint32_t *objectNumber) DEPRECATED_ATTRIBUTE; // Traditional IOUserClient transport routines kern_return_t -IOConnectMethodScalarIScalarO( - io_connect_t connect, - uint32_t index, - IOItemCount scalarInputCount, - IOItemCount scalarOutputCount, - ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; +IOConnectMethodScalarIScalarO( + io_connect_t connect, + uint32_t index, + IOItemCount scalarInputCount, + IOItemCount scalarOutputCount, + ...) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; kern_return_t IOConnectMethodScalarIStructureO( - io_connect_t connect, - uint32_t index, - IOItemCount scalarInputCount, - IOByteCount * structureSize, - ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + io_connect_t connect, + uint32_t index, + IOItemCount scalarInputCount, + IOByteCount *structureSize, + ...) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; kern_return_t IOConnectMethodScalarIStructureI( - io_connect_t connect, - uint32_t index, - IOItemCount scalarInputCount, - IOByteCount structureSize, - ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + io_connect_t connect, + uint32_t index, + IOItemCount scalarInputCount, + IOByteCount structureSize, + ...) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; kern_return_t IOConnectMethodStructureIStructureO( - io_connect_t connect, - uint32_t index, - IOItemCount structureInputSize, - IOByteCount * structureOutputSize, - void * inputStructure, - void * ouputStructure ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + io_connect_t connect, + uint32_t index, + IOItemCount structureInputSize, + IOByteCount *structureOutputSize, + void *inputStructure, + void *ouputStructure) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // Compatability with earlier Mig interface routines #if IOCONNECT_NO_32B_METHODS kern_return_t io_connect_map_memory( - io_connect_t connect, - uint32_t memoryType, - task_port_t intoTask, - vm_address_t *atAddress, - vm_size_t *ofSize, - IOOptionBits options) DEPRECATED_ATTRIBUTE; + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + vm_address_t *atAddress, + vm_size_t *ofSize, + IOOptionBits options) DEPRECATED_ATTRIBUTE; kern_return_t io_connect_unmap_memory( - io_connect_t connect, - uint32_t memoryType, - task_port_t fromTask, - vm_address_t atAddress) DEPRECATED_ATTRIBUTE; + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + vm_address_t atAddress) DEPRECATED_ATTRIBUTE; kern_return_t io_connect_method_scalarI_scalarO( - mach_port_t connection, - int selector, - io_scalar_inband_t input, - mach_msg_type_number_t inputCnt, - io_scalar_inband_t output, - mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_scalar_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_connect_method_scalarI_structureO( - mach_port_t connection, - int selector, - io_scalar_inband_t input, - mach_msg_type_number_t inputCnt, - io_struct_inband_t output, - mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_connect_method_scalarI_structureI( - mach_port_t connection, - int selector, - io_scalar_inband_t input, - mach_msg_type_number_t inputCnt, - io_struct_inband_t inputStruct, - mach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t inputStruct, + mach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_connect_method_structureI_structureO( - mach_port_t connection, - int selector, - io_struct_inband_t input, - mach_msg_type_number_t inputCnt, - io_struct_inband_t output, - mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + int selector, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_async_method_scalarI_scalarO( - mach_port_t connection, - mach_port_t wake_port, - io_async_ref_t reference, - mach_msg_type_number_t referenceCnt, - int selector, - io_scalar_inband_t input, - mach_msg_type_number_t inputCnt, - io_scalar_inband_t output, - mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_scalar_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_async_method_scalarI_structureO( - mach_port_t connection, - mach_port_t wake_port, - io_async_ref_t reference, - mach_msg_type_number_t referenceCnt, - int selector, - io_scalar_inband_t input, - mach_msg_type_number_t inputCnt, - io_struct_inband_t output, - mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_async_method_scalarI_structureI( - mach_port_t connection, - mach_port_t wake_port, - io_async_ref_t reference, - mach_msg_type_number_t referenceCnt, - int selector, - io_scalar_inband_t input, - mach_msg_type_number_t inputCnt, - io_struct_inband_t inputStruct, - mach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t inputStruct, + mach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE; kern_return_t io_async_method_structureI_structureO( - mach_port_t connection, - mach_port_t wake_port, - io_async_ref_t reference, - mach_msg_type_number_t referenceCnt, - int selector, - io_struct_inband_t input, - mach_msg_type_number_t inputCnt, - io_struct_inband_t output, - mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; #endif // IOCONNECT_NO_32B_METHODS #endif /* defined(__LP64__) */ diff --git a/IOKit/IOMessage.h b/IOKit/IOMessage.h index c96dd573..7ed3c4fa 100644 --- a/IOKit/IOMessage.h +++ b/IOKit/IOMessage.h @@ -41,8 +41,8 @@ typedef UInt32 IOMessage; -#define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message) -#define iokit_family_msg(sub,message) (UInt32)(sys_iokit|sub|message) +#define iokit_common_msg(message) (UInt32)(sys_iokit | sub_iokit_common | message) +#define iokit_family_msg(sub, message) (UInt32)(sys_iokit | sub | message) /*! * @defined iokit_vendor_specific_msg @@ -50,27 +50,26 @@ typedef UInt32 IOMessage; * subsystem. It can be used to generate messages that are used for private * communication between vendor specific code with the IOService::message() etc. APIs. */ -#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message) +#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit | sub_iokit_vendor_specific | message) -#define kIOMessageServiceIsTerminated iokit_common_msg(0x010) -#define kIOMessageServiceIsSuspended iokit_common_msg(0x020) -#define kIOMessageServiceIsResumed iokit_common_msg(0x030) +#define kIOMessageServiceIsTerminated iokit_common_msg(0x010) +#define kIOMessageServiceIsSuspended iokit_common_msg(0x020) +#define kIOMessageServiceIsResumed iokit_common_msg(0x030) #define kIOMessageServiceIsRequestingClose iokit_common_msg(0x100) -#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) -#define kIOMessageServiceWasClosed iokit_common_msg(0x110) +#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) +#define kIOMessageServiceWasClosed iokit_common_msg(0x110) -#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) +#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) -#define kIOMessageConsoleSecurityChange iokit_common_msg(0x128) +#define kIOMessageConsoleSecurityChange iokit_common_msg(0x128) -#define kIOMessageServicePropertyChange iokit_common_msg(0x130) +#define kIOMessageServicePropertyChange iokit_common_msg(0x130) -#define kIOMessageCopyClientID iokit_common_msg(0x330) - -#define kIOMessageSystemCapabilityChange iokit_common_msg(0x340) -#define kIOMessageDeviceSignaledWakeup iokit_common_msg(0x350) +#define kIOMessageCopyClientID iokit_common_msg(0x330) +#define kIOMessageSystemCapabilityChange iokit_common_msg(0x340) +#define kIOMessageDeviceSignaledWakeup iokit_common_msg(0x350) /*! * @defined kIOMessageDeviceWillPowerOff @@ -78,7 +77,7 @@ typedef UInt32 IOMessage; * Sent to IOKit interest notification clients of type kIOAppPowerStateInterest * and kIOGeneralInterest. */ -#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) +#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) /*! * @defined kIOMessageDeviceHasPoweredOn @@ -86,7 +85,7 @@ typedef UInt32 IOMessage; * Sent to IOKit interest notification clients of type kIOAppPowerStateInterest * and kIOGeneralInterest. */ -#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) +#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) /*! @group In-kernel system shutdown and restart notifications */ @@ -100,7 +99,7 @@ typedef UInt32 IOMessage; * and to clients of registerPrioritySleepWakeInterest(). * Never delivered to user space notification clients. */ -#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) +#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) /*! * @defined kIOMessageSystemWillRestart @@ -111,7 +110,7 @@ typedef UInt32 IOMessage; * and to clients of registerPrioritySleepWakeInterest(). * Never delivered to user space notification clients. */ -#define kIOMessageSystemWillRestart iokit_common_msg(0x310) +#define kIOMessageSystemWillRestart iokit_common_msg(0x310) /*! * @defined kIOMessageSystemPagingOff @@ -121,8 +120,7 @@ typedef UInt32 IOMessage; * Delivered to clients of registerPrioritySleepWakeInterest(). * Never delivered to user space notification clients. */ -#define kIOMessageSystemPagingOff iokit_common_msg(0x255) - +#define kIOMessageSystemPagingOff iokit_common_msg(0x255) /*! @group System sleep and wake notifications */ @@ -134,7 +132,7 @@ typedef UInt32 IOMessage; * and kIOPriorityPowerStateInterest. * Delivered to user clients of IORegisterForSystemPower. */ -#define kIOMessageCanSystemSleep iokit_common_msg(0x270) +#define kIOMessageCanSystemSleep iokit_common_msg(0x270) /*! * @defined kIOMessageSystemWillNotSleep @@ -144,7 +142,7 @@ typedef UInt32 IOMessage; * and kIOPriorityPowerStateInterest. * Delivered to user clients of IORegisterForSystemPower. */ -#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) +#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) /*! * @defined kIOMessageSystemWillSleep @@ -153,7 +151,7 @@ typedef UInt32 IOMessage; * and kIOPriorityPowerStateInterest. * Delivered to user clients of IORegisterForSystemPower. */ -#define kIOMessageSystemWillSleep iokit_common_msg(0x280) +#define kIOMessageSystemWillSleep iokit_common_msg(0x280) /*! * @defined kIOMessageSystemWillPowerOn @@ -163,7 +161,7 @@ typedef UInt32 IOMessage; * and kIOPriorityPowerStateInterest. * Delivered to user clients of IORegisterForSystemPower. */ -#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) +#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) /*! * @defined kIOMessageSystemHasPoweredOn @@ -172,7 +170,7 @@ typedef UInt32 IOMessage; * and kIOPriorityPowerStateInterest. * Delivered to user clients of IORegisterForSystemPower. */ -#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) +#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) /*! @group Unused and deprecated notifications */ @@ -183,38 +181,37 @@ typedef UInt32 IOMessage; * devices that implement their own idle timeouts. * This message type is almost never used. */ -#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200) +#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200) /*! * @defined kIOMessageDeviceWillNotPowerOff * @discussion This IOKit interest notification is largely unused; * it's not very interesting. */ -#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) +#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) /*! * @defined kIOMessageSystemWillNotPowerOff * @deprecated This IOKit message is unused. */ -#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) +#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) /*! * @defined kIOMessageCanSystemPowerOff * @deprecated This IOKit message is unused. */ -#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240) +#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240) /*! * @defined kIOMessageDeviceWillPowerOn * @discussion IOService power mgt does not send kIOMessageDeviceWillPowerOn. */ -#define kIOMessageDeviceWillPowerOn iokit_common_msg(0x215) +#define kIOMessageDeviceWillPowerOn iokit_common_msg(0x215) /*! * @defined kIOMessageDeviceHasPoweredOff * @discussion IOService power mgt does not send kIOMessageDeviceHasPoweredOff. */ -#define kIOMessageDeviceHasPoweredOff iokit_common_msg(0x225) - +#define kIOMessageDeviceHasPoweredOff iokit_common_msg(0x225) #endif /* ! __IOKIT_IOMESSAGE_H */ diff --git a/IOKit/IOReturn.h b/IOKit/IOReturn.h index 38811b63..721ebcfb 100644 --- a/IOKit/IOReturn.h +++ b/IOKit/IOReturn.h @@ -28,7 +28,7 @@ /* * HISTORY */ - + /* * Core IOReturn values. Others may be family defined. */ @@ -42,93 +42,93 @@ extern "C" { #include -typedef kern_return_t IOReturn; +typedef kern_return_t IOReturn; #ifndef sys_iokit -#define sys_iokit err_system(0x38) +#define sys_iokit err_system(0x38) #endif /* sys_iokit */ -#define sub_iokit_common err_sub(0) -#define sub_iokit_usb err_sub(1) -#define sub_iokit_firewire err_sub(2) -#define sub_iokit_block_storage err_sub(4) -#define sub_iokit_graphics err_sub(5) -#define sub_iokit_networking err_sub(6) -#define sub_iokit_bluetooth err_sub(8) -#define sub_iokit_pmu err_sub(9) -#define sub_iokit_acpi err_sub(10) -#define sub_iokit_smbus err_sub(11) -#define sub_iokit_ahci err_sub(12) -#define sub_iokit_powermanagement err_sub(13) +#define sub_iokit_common err_sub(0) +#define sub_iokit_usb err_sub(1) +#define sub_iokit_firewire err_sub(2) +#define sub_iokit_block_storage err_sub(4) +#define sub_iokit_graphics err_sub(5) +#define sub_iokit_networking err_sub(6) +#define sub_iokit_bluetooth err_sub(8) +#define sub_iokit_pmu err_sub(9) +#define sub_iokit_acpi err_sub(10) +#define sub_iokit_smbus err_sub(11) +#define sub_iokit_ahci err_sub(12) +#define sub_iokit_powermanagement err_sub(13) //#define sub_iokit_hidsystem err_sub(14) -#define sub_iokit_scsi err_sub(16) +#define sub_iokit_scsi err_sub(16) //#define sub_iokit_pccard err_sub(21) -#define sub_iokit_vendor_specific err_sub(-2) -#define sub_iokit_reserved err_sub(-1) +#define sub_iokit_vendor_specific err_sub(-2) +#define sub_iokit_reserved err_sub(-1) -#define iokit_common_err(return) (sys_iokit|sub_iokit_common|return) -#define iokit_family_err(sub,return) (sys_iokit|sub|return) -#define iokit_vendor_specific_err(return) (sys_iokit|sub_iokit_vendor_specific|return) +#define iokit_common_err(return ) (sys_iokit | sub_iokit_common | return ) +#define iokit_family_err(sub, return ) (sys_iokit | sub | return ) +#define iokit_vendor_specific_err(return ) (sys_iokit | sub_iokit_vendor_specific | return ) -#define kIOReturnSuccess KERN_SUCCESS // OK -#define kIOReturnError iokit_common_err(0x2bc) // general error -#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory -#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage -#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC -#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device -#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation -#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument -#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked -#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked -#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and - // device already open -#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages - // had different msg_id -#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function -#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure -#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error -#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error -//#define kIOReturn???Error iokit_common_err(0x2cb) // ??? -#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock -#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open -#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported -#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported -#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error -#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error -#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open -#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure -#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure -#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy -#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout -#define kIOReturnOffline iokit_common_err(0x2d7) // device offline -#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready -#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached -#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left -#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data -//#define kIOReturn???Error iokit_common_err(0x2dc) // ??? -#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists -#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down - // physical memory -#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached -#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued -#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received - // on interrupt port -#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted -#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device -#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present -#define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted +#define kIOReturnSuccess KERN_SUCCESS // OK +#define kIOReturnError iokit_common_err(0x2bc) // general error +#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory +#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage +#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC +#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device +#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation +#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument +#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked +#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked +#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and \ + // device already open +#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages \ + // had different msg_id +#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function +#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure +#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error +#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error +//#define kIOReturn???Error iokit_common_err(0x2cb) // ??? +#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock +#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open +#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported +#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported +#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error +#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error +#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open +#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure +#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure +#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy +#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout +#define kIOReturnOffline iokit_common_err(0x2d7) // device offline +#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready +#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached +#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left +#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data +//#define kIOReturn???Error iokit_common_err(0x2dc) // ??? +#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists +#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down \ + // physical memory +#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached +#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued +#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received \ + // on interrupt port +#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted +#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device +#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present +#define kIOReturnUnformattedMedia iokit_common_err(0x2e5) // media not formatted #define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode -#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun -#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun -#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly! -#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required -#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted -#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded -#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding -#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past! -#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future -#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found -#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen +#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun +#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun +#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly! +#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required +#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted +#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded +#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding +#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past! +#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future +#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found +#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen #ifdef __cplusplus } diff --git a/IOKit/IOTypes.h b/IOKit/IOTypes.h index 9f5d5a3f..3d9a938c 100644 --- a/IOKit/IOTypes.h +++ b/IOKit/IOTypes.h @@ -25,7 +25,7 @@ * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ -#ifndef __IOKIT_IOTYPES_H +#ifndef __IOKIT_IOTYPES_H #define __IOKIT_IOTYPES_H #ifndef IOKIT @@ -45,19 +45,19 @@ extern "C" { #endif -#ifndef NULL -#if defined (__cplusplus) -#define NULL 0 +#ifndef NULL +#if defined(__cplusplus) +#define NULL 0 #else #define NULL ((void *)0) #endif #endif - + /* * Simple data types. */ -#ifndef __MACTYPES__ /* CF MacTypes.h */ -#ifndef __TYPES__ /* guess... Mac Types.h */ +#ifndef __MACTYPES__ /* CF MacTypes.h */ +#ifndef __TYPES__ /* guess... Mac Types.h */ #include #include @@ -69,70 +69,69 @@ extern "C" { #include #endif -typedef UInt32 IOOptionBits; -typedef SInt32 IOFixed; -typedef UInt32 IOVersion; -typedef UInt32 IOItemCount; -typedef UInt32 IOCacheMode; +typedef UInt32 IOOptionBits; +typedef SInt32 IOFixed; +typedef UInt32 IOVersion; +typedef UInt32 IOItemCount; +typedef UInt32 IOCacheMode; -typedef UInt32 IOByteCount32; -typedef UInt64 IOByteCount64; +typedef UInt32 IOByteCount32; +typedef UInt64 IOByteCount64; -typedef UInt32 IOPhysicalAddress32; -typedef UInt64 IOPhysicalAddress64; -typedef UInt32 IOPhysicalLength32; -typedef UInt64 IOPhysicalLength64; +typedef UInt32 IOPhysicalAddress32; +typedef UInt64 IOPhysicalAddress64; +typedef UInt32 IOPhysicalLength32; +typedef UInt64 IOPhysicalLength64; #ifdef __LP64__ -typedef mach_vm_address_t IOVirtualAddress; +typedef mach_vm_address_t IOVirtualAddress; #else -typedef vm_address_t IOVirtualAddress; +typedef vm_address_t IOVirtualAddress; #endif #if defined(__LP64__) && defined(KERNEL) -typedef IOByteCount64 IOByteCount; +typedef IOByteCount64 IOByteCount; #else -typedef IOByteCount32 IOByteCount; +typedef IOByteCount32 IOByteCount; #endif -typedef IOVirtualAddress IOLogicalAddress; +typedef IOVirtualAddress IOLogicalAddress; #if defined(__LP64__) && defined(KERNEL) -typedef IOPhysicalAddress64 IOPhysicalAddress; -typedef IOPhysicalLength64 IOPhysicalLength; -#define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32)) -#define IOPhysSize 64 +typedef IOPhysicalAddress64 IOPhysicalAddress; +typedef IOPhysicalLength64 IOPhysicalLength; +#define IOPhysical32(hi, lo) ((UInt64)lo + ((UInt64)(hi) << 32)) +#define IOPhysSize 64 #else -typedef IOPhysicalAddress32 IOPhysicalAddress; -typedef IOPhysicalLength32 IOPhysicalLength; -#define IOPhysical32( hi, lo ) (lo) -#define IOPhysSize 32 +typedef IOPhysicalAddress32 IOPhysicalAddress; +typedef IOPhysicalLength32 IOPhysicalLength; +#define IOPhysical32(hi, lo) (lo) +#define IOPhysSize 32 #endif - typedef struct { - IOPhysicalAddress address; - IOByteCount length; + IOPhysicalAddress address; + IOByteCount length; } IOPhysicalRange; -typedef struct +typedef struct { - IOVirtualAddress address; - IOByteCount length; + IOVirtualAddress address; + IOByteCount length; } IOVirtualRange; #ifdef __LP64__ -typedef IOVirtualRange IOAddressRange; +typedef IOVirtualRange IOAddressRange; #else /* !__LP64__ */ -typedef struct +typedef struct { - mach_vm_address_t address; - mach_vm_size_t length; + mach_vm_address_t address; + mach_vm_size_t length; } IOAddressRange; #endif /* !__LP64__ */ @@ -140,18 +139,16 @@ typedef struct * Map between #defined or enum'd constants and text description. */ typedef struct { - int value; - const char *name; + int value; + const char *name; } IONamedValue; - /* * Memory alignment -- specified as a power of two. */ -typedef unsigned int IOAlignment; - -#define IO_NULL_VM_TASK ((vm_task_t)0) +typedef unsigned int IOAlignment; +#define IO_NULL_VM_TASK ((vm_task_t)0) /* * Pull in machine specific stuff. @@ -164,58 +161,59 @@ typedef unsigned int IOAlignment; #ifndef __IOKIT_PORTS_DEFINED__ #define __IOKIT_PORTS_DEFINED__ #ifdef KERNEL -typedef struct OSObject * io_object_t; +typedef struct OSObject *io_object_t; #else /* KERNEL */ -typedef mach_port_t io_object_t; +typedef mach_port_t io_object_t; #endif /* KERNEL */ #endif /* __IOKIT_PORTS_DEFINED__ */ #include -typedef io_object_t io_connect_t; -typedef io_object_t io_enumerator_t; -typedef io_object_t io_iterator_t; -typedef io_object_t io_registry_entry_t; -typedef io_object_t io_service_t; +typedef io_object_t io_connect_t; +typedef io_object_t io_enumerator_t; +typedef io_object_t io_iterator_t; +typedef io_object_t io_registry_entry_t; +typedef io_object_t io_service_t; -#define IO_OBJECT_NULL ((io_object_t) 0) +#define IO_OBJECT_NULL ((io_object_t)0) #endif /* MACH_KERNEL */ // IOConnectMapMemory memoryTypes enum { - kIODefaultMemoryType = 0 + kIODefaultMemoryType = 0 }; enum { - kIODefaultCache = 0, - kIOInhibitCache = 1, - kIOWriteThruCache = 2, - kIOCopybackCache = 3, - kIOWriteCombineCache = 4 + kIODefaultCache = 0, + kIOInhibitCache = 1, + kIOWriteThruCache = 2, + kIOCopybackCache = 3, + kIOWriteCombineCache = 4 }; // IOMemory mapping options enum { - kIOMapAnywhere = 0x00000001, + kIOMapAnywhere = 0x00000001, - kIOMapCacheMask = 0x00000700, - kIOMapCacheShift = 8, - kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, - kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, - kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, - kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, - kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, + kIOMapCacheMask = 0x00000700, + kIOMapCacheShift = 8, + kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, + kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, + kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, + kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, + kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, - kIOMapUserOptionsMask = 0x00000fff, + kIOMapUserOptionsMask = 0x00000fff, - kIOMapReadOnly = 0x00001000, + kIOMapReadOnly = 0x00001000, - kIOMapStatic = 0x01000000, - kIOMapReference = 0x02000000, - kIOMapUnique = 0x04000000 + kIOMapStatic = 0x01000000, + kIOMapReference = 0x02000000, + kIOMapUnique = 0x04000000 #ifdef XNU_KERNEL_PRIVATE - , kIOMap64Bit = 0x08000000 + , + kIOMap64Bit = 0x08000000 #endif }; @@ -228,11 +226,11 @@ enum { @constant kSecondScale Scale factor for second based times. */ enum { - kNanosecondScale = 1, + kNanosecondScale = 1, kMicrosecondScale = 1000, kMillisecondScale = 1000 * 1000, - kSecondScale = 1000 * 1000 * 1000, - kTickScale = (kSecondScale / 100) + kSecondScale = 1000 * 1000 * 1000, + kTickScale = (kSecondScale / 100) }; /* compatibility types */ diff --git a/IOKit/OSKext.h b/IOKit/OSKext.h index 2da9b41b..e333aad2 100644 --- a/IOKit/OSKext.h +++ b/IOKit/OSKext.h @@ -53,7 +53,7 @@ __BEGIN_DECLS * safe. You must use your own locking with threads sharing access to OSKext. * You can not use this library in an application with garbage collection. */ - + #pragma mark Types and Constants /******************************************************************************* * Types and Constants @@ -71,11 +71,10 @@ __BEGIN_DECLS * * The kernel counterpart of OSKext is the OSKext libkern C++ class. */ -typedef struct __OSKext * OSKextRef - ; +typedef struct __OSKext *OSKextRef; -#define kOSKextBundleExtension "kext" -#define kOSKextMkextExtension "mkext" +#define kOSKextBundleExtension "kext" +#define kOSKextMkextExtension "mkext" /*! * @typedef OSKextDiagnosticsFlags @@ -86,14 +85,14 @@ typedef struct __OSKext * OSKextRef * @constant kOSKextDiagnosticsFlagWarnings */ enum { - kOSKextDiagnosticsFlagNone = (UInt32) 0x0U, + kOSKextDiagnosticsFlagNone = (UInt32)0x0U, - kOSKextDiagnosticsFlagValidation = (UInt32) 0x1U, - kOSKextDiagnosticsFlagAuthentication = (UInt32) 0x2U, - kOSKextDiagnosticsFlagDependencies = (UInt32) 0x4U, - kOSKextDiagnosticsFlagWarnings = (UInt32) 0x8U, + kOSKextDiagnosticsFlagValidation = (UInt32)0x1U, + kOSKextDiagnosticsFlagAuthentication = (UInt32)0x2U, + kOSKextDiagnosticsFlagDependencies = (UInt32)0x4U, + kOSKextDiagnosticsFlagWarnings = (UInt32)0x8U, - kOSKextDiagnosticsFlagAll = (UInt32)0xFFFFFFFFU, + kOSKextDiagnosticsFlagAll = (UInt32)0xFFFFFFFFU, }; typedef UInt32 OSKextDiagnosticsFlags; typedef UInt64 OSKextLogFlags; @@ -101,9 +100,9 @@ typedef SInt64 OSKextVersion; typedef kern_return_t OSReturn; typedef uint8_t OSKextExcludeLevel; -#define kOSKextExcludeNone (0) -#define kOSKextExcludeKext (1) -#define kOSKextExcludeAll (2) +#define kOSKextExcludeNone (0) +#define kOSKextExcludeKext (1) +#define kOSKextExcludeAll (2) /* Top-level keys for diagnostics dicts. See @link OSKextCopyDiagnostics@/link. */ @@ -126,8 +125,7 @@ const CFStringRef kOSKextDiagnosticsWarningsKey; * @result The type identifier for the OSKext opaque type. */ CF_EXPORT CFTypeID -OSKextGetTypeID(void) - ; +OSKextGetTypeID(void); #pragma mark Module Configuration /********************************************************************* @@ -170,8 +168,7 @@ OSKextGetTypeID(void) */ // xxx - should this also have a flushDependenciesFlag? CF_EXPORT Boolean -OSKextSetArchitecture(const NXArchInfo * archInfo) - ; +OSKextSetArchitecture(const NXArchInfo *archInfo); /*! * @function OSKextGetArchitecture @@ -190,8 +187,7 @@ OSKextSetArchitecture(const NXArchInfo * archInfo) * the user-space process). */ CF_EXPORT const NXArchInfo * -OSKextGetArchitecture(void) - ; +OSKextGetArchitecture(void); /*! * @function OSKextGetRunningKernelArchitecture @@ -209,8 +205,7 @@ OSKextGetArchitecture(void) * running with a 64-bit kernel, or vice-versa). */ CF_EXPORT const NXArchInfo * -OSKextGetRunningKernelArchitecture(void) - ; +OSKextGetRunningKernelArchitecture(void); /*! @function OSKextGetLogFlags @param kext The kext to get the log flags. Pass NULL to get the global flag. */ @@ -235,10 +230,9 @@ CF_EXPORT void OSKextSetLogFlags(OSKextRef kext, OSKextLogFlags logFlags); */ /* xxx - no CF_EXPORT, compiler dies */ typedef void (*OSKextLogFunction)( - OSKextLogFlags flags, - const char * format, - ...) - ; + OSKextLogFlags flags, + const char *format, + ...); /*! * @function OSKextSetLogFunction @@ -253,8 +247,7 @@ typedef void (*OSKextLogFunction)( * Log messages have no trailing newline, to accommodate system log facilities. */ CF_EXPORT void -OSKextSetLogFunction(OSKextLogFunction func) - ; +OSKextSetLogFunction(OSKextLogFunction func); /*! * @function OSKextSetSimulatedSafeBoot @@ -270,8 +263,7 @@ OSKextSetLogFunction(OSKextLogFunction func) * catch non-loadable kexts and present appropriate diagnostics. */ CF_EXPORT void -OSKextSetSimulatedSafeBoot(Boolean flag) - ; +OSKextSetSimulatedSafeBoot(Boolean flag); /*! * @function OSKextGetSimulatedSafeBoot @@ -288,8 +280,7 @@ OSKextSetSimulatedSafeBoot(Boolean flag) * catch non-loadable kexts and present appropriate diagnostics. */ CF_EXPORT Boolean -OSKextGetSimulatedSafeBoot(void) - ; +OSKextGetSimulatedSafeBoot(void); /*! * @function OSKextGetActualSafeBoot @@ -309,8 +300,7 @@ OSKextGetSimulatedSafeBoot(void) */ // xxx - we used to disallow kexts w/debug-log flags in safe boot, too CF_EXPORT Boolean -OSKextGetActualSafeBoot(void) - ; +OSKextGetActualSafeBoot(void); /*! * @function OSKextGetSystemExtensionsFolderURLs @@ -327,8 +317,7 @@ OSKextGetActualSafeBoot(void) * @link OSKextCreateKextsFromURLs@/link. */ CF_EXPORT CFArrayRef -OSKextGetSystemExtensionsFolderURLs(void) - ; +OSKextGetSystemExtensionsFolderURLs(void); /*! * @function OSKextSetRecordsDiagnostics @@ -360,8 +349,7 @@ OSKextGetSystemExtensionsFolderURLs(void) */ // Could list a pile of see also's here.... CF_EXPORT void -OSKextSetRecordsDiagnostics(OSKextDiagnosticsFlags flags) - ; +OSKextSetRecordsDiagnostics(OSKextDiagnosticsFlags flags); /*! * @function OSKextGetRecordsDiagnostics @@ -375,9 +363,7 @@ OSKextSetRecordsDiagnostics(OSKextDiagnosticsFlags flags) * @link OSKextSetRecordsDiagnostics@/link. */ CF_EXPORT OSKextDiagnosticsFlags -OSKextGetRecordsDiagnostics(void) - ; - +OSKextGetRecordsDiagnostics(void); /*! * @function OSKextSetUsesCaches @@ -396,8 +382,7 @@ OSKextGetRecordsDiagnostics(void) * See also @link OSKextGetUsesCaches@/link. */ CF_EXPORT void -OSKextSetUsesCaches(Boolean flag) - ; +OSKextSetUsesCaches(Boolean flag); /*! * @function OSKextGetUsesCaches @@ -416,8 +401,7 @@ OSKextSetUsesCaches(Boolean flag) * See also @link OSKextGetUsesCaches@/link. */ CF_EXPORT Boolean -OSKextGetUsesCaches(void) - ; +OSKextGetUsesCaches(void); #pragma mark Instance Management /********************************************************************* @@ -459,8 +443,7 @@ OSKextGetUsesCaches(void) CF_EXPORT OSKextRef OSKextCreate( CFAllocatorRef allocator, - CFURLRef anURL) - ; + CFURLRef anURL); /*! * @function OSKextCreateKextsFromURL @@ -495,8 +478,7 @@ OSKextCreate( */ CFArrayRef OSKextCreateKextsFromURL( CFAllocatorRef allocator, - CFURLRef anURL) - ; + CFURLRef anURL); /*! * @function OSKextCreateKextsFromURLs @@ -530,8 +512,7 @@ CFArrayRef OSKextCreateKextsFromURL( CF_EXPORT CFArrayRef OSKextCreateKextsFromURLs( CFAllocatorRef allocator, - CFArrayRef arrayOfURLs) - ; + CFArrayRef arrayOfURLs); /*! * @function OSKextGetAllKexts @@ -547,8 +528,7 @@ OSKextCreateKextsFromURLs( * This function is potentially expensive, so use with care. */ CF_EXPORT CFArrayRef -OSKextGetAllKexts(void) - ; +OSKextGetAllKexts(void); /*! @function OSKextCopyKextsWithIdentifier */ CF_EXPORT CFArrayRef OSKextCopyKextsWithIdentifier(CFStringRef bundleID); @@ -580,8 +560,7 @@ CF_EXPORT CFArrayRef OSKextGetKextsWithIdentifiers(CFArrayRef bundleIDs); // xxx - check on same-version ordering with folks CF_EXPORT OSKextRef OSKextGetKextWithIdentifierAndVersion( - CFStringRef aBundleID, OSKextVersion aVersion) - ; + CFStringRef aBundleID, OSKextVersion aVersion); /*! * @function OSKextGetKextsWithIdentifier @@ -604,8 +583,7 @@ OSKextGetKextWithIdentifierAndVersion( */ CF_EXPORT CFArrayRef OSKextCopyKextsWithIdentifier( - CFStringRef aBundleID) - ; + CFStringRef aBundleID); /*! * @function OSKextGetLoadedKextWithIdentifier @@ -629,8 +607,7 @@ OSKextCopyKextsWithIdentifier( */ CF_EXPORT OSKextRef OSKextGetLoadedKextWithIdentifier( - CFStringRef aBundleID) - ; + CFStringRef aBundleID); /*! * @function OSKextGetCompatibleKextWithIdentifier @@ -657,9 +634,8 @@ OSKextGetLoadedKextWithIdentifier( */ CF_EXPORT OSKextRef OSKextGetCompatibleKextWithIdentifier( - CFStringRef aBundleID, - OSKextVersion requestedVersion) - ; + CFStringRef aBundleID, + OSKextVersion requestedVersion); #pragma mark Basic Accessors /********************************************************************* @@ -681,8 +657,7 @@ OSKextGetCompatibleKextWithIdentifier( * URLs. */ CF_EXPORT CFURLRef -OSKextGetURL(OSKextRef aKext) - ; // always absolute +OSKextGetURL(OSKextRef aKext); // always absolute /*! * @function OSKextGetIdentifier @@ -696,8 +671,7 @@ OSKextGetURL(OSKextRef aKext) * @link //apple_ref/doc/uid/20001148-SW1 Get Rule@/link. */ CF_EXPORT CFStringRef -OSKextGetIdentifier(OSKextRef aKext) - ; +OSKextGetIdentifier(OSKextRef aKext); /*! * @function OSKextGetValueForInfoDictionaryKey @@ -746,9 +720,8 @@ OSKextGetIdentifier(OSKextRef aKext) */ CF_EXPORT CFTypeRef OSKextGetValueForInfoDictionaryKey( - OSKextRef aKext, - CFStringRef key) - ; + OSKextRef aKext, + CFStringRef key); /*! * @function OSKextCopyInfoDictionary @@ -767,8 +740,7 @@ OSKextGetValueForInfoDictionaryKey( * of the info dictionary, in order to match the parsing used in the kernel. */ CF_EXPORT CFMutableDictionaryRef -OSKextCopyInfoDictionary(OSKextRef aKext) - ; +OSKextCopyInfoDictionary(OSKextRef aKext); /*! * @function OSKextFlushInfoDictionary @@ -799,8 +771,7 @@ OSKextCopyInfoDictionary(OSKextRef aKext) * dictionaries. */ CF_EXPORT void -OSKextFlushInfoDictionary(OSKextRef aKext) - ; +OSKextFlushInfoDictionary(OSKextRef aKext); /*! * @function OSKextGetVersion @@ -814,8 +785,7 @@ OSKextFlushInfoDictionary(OSKextRef aKext) * xxx - need to fix definition of OSKextVersion. */ CF_EXPORT OSKextVersion -OSKextGetVersion(OSKextRef aKext) - ; +OSKextGetVersion(OSKextRef aKext); /*! * @function OSKextGetCompatibleVersion @@ -832,8 +802,7 @@ OSKextGetVersion(OSKextRef aKext) * xxx - needs more info on version format, ref to tn: http://developer.apple.com/technotes/tn/tn1132.html */ CF_EXPORT OSKextVersion -OSKextGetCompatibleVersion(OSKextRef aKext) - ; +OSKextGetCompatibleVersion(OSKextRef aKext); /*! * @function OSKextCopyUUIDForArchitecture @@ -855,8 +824,7 @@ OSKextGetCompatibleVersion(OSKextRef aKext) */ CF_EXPORT CFDataRef OSKextCopyUUIDForArchitecture(OSKextRef aKext, - const NXArchInfo * anArch) - ; + const NXArchInfo *anArch); /*! * @function OSKextIsKernelComponent @@ -877,8 +845,7 @@ OSKextCopyUUIDForArchitecture(OSKextRef aKext, * (see @link OSKextIsInterface@/link). */ CF_EXPORT Boolean -OSKextIsKernelComponent(OSKextRef aKext) - ; +OSKextIsKernelComponent(OSKextRef aKext); /*! * @function OSKextIsInterface @@ -900,8 +867,7 @@ OSKextIsKernelComponent(OSKextRef aKext) * the define the kernel programming interfaces for Mac OS X. */ CF_EXPORT Boolean -OSKextIsInterface(OSKextRef aKext) - ; +OSKextIsInterface(OSKextRef aKext); /*! * @function OSKextIsLibrary @@ -919,8 +885,7 @@ OSKextIsInterface(OSKextRef aKext) * property. */ CF_EXPORT Boolean -OSKextIsLibrary(OSKextRef aKext) - ; +OSKextIsLibrary(OSKextRef aKext); /*! * @function OSKextDeclaresExecutable @@ -938,8 +903,7 @@ OSKextIsLibrary(OSKextRef aKext) * for more on the latter type. */ CF_EXPORT Boolean -OSKextDeclaresExecutable(OSKextRef aKext) - ; +OSKextDeclaresExecutable(OSKextRef aKext); /*! * @function OSKextHasLogOrDebugFlags @@ -957,8 +921,7 @@ OSKextDeclaresExecutable(OSKextRef aKext) * Kexts built for distribution should not have any logging or debug flags set. */ CF_EXPORT Boolean -OSKextHasLogOrDebugFlags(OSKextRef aKext) - ; +OSKextHasLogOrDebugFlags(OSKextRef aKext); /*! * @function OSKextIsLoadableInSafeBoot @@ -980,8 +943,7 @@ OSKextHasLogOrDebugFlags(OSKextRef aKext) * @link OSKextIsLoadable@/link. */ CF_EXPORT Boolean -OSKextIsLoadableInSafeBoot(OSKextRef aKext) - ; +OSKextIsLoadableInSafeBoot(OSKextRef aKext); /*! * @function OSKextCopyArchitectures @@ -999,8 +961,7 @@ OSKextIsLoadableInSafeBoot(OSKextRef aKext) * NXArchInfo pointers. */ CF_EXPORT const NXArchInfo ** -OSKextCopyArchitectures(OSKextRef aKext) - ; +OSKextCopyArchitectures(OSKextRef aKext); /*! * @function OSKextSupportsArchitecture @@ -1016,9 +977,8 @@ OSKextCopyArchitectures(OSKextRef aKext) * @discussion */ // null for current (NOT host) arch -Boolean OSKextSupportsArchitecture(OSKextRef aKext, - const NXArchInfo * anArch) -; // if NULL, uses current default +Boolean OSKextSupportsArchitecture(OSKextRef aKext, + const NXArchInfo *anArch); // if NULL, uses current default /*! * @function OSKextCopyPlugins @@ -1038,9 +998,8 @@ Boolean OSKextSupportsArchitecture(OSKextRef aKext, * this function returns an empty array. */ CF_EXPORT CFArrayRef -OSKextCopyPlugins(OSKextRef aKext) - ; - +OSKextCopyPlugins(OSKextRef aKext); + /*! * @function OSKextIsPlugin * @abstract Returns whether a kext is a plugin of some other kext. @@ -1055,8 +1014,7 @@ OSKextCopyPlugins(OSKextRef aKext) * ".kext/" in the absolute path leading up to the kext's bundle name. */ CF_EXPORT Boolean -OSKextIsPlugin(OSKextRef aKext) - ; +OSKextIsPlugin(OSKextRef aKext); /*! * @function OSKextCopyContainerForPluginKext @@ -1077,8 +1035,7 @@ OSKextIsPlugin(OSKextRef aKext) * This may result in the creation of a new kext. */ CF_EXPORT OSKextRef -OSKextCopyContainerForPluginKext(OSKextRef aKext) - ; +OSKextCopyContainerForPluginKext(OSKextRef aKext); /*! * @function OSKextCopyPersonalitiesArray @@ -1096,8 +1053,7 @@ OSKextCopyContainerForPluginKext(OSKextRef aKext) * personalities dictionary for the current architecture. */ CF_EXPORT CFArrayRef -OSKextCopyPersonalitiesArray(OSKextRef aKext) - ; +OSKextCopyPersonalitiesArray(OSKextRef aKext); // xxx - would it be awful to have a function that takes a CFTypeRef that's // xxx - a single kext, an array of kexts, or NULL for all open kexts? @@ -1117,8 +1073,7 @@ OSKextCopyPersonalitiesArray(OSKextRef aKext) * rather than a dictionary. This function facilitates such use. */ CF_EXPORT CFArrayRef -OSKextCopyPersonalitiesOfKexts(CFArrayRef kextArray) - ; +OSKextCopyPersonalitiesOfKexts(CFArrayRef kextArray); /*! * @function OSKextCopyExecutableForArchitecture @@ -1139,8 +1094,7 @@ OSKextCopyPersonalitiesOfKexts(CFArrayRef kextArray) */ CF_EXPORT CFDataRef OSKextCopyExecutableForArchitecture(OSKextRef aKext, - const NXArchInfo * anArch) - ; + const NXArchInfo *anArch); /*! * @function OSKextCopyResource @@ -1169,10 +1123,9 @@ OSKextCopyExecutableForArchitecture(OSKextRef aKext, */ CF_EXPORT CFDataRef OSKextCopyResource( - OSKextRef aKext, + OSKextRef aKext, CFStringRef resourceName, - CFStringRef resourceType) - ; + CFStringRef resourceType); #pragma mark Dependency Resolution /********************************************************************* @@ -1206,8 +1159,7 @@ OSKextCopyResource( */ // xxx - check on same-version ordering with folks CF_EXPORT Boolean -OSKextResolveDependencies(OSKextRef aKext) - ; +OSKextResolveDependencies(OSKextRef aKext); /*! * @function OSKextFlushDependencies @@ -1240,8 +1192,7 @@ OSKextResolveDependencies(OSKextRef aKext) * and @link OSKextFlushDiagnostics@/link. */ CF_EXPORT void -OSKextFlushDependencies(OSKextRef aKext) - ; +OSKextFlushDependencies(OSKextRef aKext); /*! * @function OSKextCopyDeclaredDependencies @@ -1263,9 +1214,7 @@ OSKextFlushDependencies(OSKextRef aKext) CF_EXPORT CFArrayRef OSKextCopyDeclaredDependencies( OSKextRef aKext, - Boolean needAllFlag) - ; - + Boolean needAllFlag); /*! * @function OSKextCopyLinkDependencies @@ -1291,12 +1240,11 @@ OSKextCopyDeclaredDependencies( * This function calls @link OSKextResolveDependencies@/link to find * dependencies. */ - // xxx - need to insert a manpage link on kextstat +// xxx - need to insert a manpage link on kextstat CF_EXPORT CFArrayRef OSKextCopyLinkDependencies( OSKextRef aKext, - Boolean needAllFlag) - ; + Boolean needAllFlag); /*! * @function OSKextCopyLoadList @@ -1324,8 +1272,7 @@ OSKextCopyLinkDependencies( CF_EXPORT CFMutableArrayRef OSKextCopyLoadList( OSKextRef aKext, - Boolean needAllFlag) - ; + Boolean needAllFlag); /*! * @function OSKextCopyLoadListForKexts @@ -1351,12 +1298,10 @@ OSKextCopyLoadList( * This function calls @link OSKextResolveDependencies@/link to find * dependencies. */ -CF_EXPORT CFMutableArrayRef +CF_EXPORT CFMutableArrayRef OSKextCopyLoadListForKexts( - CFArrayRef kexts, - Boolean needAllFlag) - ; - + CFArrayRef kexts, + Boolean needAllFlag); /*! * @function OSKextCopyAllDependencies @@ -1379,8 +1324,7 @@ OSKextCopyLoadListForKexts( CF_EXPORT CFMutableArrayRef OSKextCopyAllDependencies( OSKextRef aKext, - Boolean needAllFlag) - ; + Boolean needAllFlag); /*! * @function OSKextCopyIndirectDependencies @@ -1408,8 +1352,7 @@ OSKextCopyAllDependencies( // xxx - This one isn't really useful, is it? CFMutableArrayRef OSKextCopyIndirectDependencies( OSKextRef aKext, - Boolean needAllFlag) -; + Boolean needAllFlag); /*! * @function OSKextDependsOnKext @@ -1440,8 +1383,7 @@ CF_EXPORT Boolean OSKextDependsOnKext( OSKextRef aKext, OSKextRef libraryKext, - Boolean directFlag) - ; + Boolean directFlag); /*! * @function OSKextCopyDependents @@ -1468,8 +1410,7 @@ OSKextDependsOnKext( */ CF_EXPORT CFMutableArrayRef OSKextCopyDependents(OSKextRef aKext, - Boolean directFlag) - ; + Boolean directFlag); /*! * @function OSKextIsCompatibleWithVersion @@ -1487,9 +1428,8 @@ OSKextCopyDependents(OSKextRef aKext, */ CF_EXPORT Boolean OSKextIsCompatibleWithVersion( - OSKextRef aKext, - OSKextVersion aVersion) - ; + OSKextRef aKext, + OSKextVersion aVersion); /*! * @function OSKextLogDependencyGraph @@ -1514,8 +1454,7 @@ OSKextIsCompatibleWithVersion( CF_EXPORT void OSKextLogDependencyGraph(OSKextRef aKext, Boolean bundleIDFlag, - Boolean linkFlag) - ; + Boolean linkFlag); /*! * @function OSKextFindLinkDependencies @@ -1576,14 +1515,13 @@ OSKextLogDependencyGraph(OSKextRef aKext, * kexts' information dictionaries, and all library kexts' executables. */ CFArrayRef OSKextFindLinkDependencies( - OSKextRef aKext, - Boolean nonKPIFlag, - Boolean allowUnsupportedFlag, - CFDictionaryRef * undefinedSymbolsOut, - CFDictionaryRef * onedefSymbolsOut, - CFDictionaryRef * multiplyDefinedSymbolsOut, - CFArrayRef * multipleDefinitionLibrariesOut) - ; + OSKextRef aKext, + Boolean nonKPIFlag, + Boolean allowUnsupportedFlag, + CFDictionaryRef *undefinedSymbolsOut, + CFDictionaryRef *onedefSymbolsOut, + CFDictionaryRef *multiplyDefinedSymbolsOut, + CFArrayRef *multipleDefinitionLibrariesOut); #pragma mark Linking and Loading; Other Kernel Operations /********************************************************************* @@ -1617,8 +1555,7 @@ CFArrayRef OSKextFindLinkDependencies( */ // xxx - need to list errors that may be returned CF_EXPORT OSReturn -OSKextLoad(OSKextRef aKext) - ; +OSKextLoad(OSKextRef aKext); /*! * @function OSKextLoadWithOptions @@ -1676,13 +1613,12 @@ OSKextLoad(OSKextRef aKext) // xxx - need to list errors that may be returned CF_EXPORT OSReturn OSKextLoadWithOptions( - OSKextRef aKext, - OSKextExcludeLevel startExclusion, - OSKextExcludeLevel addPersonalitiesExclusion, - CFArrayRef personalityNames, - Boolean delayAutounloadFlag) - ; - + OSKextRef aKext, + OSKextExcludeLevel startExclusion, + OSKextExcludeLevel addPersonalitiesExclusion, + CFArrayRef personalityNames, + Boolean delayAutounloadFlag); + /*! * @function OSKextGenerateDebugSymbols * @abstract Generate debug symbols for a kext and its dependencies. @@ -1714,8 +1650,7 @@ OSKextLoadWithOptions( CF_EXPORT CFDictionaryRef OSKextGenerateDebugSymbols( OSKextRef aKext, - CFDataRef kernelImage) - ; + CFDataRef kernelImage); /*! * @function OSKextNeedsLoadAddressForDebugSymbols @@ -1729,8 +1664,7 @@ OSKextGenerateDebugSymbols( * @link OSKextGenerateDebugSymbols@/link, false otherwise. */ CF_EXPORT Boolean -OSKextNeedsLoadAddressForDebugSymbols(OSKextRef aKext) - ; +OSKextNeedsLoadAddressForDebugSymbols(OSKextRef aKext); /*! * @function OSKextUnload @@ -1757,8 +1691,7 @@ OSKextNeedsLoadAddressForDebugSymbols(OSKextRef aKext) // xxx - need to list errors that may be returned CF_EXPORT OSReturn OSKextUnload(OSKextRef aKext, - Boolean terminateServiceAndRemovePersonalities) - ; + Boolean terminateServiceAndRemovePersonalities); /*! * OSKextUnload @@ -1786,8 +1719,7 @@ OSKextUnload(OSKextRef aKext, // xxx - need to list errors that may be returned CF_EXPORT OSReturn OSKextUnloadKextWithIdentifier(CFStringRef kextIdentifier, - Boolean terminateServiceAndRemovePersonalities) - ; + Boolean terminateServiceAndRemovePersonalities); /*! * @function OSKextIsStarted @@ -1803,8 +1735,7 @@ OSKextUnloadKextWithIdentifier(CFStringRef kextIdentifier, * @link OSKextReadLoadedKextInfo@/link was called. */ CF_EXPORT Boolean -OSKextIsStarted(OSKextRef aKext) - ; +OSKextIsStarted(OSKextRef aKext); /*! * @function OSKextStart @@ -1828,8 +1759,7 @@ OSKextIsStarted(OSKextRef aKext) // xxx - need to list errors that may be returned */ CF_EXPORT OSReturn -OSKextStart(OSKextRef aKext) - ; +OSKextStart(OSKextRef aKext); /*! * @function OSKextStop @@ -1858,8 +1788,7 @@ OSKextStart(OSKextRef aKext) // xxx - themselves not started? // xxx - need to list errors that may be returned CF_EXPORT OSReturn -OSKextStop(OSKextRef aKext) - ; +OSKextStop(OSKextRef aKext); /*! * @function OSKextSendPersonalitiesToKernel @@ -1881,8 +1810,7 @@ OSKextStop(OSKextRef aKext) */ // xxx - need to list errors that may be returned CF_EXPORT OSReturn -OSKextSendPersonalitiesToKernel(CFArrayRef personalities) - ; +OSKextSendPersonalitiesToKernel(CFArrayRef personalities); /*! * @function OSKextSendKextPersonalitiesToKernel @@ -1911,9 +1839,8 @@ OSKextSendPersonalitiesToKernel(CFArrayRef personalities) // xxx - need to list errors that may be returned CF_EXPORT OSReturn OSKextSendKextPersonalitiesToKernel( - OSKextRef aKext, - CFArrayRef personalityNames) - ; + OSKextRef aKext, + CFArrayRef personalityNames); /*! * @function OSKextSendPersonalitiesOfKextsToKernel @@ -1933,8 +1860,7 @@ OSKextSendKextPersonalitiesToKernel( */ // xxx - need to list errors that may be returned CF_EXPORT OSReturn -OSKextSendPersonalitiesOfKextsToKernel(CFArrayRef kextArray) - ; +OSKextSendPersonalitiesOfKextsToKernel(CFArrayRef kextArray); /*! * @function OSKextRemoveKextPersonalitiesFromKernel @@ -1971,8 +1897,7 @@ OSKextSendPersonalitiesOfKextsToKernel(CFArrayRef kextArray) // xxx - might we just want the function to take a bundle ID? // xxx - does IOCatalogueSendData really require root access? CF_EXPORT OSReturn -OSKextRemoveKextPersonalitiesFromKernel(OSKextRef aKext) - ; +OSKextRemoveKextPersonalitiesFromKernel(OSKextRef aKext); /*! * @function OSKextRemovePersonalitiesForIdentifierFromKernel @@ -2001,8 +1926,7 @@ OSKextRemoveKextPersonalitiesFromKernel(OSKextRef aKext) // xxx - I want 2 separate functions for logging; a kext can have flags in it // xxx - does IOCatalogueSendData really require root access? CF_EXPORT OSReturn -OSKextRemovePersonalitiesForIdentifierFromKernel(CFStringRef aBundleID) - ; +OSKextRemovePersonalitiesForIdentifierFromKernel(CFStringRef aBundleID); /*! * @function OSKextCreateLoadedKextInfo @@ -2021,8 +1945,7 @@ OSKextRemovePersonalitiesForIdentifierFromKernel(CFStringRef aBundleID) // xxx - need to document the keys from OSKextLib.h. CF_EXPORT CFArrayRef OSKextCreateLoadedKextInfo( - CFArrayRef kextIdentifiers) - ; + CFArrayRef kextIdentifiers); /*! * @function OSKextReadLoadedKextInfo @@ -2068,8 +1991,7 @@ OSKextCreateLoadedKextInfo( CF_EXPORT OSReturn OSKextReadLoadedKextInfo( CFArrayRef kexts, - Boolean flushDependenciesFlag) - ; + Boolean flushDependenciesFlag); /*! * @function OSKextIsLoaded @@ -2088,8 +2010,7 @@ OSKextReadLoadedKextInfo( * a different version of aKext is loaded. */ CF_EXPORT Boolean -OSKextIsLoaded(OSKextRef aKext) - ; +OSKextIsLoaded(OSKextRef aKext); /*! * @function OSKextGetLoadAddress @@ -2109,8 +2030,7 @@ OSKextIsLoaded(OSKextRef aKext) * @link OSKextSetLoadAddress@/link for the load address to be nonzero. */ CF_EXPORT uint64_t -OSKextGetLoadAddress(OSKextRef aKext) - ; +OSKextGetLoadAddress(OSKextRef aKext); /*! * @function OSKextSetLoadAddress @@ -2132,8 +2052,7 @@ OSKextGetLoadAddress(OSKextRef aKext) * with @link OSKextGenerateDebugSymbols@/link. */ CF_EXPORT Boolean -OSKextSetLoadAddress(OSKextRef aKext, uint64_t anAddress) - ; +OSKextSetLoadAddress(OSKextRef aKext, uint64_t anAddress); /*! * @function OSKextGetLoadTag @@ -2155,8 +2074,7 @@ OSKextSetLoadAddress(OSKextRef aKext, uint64_t anAddress) * is loaded. */ CF_EXPORT uint32_t -OSKextGetLoadTag(OSKextRef aKext) - ; +OSKextGetLoadTag(OSKextRef aKext); /*! * @function OSKextFlushLoadInfo @@ -2195,8 +2113,7 @@ OSKextGetLoadTag(OSKextRef aKext) CF_EXPORT void OSKextFlushLoadInfo( OSKextRef aKext, - Boolean flushDependenciesFlag) - ; + Boolean flushDependenciesFlag); /*! * @function OSKextCopyAllRequestedIdentifiers @@ -2210,9 +2127,8 @@ OSKextFlushLoadInfo( * @link //apple_ref/doc/uid/20001148-103029 Create Rule@/link. * */ -CF_EXPORT CFArrayRef -OSKextCopyAllRequestedIdentifiers(void) - ; +CF_EXPORT CFArrayRef +OSKextCopyAllRequestedIdentifiers(void); #pragma mark Sanity Checking and Diagnostics /********************************************************************* @@ -2231,13 +2147,11 @@ OSKextCopyAllRequestedIdentifiers(void) * Returns -1 if the version couldn't be parsed. */ CF_EXPORT OSKextVersion -OSKextParseVersionCFString(CFStringRef versionString) - ; +OSKextParseVersionCFString(CFStringRef versionString); /*! @function OSKextParseVersionString */ -CF_EXPORT OSKextVersion OSKextParseVersionString(const char* versionString); -CF_EXPORT void OSKextVersionGetString(OSKextVersion version, char* buffer, size_t bufferLength); - +CF_EXPORT OSKextVersion OSKextParseVersionString(const char *versionString); +CF_EXPORT void OSKextVersionGetString(OSKextVersion version, char *buffer, size_t bufferLength); /*! * @function OSKextValidate @@ -2262,8 +2176,7 @@ CF_EXPORT void OSKextVersionGetString(OSKextVersion version, char* buffer, size_ */ // compare with CFBundlePreflightExecutable() CF_EXPORT Boolean -OSKextValidate(OSKextRef aKext) - ; +OSKextValidate(OSKextRef aKext); /*! * @function OSKextIsValid @@ -2281,8 +2194,7 @@ OSKextValidate(OSKextRef aKext) * validation of all possible problems, use @link OSKextValidate@/link. */ CF_EXPORT Boolean -OSKextIsValid(OSKextRef aKext) - ; +OSKextIsValid(OSKextRef aKext); /*! * @function OSKextValidateDependencies @@ -2308,8 +2220,7 @@ OSKextIsValid(OSKextRef aKext) * dependencies. */ CF_EXPORT Boolean -OSKextValidateDependencies(OSKextRef aKext) - ; +OSKextValidateDependencies(OSKextRef aKext); /*! * @function OSKextAuthenticate @@ -2335,8 +2246,7 @@ OSKextValidateDependencies(OSKextRef aKext) * (see @link OSKextCreateKextsFromMkextFile@/link. */ CF_EXPORT Boolean -OSKextAuthenticate(OSKextRef aKext) - ; +OSKextAuthenticate(OSKextRef aKext); /*! * @function OSKextIsAuthentic @@ -2354,8 +2264,7 @@ OSKextAuthenticate(OSKextRef aKext) * validation of all possible problems, use @link OSKextValidate@/link. */ CF_EXPORT Boolean -OSKextIsAuthentic(OSKextRef aKext) - ; +OSKextIsAuthentic(OSKextRef aKext); /*! * @function OSKextAuthenticateDependencies @@ -2377,8 +2286,7 @@ OSKextIsAuthentic(OSKextRef aKext) * dependencies. */ CF_EXPORT Boolean -OSKextAuthenticateDependencies(OSKextRef aKext) - ; +OSKextAuthenticateDependencies(OSKextRef aKext); /*! * @function OSKextIsLoadable @@ -2407,8 +2315,7 @@ OSKextAuthenticateDependencies(OSKextRef aKext) * dependencies. */ CF_EXPORT Boolean -OSKextIsLoadable(OSKextRef aKext) - ; +OSKextIsLoadable(OSKextRef aKext); /*! * @function OSKextCopyDiagnostics @@ -2433,8 +2340,7 @@ OSKextIsLoadable(OSKextRef aKext) */ // xxx - need to tie in with the kernel & linker to get link failures CFDictionaryRef OSKextCopyDiagnostics(OSKextRef aKext, - OSKextDiagnosticsFlags typeFlags) -; + OSKextDiagnosticsFlags typeFlags); /*! * @function OSKextLogDiagnostics @@ -2450,9 +2356,8 @@ CFDictionaryRef OSKextCopyDiagnostics(OSKextRef aKext, */ CF_EXPORT void OSKextLogDiagnostics( - OSKextRef aKext, - OSKextDiagnosticsFlags typeFlags) - ; + OSKextRef aKext, + OSKextDiagnosticsFlags typeFlags); /*! * @function OSKextFlushDiagnostics @@ -2476,22 +2381,20 @@ OSKextLogDiagnostics( * and @link OSKextFlushLoadInfo@/link. */ CF_EXPORT void -OSKextFlushDiagnostics(OSKextRef aKext, OSKextDiagnosticsFlags typeFlags) - ; +OSKextFlushDiagnostics(OSKextRef aKext, OSKextDiagnosticsFlags typeFlags); #pragma mark Mkext and Prelinked Kernel Files /********************************************************************* * Mkext and Prelinked Kernel Files *********************************************************************/ // xxx - Use "Flag" or "Mask"? -typedef uint32_t OSKextRequiredFlags -; -#define kOSKextOSBundleRequiredNone 0x0 -#define kOSKextOSBundleRequiredRootFlag 0x1ULL -#define kOSKextOSBundleRequiredLocalRootFlag 0x1ULL << 1 -#define kOSKextOSBundleRequiredNetworkRootFlag 0x1ULL << 2 -#define kOSKextOSBundleRequiredSafeBootFlag 0x1ULL << 3 -#define kOSKextOSBundleRequiredConsoleFlag 0x1ULL << 4 +typedef uint32_t OSKextRequiredFlags; +#define kOSKextOSBundleRequiredNone 0x0 +#define kOSKextOSBundleRequiredRootFlag 0x1ULL +#define kOSKextOSBundleRequiredLocalRootFlag 0x1ULL << 1 +#define kOSKextOSBundleRequiredNetworkRootFlag 0x1ULL << 2 +#define kOSKextOSBundleRequiredSafeBootFlag 0x1ULL << 3 +#define kOSKextOSBundleRequiredConsoleFlag 0x1ULL << 4 /*! * @function OSKextIsFromMkext @@ -2507,8 +2410,7 @@ typedef uint32_t OSKextRequiredFlags * and any resources listed in its the OSBundleStartupResources property. */ CF_EXPORT Boolean -OSKextIsFromMkext(OSKextRef aKext) - ; +OSKextIsFromMkext(OSKextRef aKext); /*! * @function OSKextMatchesRequiredFlags @@ -2531,8 +2433,7 @@ OSKextIsFromMkext(OSKextRef aKext) */ CF_EXPORT Boolean OSKextMatchesRequiredFlags(OSKextRef aKext, - OSKextRequiredFlags requiredFlags) - ; + OSKextRequiredFlags requiredFlags); /*! * @function OSKextFilterRequiredKexts @@ -2556,8 +2457,7 @@ OSKextMatchesRequiredFlags(OSKextRef aKext, */ CF_EXPORT CFArrayRef OSKextFilterRequiredKexts(CFArrayRef kextArray, - OSKextRequiredFlags requiredFlags) - ; + OSKextRequiredFlags requiredFlags); /*! * @function OSKextCreateMkext @@ -2602,13 +2502,12 @@ OSKextFilterRequiredKexts(CFArrayRef kextArray, // xxx - add flag to take only most recent version of a given bundle ID? CF_EXPORT CFDataRef OSKextCreateMkext( - CFAllocatorRef allocator, - CFArrayRef kextArray, - CFURLRef volumeRootURL, + CFAllocatorRef allocator, + CFArrayRef kextArray, + CFURLRef volumeRootURL, OSKextRequiredFlags requiredFlags, - Boolean compressFlag) - ; - + Boolean compressFlag); + /*! * @function OSKextCreateKextsFromMkextFile * @abstract Reads all kexts from an mkext file on disk. @@ -2641,8 +2540,7 @@ OSKextCreateMkext( */ CF_EXPORT CFArrayRef OSKextCreateKextsFromMkextFile(CFAllocatorRef allocator, - CFURLRef mkextURL) - ; + CFURLRef mkextURL); /*! * @function OSKextCreateKextsFromMkextData @@ -2676,8 +2574,7 @@ OSKextCreateKextsFromMkextFile(CFAllocatorRef allocator, */ CF_EXPORT CFArrayRef OSKextCreateKextsFromMkextData(CFAllocatorRef allocator, - CFDataRef mkextData) - ; + CFDataRef mkextData); /*! * @function OSKextCreatePrelinkedKernel @@ -2716,14 +2613,13 @@ OSKextCreateKextsFromMkextData(CFAllocatorRef allocator, */ CF_EXPORT CFDataRef OSKextCreatePrelinkedKernel( - CFDataRef kernelImage, - CFArrayRef kextArray, - CFURLRef volumeRootURL, - Boolean needAllFlag, - Boolean skipAuthenticationFlag, - Boolean printDiagnosticsFlag, - CFDictionaryRef * symbolsOut) - ; + CFDataRef kernelImage, + CFArrayRef kextArray, + CFURLRef volumeRootURL, + Boolean needAllFlag, + Boolean skipAuthenticationFlag, + Boolean printDiagnosticsFlag, + CFDictionaryRef *symbolsOut); /*! * @function OSKextotherCFBundleVersionIsLoaded @@ -2745,7 +2641,7 @@ OSKextCreatePrelinkedKernel( * Use @link OSKextIsLoaded@/link to check whether aKext * itself is loaded. */ -CF_EXPORT Boolean OSKextotherCFBundleVersionIsLoaded(OSKextRef kext, Boolean* uuidFlag); +CF_EXPORT Boolean OSKextotherCFBundleVersionIsLoaded(OSKextRef kext, Boolean *uuidFlag); __END_DECLS diff --git a/IOKit/OSMessageNotification.h b/IOKit/OSMessageNotification.h index 7d7b5e53..43fcf439 100644 --- a/IOKit/OSMessageNotification.h +++ b/IOKit/OSMessageNotification.h @@ -32,7 +32,7 @@ * */ -#ifndef __OS_OSMESSAGENOTIFICATION_H +#ifndef __OS_OSMESSAGENOTIFICATION_H #define __OS_OSMESSAGENOTIFICATION_H #ifdef __cplusplus @@ -44,64 +44,62 @@ extern "C" { #include enum { - kFirstIOKitNotificationType = 100, - kIOServicePublishNotificationType = 100, - kIOServiceMatchedNotificationType = 101, - kIOServiceTerminatedNotificationType = 102, - kIOAsyncCompletionNotificationType = 150, - kIOServiceMessageNotificationType = 160, - kLastIOKitNotificationType = 199 + kFirstIOKitNotificationType = 100, + kIOServicePublishNotificationType = 100, + kIOServiceMatchedNotificationType = 101, + kIOServiceTerminatedNotificationType = 102, + kIOAsyncCompletionNotificationType = 150, + kIOServiceMessageNotificationType = 160, + kLastIOKitNotificationType = 199 }; enum { - kOSNotificationMessageID = 53, - kOSAsyncCompleteMessageID = 57, - kMaxAsyncArgs = 16 + kOSNotificationMessageID = 53, + kOSAsyncCompleteMessageID = 57, + kMaxAsyncArgs = 16 }; enum { - kIOAsyncReservedIndex = 0, + kIOAsyncReservedIndex = 0, kIOAsyncReservedCount, - kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, + kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, kIOAsyncCalloutRefconIndex, kIOAsyncCalloutCount, - kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, + kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, kIOMatchingCalloutRefconIndex, kIOMatchingCalloutCount, - - kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, + + kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, kIOInterestCalloutRefconIndex, kIOInterestCalloutServiceIndex, kIOInterestCalloutCount }; - - // -------------- enum { - kOSAsyncRef64Count = 8, - kOSAsyncRef64Size = kOSAsyncRef64Count * ((int) sizeof(io_user_reference_t)) + kOSAsyncRef64Count = 8, + kOSAsyncRef64Size = kOSAsyncRef64Count * ((int)sizeof(io_user_reference_t)) }; typedef io_user_reference_t OSAsyncReference64[kOSAsyncRef64Count]; struct OSNotificationHeader64 { - mach_msg_size_t size; /* content size */ - natural_t type; - OSAsyncReference64 reference; + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference64 reference; #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) - unsigned char content[]; + unsigned char content[]; #else - unsigned char content[0]; + unsigned char content[0]; #endif }; #pragma pack(4) struct IOServiceInterestContent64 { - natural_t messageType; - io_user_reference_t messageArgument[1]; + natural_t messageType; + io_user_reference_t messageArgument[1]; }; #pragma pack() // -------------- @@ -109,27 +107,27 @@ struct IOServiceInterestContent64 { #if !KERNEL_USER32 enum { - kOSAsyncRefCount = 8, - kOSAsyncRefSize = 32 + kOSAsyncRefCount = 8, + kOSAsyncRefSize = 32 }; typedef natural_t OSAsyncReference[kOSAsyncRefCount]; struct OSNotificationHeader { - mach_msg_size_t size; /* content size */ - natural_t type; - OSAsyncReference reference; + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference reference; #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) - unsigned char content[]; + unsigned char content[]; #else - unsigned char content[0]; + unsigned char content[0]; #endif }; #pragma pack(4) struct IOServiceInterestContent { - natural_t messageType; - void * messageArgument[1]; + natural_t messageType; + void *messageArgument[1]; }; #pragma pack() @@ -138,9 +136,9 @@ struct IOServiceInterestContent { struct IOAsyncCompletionContent { IOReturn result; #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) - void * args[] __attribute__ ((packed)); + void *args[] __attribute__((packed)); #else - void * args[0] __attribute__ ((packed)); + void *args[0] __attribute__((packed)); #endif }; @@ -155,4 +153,3 @@ typedef struct IOAsyncCompletionContent IOAsyncCompletionContent; #endif #endif /* __OS_OSMESSAGENOTIFICATION_H */ - diff --git a/IOKit/hid/IOHIDDisplay.h b/IOKit/hid/IOHIDDisplay.h index e71efedf..f4b763d8 100644 --- a/IOKit/hid/IOHIDDisplay.h +++ b/IOKit/hid/IOHIDDisplay.h @@ -40,8 +40,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if __cplusplus extern "C" { #endif - - typedef struct __IOHIDDisplay + +typedef struct __IOHIDDisplay #if 0 { CFRuntimeBase _base; // 0, 4 @@ -72,60 +72,59 @@ extern "C" { CFTimeInterval fadePeriod; // 84 } #endif - * IOHIDDisplayRef; - + *IOHIDDisplayRef; + #pragma mark - #pragma mark Creators - - CFTypeID IOHIDDisplayGetTypeID(void); - IOHIDDisplayRef _IOHIDDisplayCreate(CFAllocatorRef allocator, io_service_t service); - + +CFTypeID IOHIDDisplayGetTypeID(void); +IOHIDDisplayRef _IOHIDDisplayCreate(CFAllocatorRef allocator, io_service_t service); + #pragma mark - #pragma mark Accessors - - float _IOHIDDisplayGetAmbient(IOHIDDisplayRef display); - void _IOHIDDisplaySetAmbient(IOHIDDisplayRef display, float ambient); - - float _IOHIDDisplayGetBrightness(IOHIDDisplayRef display); - void _IOHIDDisplaySetBrightness(IOHIDDisplayRef display, float brightness); - void _IOHIDDisplaySetBrightnessMax(IOHIDDisplayRef display, float brightnessMax); - - void _IOHIDDisplaySetBrightnessFactor(IOHIDDisplayRef display, float factor); - float _IOHIDDisplayGetBrightnessFactor(IOHIDDisplayRef display); - - void IOHIDDisplaySetProperty(IOHIDDisplayRef display, CFStringRef property, CFTypeRef value); - CFTypeRef IOHIDDisplayGetProperty(IOHIDDisplayRef display, CFStringRef property); - - CFTypeRef _IOHIDDisplayGetClient(IOHIDDisplayRef display); - + +float _IOHIDDisplayGetAmbient(IOHIDDisplayRef display); +void _IOHIDDisplaySetAmbient(IOHIDDisplayRef display, float ambient); + +float _IOHIDDisplayGetBrightness(IOHIDDisplayRef display); +void _IOHIDDisplaySetBrightness(IOHIDDisplayRef display, float brightness); +void _IOHIDDisplaySetBrightnessMax(IOHIDDisplayRef display, float brightnessMax); + +void _IOHIDDisplaySetBrightnessFactor(IOHIDDisplayRef display, float factor); +float _IOHIDDisplayGetBrightnessFactor(IOHIDDisplayRef display); + +void IOHIDDisplaySetProperty(IOHIDDisplayRef display, CFStringRef property, CFTypeRef value); +CFTypeRef IOHIDDisplayGetProperty(IOHIDDisplayRef display, CFStringRef property); + +CFTypeRef _IOHIDDisplayGetClient(IOHIDDisplayRef display); + #pragma mark - #pragma mark Actions - - void _IOHIDDisplayUnscheduleWithRunLoop(IOHIDDisplayRef display, CFRunLoopRef runloop, CFStringRef mode); - void _IOHIDDisplayScheduleWithRunLoop(IOHIDDisplayRef display, CFRunLoopRef runloop, CFStringRef mode); - - IOHIDNotificationRef IOHIDDisplayCreateRemovalNotification(IOHIDDisplayRef display, IOHIDNotificationCallback callback, void* target, void* refcon); - - Boolean _IOHIDDisplayOpen(IOHIDDisplayRef display, CFTypeRef client); - void _IOHIDDisplayClose(IOHIDDisplayRef display, CFTypeRef client); - + +void _IOHIDDisplayUnscheduleWithRunLoop(IOHIDDisplayRef display, CFRunLoopRef runloop, CFStringRef mode); +void _IOHIDDisplayScheduleWithRunLoop(IOHIDDisplayRef display, CFRunLoopRef runloop, CFStringRef mode); + +IOHIDNotificationRef IOHIDDisplayCreateRemovalNotification(IOHIDDisplayRef display, IOHIDNotificationCallback callback, void *target, void *refcon); + +Boolean _IOHIDDisplayOpen(IOHIDDisplayRef display, CFTypeRef client); +void _IOHIDDisplayClose(IOHIDDisplayRef display, CFTypeRef client); + #pragma mark - #pragma mark Constants - - static const CFStringRef kIOHIDDisplayPropertyBrightness = CFSTR("DisplayBrightness"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessAuto = CFSTR("DisplayBrightnessAuto"); // boolean - static const CFStringRef kIOHIDDisplayPropertyBrightnessMin = CFSTR("DisplayBrightnessMin"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessMax = CFSTR("DisplayBrightnessMax"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessAutoWeightMax = CFSTR("DisplayBrightnessAutoWeightMax"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessAutoWeightMin = CFSTR("DisplayBrightnessAutoWeightMin"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessFactor = CFSTR("DisplayBrightnessFactor"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessFactorWithFade = CFSTR("DisplayBrightnessFactorWithFade"); // float - static const CFStringRef kIOHIDDisplayPropertyBrightnessFadePeriod = CFSTR("DisplayBrightnessFadePeriod"); // float - static const CFStringRef kIOHIDDisplayPropertyLogLevel = CFSTR("LogLevel"); // int - + +static const CFStringRef kIOHIDDisplayPropertyBrightness = CFSTR("DisplayBrightness"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessAuto = CFSTR("DisplayBrightnessAuto"); // boolean +static const CFStringRef kIOHIDDisplayPropertyBrightnessMin = CFSTR("DisplayBrightnessMin"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessMax = CFSTR("DisplayBrightnessMax"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessAutoWeightMax = CFSTR("DisplayBrightnessAutoWeightMax"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessAutoWeightMin = CFSTR("DisplayBrightnessAutoWeightMin"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessFactor = CFSTR("DisplayBrightnessFactor"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessFactorWithFade = CFSTR("DisplayBrightnessFactorWithFade"); // float +static const CFStringRef kIOHIDDisplayPropertyBrightnessFadePeriod = CFSTR("DisplayBrightnessFadePeriod"); // float +static const CFStringRef kIOHIDDisplayPropertyLogLevel = CFSTR("LogLevel"); // int + #if __cplusplus } #endif #endif - diff --git a/IOKit/hid/IOHIDEvent.h b/IOKit/hid/IOHIDEvent.h index 1ea306c8..75d68432 100644 --- a/IOKit/hid/IOHIDEvent.h +++ b/IOKit/hid/IOHIDEvent.h @@ -44,8 +44,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if __cplusplus extern "C" { #endif - - typedef struct __IOHIDEvent + +typedef struct __IOHIDEvent #if 0 { CFRuntimeBase base; // 0, 4 @@ -61,47 +61,47 @@ extern "C" { void record[]; } #endif - * IOHIDEventRef; - + *IOHIDEventRef; + #pragma mark - #pragma mark GetTypeID - - /*! @function IOHIDEventGetTypeID */ - CFTypeID IOHIDEventGetTypeID(void); - + +/*! @function IOHIDEventGetTypeID */ +CFTypeID IOHIDEventGetTypeID(void); + #pragma mark - #pragma mark Generic creation functions - - IOHIDEventRef IOHIDEventCreateCopy(CFAllocatorRef allocator, IOHIDEventRef event); - /*! @function IOHIDEventCreate + +IOHIDEventRef IOHIDEventCreateCopy(CFAllocatorRef allocator, IOHIDEventRef event); +/*! @function IOHIDEventCreate @abstract Create an IOHIDEvent. @discussion All event-specific parameters are zeroed. */ - IOHIDEventRef IOHIDEventCreate(CFAllocatorRef allocator, IOHIDEventType type, AbsoluteTime timeStamp, IOOptionBits options); - - CFMutableDataRef IOHIDEventCreateData(CFAllocatorRef allocator, IOHIDEventRef event); - IOHIDEventRef IOHIDEventCreateWithData(CFAllocatorRef allocator, CFDataRef data); - +IOHIDEventRef IOHIDEventCreate(CFAllocatorRef allocator, IOHIDEventType type, AbsoluteTime timeStamp, IOOptionBits options); + +CFMutableDataRef IOHIDEventCreateData(CFAllocatorRef allocator, IOHIDEventRef event); +IOHIDEventRef IOHIDEventCreateWithData(CFAllocatorRef allocator, CFDataRef data); + #pragma mark - #pragma mark Predefined creation functions - - IOHIDEventRef IOHIDEventCreateProgressEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, - uint32_t eventType, IOHIDFloat level, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateVendorDefinedEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, - uint16_t usagePage, uint16_t usage, uint32_t version, const uint8_t* data, uint32_t length, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateSwipeEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDSwipeMask swipeMask, IOOptionBits options); - - /*! @function IOHIDEventCreateDigitizerEvent + +IOHIDEventRef IOHIDEventCreateProgressEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, + uint32_t eventType, IOHIDFloat level, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateVendorDefinedEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, + uint16_t usagePage, uint16_t usage, uint32_t version, const uint8_t *data, uint32_t length, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateSwipeEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDSwipeMask swipeMask, IOOptionBits options); + +/*! @function IOHIDEventCreateDigitizerEvent @abstract Create a digitizer event. You should use the more specialized methods instead. */ - IOHIDEventRef IOHIDEventCreateDigitizerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDDigitizerTransducerType type, - uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, - Boolean range, Boolean touch, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateDigitizerFingerEventWithQuality(CFAllocatorRef allocator, AbsoluteTime timeStamp, - uint32_t index, uint32_t identity, uint32_t eventMask, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat twist, - IOHIDFloat minorRadius, IOHIDFloat majorRadius, IOHIDFloat quality, IOHIDFloat density, IOHIDFloat irregularity, - Boolean range, Boolean touch, IOOptionBits options); - /*! @function IOHIDEventCreateDigitizerFingerEvent +IOHIDEventRef IOHIDEventCreateDigitizerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDDigitizerTransducerType type, + uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, + Boolean range, Boolean touch, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateDigitizerFingerEventWithQuality(CFAllocatorRef allocator, AbsoluteTime timeStamp, + uint32_t index, uint32_t identity, uint32_t eventMask, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat twist, + IOHIDFloat minorRadius, IOHIDFloat majorRadius, IOHIDFloat quality, IOHIDFloat density, IOHIDFloat irregularity, + Boolean range, Boolean touch, IOOptionBits options); +/*! @function IOHIDEventCreateDigitizerFingerEvent @abstract Create a finger digitizer event with default qualities. @discussion The default qualities are: - minorRadius = 5 mm, @@ -109,109 +109,109 @@ extern "C" { - quality = 1, - density = 1, - irregularity = 1. */ - IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, - uint32_t index, uint32_t identity, uint32_t eventMask, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat twist, - Boolean range, Boolean touch, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateDigitizerStylusEventWithPolarOrientation(CFAllocatorRef allocator, AbsoluteTime timeStamp, - uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, - IOHIDFloat twist, IOHIDFloat altitude, IOHIDFloat azimuth, - Boolean range, Boolean invert, IOOptionBits options); - /*! @function IOHIDEventCreateDigitizerStylusEvent +IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, + uint32_t index, uint32_t identity, uint32_t eventMask, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat twist, + Boolean range, Boolean touch, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateDigitizerStylusEventWithPolarOrientation(CFAllocatorRef allocator, AbsoluteTime timeStamp, + uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, + IOHIDFloat twist, IOHIDFloat altitude, IOHIDFloat azimuth, + Boolean range, Boolean invert, IOOptionBits options); +/*! @function IOHIDEventCreateDigitizerStylusEvent @discussion Same as IOHIDEventCreateDigitizerStylusEventWithPolarOrientation? */ - IOHIDEventRef IOHIDEventCreateDigitizerStylusEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, - uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, - IOHIDFloat twist, IOHIDFloat altitude, IOHIDFloat azimuth, - Boolean range, Boolean invert, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateDigitizerStylusEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, + uint32_t index, uint32_t identity, uint32_t eventMask, uint32_t buttonMask, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat barrelPressure, + IOHIDFloat twist, IOHIDFloat altitude, IOHIDFloat azimuth, + Boolean range, Boolean invert, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateProximtyEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDProximityDetectionMask detectionMask, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateProximtyEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDProximityDetectionMask detectionMask, IOOptionBits options); #define IOHIDEventCreateProximityEvent IOHIDEventCreateProximtyEvent - IOHIDEventRef IOHIDEventCreateAmbientLightSensorEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat level, IOOptionBits options); - - /*! @function IOHIDEventCreateMouseEvent +IOHIDEventRef IOHIDEventCreateAmbientLightSensorEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat level, IOOptionBits options); + +/*! @function IOHIDEventCreateMouseEvent @abstract Create an mouse event, with pressure of 1.0. */ - IOHIDEventRef IOHIDEventCreateMouseEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, uint32_t buttonMask, IOOptionBits options); - /*! @function IOHIDEventCreateMouseEventWithPressure +IOHIDEventRef IOHIDEventCreateMouseEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, uint32_t buttonMask, IOOptionBits options); +/*! @function IOHIDEventCreateMouseEventWithPressure @abstract Create an mouse event with pressure. @discussion The mouse is considered clicked when the pressure is > 0.15. */ - IOHIDEventRef IOHIDEventCreateMouseEventWithPressure(CFAllocatorRef allocator, AbsoluteTime timeStamp, - IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, uint32_t buttonMask, IOHIDFloat pressure, IOOptionBits options); - /*! @function IOHIDEventCreateButtonEvent +IOHIDEventRef IOHIDEventCreateMouseEventWithPressure(CFAllocatorRef allocator, AbsoluteTime timeStamp, + IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, uint32_t buttonMask, IOHIDFloat pressure, IOOptionBits options); +/*! @function IOHIDEventCreateButtonEvent @abstract Create an button event, with pressure of 1.0. */ - IOHIDEventRef IOHIDEventCreateButtonEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint32_t buttonMask, IOOptionBits options); - /*! @function IOHIDEventCreateButtonEventWithPressure +IOHIDEventRef IOHIDEventCreateButtonEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint32_t buttonMask, IOOptionBits options); +/*! @function IOHIDEventCreateButtonEventWithPressure @abstract Create an button event with pressure. @discussion The button is considered pressed when the pressure is > 0.15. */ - IOHIDEventRef IOHIDEventCreateButtonEventWithPressure(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint32_t buttonMask, IOHIDFloat pressure, IOOptionBits options); - - IOHIDEventRef IOHIDEventCreateKeyboardEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint16_t usagePage, uint16_t usage, Boolean down, IOHIDEventOptionBits flags); - - IOHIDEventRef IOHIDEventCreateAccelerometerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreatePolarOrientationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateOrientationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateVelocityEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateScaleEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateScrollEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateRotationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - IOHIDEventRef IOHIDEventCreateTranslationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); - +IOHIDEventRef IOHIDEventCreateButtonEventWithPressure(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint32_t buttonMask, IOHIDFloat pressure, IOOptionBits options); + +IOHIDEventRef IOHIDEventCreateKeyboardEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint16_t usagePage, uint16_t usage, Boolean down, IOHIDEventOptionBits flags); + +IOHIDEventRef IOHIDEventCreateAccelerometerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreatePolarOrientationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateOrientationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateVelocityEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateScaleEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateScrollEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateRotationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); +IOHIDEventRef IOHIDEventCreateTranslationEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOOptionBits options); + #pragma mark - #pragma mark Accessors - - IOHIDEventType IOHIDEventGetType(IOHIDEventRef event); - - AbsoluteTime IOHIDEventGetTimeStamp(IOHIDEventRef event); - void IOHIDEventSetTimeStamp(IOHIDEventRef event, AbsoluteTime timeStamp); - - uint32_t IOHIDEventGetEventFlags(IOHIDEventRef event); - void IOHIDEventSetEventFlags(IOHIDEventRef event, uint32_t eventFlags); - Boolean IOHIDEventIsAbsolute(IOHIDEventRef event); - - IOHIDEventRef IOHIDEventGetParent(IOHIDEventRef event); - CFArrayRef IOHIDEventGetChildren(IOHIDEventRef event); - - void IOHIDEventGetVendorDefinedData(IOHIDEventRef event, uint32_t* length, uint8_t** data); + +IOHIDEventType IOHIDEventGetType(IOHIDEventRef event); + +AbsoluteTime IOHIDEventGetTimeStamp(IOHIDEventRef event); +void IOHIDEventSetTimeStamp(IOHIDEventRef event, AbsoluteTime timeStamp); + +uint32_t IOHIDEventGetEventFlags(IOHIDEventRef event); +void IOHIDEventSetEventFlags(IOHIDEventRef event, uint32_t eventFlags); +Boolean IOHIDEventIsAbsolute(IOHIDEventRef event); + +IOHIDEventRef IOHIDEventGetParent(IOHIDEventRef event); +CFArrayRef IOHIDEventGetChildren(IOHIDEventRef event); + +void IOHIDEventGetVendorDefinedData(IOHIDEventRef event, uint32_t *length, uint8_t **data); #pragma mark - #pragma mark Subevents - - /*! @function IOHIDEventGetEventWithOptions + +/*! @function IOHIDEventGetEventWithOptions @abstract Get the deepest event that bears the specified type and matches the options. @discussion If any of the top 4 bits of options is set (i.e. (options & 0xF0000000) != 0), the children of this event will not be checked. */ - IOHIDEventRef IOHIDEventGetEventWithOptions(IOHIDEventRef event, IOHIDEventType type, IOOptionBits options); - /*! @function IOHIDEventGetEvent +IOHIDEventRef IOHIDEventGetEventWithOptions(IOHIDEventRef event, IOHIDEventType type, IOOptionBits options); +/*! @function IOHIDEventGetEvent @abstract Get the event that bears the specified type. @discussion Equivalent to IOHIDEventGetEventWithOptions(event, type, 0xF0000000); */ - IOHIDEventRef IOHIDEventGetEvent(IOHIDEventRef event, IOHIDEventType type); - - void IOHIDEventSetFloatValueWithOptions(IOHIDEventRef event, IOHIDEventField field, IOHIDFloat value, IOOptionBits options); - void IOHIDEventSetFloatValue(IOHIDEventRef event, IOHIDEventField field, IOHIDFloat value); - void IOHIDEventSetIntegerValueWithOptions(IOHIDEventRef event, IOHIDEventField field, int value, IOOptionBits options); - void IOHIDEventSetIntegerValue(IOHIDEventRef event, IOHIDEventField field, int value); - void IOHIDEventSetPositionWithOptions(IOHIDEventRef event, IOHIDEventField field, IOHID3DPoint position, IOOptionBits options); - void IOHIDEventSetPosition(IOHIDEventRef event, IOHIDEventField field, IOHID3DPoint position); - - IOHIDFloat IOHIDEventGetFloatValueWithOptions(IOHIDEventRef event, IOHIDEventField field, IOOptionBits options); - IOHIDFloat IOHIDEventGetFloatValue(IOHIDEventRef event, IOHIDEventField field); - int IOHIDEventGetIntegerValueWithOptions(IOHIDEventRef event, IOHIDEventField field, IOOptionBits options); - int IOHIDEventGetIntegerValue(IOHIDEventRef event, IOHIDEventField field); - IOHID3DPoint IOHIDEventGetPositionWithOptions(IOHIDEventRef event, IOHIDEventField field, IOOptionBits options); - IOHID3DPoint IOHIDEventGetPosition(IOHIDEventRef event, IOHIDEventField field); - - /*! @function IOHIDEventConformsToWithOptions +IOHIDEventRef IOHIDEventGetEvent(IOHIDEventRef event, IOHIDEventType type); + +void IOHIDEventSetFloatValueWithOptions(IOHIDEventRef event, IOHIDEventField field, IOHIDFloat value, IOOptionBits options); +void IOHIDEventSetFloatValue(IOHIDEventRef event, IOHIDEventField field, IOHIDFloat value); +void IOHIDEventSetIntegerValueWithOptions(IOHIDEventRef event, IOHIDEventField field, int value, IOOptionBits options); +void IOHIDEventSetIntegerValue(IOHIDEventRef event, IOHIDEventField field, int value); +void IOHIDEventSetPositionWithOptions(IOHIDEventRef event, IOHIDEventField field, IOHID3DPoint position, IOOptionBits options); +void IOHIDEventSetPosition(IOHIDEventRef event, IOHIDEventField field, IOHID3DPoint position); + +IOHIDFloat IOHIDEventGetFloatValueWithOptions(IOHIDEventRef event, IOHIDEventField field, IOOptionBits options); +IOHIDFloat IOHIDEventGetFloatValue(IOHIDEventRef event, IOHIDEventField field); +int IOHIDEventGetIntegerValueWithOptions(IOHIDEventRef event, IOHIDEventField field, IOOptionBits options); +int IOHIDEventGetIntegerValue(IOHIDEventRef event, IOHIDEventField field); +IOHID3DPoint IOHIDEventGetPositionWithOptions(IOHIDEventRef event, IOHIDEventField field, IOOptionBits options); +IOHID3DPoint IOHIDEventGetPosition(IOHIDEventRef event, IOHIDEventField field); + +/*! @function IOHIDEventConformsToWithOptions @abstract Returns if the event or any of its children bears the specified type and options. @discussion If any of the top 4 bits of options is set (i.e. (options & 0xF0000000) != 0), the children of this event will not be checked. */ - Boolean IOHIDEventConformsToWithOptions(IOHIDEventRef event, IOHIDEventType type, IOOptionBits options); - /*! @function IOHIDEventConformsTo +Boolean IOHIDEventConformsToWithOptions(IOHIDEventRef event, IOHIDEventType type, IOOptionBits options); +/*! @function IOHIDEventConformsTo @abstract Returns if the event bears the specified type. @discussion Equivalent to IOHIDEventConformsToWithOptions(event, type, 0xF0000000); */ - Boolean IOHIDEventConformsTo(IOHIDEventRef event, IOHIDEventType type); +Boolean IOHIDEventConformsTo(IOHIDEventRef event, IOHIDEventType type); - void IOHIDEventRemoveEvent(IOHIDEventRef event, IOHIDEventRef childEvent); - void IOHIDEventAppendEvent(IOHIDEventRef event, IOHIDEventRef childEvent); +void IOHIDEventRemoveEvent(IOHIDEventRef event, IOHIDEventRef childEvent); +void IOHIDEventAppendEvent(IOHIDEventRef event, IOHIDEventRef childEvent); #if __cplusplus } diff --git a/IOKit/hid/IOHIDEventData.h b/IOKit/hid/IOHIDEventData.h index 346dd642..cf2e0f01 100644 --- a/IOKit/hid/IOHIDEventData.h +++ b/IOKit/hid/IOHIDEventData.h @@ -29,24 +29,24 @@ #include #ifdef KERNEL - #include +#include - #define IOHIDEventRef IOHIDEvent * +#define IOHIDEventRef IOHIDEvent * #else - #include +#include - typedef struct IOHIDEventData IOHIDEventData; +typedef struct IOHIDEventData IOHIDEventData; #endif //============================================================================== // IOHIDEventData Declarations //============================================================================== -#define IOHIDEVENT_BASE \ - uint32_t size; \ - IOHIDEventType type; \ - uint64_t timestamp; \ - uint32_t options; +#define IOHIDEVENT_BASE \ + uint32_t size; \ + IOHIDEventType type; \ + uint64_t timestamp; \ + uint32_t options; /*! @typedef IOHIDEventData @@ -58,38 +58,38 @@ @field options Event specific options */ -struct IOHIDEventData{ +struct IOHIDEventData { IOHIDEVENT_BASE; }; typedef struct _IOHIDVendorDefinedEventData { IOHIDEVENT_BASE; - uint16_t usagePage; - uint16_t usage; - uint32_t version; - uint32_t length; - uint8_t data[0]; + uint16_t usagePage; + uint16_t usage; + uint32_t version; + uint32_t length; + uint8_t data[0]; } IOHIDVendorDefinedEventData; enum { - kIOHIDKeyboardIsRepeat = 0x00010000 + kIOHIDKeyboardIsRepeat = 0x00010000 }; typedef struct _IOHIDKeyboardEventData { - IOHIDEVENT_BASE; // options = kHIDKeyboardRepeat - uint16_t usagePage; - uint16_t usage; - boolean_t down; + IOHIDEVENT_BASE; // options = kHIDKeyboardRepeat + uint16_t usagePage; + uint16_t usage; + boolean_t down; } IOHIDKeyboardEventData; enum { - kIOHIDEventOptionIgnore = 0xf0000000 + kIOHIDEventOptionIgnore = 0xf0000000 }; enum { - kIOHIDTransducerRange = 0x00010000, - kIOHIDTransducerTouch = 0x00020000, - kIOHIDTransducerInvert = 0x00040000, + kIOHIDTransducerRange = 0x00010000, + kIOHIDTransducerTouch = 0x00020000, + kIOHIDTransducerInvert = 0x00040000, }; enum { @@ -99,55 +99,54 @@ enum { }; typedef uint8_t IOHIDDigitizerOrientationType; -#define IOHIDAXISEVENT_BASE \ - struct { \ - IOFixed x; \ - IOFixed y; \ - IOFixed z; \ +#define IOHIDAXISEVENT_BASE \ + struct { \ + IOFixed x; \ + IOFixed y; \ + IOFixed z; \ } position; typedef struct _IOHIDAxisEventData { - IOHIDEVENT_BASE; // options = kHIDAxisRelative + IOHIDEVENT_BASE; // options = kHIDAxisRelative IOHIDAXISEVENT_BASE; } IOHIDAxisEventData, IOHIDTranslationData, IOHIDRotationEventData, IOHIDScrollEventData, IOHIDScaleEventData, IOHIDVelocityData, IOHIDOrientationEventData; typedef struct _IOHIDAccelerometerEventData { - IOHIDEVENT_BASE; // options = kHIDAxisRelative + IOHIDEVENT_BASE; // options = kHIDAxisRelative IOHIDAXISEVENT_BASE; - uint32_t acclType; + uint32_t acclType; } IOHIDAccelerometerEventData; typedef struct _IOHIDAmbientLightSensorEventData { - IOHIDEVENT_BASE; // options = kHIDAxisRelative - uint32_t level; - uint32_t ch0; - uint32_t ch1; - Boolean brightnessChanged; + IOHIDEVENT_BASE; // options = kHIDAxisRelative + uint32_t level; + uint32_t ch0; + uint32_t ch1; + Boolean brightnessChanged; } IOHIDAmbientLightSensorEventData; typedef struct _IOHIDTemperatureEventData { IOHIDEVENT_BASE; - IOFixed level; + IOFixed level; } IOHIDTemperatureEventData; typedef struct _IOHIDProximityEventData { IOHIDEVENT_BASE; - uint32_t detectionMask; + uint32_t detectionMask; } IOHIDProximityEventData; typedef struct _IOHIDProgressEventData { IOHIDEVENT_BASE; - uint32_t eventType; - IOFixed level; + uint32_t eventType; + IOFixed level; } IOHIDProgressEventData; - -#define IOHIDBUTTONEVENT_BASE \ - struct { \ - uint32_t buttonMask; \ - IOFixed pressure; \ - uint8_t buttonNumber; \ - uint8_t clickState; \ +#define IOHIDBUTTONEVENT_BASE \ + struct { \ + uint32_t buttonMask; \ + IOFixed pressure; \ + uint8_t buttonNumber; \ + uint8_t clickState; \ } button; typedef struct _IOHIDButtonEventData { @@ -161,41 +160,40 @@ typedef struct _IOHIDMouseEventData { IOHIDBUTTONEVENT_BASE; } IOHIDMouseEventData; - typedef struct _IOHIDDigitizerEventData { - IOHIDEVENT_BASE; // options = kIOHIDTransducerRange, kHIDTransducerTouch, kHIDTransducerInvert - IOHIDAXISEVENT_BASE; // 3c, 40, 44 - - uint32_t transducerIndex; - uint32_t transducerType; // could overload this to include that both the hand and finger id. - uint32_t identity; // Specifies a unique ID of the current transducer action. - uint32_t eventMask; // the type of event that has occurred: range, touch, position - uint32_t childEventMask; // CHILD: the type of event that has occurred: range, touch, position - - uint32_t buttonMask; // Bit field representing the current button state - // Pressure field are assumed to be scaled from 0.0 to 1.0 - IOFixed tipPressure; // Force exerted against the digitizer surface by the transducer. - IOFixed barrelPressure; // Force exerted directly by the user on a transducer sensor. - - IOFixed twist; // Specifies the clockwise rotation of the cursor around its own major axis. Unsure it the device should declare units via properties or event. My first inclination is force degrees as the is the unit already expected by AppKit, Carbon and OpenGL. - uint32_t orientationType; // Specifies the orientation type used by the transducer. + IOHIDEVENT_BASE; // options = kIOHIDTransducerRange, kHIDTransducerTouch, kHIDTransducerInvert + IOHIDAXISEVENT_BASE; // 3c, 40, 44 + + uint32_t transducerIndex; + uint32_t transducerType; // could overload this to include that both the hand and finger id. + uint32_t identity; // Specifies a unique ID of the current transducer action. + uint32_t eventMask; // the type of event that has occurred: range, touch, position + uint32_t childEventMask; // CHILD: the type of event that has occurred: range, touch, position + + uint32_t buttonMask; // Bit field representing the current button state + // Pressure field are assumed to be scaled from 0.0 to 1.0 + IOFixed tipPressure; // Force exerted against the digitizer surface by the transducer. + IOFixed barrelPressure; // Force exerted directly by the user on a transducer sensor. + + IOFixed twist; // Specifies the clockwise rotation of the cursor around its own major axis. Unsure it the device should declare units via properties or event. My first inclination is force degrees as the is the unit already expected by AppKit, Carbon and OpenGL. + uint32_t orientationType; // Specifies the orientation type used by the transducer. union { - struct { // X Tilt and Y Tilt are used together to specify the tilt away from normal of a digitizer transducer. In its normal position, the values of X Tilt and Y Tilt for a transducer are both zero. - IOFixed x; // This quantity is used in conjunction with Y Tilt to represent the tilt away from normal of a transducer, such as a stylus. The X Tilt value represents the plane angle between the Y-Z plane and the plane containing the transducer axis and the Y axis. A positive X Tilt is to the right. - IOFixed y; // This value represents the angle between the X-Z and transducer-X planes. A positive Y Tilt is toward the user. + struct { // X Tilt and Y Tilt are used together to specify the tilt away from normal of a digitizer transducer. In its normal position, the values of X Tilt and Y Tilt for a transducer are both zero. + IOFixed x; // This quantity is used in conjunction with Y Tilt to represent the tilt away from normal of a transducer, such as a stylus. The X Tilt value represents the plane angle between the Y-Z plane and the plane containing the transducer axis and the Y axis. A positive X Tilt is to the right. + IOFixed y; // This value represents the angle between the X-Z and transducer-X planes. A positive Y Tilt is toward the user. } tilt; - struct { // X Tilt and Y Tilt are used together to specify the tilt away from normal of a digitizer transducer. In its normal position, the values of X Tilt and Y Tilt for a transducer are both zero. - IOFixed altitude; //The angle with the X-Y plane though a signed, semicicular range. Positive values specify an angle downward and toward the positive Z axis. - IOFixed azimuth; // Specifies the counter clockwise rotation of the cursor around the Z axis though a full circular range. + struct { // X Tilt and Y Tilt are used together to specify the tilt away from normal of a digitizer transducer. In its normal position, the values of X Tilt and Y Tilt for a transducer are both zero. + IOFixed altitude; //The angle with the X-Y plane though a signed, semicicular range. Positive values specify an angle downward and toward the positive Z axis. + IOFixed azimuth; // Specifies the counter clockwise rotation of the cursor around the Z axis though a full circular range. } polar; struct { - IOFixed quality; // If set, indicates that the transducer is sensed to be in a relatively noise-free region of digitizing. - IOFixed density; - IOFixed irregularity; - IOFixed majorRadius; // units in mm - IOFixed minorRadius; // units in mm + IOFixed quality; // If set, indicates that the transducer is sensed to be in a relatively noise-free region of digitizing. + IOFixed density; + IOFixed irregularity; + IOFixed majorRadius; // units in mm + IOFixed minorRadius; // units in mm } quality; - }orientation; + } orientation; } IOHIDDigitizerEventData; typedef struct _IOHIDSwipeEventData { @@ -203,7 +201,6 @@ typedef struct _IOHIDSwipeEventData { IOHIDSwipeMask swipeMask; } IOHIDSwipeEventData; - /*! @typedef IOHIDSystemQueueElement @abstract Memory structure defining the layout of each event queue element @@ -221,11 +218,11 @@ typedef struct _IOHIDSwipeEventData { pertinent event data */ typedef struct _IOHIDSystemQueueElement { - uint64_t timeStamp; - uint64_t deviceID; - uint32_t options; - uint32_t eventCount; - IOHIDEventData events[]; + uint64_t timeStamp; + uint64_t deviceID; + uint32_t options; + uint32_t eventCount; + IOHIDEventData events[]; } IOHIDSystemQueueElement; //****************************************************************************** @@ -234,787 +231,744 @@ typedef struct _IOHIDSystemQueueElement { #define IOHIDEventFieldEventType(field) ((field >> 16) & 0xffff) #define IOHIDEventFieldOffset(field) (field & 0xffff) -#define IOHIDEventGetSize(type,size) \ -{ \ - switch ( type ) { \ - case kIOHIDEventTypeNULL: \ - size = sizeof(IOHIDEventData);\ - break; \ - case kIOHIDEventTypeVendorDefined:\ - size = sizeof(IOHIDVendorDefinedEventData);\ - break; \ - case kIOHIDEventTypeKeyboard: \ - size = sizeof(IOHIDKeyboardEventData);\ - break; \ - case kIOHIDEventTypeTranslation:\ - case kIOHIDEventTypeRotation: \ - case kIOHIDEventTypeScroll: \ - case kIOHIDEventTypeScale: \ - case kIOHIDEventTypeVelocity: \ - case kIOHIDEventTypeOrientation:\ - size = sizeof(IOHIDAxisEventData);\ - break; \ - case kIOHIDEventTypeAccelerometer:\ - size = sizeof(IOHIDAccelerometerEventData);\ - break;\ - case kIOHIDEventTypeAmbientLightSensor:\ - size = sizeof(IOHIDAmbientLightSensorEventData);\ - break; \ - case kIOHIDEventTypeProximity: \ - size = sizeof(IOHIDProximityEventData);\ - break; \ - case kIOHIDEventTypeButton: \ - size = sizeof(IOHIDButtonEventData);\ - break; \ - case kIOHIDEventTypeDigitizer: \ - size = sizeof(IOHIDDigitizerEventData);\ - break; \ - case kIOHIDEventTypeTemperature:\ - size = sizeof(IOHIDTemperatureEventData);\ - break; \ - case kIOHIDEventTypeSwipe:\ - size = sizeof(IOHIDSwipeEventData);\ - break; \ - case kIOHIDEventTypeMouse:\ - size = sizeof(IOHIDMouseEventData);\ - break; \ - case kIOHIDEventTypeProgress:\ - size = sizeof(IOHIDProgressEventData);\ - break; \ - default: \ - size = 0; \ - break; \ - } \ -} -#define IOHIDEventGetQueueElementSize(type,size)\ -{ \ - IOHIDEventGetSize(type,size); \ - size += sizeof(IOHIDSystemQueueElement); \ -} +#define IOHIDEventGetSize(type, size) \ + { \ + switch (type) { \ + case kIOHIDEventTypeNULL: \ + size = sizeof(IOHIDEventData); \ + break; \ + case kIOHIDEventTypeVendorDefined: \ + size = sizeof(IOHIDVendorDefinedEventData); \ + break; \ + case kIOHIDEventTypeKeyboard: \ + size = sizeof(IOHIDKeyboardEventData); \ + break; \ + case kIOHIDEventTypeTranslation: \ + case kIOHIDEventTypeRotation: \ + case kIOHIDEventTypeScroll: \ + case kIOHIDEventTypeScale: \ + case kIOHIDEventTypeVelocity: \ + case kIOHIDEventTypeOrientation: \ + size = sizeof(IOHIDAxisEventData); \ + break; \ + case kIOHIDEventTypeAccelerometer: \ + size = sizeof(IOHIDAccelerometerEventData); \ + break; \ + case kIOHIDEventTypeAmbientLightSensor: \ + size = sizeof(IOHIDAmbientLightSensorEventData); \ + break; \ + case kIOHIDEventTypeProximity: \ + size = sizeof(IOHIDProximityEventData); \ + break; \ + case kIOHIDEventTypeButton: \ + size = sizeof(IOHIDButtonEventData); \ + break; \ + case kIOHIDEventTypeDigitizer: \ + size = sizeof(IOHIDDigitizerEventData); \ + break; \ + case kIOHIDEventTypeTemperature: \ + size = sizeof(IOHIDTemperatureEventData); \ + break; \ + case kIOHIDEventTypeSwipe: \ + size = sizeof(IOHIDSwipeEventData); \ + break; \ + case kIOHIDEventTypeMouse: \ + size = sizeof(IOHIDMouseEventData); \ + break; \ + case kIOHIDEventTypeProgress: \ + size = sizeof(IOHIDProgressEventData); \ + break; \ + default: \ + size = 0; \ + break; \ + } \ + } +#define IOHIDEventGetQueueElementSize(type, size) \ + { \ + IOHIDEventGetSize(type, size); \ + size += sizeof(IOHIDSystemQueueElement); \ + } #ifdef KERNEL - #ifdef HIDEVENTFIXED - #define IOHIDEventValueFloat(value) (value) - #define IOHIDEventValueFixed(value) (value) - #else - #define IOHIDEventValueFloat(value) (value >> 16) - #define IOHIDEventValueFixed(value) (value << 16) - #endif - #define IOHIDEventGetEventWithOptions(event, type, options) event->getEvent(type, options) - #define GET_EVENTDATA(event) event->_data +#ifdef HIDEVENTFIXED +#define IOHIDEventValueFloat(value) (value) +#define IOHIDEventValueFixed(value) (value) +#else +#define IOHIDEventValueFloat(value) (value >> 16) +#define IOHIDEventValueFixed(value) (value << 16) +#endif +#define IOHIDEventGetEventWithOptions(event, type, options) event->getEvent(type, options) +#define GET_EVENTDATA(event) event->_data #else - #define IOHIDEventValueFloat(value) (value / 65536.0) - #define IOHIDEventValueFixed(value) (value * 65536) - #define GET_EVENTDATA(event) event->eventData +#define IOHIDEventValueFloat(value) (value / 65536.0) +#define IOHIDEventValueFixed(value) (value * 65536) +#define GET_EVENTDATA(event) event->eventData #endif //============================================================================== // IOHIDEventGetValue MACRO //============================================================================== -#define GET_EVENTDATA_VALUE(eventData, fieldEvType, fieldOffset, value)\ -{ \ - switch ( fieldEvType ) { \ - case kIOHIDEventTypeNULL: \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldIsRelative): \ - value = (eventData->options & kIOHIDEventOptionIsAbsolute) == 0; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldIsCollection): \ - value = (eventData->options & kIOHIDEventOptionIsCollection) != 0; \ - break; \ - }; break; \ - case kIOHIDEventTypeVendorDefined: \ - { \ - IOHIDVendorDefinedEventData * sysDef = (IOHIDVendorDefinedEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsagePage): \ - value = sysDef->usagePage; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsage): \ - value = sysDef->usage; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedVersion): \ - value = sysDef->version; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedDataLength): \ - value = sysDef->length; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedData): \ - if (sysDef->data) \ - value = *((typeof(value)*) sysDef->data); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeProgress: \ - { \ - IOHIDProgressEventData * progress = (IOHIDProgressEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldProgressEventType): \ - value = progress->eventType; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldProgressLevel): \ - value = IOHIDEventValueFloat(progress->level); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeButton: \ - { \ - IOHIDButtonEventData * button = (IOHIDButtonEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonMask): \ - value = button->button.buttonMask; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonNumber): \ - value = button->button.buttonNumber; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonClickCount): \ - value = button->button.clickState; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonPressure): \ - value = IOHIDEventValueFloat(button->button.pressure); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeAccelerometer: \ - { \ - IOHIDAccelerometerEventData * accl = (IOHIDAccelerometerEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ - value = IOHIDEventValueFloat(accl->position.x); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ - value = IOHIDEventValueFloat(accl->position.y); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ - value = IOHIDEventValueFloat(accl->position.z); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerType): \ - value = accl->acclType; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeMouse: \ - { \ - IOHIDMouseEventData * mouse = (IOHIDMouseEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseX): \ - value = IOHIDEventValueFloat(mouse->position.x); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseY): \ - value = IOHIDEventValueFloat(mouse->position.y); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseZ): \ - value = IOHIDEventValueFloat(mouse->position.z); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseButtonMask): \ - value = mouse->button.buttonMask; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseNumber): \ - value = mouse->button.buttonNumber; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseClickCount): \ - value = mouse->button.clickState; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMousePressure): \ - value = IOHIDEventValueFloat(mouse->button.pressure); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeSwipe: \ - { \ - IOHIDSwipeEventData * swipe = (IOHIDSwipeEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldSwipeMask): \ - value = swipe->swipeMask; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeTemperature: \ - { \ - IOHIDTemperatureEventData * temp = (IOHIDTemperatureEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTemperatureLevel): \ - value = IOHIDEventValueFloat(temp->level);\ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeTranslation: \ - case kIOHIDEventTypeRotation: \ - case kIOHIDEventTypeScroll: \ - case kIOHIDEventTypeScale: \ - case kIOHIDEventTypeVelocity: \ - case kIOHIDEventTypeOrientation: \ - { \ - IOHIDAxisEventData * axis = (IOHIDAxisEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationX): \ - /* \ - case IOHIDEventFieldOffset(kIOHIDEventFieldRotationX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScaleX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX); \ - case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationRadius): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ - */ \ - value = IOHIDEventValueFloat(axis->position.x); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationY): \ - /* \ - case IOHIDEventFieldOffset(kIOHIDEventFieldRotationY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScaleY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY); \ - case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAzimuth): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ - */ \ - value = IOHIDEventValueFloat(axis->position.y); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationZ): \ - /* \ - case IOHIDEventFieldOffset(kIOHIDEventFieldRotationZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScaleZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ); \ - case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAltitude):\ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ - */ \ - value = IOHIDEventValueFloat(axis->position.z); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollIsPixels): \ - value = ((axis->options & kIOHIDEventOptionPixelUnits) != 0);\ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeAmbientLightSensor: \ - { \ - IOHIDAmbientLightSensorEventData * alsEvent = (IOHIDAmbientLightSensorEventData *)eventData;\ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorLevel): \ - value = alsEvent->level; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel0): \ - value = alsEvent->ch0; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel1): \ - value = alsEvent->ch1; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightDisplayBrightnessChanged): \ - value = alsEvent->brightnessChanged; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeProximity: \ - { \ - IOHIDProximityEventData * proxEvent = (IOHIDProximityEventData *)eventData;\ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldProximityDetectionMask): \ - value = proxEvent->detectionMask; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeKeyboard: \ - { \ - IOHIDKeyboardEventData * keyEvent = (IOHIDKeyboardEventData *)eventData;\ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsagePage): \ - value = keyEvent->usagePage; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsage): \ - value = keyEvent->usage; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardDown): \ - value = keyEvent->down; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardRepeat): \ - value = (keyEvent->options & kIOHIDKeyboardIsRepeat);\ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeDigitizer: \ - { \ - IOHIDDigitizerEventData * digEvent = (IOHIDDigitizerEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX): \ - value = IOHIDEventValueFloat(digEvent->position.x); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY): \ - value = IOHIDEventValueFloat(digEvent->position.y); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ): \ - value = IOHIDEventValueFloat(digEvent->position.z); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerButtonMask): \ - value = digEvent->buttonMask; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIndex): \ - value = digEvent->transducerIndex; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIdentity): \ - value = digEvent->identity; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerEventMask): \ - value = digEvent->eventMask; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerChildEventMask): \ - value = digEvent->childEventMask; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerRange): \ - value = (digEvent->options & kIOHIDTransducerRange) != 0;\ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTouch): \ - value = (digEvent->options & kIOHIDTransducerTouch) != 0;\ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerCollection): \ - value = (digEvent->options & kIOHIDEventOptionIsCollection) != 0;\ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerPressure): \ - value = IOHIDEventValueFloat(digEvent->tipPressure); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerBarrelPressure): \ - value = IOHIDEventValueFloat(digEvent->barrelPressure); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTwist): \ - value = IOHIDEventValueFloat(digEvent->twist); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ - switch ( digEvent->orientationType ) {\ - case kIOHIDDigitizerOrientationTypeTilt:\ - switch ( fieldOffset ) {\ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ - value = IOHIDEventValueFloat(digEvent->orientation.tilt.x); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ - value = IOHIDEventValueFloat(digEvent->orientation.tilt.y); \ - break; \ - }; \ - break; \ - case kIOHIDDigitizerOrientationTypePolar:\ - switch ( fieldOffset ) {\ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAltitude): \ - value = IOHIDEventValueFloat(digEvent->orientation.polar.altitude); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAzimuth): \ - value = IOHIDEventValueFloat(digEvent->orientation.polar.azimuth); \ - break; \ - }; \ - break; \ - case kIOHIDDigitizerOrientationTypeQuality:\ - switch ( fieldOffset ) {\ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ - value = IOHIDEventValueFloat(digEvent->orientation.quality.quality); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ - value = IOHIDEventValueFloat(digEvent->orientation.quality.density); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ - value = IOHIDEventValueFloat(digEvent->orientation.quality.irregularity); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ - value = IOHIDEventValueFloat(digEvent->orientation.quality.majorRadius); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ - value = IOHIDEventValueFloat(digEvent->orientation.quality.minorRadius); \ - break; \ - }; \ - break; \ - }; \ - break; \ - }; \ - } \ - break; \ - }; \ -} - -#define GET_EVENT_VALUE(event, field, value, options) \ -{ IOHIDEventType fieldEvType = IOHIDEventFieldEventType(field); \ - uint32_t fieldOffset = IOHIDEventFieldOffset(field); \ - IOHIDEventRef ev = NULL; \ - if ( (ev = IOHIDEventGetEventWithOptions(event, fieldEvType, options)) ) {\ - GET_EVENTDATA_VALUE(GET_EVENTDATA(ev),fieldEvType,fieldOffset,value);\ - } \ -} +#define GET_EVENTDATA_VALUE(eventData, fieldEvType, fieldOffset, value) \ + { \ + switch (fieldEvType) { \ + case kIOHIDEventTypeNULL: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldIsRelative): \ + value = (eventData->options & kIOHIDEventOptionIsAbsolute) == 0; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldIsCollection): \ + value = (eventData->options & kIOHIDEventOptionIsCollection) != 0; \ + break; \ + }; \ + break; \ + case kIOHIDEventTypeVendorDefined: { \ + IOHIDVendorDefinedEventData *sysDef = (IOHIDVendorDefinedEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsagePage): \ + value = sysDef->usagePage; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsage): \ + value = sysDef->usage; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedVersion): \ + value = sysDef->version; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedDataLength): \ + value = sysDef->length; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedData): \ + if (sysDef->data) \ + value = *((typeof(value) *)sysDef->data); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeProgress: { \ + IOHIDProgressEventData *progress = (IOHIDProgressEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldProgressEventType): \ + value = progress->eventType; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldProgressLevel): \ + value = IOHIDEventValueFloat(progress->level); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeButton: { \ + IOHIDButtonEventData *button = (IOHIDButtonEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonMask): \ + value = button->button.buttonMask; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonNumber): \ + value = button->button.buttonNumber; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonClickCount): \ + value = button->button.clickState; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonPressure): \ + value = IOHIDEventValueFloat(button->button.pressure); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeAccelerometer: { \ + IOHIDAccelerometerEventData *accl = (IOHIDAccelerometerEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ + value = IOHIDEventValueFloat(accl->position.x); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ + value = IOHIDEventValueFloat(accl->position.y); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ + value = IOHIDEventValueFloat(accl->position.z); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerType): \ + value = accl->acclType; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeMouse: { \ + IOHIDMouseEventData *mouse = (IOHIDMouseEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseX): \ + value = IOHIDEventValueFloat(mouse->position.x); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseY): \ + value = IOHIDEventValueFloat(mouse->position.y); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseZ): \ + value = IOHIDEventValueFloat(mouse->position.z); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseButtonMask): \ + value = mouse->button.buttonMask; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseNumber): \ + value = mouse->button.buttonNumber; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseClickCount): \ + value = mouse->button.clickState; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMousePressure): \ + value = IOHIDEventValueFloat(mouse->button.pressure); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeSwipe: { \ + IOHIDSwipeEventData *swipe = (IOHIDSwipeEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldSwipeMask): \ + value = swipe->swipeMask; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeTemperature: { \ + IOHIDTemperatureEventData *temp = (IOHIDTemperatureEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTemperatureLevel): \ + value = IOHIDEventValueFloat(temp->level); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeTranslation: \ + case kIOHIDEventTypeRotation: \ + case kIOHIDEventTypeScroll: \ + case kIOHIDEventTypeScale: \ + case kIOHIDEventTypeVelocity: \ + case kIOHIDEventTypeOrientation: { \ + IOHIDAxisEventData *axis = (IOHIDAxisEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationX): \ + /* \ + case IOHIDEventFieldOffset(kIOHIDEventFieldRotationX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScaleX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX); \ + case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationRadius): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ + */ \ + value = IOHIDEventValueFloat(axis->position.x); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationY): \ + /* \ + case IOHIDEventFieldOffset(kIOHIDEventFieldRotationY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScaleY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY); \ + case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAzimuth): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ + */ \ + value = IOHIDEventValueFloat(axis->position.y); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationZ): \ + /* \ + case IOHIDEventFieldOffset(kIOHIDEventFieldRotationZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScaleZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ); \ + case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAltitude): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ + */ \ + value = IOHIDEventValueFloat(axis->position.z); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollIsPixels): \ + value = ((axis->options & kIOHIDEventOptionPixelUnits) != 0); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeAmbientLightSensor: { \ + IOHIDAmbientLightSensorEventData *alsEvent = (IOHIDAmbientLightSensorEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorLevel): \ + value = alsEvent->level; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel0): \ + value = alsEvent->ch0; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel1): \ + value = alsEvent->ch1; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightDisplayBrightnessChanged): \ + value = alsEvent->brightnessChanged; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeProximity: { \ + IOHIDProximityEventData *proxEvent = (IOHIDProximityEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldProximityDetectionMask): \ + value = proxEvent->detectionMask; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeKeyboard: { \ + IOHIDKeyboardEventData *keyEvent = (IOHIDKeyboardEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsagePage): \ + value = keyEvent->usagePage; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsage): \ + value = keyEvent->usage; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardDown): \ + value = keyEvent->down; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardRepeat): \ + value = (keyEvent->options & kIOHIDKeyboardIsRepeat); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeDigitizer: { \ + IOHIDDigitizerEventData *digEvent = (IOHIDDigitizerEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX): \ + value = IOHIDEventValueFloat(digEvent->position.x); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY): \ + value = IOHIDEventValueFloat(digEvent->position.y); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ): \ + value = IOHIDEventValueFloat(digEvent->position.z); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerButtonMask): \ + value = digEvent->buttonMask; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIndex): \ + value = digEvent->transducerIndex; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIdentity): \ + value = digEvent->identity; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerEventMask): \ + value = digEvent->eventMask; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerChildEventMask): \ + value = digEvent->childEventMask; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerRange): \ + value = (digEvent->options & kIOHIDTransducerRange) != 0; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTouch): \ + value = (digEvent->options & kIOHIDTransducerTouch) != 0; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerCollection): \ + value = (digEvent->options & kIOHIDEventOptionIsCollection) != 0; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerPressure): \ + value = IOHIDEventValueFloat(digEvent->tipPressure); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerBarrelPressure): \ + value = IOHIDEventValueFloat(digEvent->barrelPressure); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTwist): \ + value = IOHIDEventValueFloat(digEvent->twist); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ + switch (digEvent->orientationType) { \ + case kIOHIDDigitizerOrientationTypeTilt: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ + value = IOHIDEventValueFloat(digEvent->orientation.tilt.x); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ + value = IOHIDEventValueFloat(digEvent->orientation.tilt.y); \ + break; \ + }; \ + break; \ + case kIOHIDDigitizerOrientationTypePolar: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAltitude): \ + value = IOHIDEventValueFloat(digEvent->orientation.polar.altitude); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAzimuth): \ + value = IOHIDEventValueFloat(digEvent->orientation.polar.azimuth); \ + break; \ + }; \ + break; \ + case kIOHIDDigitizerOrientationTypeQuality: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ + value = IOHIDEventValueFloat(digEvent->orientation.quality.quality); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ + value = IOHIDEventValueFloat(digEvent->orientation.quality.density); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ + value = IOHIDEventValueFloat(digEvent->orientation.quality.irregularity); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ + value = IOHIDEventValueFloat(digEvent->orientation.quality.majorRadius); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ + value = IOHIDEventValueFloat(digEvent->orientation.quality.minorRadius); \ + break; \ + }; \ + break; \ + }; \ + break; \ + }; \ + } break; \ + }; \ + } + +#define GET_EVENT_VALUE(event, field, value, options) \ + { \ + IOHIDEventType fieldEvType = IOHIDEventFieldEventType(field); \ + uint32_t fieldOffset = IOHIDEventFieldOffset(field); \ + IOHIDEventRef ev = NULL; \ + if ((ev = IOHIDEventGetEventWithOptions(event, fieldEvType, options))) { \ + GET_EVENTDATA_VALUE(GET_EVENTDATA(ev), fieldEvType, fieldOffset, value); \ + } \ + } //============================================================================== // IOHIDEventSetValue MACRO //============================================================================== -#define SET_EVENTDATA_VALUE(eventData, fieldEvType, fieldOffset, value) \ -{ switch ( fieldEvType ) { \ - case kIOHIDEventTypeNULL: \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldIsRelative): \ - if ( value ) \ - eventData->options &= ~kIOHIDEventOptionIsAbsolute; \ - else \ - eventData->options |= kIOHIDEventOptionIsAbsolute; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldIsCollection): \ - if ( value ) \ - eventData->options |= kIOHIDEventOptionIsCollection; \ - else \ - eventData->options &= ~kIOHIDEventOptionIsCollection; \ - break; \ - }; break; \ - case kIOHIDEventTypeVendorDefined: \ - { \ - IOHIDVendorDefinedEventData * sysDef = (IOHIDVendorDefinedEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsagePage): \ - sysDef->usagePage = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsage): \ - sysDef->usage = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedVersion): \ - sysDef->version = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedData): \ - if (sysDef->data) \ - *((typeof(value)*) sysDef->data) = value; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeProgress: \ - { \ - IOHIDProgressEventData * progress = (IOHIDProgressEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldProgressEventType): \ - progress->eventType = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldProgressLevel): \ - progress->level = IOHIDEventValueFixed(value); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeButton: \ - { \ - IOHIDButtonEventData * button = (IOHIDButtonEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonMask): \ - button->button.buttonMask = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonNumber): \ - button->button.buttonNumber = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonClickCount): \ - button->button.clickState = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldButtonPressure): \ - button->button.pressure = IOHIDEventValueFixed(value); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeAccelerometer: \ - { \ - IOHIDAccelerometerEventData * accl = (IOHIDAccelerometerEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ - accl->position.x = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ - accl->position.y = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ - accl->position.z = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerType): \ - accl->acclType = value; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeMouse: \ - { \ - IOHIDMouseEventData * mouse = (IOHIDMouseEventData*)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseX): \ - mouse->position.x = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseY): \ - mouse->position.y = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseZ): \ - mouse->position.z = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseButtonMask): \ - mouse->button.buttonMask = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseNumber): \ - mouse->button.buttonNumber = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMouseClickCount): \ - mouse->button.clickState = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldMousePressure): \ - mouse->button.pressure = IOHIDEventValueFixed(value); \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeSwipe: \ - { \ - IOHIDSwipeEventData * swipe = (IOHIDSwipeEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldSwipeMask): \ - swipe->swipeMask = value;\ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeTemperature: \ - { \ - IOHIDTemperatureEventData * temp = (IOHIDTemperatureEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTemperatureLevel): \ - temp->level = IOHIDEventValueFixed(value);\ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeTranslation: \ - case kIOHIDEventTypeRotation: \ - case kIOHIDEventTypeScroll: \ - case kIOHIDEventTypeScale: \ - case kIOHIDEventTypeVelocity: \ - case kIOHIDEventTypeOrientation: \ - { \ - IOHIDAxisEventData * axis = (IOHIDAxisEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationX): \ - /* \ - case IOHIDEventFieldOffset(kIOHIDEventFieldRotationX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScaleX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX); \ - case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationRadius): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ - */ \ - axis->position.x = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationY): \ - /* \ - case IOHIDEventFieldOffset(kIOHIDEventFieldRotationY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScaleY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY); \ - case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAzimuth): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ - */ \ - axis->position.y = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationZ): \ - /* \ - case IOHIDEventFieldOffset(kIOHIDEventFieldRotationZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScaleZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityZ): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ); \ - case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAltitude):\ - case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ - */ \ - axis->position.z = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldScrollIsPixels): \ - if ( value ) \ - axis->options |= kIOHIDEventOptionPixelUnits; \ - else \ - axis->options &= ~kIOHIDEventOptionPixelUnits; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeAmbientLightSensor: \ - { \ - IOHIDAmbientLightSensorEventData * alsEvent = (IOHIDAmbientLightSensorEventData *)eventData;\ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorLevel): \ - alsEvent->level = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel0): \ - alsEvent->ch0 = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel1): \ - alsEvent->ch1 = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightDisplayBrightnessChanged): \ - alsEvent->brightnessChanged = value; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeProximity: \ - { \ - IOHIDProximityEventData * proxEvent = (IOHIDProximityEventData *)eventData;\ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldProximityDetectionMask): \ - proxEvent->detectionMask = value; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeKeyboard: \ - { \ - IOHIDKeyboardEventData * keyEvent = (IOHIDKeyboardEventData *)eventData;\ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsagePage): \ - keyEvent->usagePage = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsage): \ - keyEvent->usage = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardDown): \ - keyEvent->down = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardRepeat): \ - if ( value ) \ - keyEvent->options |= kIOHIDKeyboardIsRepeat; \ - else \ - keyEvent->options &= ~kIOHIDKeyboardIsRepeat; \ - break; \ - }; \ - } \ - break; \ - case kIOHIDEventTypeDigitizer: \ - { \ - IOHIDDigitizerEventData * digEvent = (IOHIDDigitizerEventData *)eventData; \ - switch ( fieldOffset ) { \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX): \ - digEvent->position.x = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY): \ - digEvent->position.y = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ): \ - digEvent->position.z = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerButtonMask): \ - digEvent->buttonMask = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIndex): \ - digEvent->transducerIndex = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIdentity): \ - digEvent->identity = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerEventMask): \ - digEvent->eventMask = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerChildEventMask): \ - digEvent->childEventMask = value; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerRange): \ - if ( value ) \ - digEvent->options |= kIOHIDTransducerRange; \ - else \ - digEvent->options &= ~kIOHIDTransducerRange; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTouch): \ - if ( value ) \ - digEvent->options |= kIOHIDTransducerTouch; \ - else \ - digEvent->options &= ~kIOHIDTransducerTouch; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerCollection): \ - if ( value ) \ - digEvent->options |= kIOHIDEventOptionIsCollection; \ - else \ - digEvent->options &= ~kIOHIDEventOptionIsCollection; \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerPressure): \ - digEvent->tipPressure = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerBarrelPressure): \ - digEvent->barrelPressure = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTwist): \ - digEvent->twist = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ - switch ( digEvent->orientationType ) {\ - case kIOHIDDigitizerOrientationTypeTilt:\ - switch ( fieldOffset ) {\ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ - digEvent->orientation.tilt.x = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ - digEvent->orientation.tilt.y = IOHIDEventValueFixed(value); \ - break; \ - }; \ - break; \ - case kIOHIDDigitizerOrientationTypePolar:\ - switch ( fieldOffset ) {\ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAltitude): \ - digEvent->orientation.polar.altitude = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAzimuth): \ - digEvent->orientation.polar.azimuth = IOHIDEventValueFixed(value); \ - break; \ - }; \ - break; \ - case kIOHIDDigitizerOrientationTypeQuality:\ - switch ( fieldOffset ) {\ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ - digEvent->orientation.quality.quality = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ - digEvent->orientation.quality.density = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ - digEvent->orientation.quality.irregularity = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ - digEvent->orientation.quality.majorRadius = IOHIDEventValueFixed(value); \ - break; \ - case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ - digEvent->orientation.quality.minorRadius = IOHIDEventValueFixed(value); \ - break; \ - }; \ - break; \ - }; \ - break; \ - }; \ - } \ - break; \ - }; \ -} - -#define SET_EVENT_VALUE(event, field, value, options) \ -{ IOHIDEventType fieldEvType = IOHIDEventFieldEventType(field); \ - uint32_t fieldOffset = IOHIDEventFieldOffset(field); \ - IOHIDEventRef ev = NULL; \ - if ( (ev = IOHIDEventGetEventWithOptions(event, fieldEvType, options)) ) {\ - SET_EVENTDATA_VALUE(GET_EVENTDATA(ev),fieldEvType,fieldOffset,value);\ - } \ -} +#define SET_EVENTDATA_VALUE(eventData, fieldEvType, fieldOffset, value) \ + { \ + switch (fieldEvType) { \ + case kIOHIDEventTypeNULL: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldIsRelative): \ + if (value) \ + eventData->options &= ~kIOHIDEventOptionIsAbsolute; \ + else \ + eventData->options |= kIOHIDEventOptionIsAbsolute; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldIsCollection): \ + if (value) \ + eventData->options |= kIOHIDEventOptionIsCollection; \ + else \ + eventData->options &= ~kIOHIDEventOptionIsCollection; \ + break; \ + }; \ + break; \ + case kIOHIDEventTypeVendorDefined: { \ + IOHIDVendorDefinedEventData *sysDef = (IOHIDVendorDefinedEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsagePage): \ + sysDef->usagePage = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedUsage): \ + sysDef->usage = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedVersion): \ + sysDef->version = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVendorDefinedData): \ + if (sysDef->data) \ + *((typeof(value) *)sysDef->data) = value; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeProgress: { \ + IOHIDProgressEventData *progress = (IOHIDProgressEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldProgressEventType): \ + progress->eventType = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldProgressLevel): \ + progress->level = IOHIDEventValueFixed(value); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeButton: { \ + IOHIDButtonEventData *button = (IOHIDButtonEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonMask): \ + button->button.buttonMask = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonNumber): \ + button->button.buttonNumber = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonClickCount): \ + button->button.clickState = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldButtonPressure): \ + button->button.pressure = IOHIDEventValueFixed(value); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeAccelerometer: { \ + IOHIDAccelerometerEventData *accl = (IOHIDAccelerometerEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ + accl->position.x = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ + accl->position.y = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ + accl->position.z = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerType): \ + accl->acclType = value; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeMouse: { \ + IOHIDMouseEventData *mouse = (IOHIDMouseEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseX): \ + mouse->position.x = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseY): \ + mouse->position.y = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseZ): \ + mouse->position.z = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseButtonMask): \ + mouse->button.buttonMask = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseNumber): \ + mouse->button.buttonNumber = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMouseClickCount): \ + mouse->button.clickState = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldMousePressure): \ + mouse->button.pressure = IOHIDEventValueFixed(value); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeSwipe: { \ + IOHIDSwipeEventData *swipe = (IOHIDSwipeEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldSwipeMask): \ + swipe->swipeMask = value; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeTemperature: { \ + IOHIDTemperatureEventData *temp = (IOHIDTemperatureEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTemperatureLevel): \ + temp->level = IOHIDEventValueFixed(value); \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeTranslation: \ + case kIOHIDEventTypeRotation: \ + case kIOHIDEventTypeScroll: \ + case kIOHIDEventTypeScale: \ + case kIOHIDEventTypeVelocity: \ + case kIOHIDEventTypeOrientation: { \ + IOHIDAxisEventData *axis = (IOHIDAxisEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationX): \ + /* \ + case IOHIDEventFieldOffset(kIOHIDEventFieldRotationX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScaleX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX); \ + case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationRadius): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerX): \ + */ \ + axis->position.x = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationY): \ + /* \ + case IOHIDEventFieldOffset(kIOHIDEventFieldRotationY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScaleY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY); \ + case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAzimuth): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerY): \ + */ \ + axis->position.y = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldTranslationZ): \ + /* \ + case IOHIDEventFieldOffset(kIOHIDEventFieldRotationZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScaleZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldVelocityZ): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ); \ + case IOHIDEventFieldOffset(kIOHIDEventFieldOrientationAltitude): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAccelerometerZ): \ + */ \ + axis->position.z = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldScrollIsPixels): \ + if (value) \ + axis->options |= kIOHIDEventOptionPixelUnits; \ + else \ + axis->options &= ~kIOHIDEventOptionPixelUnits; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeAmbientLightSensor: { \ + IOHIDAmbientLightSensorEventData *alsEvent = (IOHIDAmbientLightSensorEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorLevel): \ + alsEvent->level = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel0): \ + alsEvent->ch0 = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightSensorRawChannel1): \ + alsEvent->ch1 = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldAmbientLightDisplayBrightnessChanged): \ + alsEvent->brightnessChanged = value; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeProximity: { \ + IOHIDProximityEventData *proxEvent = (IOHIDProximityEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldProximityDetectionMask): \ + proxEvent->detectionMask = value; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeKeyboard: { \ + IOHIDKeyboardEventData *keyEvent = (IOHIDKeyboardEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsagePage): \ + keyEvent->usagePage = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardUsage): \ + keyEvent->usage = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardDown): \ + keyEvent->down = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldKeyboardRepeat): \ + if (value) \ + keyEvent->options |= kIOHIDKeyboardIsRepeat; \ + else \ + keyEvent->options &= ~kIOHIDKeyboardIsRepeat; \ + break; \ + }; \ + } break; \ + case kIOHIDEventTypeDigitizer: { \ + IOHIDDigitizerEventData *digEvent = (IOHIDDigitizerEventData *)eventData; \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerX): \ + digEvent->position.x = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerY): \ + digEvent->position.y = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerZ): \ + digEvent->position.z = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerButtonMask): \ + digEvent->buttonMask = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIndex): \ + digEvent->transducerIndex = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIdentity): \ + digEvent->identity = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerEventMask): \ + digEvent->eventMask = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerChildEventMask): \ + digEvent->childEventMask = value; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerRange): \ + if (value) \ + digEvent->options |= kIOHIDTransducerRange; \ + else \ + digEvent->options &= ~kIOHIDTransducerRange; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTouch): \ + if (value) \ + digEvent->options |= kIOHIDTransducerTouch; \ + else \ + digEvent->options &= ~kIOHIDTransducerTouch; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerCollection): \ + if (value) \ + digEvent->options |= kIOHIDEventOptionIsCollection; \ + else \ + digEvent->options &= ~kIOHIDEventOptionIsCollection; \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerPressure): \ + digEvent->tipPressure = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerBarrelPressure): \ + digEvent->barrelPressure = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTwist): \ + digEvent->twist = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ + switch (digEvent->orientationType) { \ + case kIOHIDDigitizerOrientationTypeTilt: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltX): \ + digEvent->orientation.tilt.x = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerTiltY): \ + digEvent->orientation.tilt.y = IOHIDEventValueFixed(value); \ + break; \ + }; \ + break; \ + case kIOHIDDigitizerOrientationTypePolar: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAltitude): \ + digEvent->orientation.polar.altitude = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerAzimuth): \ + digEvent->orientation.polar.azimuth = IOHIDEventValueFixed(value); \ + break; \ + }; \ + break; \ + case kIOHIDDigitizerOrientationTypeQuality: \ + switch (fieldOffset) { \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerQuality): \ + digEvent->orientation.quality.quality = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerDensity): \ + digEvent->orientation.quality.density = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerIrregularity): \ + digEvent->orientation.quality.irregularity = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMajorRadius): \ + digEvent->orientation.quality.majorRadius = IOHIDEventValueFixed(value); \ + break; \ + case IOHIDEventFieldOffset(kIOHIDEventFieldDigitizerMinorRadius): \ + digEvent->orientation.quality.minorRadius = IOHIDEventValueFixed(value); \ + break; \ + }; \ + break; \ + }; \ + break; \ + }; \ + } break; \ + }; \ + } + +#define SET_EVENT_VALUE(event, field, value, options) \ + { \ + IOHIDEventType fieldEvType = IOHIDEventFieldEventType(field); \ + uint32_t fieldOffset = IOHIDEventFieldOffset(field); \ + IOHIDEventRef ev = NULL; \ + if ((ev = IOHIDEventGetEventWithOptions(event, fieldEvType, options))) { \ + SET_EVENTDATA_VALUE(GET_EVENTDATA(ev), fieldEvType, fieldOffset, value); \ + } \ + } #endif /* _IOKIT_HID_IOHIDEVENTDATA_H */ diff --git a/IOKit/hid/IOHIDEventQueue.h b/IOKit/hid/IOHIDEventQueue.h index 84c9c63b..bc03ff92 100644 --- a/IOKit/hid/IOHIDEventQueue.h +++ b/IOKit/hid/IOHIDEventQueue.h @@ -39,8 +39,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if __cplusplus extern "C" { #endif - - typedef struct __IOHIDEventQueue + +typedef struct __IOHIDEventQueue #if 0 { CFRuntimeBase base; // 0, 4 @@ -51,30 +51,30 @@ extern "C" { int topBitOfToken; // 18, = token >> 31 } #endif - * IOHIDEventQueueRef; - + *IOHIDEventQueueRef; + #pragma mark - #pragma mark Creators - - CFTypeID IOHIDEventQueueGetTypeID(void); - - // Token must be nonzero. - IOHIDEventQueueRef IOHIDEventQueueCreateWithToken(CFAllocatorRef allocator, uint32_t token); - IOHIDEventQueueRef IOHIDEventQueueCreate(CFAllocatorRef allocator, int notificationPortType, uint32_t token); + +CFTypeID IOHIDEventQueueGetTypeID(void); + +// Token must be nonzero. +IOHIDEventQueueRef IOHIDEventQueueCreateWithToken(CFAllocatorRef allocator, uint32_t token); +IOHIDEventQueueRef IOHIDEventQueueCreate(CFAllocatorRef allocator, int notificationPortType, uint32_t token); #pragma mark - #pragma mark Accessors - - uint32_t IOHIDEventQueueGetToken(IOHIDEventQueueRef queue); - - void IOHIDEventQueueSetNotificationPort(IOHIDEventQueueRef queue, mach_port_t port); - + +uint32_t IOHIDEventQueueGetToken(IOHIDEventQueueRef queue); + +void IOHIDEventQueueSetNotificationPort(IOHIDEventQueueRef queue, mach_port_t port); + #pragma mark - #pragma mark Actions - - IOHIDEventRef IOHIDEventQueueDequeueCopy(IOHIDEventQueueRef queue); - void IOHIDEventQueueEnqueue(IOHIDEventQueueRef queue, IOHIDEventRef event); // will send a message to the "tickle port" as well. - + +IOHIDEventRef IOHIDEventQueueDequeueCopy(IOHIDEventQueueRef queue); +void IOHIDEventQueueEnqueue(IOHIDEventQueueRef queue, IOHIDEventRef event); // will send a message to the "tickle port" as well. + #if __cplusplus } #endif diff --git a/IOKit/hid/IOHIDEventSystem.h b/IOKit/hid/IOHIDEventSystem.h index 5b90e24a..dc82810b 100644 --- a/IOKit/hid/IOHIDEventSystem.h +++ b/IOKit/hid/IOHIDEventSystem.h @@ -44,8 +44,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if __cplusplus extern "C" { #endif - - typedef struct ___IOHIDEventSystem + +typedef struct ___IOHIDEventSystem #if 0 { CFRuntimeBase _base; // 0, 4 @@ -63,26 +63,26 @@ extern "C" { CFMutableSetRef queues; // 5c } #endif - * IOHIDEventSystemRef; - - typedef void(*IOHIDEventSystemCallback)(void* target, void* refcon, IOHIDServiceRef service, IOHIDEventRef event); - - CFTypeID IOHIDEventSystemGetTypeID(void); - IOHIDEventSystemRef IOHIDEventSystemCreate(CFAllocatorRef allocator); - - CFArrayRef IOHIDEventSystemCopyMatchingServices(IOHIDEventSystemRef system, CFDictionaryRef propertyTable, - IOHIDNotificationCallback matchCallback, void* matchTarget, void* matchRefcon, IOHIDNotificationRef* matchNotif); - void IOHIDEventSystemRegisterQueue(IOHIDEventSystemRef system, IOHIDEventQueueRef queue); - void IOHIDEventSystemUnregisterQueue(IOHIDEventSystemRef system, IOHIDEventQueueRef queue); - - IOHIDEventRef IOHIDEventSystemCopyEvent(IOHIDEventSystemRef system, IOHIDEventType type, IOHIDEventRef event, IOOptionBits options); - - CFTypeRef IOHIDEventSystemGetProperty(IOHIDEventSystemRef system, CFStringRef property); - Boolean IOHIDEventSystemSetProperty(IOHIDEventSystemRef system, CFStringRef property, CFTypeRef value); - - Boolean IOHIDEventSystemOpen(IOHIDEventSystemRef system, IOHIDEventSystemCallback callback, void* target, void* refcon, void* unused); - void IOHIDEventSystemClose(IOHIDEventSystemRef system, void* unused); - + *IOHIDEventSystemRef; + +typedef void (*IOHIDEventSystemCallback)(void *target, void *refcon, IOHIDServiceRef service, IOHIDEventRef event); + +CFTypeID IOHIDEventSystemGetTypeID(void); +IOHIDEventSystemRef IOHIDEventSystemCreate(CFAllocatorRef allocator); + +CFArrayRef IOHIDEventSystemCopyMatchingServices(IOHIDEventSystemRef system, CFDictionaryRef propertyTable, + IOHIDNotificationCallback matchCallback, void *matchTarget, void *matchRefcon, IOHIDNotificationRef *matchNotif); +void IOHIDEventSystemRegisterQueue(IOHIDEventSystemRef system, IOHIDEventQueueRef queue); +void IOHIDEventSystemUnregisterQueue(IOHIDEventSystemRef system, IOHIDEventQueueRef queue); + +IOHIDEventRef IOHIDEventSystemCopyEvent(IOHIDEventSystemRef system, IOHIDEventType type, IOHIDEventRef event, IOOptionBits options); + +CFTypeRef IOHIDEventSystemGetProperty(IOHIDEventSystemRef system, CFStringRef property); +Boolean IOHIDEventSystemSetProperty(IOHIDEventSystemRef system, CFStringRef property, CFTypeRef value); + +Boolean IOHIDEventSystemOpen(IOHIDEventSystemRef system, IOHIDEventSystemCallback callback, void *target, void *refcon, void *unused); +void IOHIDEventSystemClose(IOHIDEventSystemRef system, void *unused); + #if 0 dlfun("IOHIDEventSystemGetTypeID", "I"); dlfun("IOHIDEventSystemCreate", "@@"); @@ -95,10 +95,9 @@ extern "C" { dlfun("IOHIDEventSystemOpen", "c@^v^v^v^v"); dlfun("IOHIDEventSystemClose", "v@^v"); #endif - + #if __cplusplus } #endif #endif - diff --git a/IOKit/hid/IOHIDEventSystemClient.h b/IOKit/hid/IOHIDEventSystemClient.h index 76a0bac7..b6a9d0b2 100644 --- a/IOKit/hid/IOHIDEventSystemClient.h +++ b/IOKit/hid/IOHIDEventSystemClient.h @@ -42,8 +42,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if __cplusplus extern "C" { #endif - - typedef struct __IOHIDEventSystemClient + +typedef struct __IOHIDEventSystemClient #if 0 { void* x00; @@ -61,24 +61,23 @@ extern "C" { CFStringRef mode; // 38 } #endif - * IOHIDEventSystemClientRef; - - typedef void(*IOHIDEventSystemClientEventCallback)(void* target, void* refcon, IOHIDEventQueueRef queue, IOHIDEventRef event); - - void IOHIDEventSystemClientRegisterEventCallback(IOHIDEventSystemClientRef client, IOHIDEventSystemClientEventCallback callback, void* target, void* refcon); - void IOHIDEventSystemClientUnregisterEventCallback(IOHIDEventSystemClientRef client); - - void IOHIDEventSystemClientUnscheduleWithRunLoop(IOHIDEventSystemClientRef client, CFRunLoopRef runloop, CFStringRef mode); - void IOHIDEventSystemClientScheduleWithRunLoop(IOHIDEventSystemClientRef client, CFRunLoopRef runloop, CFStringRef mode); - - CFPropertyListRef IOHIDEventSystemClientCopyProperty(IOHIDEventSystemClientRef client, CFStringRef property); - Boolean IOHIDEventSystemClientSetProperty(IOHIDEventSystemClientRef client, CFStringRef property, CFPropertyListRef value); - - IOHIDEventSystemClientRef IOHIDEventSystemClient(void); - + *IOHIDEventSystemClientRef; + +typedef void (*IOHIDEventSystemClientEventCallback)(void *target, void *refcon, IOHIDEventQueueRef queue, IOHIDEventRef event); + +void IOHIDEventSystemClientRegisterEventCallback(IOHIDEventSystemClientRef client, IOHIDEventSystemClientEventCallback callback, void *target, void *refcon); +void IOHIDEventSystemClientUnregisterEventCallback(IOHIDEventSystemClientRef client); + +void IOHIDEventSystemClientUnscheduleWithRunLoop(IOHIDEventSystemClientRef client, CFRunLoopRef runloop, CFStringRef mode); +void IOHIDEventSystemClientScheduleWithRunLoop(IOHIDEventSystemClientRef client, CFRunLoopRef runloop, CFStringRef mode); + +CFPropertyListRef IOHIDEventSystemClientCopyProperty(IOHIDEventSystemClientRef client, CFStringRef property); +Boolean IOHIDEventSystemClientSetProperty(IOHIDEventSystemClientRef client, CFStringRef property, CFPropertyListRef value); + +IOHIDEventSystemClientRef IOHIDEventSystemClient(void); + #if __cplusplus } #endif #endif - diff --git a/IOKit/hid/IOHIDEventTypes.h b/IOKit/hid/IOHIDEventTypes.h index 52dd2980..6de5384e 100644 --- a/IOKit/hid/IOHIDEventTypes.h +++ b/IOKit/hid/IOHIDEventTypes.h @@ -27,7 +27,7 @@ #include -#define IOHIDEventTypeMask(type) (1< [0] = NULL [4] = IOHIDIUnknown::genericQueryInterface(void*, CFUUIDBytes, void**) @@ -81,42 +81,40 @@ extern "C" { [0x24] = IOHIDEventServiceClass::_scheduleWithRunLoop(void*, __CFRunLoop*, __CFString const*) [0x28] = IOHIDEventServiceClass::_unscheduleFromRunLoop(void*, __CFRunLoop*, __CFString const*) [0x2c] = IOHIDEventServiceClass::_copyEvent(void*, unsigned int, __IOHIDEvent*, unsigned long) - */ - + */ + #pragma mark - #pragma mark Creators - - CFTypeID IOHIDServiceGetTypeID(void); - IOHIDServiceRef _IOHIDServiceCreate(CFAllocatorRef allocator, io_service_t service); - + +CFTypeID IOHIDServiceGetTypeID(void); +IOHIDServiceRef _IOHIDServiceCreate(CFAllocatorRef allocator, io_service_t service); + #pragma mark - #pragma mark Accessors - - CFTypeRef IOHIDServiceGetProperty(IOHIDServiceRef service, CFStringRef property); - Boolean IOHIDServiceSetProperty(IOHIDServiceRef service, CFStringRef property, CFTypeRef value); - - CFTypeRef _IOHIDServiceGetClient(IOHIDServiceRef service); - Boolean _IOHIDServiceMatchPropertyTable(IOHIDServiceRef service, CFDictionaryRef propertyTable); - - IOHIDEventRef IOHIDServiceCopyEvent(IOHIDServiceRef service, IOHIDEventType type, IOHIDEventRef event, IOOptionBits options); - - void _IOHIDServiceSetEventCallback(IOHIDServiceRef service, IOHIDServiceEventCallback eventCallback, void* target, void* refcon); - + +CFTypeRef IOHIDServiceGetProperty(IOHIDServiceRef service, CFStringRef property); +Boolean IOHIDServiceSetProperty(IOHIDServiceRef service, CFStringRef property, CFTypeRef value); + +CFTypeRef _IOHIDServiceGetClient(IOHIDServiceRef service); +Boolean _IOHIDServiceMatchPropertyTable(IOHIDServiceRef service, CFDictionaryRef propertyTable); + +IOHIDEventRef IOHIDServiceCopyEvent(IOHIDServiceRef service, IOHIDEventType type, IOHIDEventRef event, IOOptionBits options); + +void _IOHIDServiceSetEventCallback(IOHIDServiceRef service, IOHIDServiceEventCallback eventCallback, void *target, void *refcon); + #pragma mark - #pragma mark Actions - - void _IOHIDServiceScheduleWithRunLoop(IOHIDServiceRef service, CFRunLoopRef runloop, CFStringRef mode); - void _IOHIDServiceUnscheduleWithRunLoop(IOHIDServiceRef service); - - IOHIDNotificationRef IOHIDServiceCreateRemovalNotification(IOHIDServiceRef display, IOHIDNotificationCallback callback, void* target, void* refcon); - - Boolean _IOHIDServiceOpen(IOHIDServiceRef service, CFTypeRef client, IOOptionBits options); - Boolean _IOHIDServiceClose(IOHIDServiceRef service, CFTypeRef client, IOOptionBits options); - - + +void _IOHIDServiceScheduleWithRunLoop(IOHIDServiceRef service, CFRunLoopRef runloop, CFStringRef mode); +void _IOHIDServiceUnscheduleWithRunLoop(IOHIDServiceRef service); + +IOHIDNotificationRef IOHIDServiceCreateRemovalNotification(IOHIDServiceRef display, IOHIDNotificationCallback callback, void *target, void *refcon); + +Boolean _IOHIDServiceOpen(IOHIDServiceRef service, CFTypeRef client, IOOptionBits options); +Boolean _IOHIDServiceClose(IOHIDServiceRef service, CFTypeRef client, IOOptionBits options); + #if __cplusplus } #endif #endif - diff --git a/IOKit/hid/IOHIDSession.h b/IOKit/hid/IOHIDSession.h index 441cf160..95060c4f 100644 --- a/IOKit/hid/IOHIDSession.h +++ b/IOKit/hid/IOHIDSession.h @@ -41,12 +41,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if __cplusplus extern "C" { #endif - - typedef struct IOHIDSessionWorkSpace { - uint64_t value; - } IOHIDSessionWorkSpace; - - typedef struct __IOHIDSession + +typedef struct IOHIDSessionWorkSpace { + uint64_t value; +} IOHIDSessionWorkSpace; + +typedef struct __IOHIDSession #if 0 { CFRuntimeBase _base; // 0, 4 @@ -94,59 +94,57 @@ extern "C" { int logLevel; // 144, initially = 6 } #endif - * IOHIDSessionRef; - - typedef void(*IOHIDSessionCallback)(CFTypeRef client, void* refcon, IOHIDServiceRef service, IOHIDEventRef event); - + *IOHIDSessionRef; + +typedef void (*IOHIDSessionCallback)(CFTypeRef client, void *refcon, IOHIDServiceRef service, IOHIDEventRef event); + #pragma mark - #pragma mark Creators - - CFTypeID IOHIDSessionGetTypeID(void); - IOHIDSessionRef IOHIDSessionCreate(CFAllocatorRef allocator); - + +CFTypeID IOHIDSessionGetTypeID(void); +IOHIDSessionRef IOHIDSessionCreate(CFAllocatorRef allocator); + #pragma mark - #pragma mark Accessors - - CFTypeRef IOHIDSessionGetProperty(IOHIDSessionRef session, CFStringRef key); - Boolean IOHIDSessionSetProperty(IOHIDSessionRef session, CFStringRef key, CFTypeRef value); - - IOHIDSessionWorkSpace IOHIDSessionGetWorkSpace(IOHIDSessionRef session); - void IOHIDSessionSetWorkSpace(IOHIDSessionRef session, IOHIDSessionWorkSpace workSpace); - - Boolean IOHIDSessionGetLockState(IOHIDSessionRef session); - void IOHIDSessionSetLockState(IOHIDSessionRef session, Boolean lockState); - + +CFTypeRef IOHIDSessionGetProperty(IOHIDSessionRef session, CFStringRef key); +Boolean IOHIDSessionSetProperty(IOHIDSessionRef session, CFStringRef key, CFTypeRef value); + +IOHIDSessionWorkSpace IOHIDSessionGetWorkSpace(IOHIDSessionRef session); +void IOHIDSessionSetWorkSpace(IOHIDSessionRef session, IOHIDSessionWorkSpace workSpace); + +Boolean IOHIDSessionGetLockState(IOHIDSessionRef session); +void IOHIDSessionSetLockState(IOHIDSessionRef session, Boolean lockState); + #pragma mark - #pragma mark Actions - - Boolean IOHIDSessionOpen(IOHIDSessionRef session, CFTypeRef client, IOHIDSessionCallback callback, void* refcon) - void IOHIDSessionClose(IOHIDSessionRef session, CFTypeRef client); - - void IOHIDSessionAddService(IOHIDSessionRef, IOHIDServiceRef service); - void IOHIDSessionRemoveService(IOHIDSessionRef, IOHIDServiceRef service); - - void IOHIDSessionAddDisplay(IOHIDSessionRef, IOHIDDisplayRef display); - void IOHIDSessionRemoveDisplay(IOHIDSessionRef session, IOHIDDisplayRef display); - - IOHIDEventRef IOHIDSessionCopyEvent(IOHIDSessionRef session, IOHIDEventType type, IOHIDEventRef event, IOOptionBits options); - + +Boolean IOHIDSessionOpen(IOHIDSessionRef session, CFTypeRef client, IOHIDSessionCallback callback, void *refcon) void IOHIDSessionClose(IOHIDSessionRef session, CFTypeRef client); + +void IOHIDSessionAddService(IOHIDSessionRef, IOHIDServiceRef service); +void IOHIDSessionRemoveService(IOHIDSessionRef, IOHIDServiceRef service); + +void IOHIDSessionAddDisplay(IOHIDSessionRef, IOHIDDisplayRef display); +void IOHIDSessionRemoveDisplay(IOHIDSessionRef session, IOHIDDisplayRef display); + +IOHIDEventRef IOHIDSessionCopyEvent(IOHIDSessionRef session, IOHIDEventType type, IOHIDEventRef event, IOOptionBits options); + #pragma mark - #pragma mark Constants - - static const CFStringRef kIOHIDSessionPropertyDisplayOrientation = CFSTR("DisplayOrientation"); - static const CFStringRef kIOHIDSessionPropertyDisplayBrightnessFactor = CFSTR("DisplayBrightnessFactor"); - static const CFStringRef kIOHIDSessionPropertyDisplayBrightnessFactorWithFade = CFSTR("DisplayBrightnessFactorWithFade"); - static const CFStringRef kIOHIDSessionPropertyDisplayBrightnessFactorPending = CFSTR("DisplayBrightnessFactorPending"); - static const CFStringRef kIOHIDSessionPropertyLogLevel = CFSTR("LogLevel"); - static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationEnabled = CFSTR("ALSIntPeriodOrientationEnabled"); - static const CFStringRef kIOHIDSessionPropertyALSIntPeriod = CFSTR("ALSIntPeriod"); - static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationPortrait = CFSTR("ALSIntPeriodOrientationPortrait"); - static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationPortraitInv = CFSTR("ALSIntPeriodOrientationPortraitInv"); - static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationLandscape = CFSTR("ALSIntPeriodOrientationLandscape"); - + +static const CFStringRef kIOHIDSessionPropertyDisplayOrientation = CFSTR("DisplayOrientation"); +static const CFStringRef kIOHIDSessionPropertyDisplayBrightnessFactor = CFSTR("DisplayBrightnessFactor"); +static const CFStringRef kIOHIDSessionPropertyDisplayBrightnessFactorWithFade = CFSTR("DisplayBrightnessFactorWithFade"); +static const CFStringRef kIOHIDSessionPropertyDisplayBrightnessFactorPending = CFSTR("DisplayBrightnessFactorPending"); +static const CFStringRef kIOHIDSessionPropertyLogLevel = CFSTR("LogLevel"); +static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationEnabled = CFSTR("ALSIntPeriodOrientationEnabled"); +static const CFStringRef kIOHIDSessionPropertyALSIntPeriod = CFSTR("ALSIntPeriod"); +static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationPortrait = CFSTR("ALSIntPeriodOrientationPortrait"); +static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationPortraitInv = CFSTR("ALSIntPeriodOrientationPortraitInv"); +static const CFStringRef kIOHIDSessionPropertyALSIntPeriodOrientationLandscape = CFSTR("ALSIntPeriodOrientationLandscape"); + #if __cplusplus } #endif #endif - diff --git a/IOKit/hid/IOHIDUserDevice.h b/IOKit/hid/IOHIDUserDevice.h index 3f6f8ca6..f1f619ff 100644 --- a/IOKit/hid/IOHIDUserDevice.h +++ b/IOKit/hid/IOHIDUserDevice.h @@ -30,7 +30,7 @@ __BEGIN_DECLS -typedef struct __IOHIDUserDevice * IOHIDUserDeviceRef; +typedef struct __IOHIDUserDevice *IOHIDUserDeviceRef; /*! @function IOHIDUserDeviceGetTypeID @@ -50,9 +50,8 @@ CFTypeID IOHIDUserDeviceGetTypeID(void); */ CF_EXPORT IOHIDUserDeviceRef IOHIDUserDeviceCreate( - CFAllocatorRef allocator, - CFDictionaryRef properties); - + CFAllocatorRef allocator, + CFDictionaryRef properties); /*! @function IOHIDUserDeviceHandleReport @@ -60,9 +59,9 @@ IOHIDUserDeviceRef IOHIDUserDeviceCreate( */ CF_EXPORT IOReturn IOHIDUserDeviceHandleReport( - IOHIDUserDeviceRef device, - uint8_t * report, - CFIndex reportLength); + IOHIDUserDeviceRef device, + uint8_t *report, + CFIndex reportLength); __END_DECLS diff --git a/IOKit/ps/IOPSKeys.h b/IOKit/ps/IOPSKeys.h index 2a106fc2..391add8f 100644 --- a/IOKit/ps/IOPSKeys.h +++ b/IOKit/ps/IOPSKeys.h @@ -29,7 +29,7 @@ * CFDictionaries, as returned by @link //apple_ref/c/func/IOPSGetPowerSourceDescription IOPSGetPowerSourceDescription @/link * Note that all of these C strings must be converted to CFStrings before use. You can wrap * them with the CFSTR() macro, or create a CFStringRef (that you must later CFRelease()) using CFStringCreateWithCString(). - */ + */ #ifndef _IOPSKEYS_H_ #define _IOPSKEYS_H_ @@ -41,7 +41,7 @@ * Use these kIOPSPowerAdapter keys to decipher the dictionary returned * by @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link */ - + /*! * @define kIOPSPowerAdapterIDKey * @@ -52,7 +52,7 @@ * @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link * This key might not be defined in the adapter details dictionary. */ -#define kIOPSPowerAdapterIDKey "AdapterID" +#define kIOPSPowerAdapterIDKey "AdapterID" /*! * @define kIOPSPowerAdapterWattsKey @@ -64,7 +64,7 @@ * @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link * This key might not be defined in the adapter details dictionary. */ -#define kIOPSPowerAdapterWattsKey "Watts" +#define kIOPSPowerAdapterWattsKey "Watts" /*! * @define kIOPSPowerAdapterRevisionKey @@ -76,7 +76,7 @@ * @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link * This key might not be defined in the adapter details dictionary. */ -#define kIOPSPowerAdapterRevisionKey "AdapterRevision" +#define kIOPSPowerAdapterRevisionKey "AdapterRevision" /*! * @define kIOPSPowerAdapterSerialNumberKey @@ -87,8 +87,8 @@ * @discussion This key may be present in the dictionary returned from * @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link * This key might not be defined in the adapter details dictionary. - */ -#define kIOPSPowerAdapterSerialNumberKey "SerialNumber" + */ +#define kIOPSPowerAdapterSerialNumberKey "SerialNumber" /*! * @define kIOPSPowerAdapterFamilyKey @@ -100,10 +100,7 @@ * @link //apple_ref/c/func/IOPSCopyExternalPowerAdapterDetails IOPSCopyExternalPowerAdapterDetails @/link * This key might not be defined in the adapter details dictionary. */ -#define kIOPSPowerAdapterFamilyKey "FamilyCode" - - - +#define kIOPSPowerAdapterFamilyKey "FamilyCode" /*! * @group Internal Keys @@ -117,35 +114,33 @@ * @discussion kIOPSUPSManagementClaimed is obsolete. Do not use. * @deprecated Unsupported in OS X 10.5 and later. */ -#define kIOPSUPSManagementClaimed "/IOKit/UPSPowerManagementClaimed" +#define kIOPSUPSManagementClaimed "/IOKit/UPSPowerManagementClaimed" /*! * @define kIOPSLowWarnLevelKey * * @abstract Key for the "Warning" UPS low power trigger-level. Default is 50%. */ -#define kIOPSLowWarnLevelKey "Low Warn Level" +#define kIOPSLowWarnLevelKey "Low Warn Level" /*! * @define kIOPSDeadWarnLevelKey * * @abstract Key for the "Shutdown System" low power trigger-level. Default is 20%. */ -#define kIOPSDeadWarnLevelKey "Shutdown Level" - +#define kIOPSDeadWarnLevelKey "Shutdown Level" /*! * @define kIOPSDynamicStorePath * * @abstract This is only used for internal bookkeeping, and should be ignored. */ -#define kIOPSDynamicStorePath "/IOKit/PowerSources" - +#define kIOPSDynamicStorePath "/IOKit/PowerSources" /*! * @group Power Source Commands (UPS) * - */ + */ /*! * @define kIOPSCommandDelayedRemovePowerKey @@ -157,7 +152,7 @@ *
  • remove power from its AC power ports. * */ -#define kIOPSCommandDelayedRemovePowerKey "Delayed Remove Power" +#define kIOPSCommandDelayedRemovePowerKey "Delayed Remove Power" /*! * @define kIOPSCommandEnableAudibleAlarmKey @@ -170,7 +165,7 @@ * */ -#define kIOPSCommandEnableAudibleAlarmKey "Enable Audible Alarm" +#define kIOPSCommandEnableAudibleAlarmKey "Enable Audible Alarm" /*! * @define kIOPSCommandStartupDelayKey @@ -182,8 +177,7 @@ *
  • remove power from its AC power ports. * */ -#define kIOPSCommandStartupDelayKey "Startup Delay" - +#define kIOPSCommandStartupDelayKey "Startup Delay" /*! * @group Power Source data keys @@ -206,7 +200,7 @@ *
  • This key is DEPRECATED, do not provide it. * * - */ + */ /*! * @define kIOPSPowerSourceIDKey @@ -220,10 +214,9 @@ *
  • Type CFNumber, kCFNumberIntType, uniquely identifying an attached UPS. * */ - -#define kIOPSPowerSourceIDKey "Power Source ID" - +#define kIOPSPowerSourceIDKey "Power Source ID" + /*! * @define kIOPSPowerSourceStateKey * @@ -239,7 +232,7 @@ * */ -#define kIOPSPowerSourceStateKey "Power Source State" +#define kIOPSPowerSourceStateKey "Power Source State" /*! * @define kIOPSCurrentCapacityKey @@ -257,7 +250,7 @@ * */ -#define kIOPSCurrentCapacityKey "Current Capacity" +#define kIOPSCurrentCapacityKey "Current Capacity" /*! * @define kIOPSMaxCapacityKey @@ -271,7 +264,7 @@ * */ -#define kIOPSMaxCapacityKey "Max Capacity" +#define kIOPSMaxCapacityKey "Max Capacity" /*! * @define kIOPSDesignCapacityKey @@ -285,7 +278,7 @@ * */ -#define kIOPSDesignCapacityKey "DesignCapacity" +#define kIOPSDesignCapacityKey "DesignCapacity" /*! * @define kIOPSTimeToEmptyKey @@ -302,8 +295,7 @@ * */ - -#define kIOPSTimeToEmptyKey "Time to Empty" +#define kIOPSTimeToEmptyKey "Time to Empty" /*! * @define kIOPSTimeToFullChargeKey @@ -318,7 +310,7 @@ * */ -#define kIOPSTimeToFullChargeKey "Time to Full Charge" +#define kIOPSTimeToFullChargeKey "Time to Full Charge" /*! * @define kIOPSIsChargingKey @@ -331,7 +323,7 @@ * */ -#define kIOPSIsChargingKey "Is Charging" +#define kIOPSIsChargingKey "Is Charging" /*! * @define kIOPSIsPresentKey @@ -347,7 +339,7 @@ * */ -#define kIOPSIsPresentKey "Is Present" +#define kIOPSIsPresentKey "Is Present" /*! * @define kIOPSVoltageKey @@ -360,7 +352,7 @@ * */ -#define kIOPSVoltageKey "Voltage" +#define kIOPSVoltageKey "Voltage" /*! * @define kIOPSCurrentKey @@ -373,7 +365,7 @@ * */ -#define kIOPSCurrentKey "Current" +#define kIOPSCurrentKey "Current" /*! * @define kIOPSNameKey @@ -386,8 +378,7 @@ * */ -#define kIOPSNameKey "Name" - +#define kIOPSNameKey "Name" /*! * @define kIOPSTypeKey @@ -400,8 +391,7 @@ * */ -#define kIOPSTypeKey "Type" - +#define kIOPSTypeKey "Type" /*! * @define kIOPSTransportTypeKey @@ -417,7 +407,7 @@ * */ -#define kIOPSTransportTypeKey "Transport Type" +#define kIOPSTransportTypeKey "Transport Type" /*! * @define kIOPSVendorDataKey @@ -430,7 +420,7 @@ * */ -#define kIOPSVendorDataKey "Vendor Specific Data" +#define kIOPSVendorDataKey "Vendor Specific Data" /*! * @define kIOPSBatteryHealthKey @@ -446,7 +436,7 @@ * */ -#define kIOPSBatteryHealthKey "BatteryHealth" +#define kIOPSBatteryHealthKey "BatteryHealth" /*! * @define kIOPSBatteryHealthConditionKey @@ -460,7 +450,7 @@ * */ -#define kIOPSBatteryHealthConditionKey "BatteryHealthCondition" +#define kIOPSBatteryHealthConditionKey "BatteryHealthCondition" /*! * @define kIOPSBatteryFailureModesKey @@ -478,7 +468,7 @@ *
  • Type CFArrayRef * */ -#define kIOPSBatteryFailureModesKey "BatteryFailureModes" +#define kIOPSBatteryFailureModesKey "BatteryFailureModes" /*! * @define kIOPSHealthConfidenceKey @@ -494,8 +484,7 @@ * */ -#define kIOPSHealthConfidenceKey "HealthConfidence" - +#define kIOPSHealthConfidenceKey "HealthConfidence" /*! * @define kIOPSMaxErrKey @@ -509,7 +498,7 @@ * */ -#define kIOPSMaxErrKey "MaxErr" +#define kIOPSMaxErrKey "MaxErr" /*! * @define kIOPSIsChargedKey @@ -525,7 +514,7 @@ * */ -#define kIOPSIsChargedKey "Is Charged" +#define kIOPSIsChargedKey "Is Charged" /*! * @define kIOPSIsFinishingChargeKey @@ -540,7 +529,7 @@ * */ -#define kIOPSIsFinishingChargeKey "Is Finishing Charge" +#define kIOPSIsFinishingChargeKey "Is Finishing Charge" /*! * @define kIOPSHardwareSerialNumberKey @@ -554,10 +543,7 @@ * */ - -#define kIOPSHardwareSerialNumberKey "Hardware Serial Number" - - +#define kIOPSHardwareSerialNumberKey "Hardware Serial Number" /* * @group Transport types @@ -568,28 +554,27 @@ * @abstract Value for key @link kIOPSTransportTypeKey @/link. * @discussion Indicates the power source is a UPS attached over a serial connection. */ -#define kIOPSSerialTransportType "Serial" +#define kIOPSSerialTransportType "Serial" /*! * @define kIOPSUSBTransportType * @abstract Value for key @link kIOPSTransportTypeKey @/link. * @discussion Indicates the power source is a UPS attached over a USB connection. */ -#define kIOPSUSBTransportType "USB" +#define kIOPSUSBTransportType "USB" /*! * @define kIOPSNetworkTransportType * @abstract Value for key @link kIOPSTransportTypeKey @/link. * @discussion Indicates the power source is a UPS attached over a network connection (and it may be managing several computers). */ -#define kIOPSNetworkTransportType "Ethernet" +#define kIOPSNetworkTransportType "Ethernet" /*! * @define kIOPSInternalType * @abstract Value for key @link kIOPSTransportTypeKey @/link. Indicates the power source is an internal battery. */ -#define kIOPSInternalType "Internal" - +#define kIOPSInternalType "Internal" /* * @group PowerSource Types @@ -603,14 +588,14 @@ * * @abstract Represents a battery residing inside a Mac. */ -#define kIOPSInternalBatteryType "InternalBattery" +#define kIOPSInternalBatteryType "InternalBattery" /*! * @define kIOPSUPSType * * @abstract Represents an external attached UPS. */ -#define kIOPSUPSType "UPS" +#define kIOPSUPSType "UPS" /* * PS state @@ -619,21 +604,19 @@ * @define kIOPSOffLineValue * @abstract Value for key kIOPSPowerSourceStateKey. Power source is off-line or no longer connected. */ -#define kIOPSOffLineValue "Off Line" +#define kIOPSOffLineValue "Off Line" /*! * @define kIOPSACPowerValue * @abstract Value for key kIOPSPowerSourceStateKey. Power source is connected to external or AC power, and is not draining the internal battery. */ -#define kIOPSACPowerValue "AC Power" +#define kIOPSACPowerValue "AC Power" /*! * @define kIOPSBatteryPowerValue * @abstract Value for key kIOPSPowerSourceStateKey. Power source is currently using the internal battery. */ -#define kIOPSBatteryPowerValue "Battery Power" - - +#define kIOPSBatteryPowerValue "Battery Power" /*! * @group Battery Health values @@ -642,21 +625,19 @@ * @define kIOPSPoorValue * @abstract Value for key @link kIOPSBatteryHealthKey @/link. */ -#define kIOPSPoorValue "Poor" +#define kIOPSPoorValue "Poor" /*! * @define kIOPSFairValue * @abstract Value for key @link kIOPSBatteryHealthKey @/link. */ -#define kIOPSFairValue "Fair" +#define kIOPSFairValue "Fair" /*! * @define kIOPSGoodValue * @abstract Value for key @link kIOPSBatteryHealthKey @/link. */ -#define kIOPSGoodValue "Good" - - +#define kIOPSGoodValue "Good" /* * @group Battery Health Condition values @@ -668,7 +649,7 @@ * * @discussion This value indicates that the battery should be checked out by a licensed Mac repair service. */ -#define kIOPSCheckBatteryValue "Check Battery" +#define kIOPSCheckBatteryValue "Check Battery" /*! * @define kIOPSPermanentFailureValue @@ -677,8 +658,7 @@ * * @discussion Indicates the battery needs replacement. */ -#define kIOPSPermanentFailureValue "Permanent Battery Failure" - +#define kIOPSPermanentFailureValue "Permanent Battery Failure" /*! * @group Battery Failure Mode values @@ -689,85 +669,84 @@ * * @abstract Value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureExternalInput "Externally Indicated Failure" +#define kIOPSFailureExternalInput "Externally Indicated Failure" /*! * @define kIOPSFailureSafetyOverVoltage * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureSafetyOverVoltage "Safety Over-Voltage" +#define kIOPSFailureSafetyOverVoltage "Safety Over-Voltage" /*! * @define kIOPSFailureChargeOverTemp * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureChargeOverTemp "Charge Over-Temperature" +#define kIOPSFailureChargeOverTemp "Charge Over-Temperature" /*! * @define kIOPSFailureDischargeOverTemp * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureDischargeOverTemp "Discharge Over-Temperature" +#define kIOPSFailureDischargeOverTemp "Discharge Over-Temperature" /*! * @define kIOPSFailureCellImbalance * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureCellImbalance "Cell Imbalance" +#define kIOPSFailureCellImbalance "Cell Imbalance" /*! * @define kIOPSFailureChargeFET * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureChargeFET "Charge FET" +#define kIOPSFailureChargeFET "Charge FET" /*! * @define kIOPSFailureDischargeFET * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureDischargeFET "Discharge FET" +#define kIOPSFailureDischargeFET "Discharge FET" /*! * @define kIOPSFailureDataFlushFault * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureDataFlushFault "Data Flush Fault" +#define kIOPSFailureDataFlushFault "Data Flush Fault" /*! * @define kIOPSFailurePermanentAFEComms * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailurePermanentAFEComms "Permanent AFE Comms" +#define kIOPSFailurePermanentAFEComms "Permanent AFE Comms" /*! * @define kIOPSFailurePeriodicAFEComms * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailurePeriodicAFEComms "Periodic AFE Comms" +#define kIOPSFailurePeriodicAFEComms "Periodic AFE Comms" /*! * @define kIOPSFailureChargeOverCurrent * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureChargeOverCurrent "Charge Over-Current" +#define kIOPSFailureChargeOverCurrent "Charge Over-Current" /*! * @define kIOPSFailureDischargeOverCurrent * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureDischargeOverCurrent "Discharge Over-Current" +#define kIOPSFailureDischargeOverCurrent "Discharge Over-Current" /*! * @define kIOPSFailureOpenThermistor * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureOpenThermistor "Open Thermistor" +#define kIOPSFailureOpenThermistor "Open Thermistor" /*! * @define kIOPSFailureFuseBlown * * @abstract Potential value for key @link kIOPSBatteryFailureModesKey@/link */ -#define kIOPSFailureFuseBlown "Fuse Blown" - +#define kIOPSFailureFuseBlown "Fuse Blown" #endif diff --git a/IOKit/ps/IOPowerSources.h b/IOKit/ps/IOPowerSources.h index 8ca17291..a89b36a7 100644 --- a/IOKit/ps/IOPowerSources.h +++ b/IOKit/ps/IOPowerSources.h @@ -31,7 +31,6 @@ #include __BEGIN_DECLS - /*! * @header IOPowerSources.h * @@ -53,7 +52,7 @@ __BEGIN_DECLS * @abstract Notify(3) key. The system delivers notifications on this key when the * battery time remaining drops into a warnable level. */ -#define kIOPSNotifyLowBattery "com.apple.system.powersources.lowbattery" +#define kIOPSNotifyLowBattery "com.apple.system.powersources.lowbattery" /*! * @enum IOPSLowBatteryWarningLevel @@ -61,16 +60,16 @@ __BEGIN_DECLS * @discussion Possible return values from @link IOPSGetBatteryWarningLevel@/link */ typedef enum { -/*! @constant kIOPSLowBatteryWarningNone + /*! @constant kIOPSLowBatteryWarningNone * * @abstract The system is not in a low battery situation, or is on drawing from an external power source. * * @discussion The system displays no low power warnings; neither should application clients of this * API. */ - kIOPSLowBatteryWarningNone = 1, + kIOPSLowBatteryWarningNone = 1, -/*! @constant kIOPSLowBatteryWarningEarly + /*! @constant kIOPSLowBatteryWarningEarly * * @abstract The system is in an early low battery situation. * @@ -80,7 +79,7 @@ typedef enum { */ kIOPSLowBatteryWarningEarly = 2, -/*! @constant kIOPSLowBatteryWarningFinal + /*! @constant kIOPSLowBatteryWarningFinal * * @abstract The battery can provide no more than 10 minutes of runtime. * @@ -112,7 +111,7 @@ IOPSLowBatteryWarningLevel IOPSGetBatteryWarningLevel(void); * * @discussion Use notify(3) API to register for notifications. */ -#define kIOPSTimeRemainingNotificationKey "com.apple.system.powersources.timeremaining" +#define kIOPSTimeRemainingNotificationKey "com.apple.system.powersources.timeremaining" /*! * @constant kIOPSTimeRemainingUnknown @@ -124,7 +123,7 @@ IOPSLowBatteryWarningLevel IOPSGetBatteryWarningLevel(void); * @link kIOPSPowerSourcesNotificationKey@/link fires. */ -#define kIOPSTimeRemainingUnknown ((CFTimeInterval)-1.0) +#define kIOPSTimeRemainingUnknown ((CFTimeInterval)-1.0) /*! * @constant kIOPSTimeRemainingUnlimited @@ -134,7 +133,7 @@ IOPSLowBatteryWarningLevel IOPSGetBatteryWarningLevel(void); * @discussion Indicates the system is connected to an external power source, without a time limit. */ -#define kIOPSTimeRemainingUnlimited ((CFTimeInterval)-2.0) +#define kIOPSTimeRemainingUnlimited ((CFTimeInterval)-2.0) /*! * @function IOPSGetTimeRemainingEstimate @@ -173,12 +172,11 @@ IOPSLowBatteryWarningLevel IOPSGetBatteryWarningLevel(void); */ CFTimeInterval IOPSGetTimeRemainingEstimate(void); - /*! * @functiongroup Power Source Descriptions */ -typedef void (*IOPowerSourceCallbackType)(void *context); +typedef void (*IOPowerSourceCallbackType)(void *context); /*! @function IOPSCopyPowerSourcesInfo * @@ -204,7 +202,7 @@ CFTypeRef IOPSCopyPowerSourcesInfo(void); * * @result One of: CFSTR(kIOPMACPowerKey), CFSTR(kIOPMBatteryPowerKey), CFSTR(kIOPMUPSPowerKey) */ -CFStringRef IOPSGetProvidingPowerSourceType(CFTypeRef snapshot); +CFStringRef IOPSGetProvidingPowerSourceType(CFTypeRef snapshot); /*! @function IOPSCopyPowerSourcesList * @@ -257,7 +255,6 @@ CFDictionaryRef IOPSGetPowerSourceDescription(CFTypeRef blob, CFTypeRef ps); */ CFRunLoopSourceRef IOPSNotificationCreateRunLoopSource(IOPowerSourceCallbackType callback, void *context); - /*! @function IOPSCopyExternalPowerAdapterDetails * * @abstract Returns a CFDictionary that describes the attached (AC) external diff --git a/IOKit/ps/IOUPSPlugIn.h b/IOKit/ps/IOUPSPlugIn.h index 10f8dd6c..8f202904 100644 --- a/IOKit/ps/IOUPSPlugIn.h +++ b/IOKit/ps/IOUPSPlugIn.h @@ -54,22 +54,21 @@ IODestroyPlugInInterface(). Do not call Release() on it.

    */ - + #ifndef _IOKIT_PM_IOUPSPLUGIN_H #define _IOKIT_PM_IOUPSPLUGIN_H #include #include - /* 40A57A4E-26A0-11D8-9295-000A958A2C78 */ /*! @define kIOUPSPlugInTypeID @discussion Type ID for the IOUPSPlugInInterface. Corresponds to an available UPS device. */ -#define kIOUPSPlugInTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ - 0x40, 0xa5, 0x7a, 0x4e, 0x26, 0xa0, 0x11, 0xd8, \ +#define kIOUPSPlugInTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ + 0x40, 0xa5, 0x7a, 0x4e, 0x26, 0xa0, 0x11, 0xd8, \ 0x92, 0x95, 0x00, 0x0a, 0x95, 0x8a, 0x2c, 0x78) /* 63F8BFC4-26A0-11D8-88B4-000A958A2C78 */ @@ -78,21 +77,20 @@ @discussion Interface ID for the IOUPSPlugInInterface. Corresponds to an available UPS device. */ -#define kIOUPSPlugInInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ - 0x63, 0xf8, 0xbf, 0xc4, 0x26, 0xa0, 0x11, 0xd8, \ +#define kIOUPSPlugInInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ + 0x63, 0xf8, 0xbf, 0xc4, 0x26, 0xa0, 0x11, 0xd8, \ 0x88, 0xb4, 0x0, 0xa, 0x95, 0x8a, 0x2c, 0x78) - + /* E60E0799-9AA6-49DF-B55B-A5C94BA07A4A */ /*! @define kIOUPSPlugInInterfaceID_v140 @discussion Interface ID for the IOUPSPlugInInterface. Corresponds to an available UPS device. */ -#define kIOUPSPlugInInterfaceID_v140 CFUUIDGetConstantUUIDWithBytes(NULL, \ - 0xe6, 0xe, 0x7, 0x99, 0x9a, 0xa6, 0x49, 0xdf, \ +#define kIOUPSPlugInInterfaceID_v140 CFUUIDGetConstantUUIDWithBytes(NULL, \ + 0xe6, 0xe, 0x7, 0x99, 0x9a, 0xa6, 0x49, 0xdf, \ 0xb5, 0x5b, 0xa5, 0xc9, 0x4b, 0xa0, 0x7a, 0x4a) - /*! @typedef IOUPSEventCallbackFunction @discussion Type and arguments of callout C function that is used when a @@ -105,31 +103,29 @@ @param sender Interface instance sending the completion routine. @param event CFDictionaryRef containing event data. */ -typedef void (*IOUPSEventCallbackFunction) - (void * target, - IOReturn result, - void * refcon, - void * sender, - CFDictionaryRef event); - -#define IOUPSPLUGINBASE \ - IOReturn (*getProperties)( void * thisPointer, \ - CFDictionaryRef * properties); \ - IOReturn (*getCapabilities)(void * thisPointer, \ - CFSetRef * capabilities); \ - IOReturn (*getEvent)( void * thisPointer, \ - CFDictionaryRef * event); \ - IOReturn (*setEventCallback)(void * thisPointer, \ - IOUPSEventCallbackFunction callback, \ - void * callbackTarget, \ - void * callbackRefcon); \ - IOReturn (*sendCommand)( void * thisPointer, \ - CFDictionaryRef command) - -#define IOUPSPLUGIN_V140 \ - IOReturn (*createAsyncEventSource)(void * thisPointer, \ - CFTypeRef * source) - +typedef void (*IOUPSEventCallbackFunction)(void *target, + IOReturn result, + void *refcon, + void *sender, + CFDictionaryRef event); + +#define IOUPSPLUGINBASE \ + IOReturn (*getProperties)(void *thisPointer, \ + CFDictionaryRef *properties); \ + IOReturn (*getCapabilities)(void *thisPointer, \ + CFSetRef *capabilities); \ + IOReturn (*getEvent)(void *thisPointer, \ + CFDictionaryRef *event); \ + IOReturn (*setEventCallback)(void *thisPointer, \ + IOUPSEventCallbackFunction callback, \ + void *callbackTarget, \ + void *callbackRefcon); \ + IOReturn (*sendCommand)(void *thisPointer, \ + CFDictionaryRef command) + +#define IOUPSPLUGIN_V140 \ + IOReturn (*createAsyncEventSource)(void *thisPointer, \ + CFTypeRef *source) typedef struct IOUPSPlugInInterface { IUNKNOWN_C_GUTS; @@ -143,9 +139,9 @@ typedef struct IOUPSPlugInInterface_v140 { } IOUPSPlugInInterface_v140; // -// BEGIN READABLE STRUCTURE DEFINITIONS -// -// This portion of uncompiled code provides a more reader friendly representation of +// BEGIN READABLE STRUCTURE DEFINITIONS +// +// This portion of uncompiled code provides a more reader friendly representation of // the CFPlugin methods defined above. #if 0 @@ -251,6 +247,6 @@ typedef struct IOUPSPlugInInterface { } IOUPSPlugInInterface; #endif -// END READABLE STRUCTURE DEFINITIONS +// END READABLE STRUCTURE DEFINITIONS #endif /* !_IOKIT_PM_IOUPSPLUGIN_H */ diff --git a/IOKit/pwr_mgt/IOPM.h b/IOKit/pwr_mgt/IOPM.h index f0002d5d..f9a92b3f 100644 --- a/IOKit/pwr_mgt/IOPM.h +++ b/IOKit/pwr_mgt/IOPM.h @@ -93,15 +93,15 @@ enum { */ typedef unsigned long IOPMPowerFlags; enum { - kIOPMPowerOn = 0x00000002, - kIOPMDeviceUsable = 0x00008000, - kIOPMLowPower = 0x00010000, - kIOPMPreventIdleSleep = 0x00000040, - kIOPMSleepCapability = 0x00000004, - kIOPMRestartCapability = 0x00000080, - kIOPMSleep = 0x00000001, - kIOPMRestart = 0x00000080, - kIOPMInitialDeviceState = 0x00000100 + kIOPMPowerOn = 0x00000002, + kIOPMDeviceUsable = 0x00008000, + kIOPMLowPower = 0x00010000, + kIOPMPreventIdleSleep = 0x00000040, + kIOPMSleepCapability = 0x00000004, + kIOPMRestartCapability = 0x00000080, + kIOPMSleep = 0x00000001, + kIOPMRestart = 0x00000080, + kIOPMInitialDeviceState = 0x00000100 }; /* @@ -112,13 +112,13 @@ enum { * Their behavior is undefined */ enum { - kIOPMClockNormal = 0x0004, - kIOPMClockRunning = 0x0008, - kIOPMPreventSystemSleep = 0x0010, - kIOPMDoze = 0x0400, - kIOPMChildClamp = 0x0080, - kIOPMChildClamp2 = 0x0200, - kIOPMNotPowerManaged = 0x0800 + kIOPMClockNormal = 0x0004, + kIOPMClockRunning = 0x0008, + kIOPMPreventSystemSleep = 0x0010, + kIOPMDoze = 0x0400, + kIOPMChildClamp = 0x0080, + kIOPMChildClamp2 = 0x0200, + kIOPMNotPowerManaged = 0x0800 }; /* @@ -127,50 +127,46 @@ enum { * Capability, InputPowerRequirement, or OutputPowerCharacter fields. */ enum { - kIOPMMaxPerformance = 0x4000, - kIOPMPassThrough = 0x0100, - kIOPMAuxPowerOn = 0x0020, - kIOPMNotAttainable = 0x0001, - kIOPMContextRetained = 0x2000, - kIOPMConfigRetained = 0x1000, - kIOPMStaticPowerValid = 0x0800, - kIOPMSoftSleep = 0x0400, - kIOPMCapabilitiesMask = kIOPMPowerOn | kIOPMDeviceUsable | - kIOPMMaxPerformance | kIOPMContextRetained | - kIOPMConfigRetained | kIOPMSleepCapability | - kIOPMRestartCapability + kIOPMMaxPerformance = 0x4000, + kIOPMPassThrough = 0x0100, + kIOPMAuxPowerOn = 0x0020, + kIOPMNotAttainable = 0x0001, + kIOPMContextRetained = 0x2000, + kIOPMConfigRetained = 0x1000, + kIOPMStaticPowerValid = 0x0800, + kIOPMSoftSleep = 0x0400, + kIOPMCapabilitiesMask = kIOPMPowerOn | kIOPMDeviceUsable | kIOPMMaxPerformance | kIOPMContextRetained | kIOPMConfigRetained | kIOPMSleepCapability | kIOPMRestartCapability }; /* * Support for old names of IOPMPowerFlag constants */ enum { - IOPMNotAttainable = kIOPMNotAttainable, - IOPMPowerOn = kIOPMPowerOn, - IOPMClockNormal = kIOPMClockNormal, - IOPMClockRunning = kIOPMClockRunning, - IOPMAuxPowerOn = kIOPMAuxPowerOn, - IOPMDeviceUsable = kIOPMDeviceUsable, - IOPMMaxPerformance = kIOPMMaxPerformance, - IOPMContextRetained = kIOPMContextRetained, - IOPMConfigRetained = kIOPMConfigRetained, - IOPMNotPowerManaged = kIOPMNotPowerManaged, - IOPMSoftSleep = kIOPMSoftSleep + IOPMNotAttainable = kIOPMNotAttainable, + IOPMPowerOn = kIOPMPowerOn, + IOPMClockNormal = kIOPMClockNormal, + IOPMClockRunning = kIOPMClockRunning, + IOPMAuxPowerOn = kIOPMAuxPowerOn, + IOPMDeviceUsable = kIOPMDeviceUsable, + IOPMMaxPerformance = kIOPMMaxPerformance, + IOPMContextRetained = kIOPMContextRetained, + IOPMConfigRetained = kIOPMConfigRetained, + IOPMNotPowerManaged = kIOPMNotPowerManaged, + IOPMSoftSleep = kIOPMSoftSleep }; - enum { - kIOPMNextHigherState = 1, - kIOPMHighestState = 2, - kIOPMNextLowerState = 3, - kIOPMLowestState = 4 + kIOPMNextHigherState = 1, + kIOPMHighestState = 2, + kIOPMNextLowerState = 3, + kIOPMLowestState = 4 }; enum { - IOPMNextHigherState = kIOPMNextHigherState, - IOPMHighestState = kIOPMHighestState, - IOPMNextLowerState = kIOPMNextLowerState, - IOPMLowestState = kIOPMLowestState + IOPMNextHigherState = kIOPMNextHigherState, + IOPMHighestState = kIOPMHighestState, + IOPMNextLowerState = kIOPMNextLowerState, + IOPMLowestState = kIOPMLowestState }; // Internal commands used by power managment command queue @@ -197,7 +193,7 @@ enum { * false == clamshell is open * not present == no clamshell on this hardware */ -#define kAppleClamshellStateKey "AppleClamshellState" +#define kAppleClamshellStateKey "AppleClamshellState" /* AppleClamshellCausesSleep * reflects the clamshell close behavior on a portable. @@ -207,7 +203,7 @@ enum { * (typically external display mode) * not present == no clamshell on this hardware */ -#define kAppleClamshellCausesSleepKey "AppleClamshellCausesSleep" +#define kAppleClamshellCausesSleepKey "AppleClamshellCausesSleep" /* kIOPMSleepWakeUUIDKey * Key refers to a CFStringRef that will uniquely identify @@ -220,7 +216,7 @@ enum { * * See IOPMrootDomain notification kIOPMMessageSleepWakeUUIDChange */ - #define kIOPMSleepWakeUUIDKey "SleepWakeUUID" +#define kIOPMSleepWakeUUIDKey "SleepWakeUUID" /* kIOPMDeepSleepEnabledKey * Indicates the Deep Sleep enable state. @@ -229,14 +225,14 @@ enum { * false == Deep Sleep is disabled * not present == Deep Sleep is not supported on this hardware */ -#define kIOPMDeepSleepEnabledKey "Standby Enabled" +#define kIOPMDeepSleepEnabledKey "Standby Enabled" /* kIOPMDeepSleepDelayKey * Key refers to a CFNumberRef that represents the delay in seconds before * entering Deep Sleep state. The property is not present if Deep Sleep is * unsupported. */ -#define kIOPMDeepSleepDelayKey "Standby Delay" +#define kIOPMDeepSleepDelayKey "Standby Delay" /* kIOPMDestroyFVKeyOnStandbyKey * Specifies if FileVault key can be stored when going to standby mode @@ -245,7 +241,7 @@ enum { * false == Retain FV key when going to standby mode * not present == Retain FV key when going to standby mode */ -#define kIOPMDestroyFVKeyOnStandbyKey "DestroyFVKeyOnStandby" +#define kIOPMDestroyFVKeyOnStandbyKey "DestroyFVKeyOnStandby" /******************************************************************************* * @@ -261,12 +257,12 @@ enum { * When set, PM kernel will prefer to leave the CPU and core hardware * running in "Dark Wake" state, instead of sleeping. */ - kIOPMDriverAssertionCPUBit = 0x01, + kIOPMDriverAssertionCPUBit = 0x01, /*! kIOPMDriverAssertionUSBExternalDeviceBit * When set, driver is informing PM that an external USB device is attached. */ - kIOPMDriverAssertionUSBExternalDeviceBit = 0x04, + kIOPMDriverAssertionUSBExternalDeviceBit = 0x04, /*! kIOPMDriverAssertionBluetoothHIDDevicePairedBit * When set, driver is informing PM that a Bluetooth HID device is paired. @@ -276,38 +272,38 @@ enum { /*! kIOPMDriverAssertionExternalMediaMountedBit * When set, driver is informing PM that an external media is mounted. */ - kIOPMDriverAssertionExternalMediaMountedBit = 0x10, + kIOPMDriverAssertionExternalMediaMountedBit = 0x10, /*! kIOPMDriverAssertionReservedBit5 * Reserved for Thunderbolt. */ - kIOPMDriverAssertionReservedBit5 = 0x20, + kIOPMDriverAssertionReservedBit5 = 0x20, /*! kIOPMDriverAssertionPreventDisplaySleepBit * When set, the display should remain powered on while the system's awake. */ - kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, + kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, - kIOPMDriverAssertionReservedBit7 = 0x80 + kIOPMDriverAssertionReservedBit7 = 0x80 }; - /* kIOPMAssertionsDriverKey +/* kIOPMAssertionsDriverKey * This kIOPMrootDomain key refers to a CFNumberRef property, containing * a bitfield describing the aggregate PM assertion levels. * Example: A value of 0 indicates that no driver has asserted anything. * Or, a value of kIOPMDriverAssertionCPUBit * indicates that a driver (or drivers) have asserted a need fro CPU and video. */ -#define kIOPMAssertionsDriverKey "DriverPMAssertions" +#define kIOPMAssertionsDriverKey "DriverPMAssertions" - /* kIOPMAssertionsDriverKey +/* kIOPMAssertionsDriverKey * This kIOPMrootDomain key refers to a CFNumberRef property, containing * a bitfield describing the aggregate PM assertion levels. * Example: A value of 0 indicates that no driver has asserted anything. * Or, a value of kIOPMDriverAssertionCPUBit * indicates that a driver (or drivers) have asserted a need fro CPU and video. */ -#define kIOPMAssertionsDriverDetailedKey "DriverPMAssertionsDetailed" +#define kIOPMAssertionsDriverDetailedKey "DriverPMAssertionsDetailed" /******************************************************************************* * @@ -317,13 +313,13 @@ enum { * kIOPMAssertionsDriverKey. * */ -#define kIOPMDriverAssertionIDKey "ID" -#define kIOPMDriverAssertionCreatedTimeKey "CreatedTime" -#define kIOPMDriverAssertionModifiedTimeKey "ModifiedTime" -#define kIOPMDriverAssertionOwnerStringKey "Owner" -#define kIOPMDriverAssertionOwnerServiceKey "ServicePtr" -#define kIOPMDriverAssertionLevelKey "Level" -#define kIOPMDriverAssertionAssertedKey "Assertions" +#define kIOPMDriverAssertionIDKey "ID" +#define kIOPMDriverAssertionCreatedTimeKey "CreatedTime" +#define kIOPMDriverAssertionModifiedTimeKey "ModifiedTime" +#define kIOPMDriverAssertionOwnerStringKey "Owner" +#define kIOPMDriverAssertionOwnerServiceKey "ServicePtr" +#define kIOPMDriverAssertionLevelKey "Level" +#define kIOPMDriverAssertionAssertedKey "Assertions" /******************************************************************************* * @@ -347,8 +343,8 @@ enum { kClamshellSleepBit = (1 << 1) }; -#define kIOPMMessageClamshellStateChange \ - iokit_family_msg(sub_iokit_powermanagement, 0x100) +#define kIOPMMessageClamshellStateChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x100) /* kIOPMMessageFeatureChange * Delivered when the set of supported features ("Supported Features" dictionary @@ -356,8 +352,8 @@ enum { * removal of a supported feature. * RootDomain passes no argument with this message. */ -#define kIOPMMessageFeatureChange \ - iokit_family_msg(sub_iokit_powermanagement, 0x110) +#define kIOPMMessageFeatureChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x110) /* kIOPMMessageInflowDisableCancelled * The battery has drained completely to its "Fully Discharged" state. @@ -373,40 +369,40 @@ enum { /* kIOPMMessageInternalBatteryFullyDischarged * The battery has drained completely to its "Fully Discharged" state. */ -#define kIOPMMessageInternalBatteryFullyDischarged \ - iokit_family_msg(sub_iokit_powermanagement, 0x120) +#define kIOPMMessageInternalBatteryFullyDischarged \ + iokit_family_msg(sub_iokit_powermanagement, 0x120) /* kIOPMMessageSystemPowerEventOccurred * Some major system thermal property has changed, and interested clients may * modify their behavior. */ -#define kIOPMMessageSystemPowerEventOccurred \ - iokit_family_msg(sub_iokit_powermanagement, 0x130) +#define kIOPMMessageSystemPowerEventOccurred \ + iokit_family_msg(sub_iokit_powermanagement, 0x130) /* kIOPMMessageSleepWakeUUIDChange * Either a new SleepWakeUUID has been specified at the beginning of a sleep, * or we're removing the existing property upon completion of a wakeup. */ -#define kIOPMMessageSleepWakeUUIDChange \ - iokit_family_msg(sub_iokit_powermanagement, 0x140) - +#define kIOPMMessageSleepWakeUUIDChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x140) + /* kIOPMMessageSleepWakeUUIDSet * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when * a new UUID has been specified. */ -#define kIOPMMessageSleepWakeUUIDSet ((void *)1) +#define kIOPMMessageSleepWakeUUIDSet ((void *)1) /* kIOPMMessageSleepWakeUUIDCleared * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when * the current UUID has been removed. */ -#define kIOPMMessageSleepWakeUUIDCleared ((void *)0) +#define kIOPMMessageSleepWakeUUIDCleared ((void *)0) /*! kIOPMMessageDriverAssertionsChanged * Sent when kernel PM driver assertions have changed. */ -#define kIOPMMessageDriverAssertionsChanged \ - iokit_family_msg(sub_iokit_powermanagement, 0x150) +#define kIOPMMessageDriverAssertionsChanged \ + iokit_family_msg(sub_iokit_powermanagement, 0x150) /******************************************************************************* * @@ -419,57 +415,56 @@ enum { * TODO: deprecate kIOPMAllowSleep and kIOPMPreventSleep ******************************************************************************/ enum { - kIOPMSleepNow = (1<<0), // put machine to sleep now - kIOPMAllowSleep = (1<<1), // allow idle sleep - kIOPMPreventSleep = (1<<2), // do not allow idle sleep - kIOPMPowerButton = (1<<3), // power button was pressed - kIOPMClamshellClosed = (1<<4), // clamshell was closed - kIOPMPowerEmergency = (1<<5), // battery dangerously low - kIOPMDisableClamshell = (1<<6), // do not sleep on clamshell closure - kIOPMEnableClamshell = (1<<7), // sleep on clamshell closure - kIOPMProcessorSpeedChange = (1<<8), // change the processor speed - kIOPMOverTemp = (1<<9), // system dangerously hot - kIOPMClamshellOpened = (1<<10) // clamshell was opened + kIOPMSleepNow = (1 << 0), // put machine to sleep now + kIOPMAllowSleep = (1 << 1), // allow idle sleep + kIOPMPreventSleep = (1 << 2), // do not allow idle sleep + kIOPMPowerButton = (1 << 3), // power button was pressed + kIOPMClamshellClosed = (1 << 4), // clamshell was closed + kIOPMPowerEmergency = (1 << 5), // battery dangerously low + kIOPMDisableClamshell = (1 << 6), // do not sleep on clamshell closure + kIOPMEnableClamshell = (1 << 7), // sleep on clamshell closure + kIOPMProcessorSpeedChange = (1 << 8), // change the processor speed + kIOPMOverTemp = (1 << 9), // system dangerously hot + kIOPMClamshellOpened = (1 << 10) // clamshell was opened }; - /******************************************************************************* * * Power Management Return Codes * ******************************************************************************/ enum { - kIOPMNoErr = 0, + kIOPMNoErr = 0, // Returned by driver's setPowerState(), powerStateWillChangeTo(), // powerStateDidChangeTo(), or acknowledgeSetPowerState() to // implicitly acknowledge power change upon function return. - kIOPMAckImplied = 0, + kIOPMAckImplied = 0, // Deprecated - kIOPMWillAckLater = 1, + kIOPMWillAckLater = 1, // Returned by requestPowerDomainState() to indicate // unrecognized specification parameter. - kIOPMBadSpecification = 4, + kIOPMBadSpecification = 4, // Returned by requestPowerDomainState() to indicate // no power state matches search specification. - kIOPMNoSuchState = 5, + kIOPMNoSuchState = 5, // Deprecated - kIOPMCannotRaisePower = 6, + kIOPMCannotRaisePower = 6, // Deprecated - kIOPMParameterError = 7, + kIOPMParameterError = 7, // Returned when power management state is accessed // before driver has called PMinit(). - kIOPMNotYetInitialized = 8, + kIOPMNotYetInitialized = 8, // And the old constants; deprecated IOPMNoErr = kIOPMNoErr, - IOPMAckImplied = kIOPMAckImplied, + IOPMAckImplied = kIOPMAckImplied, IOPMWillAckLater = kIOPMWillAckLater, IOPMBadSpecification = kIOPMBadSpecification, IOPMNoSuchState = kIOPMNoSuchState, @@ -478,50 +473,49 @@ enum { IOPMNotYetInitialized = kIOPMNotYetInitialized }; - // IOPMPowerSource class descriptive strings -// Power Source state is published as properties to the IORegistry under these +// Power Source state is published as properties to the IORegistry under these // keys. -#define kIOPMPSExternalConnectedKey "ExternalConnected" -#define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable" -#define kIOPMPSBatteryInstalledKey "BatteryInstalled" -#define kIOPMPSIsChargingKey "IsCharging" -#define kIOPMFullyChargedKey "FullyCharged" -#define kIOPMPSAtWarnLevelKey "AtWarnLevel" -#define kIOPMPSAtCriticalLevelKey "AtCriticalLevel" -#define kIOPMPSCurrentCapacityKey "CurrentCapacity" -#define kIOPMPSMaxCapacityKey "MaxCapacity" -#define kIOPMPSDesignCapacityKey "DesignCapacity" -#define kIOPMPSTimeRemainingKey "TimeRemaining" -#define kIOPMPSAmperageKey "Amperage" -#define kIOPMPSVoltageKey "Voltage" -#define kIOPMPSCycleCountKey "CycleCount" -#define kIOPMPSMaxErrKey "MaxErr" -#define kIOPMPSAdapterInfoKey "AdapterInfo" -#define kIOPMPSLocationKey "Location" -#define kIOPMPSErrorConditionKey "ErrorCondition" -#define kIOPMPSManufacturerKey "Manufacturer" -#define kIOPMPSManufactureDateKey "ManufactureDate" -#define kIOPMPSModelKey "Model" -#define kIOPMPSSerialKey "Serial" -#define kIOPMDeviceNameKey "DeviceName" -#define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo" -#define kIOPMPSBatteryHealthKey "BatteryHealth" -#define kIOPMPSHealthConfidenceKey "HealthConfidence" -#define kIOPMPSCapacityEstimatedKey "CapacityEstimated" -#define kIOPMPSBatteryChargeStatusKey "ChargeStatus" -#define kIOPMPSBatteryTemperatureKey "Temperature" -#define kIOPMPSAdapterDetailsKey "AdapterDetails" -#define kIOPMPSChargerConfigurationKey "ChargerConfiguration" +#define kIOPMPSExternalConnectedKey "ExternalConnected" +#define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable" +#define kIOPMPSBatteryInstalledKey "BatteryInstalled" +#define kIOPMPSIsChargingKey "IsCharging" +#define kIOPMFullyChargedKey "FullyCharged" +#define kIOPMPSAtWarnLevelKey "AtWarnLevel" +#define kIOPMPSAtCriticalLevelKey "AtCriticalLevel" +#define kIOPMPSCurrentCapacityKey "CurrentCapacity" +#define kIOPMPSMaxCapacityKey "MaxCapacity" +#define kIOPMPSDesignCapacityKey "DesignCapacity" +#define kIOPMPSTimeRemainingKey "TimeRemaining" +#define kIOPMPSAmperageKey "Amperage" +#define kIOPMPSVoltageKey "Voltage" +#define kIOPMPSCycleCountKey "CycleCount" +#define kIOPMPSMaxErrKey "MaxErr" +#define kIOPMPSAdapterInfoKey "AdapterInfo" +#define kIOPMPSLocationKey "Location" +#define kIOPMPSErrorConditionKey "ErrorCondition" +#define kIOPMPSManufacturerKey "Manufacturer" +#define kIOPMPSManufactureDateKey "ManufactureDate" +#define kIOPMPSModelKey "Model" +#define kIOPMPSSerialKey "Serial" +#define kIOPMDeviceNameKey "DeviceName" +#define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo" +#define kIOPMPSBatteryHealthKey "BatteryHealth" +#define kIOPMPSHealthConfidenceKey "HealthConfidence" +#define kIOPMPSCapacityEstimatedKey "CapacityEstimated" +#define kIOPMPSBatteryChargeStatusKey "ChargeStatus" +#define kIOPMPSBatteryTemperatureKey "Temperature" +#define kIOPMPSAdapterDetailsKey "AdapterDetails" +#define kIOPMPSChargerConfigurationKey "ChargerConfiguration" // kIOPMPSBatteryChargeStatusKey may have one of the following values, or may have // no value. If kIOPMBatteryChargeStatusKey has a NULL value (or no value) associated with it // then charge is proceeding normally. If one of these battery charge status reasons is listed, // then the charge may have been interrupted. -#define kIOPMBatteryChargeStatusTooHot "HighTemperature" -#define kIOPMBatteryChargeStatusTooCold "LowTemperature" -#define kIOPMBatteryChargeStatusTooHotOrCold "HighOrLowTemperature" -#define kIOPMBatteryChargeStatusGradient "BatteryTemperatureGradient" +#define kIOPMBatteryChargeStatusTooHot "HighTemperature" +#define kIOPMBatteryChargeStatusTooCold "LowTemperature" +#define kIOPMBatteryChargeStatusTooHotOrCold "HighOrLowTemperature" +#define kIOPMBatteryChargeStatusGradient "BatteryTemperatureGradient" // Definitions for battery location, in case of multiple batteries. // A location of 0 is unspecified @@ -535,32 +529,31 @@ enum { // properties in an IOPMPowerSource battery kext. enum { kIOPMUndefinedValue = 0, - kIOPMPoorValue = 1, - kIOPMFairValue = 2, - kIOPMGoodValue = 3 + kIOPMPoorValue = 1, + kIOPMFairValue = 2, + kIOPMGoodValue = 3 }; // Keys for kIOPMPSAdapterDetailsKey dictionary -#define kIOPMPSAdapterDetailsIDKey "AdapterID" -#define kIOPMPSAdapterDetailsWattsKey "Watts" -#define kIOPMPSAdapterDetailsRevisionKey "AdapterRevision" -#define kIOPMPSAdapterDetailsSerialNumberKey "SerialNumber" -#define kIOPMPSAdapterDetailsFamilyKey "FamilyCode" -#define kIOPMPSAdapterDetailsAmperageKey "Amperage" -#define kIOPMPSAdapterDetailsDescriptionKey "Description" -#define kIOPMPSAdapterDetailsPMUConfigurationKey "PMUConfiguration" +#define kIOPMPSAdapterDetailsIDKey "AdapterID" +#define kIOPMPSAdapterDetailsWattsKey "Watts" +#define kIOPMPSAdapterDetailsRevisionKey "AdapterRevision" +#define kIOPMPSAdapterDetailsSerialNumberKey "SerialNumber" +#define kIOPMPSAdapterDetailsFamilyKey "FamilyCode" +#define kIOPMPSAdapterDetailsAmperageKey "Amperage" +#define kIOPMPSAdapterDetailsDescriptionKey "Description" +#define kIOPMPSAdapterDetailsPMUConfigurationKey "PMUConfiguration" // Battery's time remaining estimate is invalid this long (seconds) after a wake -#define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds" +#define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds" // Battery must wait this long (seconds) after being completely charged before // the battery is settled. -#define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds" +#define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds" -// Battery must wait this long (seconds) after being completely discharged +// Battery must wait this long (seconds) after being completely discharged // before the battery is settled. -#define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds" - +#define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds" /* CPU Power Management status keys * Pass as arguments to IOPMrootDomain::systemPowerEventOccurred @@ -571,53 +564,49 @@ enum { * power constraints. */ - /* kIOPMGraphicsPowerLimitsKey * The key representing the dictionary of graphics power limits. * The dictionary contains the other kIOPMCPUPower keys & their associated * values (e.g. Speed limit, Processor Count, and Schedule limits). */ -#define kIOPMGraphicsPowerLimitsKey "Graphics_Power_Limits" +#define kIOPMGraphicsPowerLimitsKey "Graphics_Power_Limits" /* kIOPMGraphicsPowerLimitPerformanceKey * The key representing the percent of overall performance made available * by the graphics chip as a percentage (integer 0 - 100). */ -#define kIOPMGraphicsPowerLimitPerformanceKey "Graphics_Power_Performance" - - +#define kIOPMGraphicsPowerLimitPerformanceKey "Graphics_Power_Performance" /* kIOPMCPUPowerLimitsKey * The key representing the dictionary of CPU Power Limits. * The dictionary contains the other kIOPMCPUPower keys & their associated * values (e.g. Speed limit, Processor Count, and Schedule limits). */ -#define kIOPMCPUPowerLimitsKey "CPU_Power_Limits" +#define kIOPMCPUPowerLimitsKey "CPU_Power_Limits" /* kIOPMCPUPowerLimitProcessorSpeedKey defines the speed & voltage limits placed * on the CPU. * Represented as a percentage (0-100) of maximum CPU speed. */ -#define kIOPMCPUPowerLimitProcessorSpeedKey "CPU_Speed_Limit" +#define kIOPMCPUPowerLimitProcessorSpeedKey "CPU_Speed_Limit" /* kIOPMCPUPowerLimitProcessorCountKey reflects how many, if any, CPUs have been * taken offline. Represented as an integer number of CPUs (0 - Max CPUs). */ -#define kIOPMCPUPowerLimitProcessorCountKey "CPU_Available_CPUs" +#define kIOPMCPUPowerLimitProcessorCountKey "CPU_Available_CPUs" /* kIOPMCPUPowerLimitSchedulerTimeKey represents the percentage (0-100) of CPU time * available. 100% at normal operation. The OS may limit this time for a percentage * less than 100%. */ -#define kIOPMCPUPowerLimitSchedulerTimeKey "CPU_Scheduler_Limit" - +#define kIOPMCPUPowerLimitSchedulerTimeKey "CPU_Scheduler_Limit" /* Thermal Level Warning Key * Indicates the thermal constraints placed on the system. This value may * cause clients to action to consume fewer system resources. * The value associated with this warning is defined by the platform. */ -#define kIOPMThermalLevelWarningKey "Thermal_Level_Warning" +#define kIOPMThermalLevelWarningKey "Thermal_Level_Warning" /* Thermal Warning Level values * kIOPMThermalWarningLevelNormal - under normal operating conditions @@ -627,51 +616,50 @@ enum { * The platform may define additional thermal levels if necessary. */ enum { - kIOPMThermalWarningLevelNormal = 0, - kIOPMThermalWarningLevelDanger = 5, - kIOPMThermalWarningLevelCrisis = 10 + kIOPMThermalWarningLevelNormal = 0, + kIOPMThermalWarningLevelDanger = 5, + kIOPMThermalWarningLevelCrisis = 10 }; - // PM Settings Controller setting types // Settings types used primarily with: // IOPMrootDomain::registerPMSettingController // The values are identical to the similarly named keys for use in user space // PM settings work. Those keys are defined in IOPMLibPrivate.h. -#define kIOPMSettingWakeOnRingKey "Wake On Modem Ring" -#define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss" -#define kIOPMSettingWakeOnACChangeKey "Wake On AC Change" -#define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button" -#define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open" -#define kIOPMSettingReduceBrightnessKey "ReduceBrightness" -#define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim" -#define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds" -#define kIOPMSettingMobileMotionModuleKey "MobileMotionModule" -#define kIOPMSettingGraphicsSwitchKey "GPUSwitch" +#define kIOPMSettingWakeOnRingKey "Wake On Modem Ring" +#define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss" +#define kIOPMSettingWakeOnACChangeKey "Wake On AC Change" +#define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button" +#define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open" +#define kIOPMSettingReduceBrightnessKey "ReduceBrightness" +#define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim" +#define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds" +#define kIOPMSettingMobileMotionModuleKey "MobileMotionModule" +#define kIOPMSettingGraphicsSwitchKey "GPUSwitch" // Setting controlling drivers can register to receive scheduled wake data // Either in "CF seconds" type, or structured calendar data in a formatted // IOPMCalendarStruct defined below. -#define kIOPMSettingAutoWakeSecondsKey "wake" -#define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate" -#define kIOPMSettingAutoPowerSecondsKey "poweron" -#define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate" +#define kIOPMSettingAutoWakeSecondsKey "wake" +#define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate" +#define kIOPMSettingAutoPowerSecondsKey "poweron" +#define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate" // Debug seconds auto wake // Used by sleep cycling debug tools -#define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep" -#define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown" +#define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep" +#define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown" // Maintenance wake calendar. -#define kIOPMSettingMaintenanceWakeCalendarKey "MaintenanceWakeCalendarDate" +#define kIOPMSettingMaintenanceWakeCalendarKey "MaintenanceWakeCalendarDate" struct IOPMCalendarStruct { - UInt32 year; - UInt8 month; - UInt8 day; - UInt8 hour; - UInt8 minute; - UInt8 second; + UInt32 year; + UInt8 month; + UInt8 day; + UInt8 hour; + UInt8 minute; + UInt8 second; }; typedef struct IOPMCalendarStruct IOPMCalendarStruct; @@ -687,7 +675,7 @@ enum { kPMMotionSensor, kPMLastAggressivenessType }; -#define kMaxType (kPMLastAggressivenessType-1) +#define kMaxType (kPMLastAggressivenessType - 1) // SetAggressiveness values for the kPMPowerSource aggressiveness type enum { @@ -695,46 +683,46 @@ enum { kIOPMExternalPower }; -#define kIOREMSleepEnabledKey "REMSleepEnabled" +#define kIOREMSleepEnabledKey "REMSleepEnabled" // Strings for deciphering the dictionary returned from IOPMCopyBatteryInfo -#define kIOBatteryInfoKey "IOBatteryInfo" -#define kIOBatteryCurrentChargeKey "Current" -#define kIOBatteryCapacityKey "Capacity" -#define kIOBatteryFlagsKey "Flags" -#define kIOBatteryVoltageKey "Voltage" -#define kIOBatteryAmperageKey "Amperage" -#define kIOBatteryCycleCountKey "Cycle Count" +#define kIOBatteryInfoKey "IOBatteryInfo" +#define kIOBatteryCurrentChargeKey "Current" +#define kIOBatteryCapacityKey "Capacity" +#define kIOBatteryFlagsKey "Flags" +#define kIOBatteryVoltageKey "Voltage" +#define kIOBatteryAmperageKey "Amperage" +#define kIOBatteryCycleCountKey "Cycle Count" enum { - kIOBatteryInstalled = (1 << 2), - kIOBatteryCharge = (1 << 1), - kIOBatteryChargerConnect = (1 << 0) + kIOBatteryInstalled = (1 << 2), + kIOBatteryCharge = (1 << 1), + kIOBatteryChargerConnect = (1 << 0) }; // Private power management message indicating battery data has changed // Indicates new data resides in the IORegistry -#define kIOPMMessageBatteryStatusHasChanged iokit_family_msg(sub_iokit_pmu, 0x100) +#define kIOPMMessageBatteryStatusHasChanged iokit_family_msg(sub_iokit_pmu, 0x100) // Apple private Legacy messages for re-routing AutoWake and AutoPower messages to the PMU // through newer user space IOPMSchedulePowerEvent API -#define kIOPMUMessageLegacyAutoWake iokit_family_msg(sub_iokit_pmu, 0x200) -#define kIOPMUMessageLegacyAutoPower iokit_family_msg(sub_iokit_pmu, 0x210) +#define kIOPMUMessageLegacyAutoWake iokit_family_msg(sub_iokit_pmu, 0x200) +#define kIOPMUMessageLegacyAutoPower iokit_family_msg(sub_iokit_pmu, 0x210) // For use with IOPMPowerSource bFlags -#define IOPM_POWER_SOURCE_REV 2 +#define IOPM_POWER_SOURCE_REV 2 enum { - kIOPMACInstalled = kIOBatteryChargerConnect, - kIOPMBatteryCharging = kIOBatteryCharge, - kIOPMBatteryInstalled = kIOBatteryInstalled, - kIOPMUPSInstalled = (1<<3), - kIOPMBatteryAtWarn = (1<<4), - kIOPMBatteryDepleted = (1<<5), - kIOPMACnoChargeCapability = (1<<6), // AC adapter cannot charge battery - kIOPMRawLowBattery = (1<<7), // used only by Platform Expert - kIOPMForceLowSpeed = (1<<8), // set by Platfm Expert, chk'd by Pwr Plugin - kIOPMClosedClamshell = (1<<9), // set by PMU - reflects state of the clamshell - kIOPMClamshellStateOnWake = (1<<10) // used only by Platform Expert + kIOPMACInstalled = kIOBatteryChargerConnect, + kIOPMBatteryCharging = kIOBatteryCharge, + kIOPMBatteryInstalled = kIOBatteryInstalled, + kIOPMUPSInstalled = (1 << 3), + kIOPMBatteryAtWarn = (1 << 4), + kIOPMBatteryDepleted = (1 << 5), + kIOPMACnoChargeCapability = (1 << 6), // AC adapter cannot charge battery + kIOPMRawLowBattery = (1 << 7), // used only by Platform Expert + kIOPMForceLowSpeed = (1 << 8), // set by Platfm Expert, chk'd by Pwr Plugin + kIOPMClosedClamshell = (1 << 9), // set by PMU - reflects state of the clamshell + kIOPMClamshellStateOnWake = (1 << 10) // used only by Platform Expert }; // ********************************************** @@ -754,17 +742,17 @@ enum { }; struct stateChangeNote { - IOPMPowerFlags stateFlags; - unsigned long stateNum; - void * powerRef; + IOPMPowerFlags stateFlags; + unsigned long stateNum; + void *powerRef; }; typedef struct stateChangeNote stateChangeNote; struct IOPowerStateChangeNotification { - void * powerRef; - unsigned long returnValue; - unsigned long stateNumber; - IOPMPowerFlags stateFlags; + void *powerRef; + unsigned long returnValue; + unsigned long stateNumber; + IOPMPowerFlags stateFlags; }; typedef struct IOPowerStateChangeNotification IOPowerStateChangeNotification; typedef IOPowerStateChangeNotification sleepWakeNote; @@ -795,13 +783,13 @@ typedef IOPowerStateChangeNotification sleepWakeNote; @field __reserved2 Set to zero. */ struct IOPMSystemCapabilityChangeParameters { - uint32_t notifyRef; - uint32_t maxWaitForReply; - uint32_t changeFlags; - uint32_t __reserved1; - uint32_t fromCapabilities; - uint32_t toCapabilities; - uint32_t __reserved2[4]; + uint32_t notifyRef; + uint32_t maxWaitForReply; + uint32_t changeFlags; + uint32_t __reserved1; + uint32_t fromCapabilities; + uint32_t toCapabilities; + uint32_t __reserved2[4]; }; /*! @enum IOPMSystemCapabilityChangeFlags @@ -810,14 +798,14 @@ struct IOPMSystemCapabilityChangeParameters { */ enum { kIOPMSystemCapabilityWillChange = 0x01, - kIOPMSystemCapabilityDidChange = 0x02 + kIOPMSystemCapabilityDidChange = 0x02 }; enum { - kIOPMSystemCapabilityCPU = 0x01, - kIOPMSystemCapabilityGraphics = 0x02, - kIOPMSystemCapabilityAudio = 0x04, - kIOPMSystemCapabilityNetwork = 0x08 + kIOPMSystemCapabilityCPU = 0x01, + kIOPMSystemCapabilityGraphics = 0x02, + kIOPMSystemCapabilityAudio = 0x04, + kIOPMSystemCapabilityNetwork = 0x08 }; #endif /* ! _IOKIT_IOPM_H */ diff --git a/IOKit/pwr_mgt/IOPMKeys.h b/IOKit/pwr_mgt/IOPMKeys.h index 906c1287..07e6ebf3 100644 --- a/IOKit/pwr_mgt/IOPMKeys.h +++ b/IOKit/pwr_mgt/IOPMKeys.h @@ -28,10 +28,10 @@ Note that all of these C strings must be converted to CFStrings before use. You can wrap them with the CFSTR() macro, or create a CFStringRef (that you must later CFRelease()) using CFStringCreateWithCString() */ - + #ifndef _IOPMKEYS_H_ #define _IOPMKEYS_H_ - + /* * Types of power event * These are potential arguments to IOPMSchedulePowerEvent(). @@ -42,13 +42,13 @@ @define kIOPMAutoWake @abstract Value for scheduled wake from sleep. */ -#define kIOPMAutoWake "wake" +#define kIOPMAutoWake "wake" /*! @define kIOPMAutoPowerOn @abstract Value for scheduled power on from off state. */ -#define kIOPMAutoPowerOn "poweron" +#define kIOPMAutoPowerOn "poweron" /*! @define kIOPMAutoWakeOrPowerOn @@ -56,25 +56,25 @@ power on, whichever is necessary. */ -#define kIOPMAutoWakeOrPowerOn "wakepoweron" +#define kIOPMAutoWakeOrPowerOn "wakepoweron" /*! @define kIOPMAutoSleep @abstract Value for scheduled sleep. */ -#define kIOPMAutoSleep "sleep" +#define kIOPMAutoSleep "sleep" /*! @define kIOPMAutoShutdown @abstract Value for scheduled shutdown. */ -#define kIOPMAutoShutdown "shutdown" +#define kIOPMAutoShutdown "shutdown" /*! @define kIOPMAutoRestart @abstract Value for scheduled restart. */ -#define kIOPMAutoRestart "restart" +#define kIOPMAutoRestart "restart" /* * Keys for evaluating the CFDictionaries returned by IOPMCopyScheduledPowerEvents() @@ -83,18 +83,18 @@ @define kIOPMPowerEventTimeKey @abstract Key for the time of the scheduled power event. Value is a CFDateRef. */ -#define kIOPMPowerEventTimeKey "time" +#define kIOPMPowerEventTimeKey "time" /*! @define kIOPMPowerEventAppNameKey @abstract Key for the CFBundleIdentifier of the app that scheduled the power event. Value is a CFStringRef. */ -#define kIOPMPowerEventAppNameKey "scheduledby" +#define kIOPMPowerEventAppNameKey "scheduledby" /*! @define kIOPMPowerEventTypeKey @abstract Key for the type of power event. Value is a CFStringRef, with the c-string value of one of the "kIOPMAuto" strings. */ -#define kIOPMPowerEventTypeKey "eventtype" +#define kIOPMPowerEventTypeKey "eventtype" #endif diff --git a/IOKit/pwr_mgt/IOPMLib.h b/IOKit/pwr_mgt/IOPMLib.h index f7876480..3278b32f 100644 --- a/IOKit/pwr_mgt/IOPMLib.h +++ b/IOKit/pwr_mgt/IOPMLib.h @@ -46,9 +46,9 @@ extern "C" { @param master_device_port Just pass in MACH_PORT_NULL for master device port. @result Returns a io_connect_t handle on the root domain. Must be released with IOServiceClose() when done. */ -io_connect_t IOPMFindPowerManagement( mach_port_t master_device_port ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; - +io_connect_t IOPMFindPowerManagement(mach_port_t master_device_port) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; + /*! @function IOPMSetAggressiveness @abstract Sets one of the aggressiveness factors in IOKit Power Management. @param fb Representation of the Root Power Domain from IOPMFindPowerManagement. @@ -56,9 +56,9 @@ io_connect_t IOPMFindPowerManagement( mach_port_t master_device_port ) @param aggressiveness New value of the aggressiveness factor. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IOPMSetAggressiveness (io_connect_t fb, unsigned long type, unsigned long aggressiveness ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; - +IOReturn IOPMSetAggressiveness(io_connect_t fb, unsigned long type, unsigned long aggressiveness) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; + /*! @function IOPMGetAggressiveness @abstract Retrieves the current value of one of the aggressiveness factors in IOKit Power Management. @param fb Representation of the Root Power Domain from IOPMFindPowerManagement. @@ -66,14 +66,14 @@ IOReturn IOPMSetAggressiveness (io_connect_t fb, unsigned long type, unsigned lo @param aggressiveness Points to where to store the retrieved value of the aggressiveness factor. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IOPMGetAggressiveness ( io_connect_t fb, unsigned long type, unsigned long * aggressiveness ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +IOReturn IOPMGetAggressiveness(io_connect_t fb, unsigned long type, unsigned long *aggressiveness) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IOPMSleepEnabled @abstract Tells whether the system supports full sleep, or just doze @result Returns true if the system supports sleep, false if some hardware prevents full sleep. */ -boolean_t IOPMSleepEnabled ( void ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +boolean_t IOPMSleepEnabled(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IOPMSleepSystem @abstract Request that the system initiate sleep. @@ -81,7 +81,7 @@ boolean_t IOPMSleepEnabled ( void ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; @param fb Port used to communicate to the kernel, from IOPMFindPowerManagement. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IOPMSleepSystem ( io_connect_t fb ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +IOReturn IOPMSleepSystem(io_connect_t fb) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IOPMCopyBatteryInfo @abstract Request raw battery data from the system. @@ -90,15 +90,12 @@ IOReturn IOPMSleepSystem ( io_connect_t fb ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND @param info A CFArray of CFDictionaries containing raw battery data. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IOPMCopyBatteryInfo( mach_port_t masterPort, CFArrayRef * info ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; - - +IOReturn IOPMCopyBatteryInfo(mach_port_t masterPort, CFArrayRef *info) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @functiongroup Notifications -*/ - +*/ /*! @function IORegisterApp @abstract Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService. @@ -110,12 +107,12 @@ IOReturn IOPMCopyBatteryInfo( mach_port_t masterPort, CFArrayRef * info ) @param notifier Pointer to a notifier which caller must keep and pass to subsequent call to IODeregisterApp. @result Returns a io_connect_t session for the IOService or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterApp on the notifier argument. */ -io_connect_t IORegisterApp( void * refcon, - io_service_t theDriver, - IONotificationPortRef * thePortRef, - IOServiceInterestCallback callback, - io_object_t * notifier ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +io_connect_t IORegisterApp(void *refcon, + io_service_t theDriver, + IONotificationPortRef *thePortRef, + IOServiceInterestCallback callback, + io_object_t *notifier) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IORegisterForSystemPower @abstract Connects the caller to the Root Power Domain IOService for the purpose of receiving sleep & wake notifications for the system. @@ -169,26 +166,26 @@ io_connect_t IORegisterApp( void * refcon, @result Returns a io_connect_t session for the IOPMrootDomain or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterForSystemPower on the notifier argument. */ -io_connect_t IORegisterForSystemPower ( void * refcon, - IONotificationPortRef * thePortRef, - IOServiceInterestCallback callback, - io_object_t * notifier ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +io_connect_t IORegisterForSystemPower(void *refcon, + IONotificationPortRef *thePortRef, + IOServiceInterestCallback callback, + io_object_t *notifier) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IODeregisterApp @abstract Disconnects the caller from an IOService after receiving power state change notifications from the IOService. (Caller must also release IORegisterApp's return io_connect_t and returned IONotificationPortRef for complete clean-up). @param notifier An object from IORegisterApp. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IODeregisterApp ( io_object_t * notifier ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +IOReturn IODeregisterApp(io_object_t *notifier) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IODeregisterForSystemPower @abstract Disconnects the caller from the Root Power Domain IOService after receiving system power state change notifications. (Caller must also destroy the IONotificationPortRef returned from IORegisterForSystemPower.) @param notifier The object returned from IORegisterForSystemPower. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IODeregisterForSystemPower ( io_object_t * notifier ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; - +IOReturn IODeregisterForSystemPower(io_object_t *notifier) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; + /*! @function IOAllowPowerChange @abstract The caller acknowledges notification of a power state change on a device it has registered for notifications for via IORegisterForSystemPower or IORegisterApp. @discussion Must be used when handling kIOMessageCanSystemSleep and kIOMessageSystemWillSleep messages from IOPMrootDomain system power. The caller should not call IOAllowPowerChange in response to any messages @@ -197,8 +194,8 @@ IOReturn IODeregisterForSystemPower ( io_object_t * notifier ) @param notificationID A copy of the notification ID which came as part of the power state change notification being acknowledged. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IOAllowPowerChange ( io_connect_t kernelPort, long notificationID ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +IOReturn IOAllowPowerChange(io_connect_t kernelPort, long notificationID) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @function IOCancelPowerChange @abstract The caller denies an idle system sleep power state change. @@ -213,12 +210,12 @@ IOReturn IOAllowPowerChange ( io_connect_t kernelPort, long notificationID ) @param notificationID A copy of the notification ID which came as part of the power state change notification being acknowledged. @result Returns kIOReturnSuccess or an error condition if request failed. */ -IOReturn IOCancelPowerChange ( io_connect_t kernelPort, long notificationID ) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; +IOReturn IOCancelPowerChange(io_connect_t kernelPort, long notificationID) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; /*! @functiongroup ScheduledEvents -*/ +*/ /*! @function IOPMSchedulePowerEvent @abstract Schedule the machine to wake from sleep, power on, go to sleep, or shutdown. @@ -253,8 +250,6 @@ IOReturn IOPMCancelScheduledPowerEvent(CFDateRef time_to_wake, CFStringRef my_id */ CFArrayRef IOPMCopyScheduledPowerEvents(void); - - /*! * @defineblock IOPMAssertionDictionaryKeys * @@ -276,8 +271,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * * This key may be present in the dictionary returned from @link IOPMAssertionCopyProperties@/link. */ -#define kIOPMAssertionTimeoutKey CFSTR("TimeoutSeconds") - +#define kIOPMAssertionTimeoutKey CFSTR("TimeoutSeconds") /*! * @define kIOPMAssertionTimeoutActionKey @@ -291,7 +285,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * * This key may be present in the dictionary returned from @link IOPMAssertionCopyProperties@/link. */ -#define kIOPMAssertionTimeoutActionKey CFSTR("TimeoutAction") +#define kIOPMAssertionTimeoutActionKey CFSTR("TimeoutAction") /*! * @define kIOPMAssertionTimeoutActionLog @@ -302,7 +296,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * but will not turn off or affect the setting of the assertion in any way. * */ -#define kIOPMAssertionTimeoutActionLog CFSTR("TimeoutActionLog") +#define kIOPMAssertionTimeoutActionLog CFSTR("TimeoutActionLog") /*! * @define kIOPMAssertionTimeoutActionTurnOff @@ -310,7 +304,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * @discussion When a timeout expires with this action, Power Management will log the timeout event, * and will set the assertion's level to @link kIOPMAssertionLevelOff@/link. */ -#define kIOPMAssertionTimeoutActionTurnOff CFSTR("TimeoutActionTurnOff") +#define kIOPMAssertionTimeoutActionTurnOff CFSTR("TimeoutActionTurnOff") /*! * @define kIOPMAssertionTimeoutActionRelease @@ -318,8 +312,8 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * @discussion When a timeout expires with this action, Power Management will log the timeout event, * and will release the assertion. */ -#define kIOPMAssertionTimeoutActionRelease CFSTR("TimeoutActionRelease") - +#define kIOPMAssertionTimeoutActionRelease CFSTR("TimeoutActionRelease") + /*! * @define kIOPMAssertionRetainCountKey * @@ -330,7 +324,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * * This key can be found in the dictionary returned from @link IOPMAssertionCopyProperties@/link. */ -#define kIOPMAssertionRetainCountKey CFSTR("RetainCount") +#define kIOPMAssertionRetainCountKey CFSTR("RetainCount") /*! * @define kIOPMAssertionNameKey @@ -351,7 +345,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * OPTIONAL @link kIOPMAssertionHumanReadableReasonKey @/link * OPTIONAL @link kIOPMAssertionLocalizationBundlePathKey@/link */ -#define kIOPMAssertionNameKey CFSTR("AssertName") +#define kIOPMAssertionNameKey CFSTR("AssertName") /*! * @define kIOPMAssertionDetailsKey @@ -374,8 +368,8 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * OPTIONAL @link kIOPMAssertionHumanReadableReasonKey @/link * OPTIONAL @link kIOPMAssertionLocalizationBundlePathKey@/link */ -#define kIOPMAssertionDetailsKey CFSTR("Details") - +#define kIOPMAssertionDetailsKey CFSTR("Details") + /*! * @define kIOPMAssertionHumanReadableReasonKey * @@ -398,7 +392,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * REQUIRED @link kIOPMAssertionNameKey@/link * OPTIONAL @link kIOPMAssertionDetailsKey @/link */ -#define kIOPMAssertionHumanReadableReasonKey CFSTR("HumanReadableReason") +#define kIOPMAssertionHumanReadableReasonKey CFSTR("HumanReadableReason") /*! * @define kIOPMAssertionLocalizationBundlePathKey @@ -413,7 +407,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * * This key may be present in the dictionary returned from @link IOPMAssertionCopyProperties@/link. */ -#define kIOPMAssertionLocalizationBundlePathKey CFSTR("BundlePath") +#define kIOPMAssertionLocalizationBundlePathKey CFSTR("BundlePath") /*! * @define kIOPMAssertionFrameworkIDKey @@ -428,7 +422,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * * This key may be present in the dictionary returned from @link IOPMAssertionCopyProperties@/link. */ -#define kIOPMAssertionFrameworkIDKey CFSTR("FrameworkBundleID") +#define kIOPMAssertionFrameworkIDKey CFSTR("FrameworkBundleID") /*! * @define kIOPMAssertionPlugInIDKey @@ -443,7 +437,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * * This key may be present in the dictionary returned from @link IOPMAssertionCopyProperties@/link. */ -#define kIOPMAssertionPlugInIDKey CFSTR("PlugInBundleID") +#define kIOPMAssertionPlugInIDKey CFSTR("PlugInBundleID") /*! * @define kIOPMAssertionTypeKey @@ -456,7 +450,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * specifies a deprecated assertion type; in that case the value for this key could * differ from the caller-provided assertion type. */ -#define kIOPMAssertionTypeKey CFSTR("AssertType") +#define kIOPMAssertionTypeKey CFSTR("AssertType") /*! * @define kIOPMAssertionLevelKey @@ -468,7 +462,7 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); * The level reflects the assertion's level set at creation, or adjusted via * @link IOPMAssertionSetLevel@/link */ -#define kIOPMAssertionLevelKey CFSTR("AssertLevel") +#define kIOPMAssertionLevelKey CFSTR("AssertLevel") /*! @/defineblock IOPMAssertionDictionary Keys*/ @@ -480,13 +474,10 @@ CFArrayRef IOPMCopyScheduledPowerEvents(void); */ typedef uint32_t IOPMAssertionID; - - /*! * @defineblock IOPMAssertionTypes */ - - + /*! * @define kIOPMAssertionTypePreventUserIdleSystemSleep * @@ -508,8 +499,7 @@ typedef uint32_t IOPMAssertionID; * @link kIOPMAssertionLevelOff@/link or @link kIOPMAssertionLevelOn@/link. */ -#define kIOPMAssertionTypePreventUserIdleSystemSleep CFSTR("PreventUserIdleSystemSleep") - +#define kIOPMAssertionTypePreventUserIdleSystemSleep CFSTR("PreventUserIdleSystemSleep") /*! * @define kIOPMAssertionTypePreventUserIdleDisplaySleep @@ -531,8 +521,7 @@ typedef uint32_t IOPMAssertionID; * @link kIOPMAssertionLevelOff@/link or @link kIOPMAssertionLevelOn@/link. */ -#define kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep") - +#define kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep") /*! * @define kIOPMAssertionTypePreventSystemSleep @@ -554,9 +543,8 @@ typedef uint32_t IOPMAssertionID; * @link kIOPMAssertionLevelOff@/link or @link kIOPMAssertionLevelOn@/link. */ -#define kIOPMAssertionTypePreventSystemSleep CFSTR("PreventSystemSleep") +#define kIOPMAssertionTypePreventSystemSleep CFSTR("PreventSystemSleep") - /*! * @define kIOPMAssertionTypeNoIdleSleep * @@ -567,7 +555,7 @@ typedef uint32_t IOPMAssertionID; * for other reasons. * */ -#define kIOPMAssertionTypeNoIdleSleep CFSTR("NoIdleSleepAssertion") +#define kIOPMAssertionTypeNoIdleSleep CFSTR("NoIdleSleepAssertion") /*! * @define kIOPMAssertionTypeNoDisplaySleep @@ -577,8 +565,7 @@ typedef uint32_t IOPMAssertionID; * @abstract Use as AssertionType argument to @link IOPMAssertionCreate@/link. * The idle display will not sleep when enabled, and consequently the system will not idle sleep. */ -#define kIOPMAssertionTypeNoDisplaySleep CFSTR("NoDisplaySleepAssertion") - +#define kIOPMAssertionTypeNoDisplaySleep CFSTR("NoDisplaySleepAssertion") /*! * @enum kIOPMNullAssertionID @@ -618,15 +605,13 @@ enum { * @constant kIOPMAssertionLevelOn * @abstract Level for an enabled assertion, passed as an argument to IOPMAssertionCreate. */ - kIOPMAssertionLevelOn = 255 - }; - + kIOPMAssertionLevelOn = 255 +}; /*! * @functiongroup Assertions - */ + */ - /*! @function IOPMAssertionCreateWithDescription * * @description Creates an IOPMAssertion. This is the preferred API to call to create an assertion. @@ -665,18 +650,16 @@ enum { * * @result kIOReturnSuccess, or another IOKit return code on error. */ -IOReturn IOPMAssertionCreateWithDescription( - CFStringRef AssertionType, - CFStringRef Name, - CFStringRef Details, - CFStringRef HumanReadableReason, - CFStringRef LocalizationBundlePath, - CFTimeInterval Timeout, - CFStringRef TimeoutAction, - IOPMAssertionID *AssertionID) -__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); - - +IOReturn IOPMAssertionCreateWithDescription( + CFStringRef AssertionType, + CFStringRef Name, + CFStringRef Details, + CFStringRef HumanReadableReason, + CFStringRef LocalizationBundlePath, + CFTimeInterval Timeout, + CFStringRef TimeoutAction, + IOPMAssertionID *AssertionID) + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); /*! * @function IOPMAssertionCreateWithProperties @@ -720,9 +703,9 @@ __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); * */ IOReturn IOPMAssertionCreateWithProperties( - CFDictionaryRef AssertionProperties, - IOPMAssertionID *AssertionID) - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); + CFDictionaryRef AssertionProperties, + IOPMAssertionID *AssertionID) + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); /*! * @function IOPMAssertionRetain @@ -732,9 +715,9 @@ IOReturn IOPMAssertionCreateWithProperties( * Retain count can be inspected in the assertion's info dictionary at * key @link kIOPMAssertionRetainCountKey@/link * @param theAssertion The assertion ID to retain. - */ + */ void IOPMAssertionRetain(IOPMAssertionID theAssertion) - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); /*! * @function IOPMAssertionRelease @@ -752,8 +735,7 @@ void IOPMAssertionRetain(IOPMAssertionID theAssertion) * @result Returns kIOReturnSuccess on success. */ IOReturn IOPMAssertionRelease(IOPMAssertionID AssertionID) - AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; - + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; /*! * @function IOPMAssertionCopyProperties @@ -764,7 +746,7 @@ IOReturn IOPMAssertionRelease(IOPMAssertionID AssertionID) * It's the caller's responsibility to release this dictionary. */ CFDictionaryRef IOPMAssertionCopyProperties(IOPMAssertionID theAssertion) - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); /*! * @function IOPMAssertionSetProperty @@ -780,7 +762,7 @@ CFDictionaryRef IOPMAssertionCopyProperties(IOPMAssertionID theAssertion) * Returns @link kIOReturnSuccess@/link otherwise. */ IOReturn IOPMAssertionSetProperty(IOPMAssertionID theAssertion, CFStringRef theProperty, CFTypeRef theValue) - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_3_2); /*! * @function IOPMCopyAssertionsByProcess @@ -800,7 +782,7 @@ IOReturn IOPMAssertionSetProperty(IOPMAssertionID theAssertion, CFStringRef theP * @result Returns kIOReturnSuccess on success. */ IOReturn IOPMCopyAssertionsByProcess(CFDictionaryRef *AssertionsByPID) - AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; /*! * @function IOPMCopyAssertionsStatus @@ -816,10 +798,7 @@ IOReturn IOPMCopyAssertionsByProcess(CFDictionaryRef *AssertionsByPID) * @result Returns kIOReturnSuccess on success. */ IOReturn IOPMCopyAssertionsStatus(CFDictionaryRef *AssertionsStatus) - AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; - - - + AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; /*! * @function IOPMAssertionCreate @@ -839,11 +818,10 @@ IOReturn IOPMCopyAssertionsStatus(CFDictionaryRef *AssertionsStatus) * @result Returns kIOReturnSuccess on success, any other return indicates * PM could not successfully activate the specified assertion. */ -IOReturn IOPMAssertionCreate(CFStringRef AssertionType, - IOPMAssertionLevel AssertionLevel, - IOPMAssertionID *AssertionID) - __OSX_AVAILABLE_BUT_DEPRECATED - (__MAC_10_5,__MAC_10_6,__IPHONE_2_0, __IPHONE_2_1); +IOReturn IOPMAssertionCreate(CFStringRef AssertionType, + IOPMAssertionLevel AssertionLevel, + IOPMAssertionID *AssertionID) + __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_1); /*! * @function IOPMAssertionCreateWithName @@ -869,12 +847,11 @@ IOReturn IOPMAssertionCreate(CFStringRef AssertionType, * PM could not successfully activate the specified assertion. */ IOReturn IOPMAssertionCreateWithName( - CFStringRef AssertionType, - IOPMAssertionLevel AssertionLevel, - CFStringRef AssertionName, - IOPMAssertionID *AssertionID) - AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; - + CFStringRef AssertionType, + IOPMAssertionLevel AssertionLevel, + CFStringRef AssertionName, + IOPMAssertionID *AssertionID) + AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; /*! * @functiongroup IOSystemLoadAdvisory @@ -887,7 +864,7 @@ IOReturn IOPMAssertionCreateWithName( fires - this is more efficient than calling IOGetSystemLoadAdvisory(), and returns an identical combined SystemLoadAdvisory value. */ -#define kIOSystemLoadAdvisoryNotifyName "com.apple.system.powermanagement.SystemLoadAdvisory" +#define kIOSystemLoadAdvisoryNotifyName "com.apple.system.powermanagement.SystemLoadAdvisory" /*! @typedef IOSystemLoadAdvisoryLevel @abstract Return type for IOGetSystemLoadAdvisory @@ -897,28 +874,28 @@ IOReturn IOPMAssertionCreateWithName( typedef int IOSystemLoadAdvisoryLevel; enum { - kIOSystemLoadAdvisoryLevelBad = 1, - kIOSystemLoadAdvisoryLevelOK = 2, - kIOSystemLoadAdvisoryLevelGreat = 3 + kIOSystemLoadAdvisoryLevelBad = 1, + kIOSystemLoadAdvisoryLevelOK = 2, + kIOSystemLoadAdvisoryLevelGreat = 3 }; /*! @define kIOSystemLoadAdvisoryUserLevelKey @abstract Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed @discussion Indicates user activity constraints on the current SystemLoadAdvisory level. */ -#define kIOSystemLoadAdvisoryUserLevelKey CFSTR("UserLevel") +#define kIOSystemLoadAdvisoryUserLevelKey CFSTR("UserLevel") /*! @define kIOSystemLoadAdvisoryBatteryLevelKey @abstract Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed @discussion Indicates battery constraints on the current SystemLoadAdvisory level. */ -#define kIOSystemLoadAdvisoryBatteryLevelKey CFSTR("BatteryLevel") +#define kIOSystemLoadAdvisoryBatteryLevelKey CFSTR("BatteryLevel") /*! @define kIOSystemLoadAdvisoryThermalLevelKey @abstract Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed @discussion Indicates thermal constraints on the current SystemLoadAdvisory level. */ -#define kIOSystemLoadAdvisoryThermalLevelKey CFSTR("ThermalLevel") +#define kIOSystemLoadAdvisoryThermalLevelKey CFSTR("ThermalLevel") /*! @define kIOSystemLoadAdvisoryCombinedLevelKey @abstract Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed @@ -927,7 +904,7 @@ enum { In the future, this combined level may represent new levels as well. The combined level is identical to the value returned by IOGetSystemLoadAdvisory(). */ -#define kIOSystemLoadAdvisoryCombinedLevelKey CFSTR("CombinedLevel") +#define kIOSystemLoadAdvisoryCombinedLevelKey CFSTR("CombinedLevel") /*! @function IOGetSystemLoadAdvisory @abstract Returns a hint about whether now would be a good time to perform time-insensitive @@ -952,8 +929,8 @@ enum { kIOSystemLoadAdvisoryLevelOK - An OK time to perform time-insensitive work. kIOSystemLoadAdvisoryLevelBad - A Bad time to perform time-insensitive work. */ - -IOSystemLoadAdvisoryLevel IOGetSystemLoadAdvisory( void ); + +IOSystemLoadAdvisoryLevel IOGetSystemLoadAdvisory(void); /*! @function IOCopySystemLoadAdvisoryDetailed @abstract Indicates how user activity, battery level, and thermal level each @@ -965,7 +942,6 @@ IOSystemLoadAdvisoryLevel IOGetSystemLoadAdvisory( void ); */ CFDictionaryRef IOCopySystemLoadAdvisoryDetailed(void); - /*! * @functiongroup CPU Power & Thermal */ @@ -974,13 +950,13 @@ CFDictionaryRef IOCopySystemLoadAdvisoryDetailed(void); * @abstract Key to register for BSD style notifications on CPU power or thermal change. */ -#define kIOPMCPUPowerNotificationKey "com.apple.system.power.CPU" +#define kIOPMCPUPowerNotificationKey "com.apple.system.power.CPU" /*! * @define kIOPMThermalWarningNotificationKey * @abstract Key to register for BSD style notifications on system thermal warnings. */ -#define kIOPMThermalWarningNotificationKey "com.apple.system.power.thermal_warning" - +#define kIOPMThermalWarningNotificationKey "com.apple.system.power.thermal_warning" + /*! * @function IOPMCopyCPUPowerStatus * @abstract Copy status of all current CPU power levels. @@ -996,7 +972,7 @@ CFDictionaryRef IOCopySystemLoadAdvisoryDetailed(void); * CPU PowerStatus has not been published. */ IOReturn IOPMCopyCPUPowerStatus(CFDictionaryRef *cpuPowerStatus); - + /*! * @function IOPMGetThermalWarningLevel * @abstract Get thermal warning level of the system. @@ -1011,8 +987,6 @@ IOReturn IOPMCopyCPUPowerStatus(CFDictionaryRef *cpuPowerStatus); * thermal warning level has not been published. */ IOReturn IOPMGetThermalWarningLevel(uint32_t *thermalLevel); - - #ifdef __cplusplus } diff --git a/IOKit/pwr_mgt/IOPMLibDefs.h b/IOKit/pwr_mgt/IOPMLibDefs.h index 7e49682a..f471ecd1 100644 --- a/IOKit/pwr_mgt/IOPMLibDefs.h +++ b/IOKit/pwr_mgt/IOPMLibDefs.h @@ -26,16 +26,15 @@ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ +#define kPMSetAggressiveness 0 +#define kPMGetAggressiveness 1 +#define kPMSleepSystem 2 +#define kPMAllowPowerChange 3 +#define kPMCancelPowerChange 4 +#define kPMShutdownSystem 5 +#define kPMRestartSystem 6 +#define kPMSleepSystemOptions 7 +#define kPMSetMaintenanceWakeCalendar 8 +#define kPMSetUserAssertionLevels 9 -#define kPMSetAggressiveness 0 -#define kPMGetAggressiveness 1 -#define kPMSleepSystem 2 -#define kPMAllowPowerChange 3 -#define kPMCancelPowerChange 4 -#define kPMShutdownSystem 5 -#define kPMRestartSystem 6 -#define kPMSleepSystemOptions 7 -#define kPMSetMaintenanceWakeCalendar 8 -#define kPMSetUserAssertionLevels 9 - -#define kNumPMMethods 10 +#define kNumPMMethods 10 diff --git a/LightMessaging/LightMessaging.h b/LightMessaging/LightMessaging.h index 5b091ef4..63ae398f 100644 --- a/LightMessaging/LightMessaging.h +++ b/LightMessaging/LightMessaging.h @@ -31,7 +31,7 @@ #ifdef __OBJC__ #ifndef __has_feature - #define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #if __has_feature(objc_arc) @@ -42,285 +42,285 @@ #endif typedef struct { - mach_port_t serverPort; - name_t serverName; + mach_port_t serverPort; + name_t serverName; } LMConnection; typedef LMConnection *LMConnectionRef; #define __LMMaxInlineSize 4096 + sizeof(LMMessage) typedef struct __LMMessage { - mach_msg_header_t head; - mach_msg_body_t body; - union { - struct { - mach_msg_ool_descriptor_t descriptor; - } out_of_line; - struct { - uint32_t length; - uint8_t bytes[0]; - } in_line; - } data; + mach_msg_header_t head; + mach_msg_body_t body; + union { + struct { + mach_msg_ool_descriptor_t descriptor; + } out_of_line; + struct { + uint32_t length; + uint8_t bytes[0]; + } in_line; + } data; } LMMessage; typedef struct __LMResponseBuffer { - LMMessage message; - uint8_t slack[__LMMaxInlineSize - sizeof(LMMessage) + MAX_TRAILER_SIZE]; + LMMessage message; + uint8_t slack[__LMMaxInlineSize - sizeof(LMMessage) + MAX_TRAILER_SIZE]; } LMResponseBuffer; static inline uint32_t LMBufferSizeForLength(uint32_t length) { - if (length + sizeof(LMMessage) > __LMMaxInlineSize) - return sizeof(LMMessage); - else - return ((sizeof(LMMessage) + length) + 3) & ~0x3; + if (length + sizeof(LMMessage) > __LMMaxInlineSize) + return sizeof(LMMessage); + else + return ((sizeof(LMMessage) + length) + 3) & ~0x3; } static inline void LMMessageCopyInline(LMMessage *message, const void *data, uint32_t length) { - message->data.in_line.length = length; - if (data) { - memcpy(message->data.in_line.bytes, data, length); - } + message->data.in_line.length = length; + if (data) { + memcpy(message->data.in_line.bytes, data, length); + } } static inline void LMMessageAssignOutOfLine(LMMessage *message, const void *data, uint32_t length) { - message->head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; - message->body.msgh_descriptor_count = 1; - message->data.out_of_line.descriptor.type = MACH_MSG_OOL_DESCRIPTOR; - message->data.out_of_line.descriptor.copy = MACH_MSG_VIRTUAL_COPY; - message->data.out_of_line.descriptor.deallocate = false; - message->data.out_of_line.descriptor.address = (void *)data; - message->data.out_of_line.descriptor.size = length; + message->head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + message->body.msgh_descriptor_count = 1; + message->data.out_of_line.descriptor.type = MACH_MSG_OOL_DESCRIPTOR; + message->data.out_of_line.descriptor.copy = MACH_MSG_VIRTUAL_COPY; + message->data.out_of_line.descriptor.deallocate = false; + message->data.out_of_line.descriptor.address = (void *)data; + message->data.out_of_line.descriptor.size = length; } static inline void LMMessageAssignData(LMMessage *message, const void *data, uint32_t length) { - if (length == 0) { - message->body.msgh_descriptor_count = 0; - message->data.in_line.length = length; - } else if (message->head.msgh_size != sizeof(LMMessage)) { - message->body.msgh_descriptor_count = 0; - message->data.in_line.length = length; - memcpy(message->data.in_line.bytes, data, length); - } else { - LMMessageAssignOutOfLine(message, data, length); - } + if (length == 0) { + message->body.msgh_descriptor_count = 0; + message->data.in_line.length = length; + } else if (message->head.msgh_size != sizeof(LMMessage)) { + message->body.msgh_descriptor_count = 0; + message->data.in_line.length = length; + memcpy(message->data.in_line.bytes, data, length); + } else { + LMMessageAssignOutOfLine(message, data, length); + } } static inline void *LMMessageGetData(LMMessage *message) { - if (message->body.msgh_descriptor_count) - return message->data.out_of_line.descriptor.address; - if (message->data.in_line.length == 0) - return NULL; - return &message->data.in_line.bytes; + if (message->body.msgh_descriptor_count) + return message->data.out_of_line.descriptor.address; + if (message->data.in_line.length == 0) + return NULL; + return &message->data.in_line.bytes; } static inline uint32_t LMMessageGetDataLength(LMMessage *message) { - if (message->body.msgh_descriptor_count) - return message->data.out_of_line.descriptor.size; - uint32_t result = message->data.in_line.length; - // Clip to the maximum size of a message buffer, prevents clients from forcing reads outside the region - if (result > __LMMaxInlineSize - offsetof(LMMessage, data.in_line.bytes)) - return __LMMaxInlineSize - offsetof(LMMessage, data.in_line.bytes); - // Client specified the right size, yay! - return result; + if (message->body.msgh_descriptor_count) + return message->data.out_of_line.descriptor.size; + uint32_t result = message->data.in_line.length; + // Clip to the maximum size of a message buffer, prevents clients from forcing reads outside the region + if (result > __LMMaxInlineSize - offsetof(LMMessage, data.in_line.bytes)) + return __LMMaxInlineSize - offsetof(LMMessage, data.in_line.bytes); + // Client specified the right size, yay! + return result; } static inline mach_msg_return_t LMMachMsg(LMConnection *connection, mach_msg_header_t *msg, mach_msg_option_t option, mach_msg_size_t send_size, mach_msg_size_t rcv_size, mach_port_name_t rcv_name, mach_msg_timeout_t timeout, mach_port_name_t notify) { - for (;;) { - kern_return_t err; - if (connection->serverPort == MACH_PORT_NULL) { - mach_port_t selfTask = mach_task_self(); - if ((kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_5_0) && (kCFCoreFoundationVersionNumber < 800.0)) { - int sandbox_result = sandbox_check(getpid(), "mach-lookup", (enum sandbox_filter_type)(SANDBOX_FILTER_LOCAL_NAME | SANDBOX_CHECK_NO_REPORT), connection->serverName); - if (sandbox_result) { - return sandbox_result; - } - } - // Lookup remote port - mach_port_t bootstrap = MACH_PORT_NULL; - task_get_bootstrap_port(selfTask, &bootstrap); + for (;;) { + kern_return_t err; + if (connection->serverPort == MACH_PORT_NULL) { + mach_port_t selfTask = mach_task_self(); + if ((kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_5_0) && (kCFCoreFoundationVersionNumber < 800.0)) { + int sandbox_result = sandbox_check(getpid(), "mach-lookup", (enum sandbox_filter_type)(SANDBOX_FILTER_LOCAL_NAME | SANDBOX_CHECK_NO_REPORT), connection->serverName); + if (sandbox_result) { + return sandbox_result; + } + } + // Lookup remote port + mach_port_t bootstrap = MACH_PORT_NULL; + task_get_bootstrap_port(selfTask, &bootstrap); #if LIGHTMESSAGING_USE_ROCKETBOOTSTRAP - err = rocketbootstrap_look_up(bootstrap, connection->serverName, &connection->serverPort); + err = rocketbootstrap_look_up(bootstrap, connection->serverName, &connection->serverPort); #else - err = bootstrap_look_up(bootstrap, connection->serverName, &connection->serverPort); + err = bootstrap_look_up(bootstrap, connection->serverName, &connection->serverPort); #endif - if (err) - return err; - } - msg->msgh_remote_port = connection->serverPort; - err = mach_msg(msg, option, send_size, rcv_size, rcv_name, timeout, notify); - if (err != MACH_SEND_INVALID_DEST) - return err; - mach_port_deallocate(mach_task_self(), msg->msgh_remote_port); - connection->serverPort = MACH_PORT_NULL; - } + if (err) + return err; + } + msg->msgh_remote_port = connection->serverPort; + err = mach_msg(msg, option, send_size, rcv_size, rcv_name, timeout, notify); + if (err != MACH_SEND_INVALID_DEST) + return err; + mach_port_deallocate(mach_task_self(), msg->msgh_remote_port); + connection->serverPort = MACH_PORT_NULL; + } } static inline kern_return_t LMConnectionSendOneWay(LMConnectionRef connection, SInt32 messageId, const void *data, uint32_t length) { - // Send message - uint32_t size = LMBufferSizeForLength(length); - uint8_t buffer[size]; - LMMessage *message = (LMMessage *)&buffer[0]; - memset(message, 0, sizeof(LMMessage)); - message->head.msgh_id = messageId; - message->head.msgh_size = size; - message->head.msgh_local_port = MACH_PORT_NULL; - message->head.msgh_reserved = 0; - message->head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); - LMMessageAssignData(message, data, length); - return LMMachMsg(connection, &message->head, MACH_SEND_MSG, size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + // Send message + uint32_t size = LMBufferSizeForLength(length); + uint8_t buffer[size]; + LMMessage *message = (LMMessage *)&buffer[0]; + memset(message, 0, sizeof(LMMessage)); + message->head.msgh_id = messageId; + message->head.msgh_size = size; + message->head.msgh_local_port = MACH_PORT_NULL; + message->head.msgh_reserved = 0; + message->head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); + LMMessageAssignData(message, data, length); + return LMMachMsg(connection, &message->head, MACH_SEND_MSG, size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); } static inline kern_return_t LMConnectionSendEmptyOneWay(LMConnectionRef connection, SInt32 messageId) { - // TODO: Optimize so we don't use the additional stack space - uint32_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t); - LMMessage message; - memset(&message, 0, size); - message.head.msgh_id = messageId; - message.head.msgh_size = size; - message.head.msgh_local_port = MACH_PORT_NULL; - message.head.msgh_reserved = 0; - message.head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); - return LMMachMsg(connection, &message.head, MACH_SEND_MSG, size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + // TODO: Optimize so we don't use the additional stack space + uint32_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t); + LMMessage message; + memset(&message, 0, size); + message.head.msgh_id = messageId; + message.head.msgh_size = size; + message.head.msgh_local_port = MACH_PORT_NULL; + message.head.msgh_reserved = 0; + message.head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); + return LMMachMsg(connection, &message.head, MACH_SEND_MSG, size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); } static inline kern_return_t LMConnectionSendTwoWay(LMConnectionRef connection, SInt32 messageId, const void *data, uint32_t length, LMResponseBuffer *responseBuffer) { - // Create a reply port - mach_port_t selfTask = mach_task_self(); - mach_port_name_t replyPort = MACH_PORT_NULL; - int err = mach_port_allocate(selfTask, MACH_PORT_RIGHT_RECEIVE, &replyPort); - if (err) { - responseBuffer->message.body.msgh_descriptor_count = 0; - return err; - } - // Send message - uint32_t size = LMBufferSizeForLength(length); - LMMessage *message = &responseBuffer->message; - memset(message, 0, sizeof(LMMessage)); - message->head.msgh_id = messageId; - message->head.msgh_size = size; - message->head.msgh_local_port = replyPort; - message->head.msgh_reserved = 0; - message->head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, MACH_MSG_TYPE_MAKE_SEND_ONCE); - LMMessageAssignData(message, data, length); - err = LMMachMsg(connection, &message->head, MACH_SEND_MSG | MACH_RCV_MSG | _LIGHTMESSAGING_TIMEOUT_FLAGS, size, sizeof(LMResponseBuffer), replyPort, LIGHTMESSAGING_TIMEOUT, MACH_PORT_NULL); - if (err) - responseBuffer->message.body.msgh_descriptor_count = 0; - // Cleanup - mach_port_mod_refs(selfTask, replyPort, MACH_PORT_RIGHT_RECEIVE, -1); - return err; + // Create a reply port + mach_port_t selfTask = mach_task_self(); + mach_port_name_t replyPort = MACH_PORT_NULL; + int err = mach_port_allocate(selfTask, MACH_PORT_RIGHT_RECEIVE, &replyPort); + if (err) { + responseBuffer->message.body.msgh_descriptor_count = 0; + return err; + } + // Send message + uint32_t size = LMBufferSizeForLength(length); + LMMessage *message = &responseBuffer->message; + memset(message, 0, sizeof(LMMessage)); + message->head.msgh_id = messageId; + message->head.msgh_size = size; + message->head.msgh_local_port = replyPort; + message->head.msgh_reserved = 0; + message->head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, MACH_MSG_TYPE_MAKE_SEND_ONCE); + LMMessageAssignData(message, data, length); + err = LMMachMsg(connection, &message->head, MACH_SEND_MSG | MACH_RCV_MSG | _LIGHTMESSAGING_TIMEOUT_FLAGS, size, sizeof(LMResponseBuffer), replyPort, LIGHTMESSAGING_TIMEOUT, MACH_PORT_NULL); + if (err) + responseBuffer->message.body.msgh_descriptor_count = 0; + // Cleanup + mach_port_mod_refs(selfTask, replyPort, MACH_PORT_RIGHT_RECEIVE, -1); + return err; } static inline void LMResponseBufferFree(LMResponseBuffer *responseBuffer) { - if (responseBuffer->message.body.msgh_descriptor_count != 0 && responseBuffer->message.data.out_of_line.descriptor.type == MACH_MSG_OOL_DESCRIPTOR) { - vm_deallocate(mach_task_self(), (vm_address_t)responseBuffer->message.data.out_of_line.descriptor.address, responseBuffer->message.data.out_of_line.descriptor.size); - responseBuffer->message.body.msgh_descriptor_count = 0; - } + if (responseBuffer->message.body.msgh_descriptor_count != 0 && responseBuffer->message.data.out_of_line.descriptor.type == MACH_MSG_OOL_DESCRIPTOR) { + vm_deallocate(mach_task_self(), (vm_address_t)responseBuffer->message.data.out_of_line.descriptor.address, responseBuffer->message.data.out_of_line.descriptor.size); + responseBuffer->message.body.msgh_descriptor_count = 0; + } } #pragma GCC diagnostic ignored "-Wdeprecated-declarations" static inline kern_return_t LMStartServiceWithUserInfo(const name_t serverName, CFRunLoopRef runLoop, CFMachPortCallBack callback, void *userInfo) { - // TODO: Figure out what the real interface is, implement service stopping, handle failures correctly - mach_port_t bootstrap = MACH_PORT_NULL; - task_get_bootstrap_port(mach_task_self(), &bootstrap); - CFMachPortContext context = { 0, userInfo, NULL, NULL, NULL }; - CFMachPortRef machPort = CFMachPortCreate(kCFAllocatorDefault, callback, &context, NULL); - CFRunLoopSourceRef machPortSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, machPort, 0); - CFRunLoopAddSource(runLoop, machPortSource, kCFRunLoopCommonModes); - mach_port_t port = CFMachPortGetPort(machPort); + // TODO: Figure out what the real interface is, implement service stopping, handle failures correctly + mach_port_t bootstrap = MACH_PORT_NULL; + task_get_bootstrap_port(mach_task_self(), &bootstrap); + CFMachPortContext context = { 0, userInfo, NULL, NULL, NULL }; + CFMachPortRef machPort = CFMachPortCreate(kCFAllocatorDefault, callback, &context, NULL); + CFRunLoopSourceRef machPortSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, machPort, 0); + CFRunLoopAddSource(runLoop, machPortSource, kCFRunLoopCommonModes); + mach_port_t port = CFMachPortGetPort(machPort); #if LIGHTMESSAGING_USE_ROCKETBOOTSTRAP - rocketbootstrap_unlock(serverName); + rocketbootstrap_unlock(serverName); #endif - return bootstrap_register(bootstrap, serverName, port); + return bootstrap_register(bootstrap, serverName, port); } #pragma GCC diagnostic warning "-Wdeprecated-declarations" static inline kern_return_t LMStartService(const name_t serverName, CFRunLoopRef runLoop, CFMachPortCallBack callback) { - return LMStartServiceWithUserInfo(serverName, runLoop, callback, NULL); + return LMStartServiceWithUserInfo(serverName, runLoop, callback, NULL); } static inline kern_return_t LMCheckInService(const name_t serverName, CFRunLoopRef runLoop, CFMachPortCallBack callback, void *userInfo) { - // TODO: Figure out what the real interface is, implement service stopping, handle failures correctly - mach_port_t bootstrap = MACH_PORT_NULL; - task_get_bootstrap_port(mach_task_self(), &bootstrap); - CFMachPortContext context = { 0, userInfo, NULL, NULL, NULL }; - mach_port_t port = MACH_PORT_NULL; - kern_return_t result = bootstrap_check_in(bootstrap, serverName, &port); - if (result) - return result; - CFMachPortRef machPort = CFMachPortCreateWithPort(kCFAllocatorDefault, port, callback, &context, NULL); - CFRunLoopSourceRef machPortSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, machPort, 0); - CFRunLoopAddSource(runLoop, machPortSource, kCFRunLoopCommonModes); + // TODO: Figure out what the real interface is, implement service stopping, handle failures correctly + mach_port_t bootstrap = MACH_PORT_NULL; + task_get_bootstrap_port(mach_task_self(), &bootstrap); + CFMachPortContext context = { 0, userInfo, NULL, NULL, NULL }; + mach_port_t port = MACH_PORT_NULL; + kern_return_t result = bootstrap_check_in(bootstrap, serverName, &port); + if (result) + return result; + CFMachPortRef machPort = CFMachPortCreateWithPort(kCFAllocatorDefault, port, callback, &context, NULL); + CFRunLoopSourceRef machPortSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, machPort, 0); + CFRunLoopAddSource(runLoop, machPortSource, kCFRunLoopCommonModes); #if LIGHTMESSAGING_USE_ROCKETBOOTSTRAP - rocketbootstrap_unlock(serverName); + rocketbootstrap_unlock(serverName); #endif - return 0; + return 0; } static inline bool LMDataWithSizeIsValidMessage(const void *data, CFIndex size) { - if (size < 0) - return false; - if ((size_t)size < sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t)) - return false; - const LMMessage *message = (const LMMessage *)data; - if (message->body.msgh_descriptor_count) - return (size_t)size >= sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t) + sizeof(mach_msg_ool_descriptor_t); - if ((size_t)size < sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t) + sizeof(uint32_t)) - return false; - if ((size_t)size < sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t) + sizeof(uint32_t) + message->data.in_line.length) - return false; - return true; + if (size < 0) + return false; + if ((size_t)size < sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t)) + return false; + const LMMessage *message = (const LMMessage *)data; + if (message->body.msgh_descriptor_count) + return (size_t)size >= sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t) + sizeof(mach_msg_ool_descriptor_t); + if ((size_t)size < sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t) + sizeof(uint32_t)) + return false; + if ((size_t)size < sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t) + sizeof(uint32_t) + message->data.in_line.length) + return false; + return true; } static inline kern_return_t LMSendReply(mach_port_t replyPort, const void *data, uint32_t length) { - if (replyPort == MACH_PORT_NULL) - return 0; - uint32_t size = LMBufferSizeForLength(length); - uint8_t buffer[size]; - memset(buffer, 0, sizeof(LMMessage)); - LMMessage *response = (LMMessage *)&buffer[0]; - response->head.msgh_id = 0; - response->head.msgh_size = size; - response->head.msgh_remote_port = replyPort; - response->head.msgh_local_port = MACH_PORT_NULL; - response->head.msgh_reserved = 0; - response->head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE, 0); - LMMessageAssignData(response, data, length); - // Send message - kern_return_t err = mach_msg(&response->head, MACH_SEND_MSG, size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - if (err) { - // Cleanup leaked SEND_ONCE - mach_port_mod_refs(mach_task_self(), replyPort, MACH_PORT_RIGHT_SEND_ONCE, -1); - } - return err; + if (replyPort == MACH_PORT_NULL) + return 0; + uint32_t size = LMBufferSizeForLength(length); + uint8_t buffer[size]; + memset(buffer, 0, sizeof(LMMessage)); + LMMessage *response = (LMMessage *)&buffer[0]; + response->head.msgh_id = 0; + response->head.msgh_size = size; + response->head.msgh_remote_port = replyPort; + response->head.msgh_local_port = MACH_PORT_NULL; + response->head.msgh_reserved = 0; + response->head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE, 0); + LMMessageAssignData(response, data, length); + // Send message + kern_return_t err = mach_msg(&response->head, MACH_SEND_MSG, size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (err) { + // Cleanup leaked SEND_ONCE + mach_port_mod_refs(mach_task_self(), replyPort, MACH_PORT_RIGHT_SEND_ONCE, -1); + } + return err; } static inline kern_return_t LMSendIntegerReply(mach_port_t replyPort, int integer) { - return LMSendReply(replyPort, &integer, sizeof(integer)); + return LMSendReply(replyPort, &integer, sizeof(integer)); } static inline kern_return_t LMSendCFDataReply(mach_port_t replyPort, CFDataRef data) { - if (data) { - return LMSendReply(replyPort, CFDataGetBytePtr(data), CFDataGetLength(data)); - } else { - return LMSendReply(replyPort, NULL, 0); - } + if (data) { + return LMSendReply(replyPort, CFDataGetBytePtr(data), CFDataGetLength(data)); + } else { + return LMSendReply(replyPort, NULL, 0); + } } #ifdef __OBJC__ @@ -328,32 +328,32 @@ static inline kern_return_t LMSendCFDataReply(mach_port_t replyPort, CFDataRef d #pragma GCC diagnostic ignored "-Wdeprecated-declarations" static inline id LMPropertyListForData(NSData *data) { - if ([NSPropertyListSerialization respondsToSelector:@selector(propertyListWithData:options:format:error:)]) - return [NSPropertyListSerialization propertyListWithData:data options:0 format:NULL error:NULL]; + if ([NSPropertyListSerialization respondsToSelector:@selector(propertyListWithData:options:format:error:)]) + return [NSPropertyListSerialization propertyListWithData:data options:0 format:NULL error:NULL]; - return [NSPropertyListSerialization propertyListFromData:data mutabilityOption:0 format:NULL errorDescription:NULL]; + return [NSPropertyListSerialization propertyListFromData:data mutabilityOption:0 format:NULL errorDescription:NULL]; } static inline NSData *LMDataForPropertyList(id propertyList) { - if ([NSPropertyListSerialization respondsToSelector:@selector(dataWithPropertyList:options:format:error:)]) - return [NSPropertyListSerialization dataWithPropertyList:propertyList format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL]; + if ([NSPropertyListSerialization respondsToSelector:@selector(dataWithPropertyList:options:format:error:)]) + return [NSPropertyListSerialization dataWithPropertyList:propertyList format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL]; - return [NSPropertyListSerialization dataFromPropertyList:propertyList format:NSPropertyListBinaryFormat_v1_0 errorDescription:NULL]; + return [NSPropertyListSerialization dataFromPropertyList:propertyList format:NSPropertyListBinaryFormat_v1_0 errorDescription:NULL]; } #pragma GCC diagnostic warning "-Wdeprecated-declarations" static inline kern_return_t LMSendNSDataReply(mach_port_t replyPort, NSData *data) { - return LMSendReply(replyPort, [data bytes], [data length]); + return LMSendReply(replyPort, [data bytes], [data length]); } static inline kern_return_t LMSendPropertyListReply(mach_port_t replyPort, id propertyList) { - if (propertyList) - return LMSendNSDataReply(replyPort, LMDataForPropertyList(propertyList)); - else - return LMSendReply(replyPort, NULL, 0); + if (propertyList) + return LMSendNSDataReply(replyPort, LMDataForPropertyList(propertyList)); + else + return LMSendReply(replyPort, NULL, 0); } #endif @@ -362,171 +362,171 @@ static inline kern_return_t LMSendPropertyListReply(mach_port_t replyPort, id pr static inline bool LMConnectionSendOneWayData(LMConnectionRef connection, SInt32 messageId, CFDataRef data) { - if (data) - return LMConnectionSendOneWay(connection, messageId, CFDataGetBytePtr(data), CFDataGetLength(data)) == 0; - else - return LMConnectionSendOneWay(connection, messageId, NULL, 0) == 0; + if (data) + return LMConnectionSendOneWay(connection, messageId, CFDataGetBytePtr(data), CFDataGetLength(data)) == 0; + else + return LMConnectionSendOneWay(connection, messageId, NULL, 0) == 0; } static inline kern_return_t LMConnectionSendTwoWayData(LMConnectionRef connection, SInt32 messageId, CFDataRef data, LMResponseBuffer *buffer) { - if (data) - return LMConnectionSendTwoWay(connection, messageId, CFDataGetBytePtr(data), CFDataGetLength(data), buffer); - else - return LMConnectionSendTwoWay(connection, messageId, NULL, 0, buffer); + if (data) + return LMConnectionSendTwoWay(connection, messageId, CFDataGetBytePtr(data), CFDataGetLength(data), buffer); + else + return LMConnectionSendTwoWay(connection, messageId, NULL, 0, buffer); } static inline int32_t LMResponseConsumeInteger(LMResponseBuffer *buffer) { - int32_t result = LMMessageGetDataLength(&buffer->message) == sizeof(int32_t) ? *(int32_t *)buffer->message.data.in_line.bytes : 0; - LMResponseBufferFree(buffer); - return result; + int32_t result = LMMessageGetDataLength(&buffer->message) == sizeof(int32_t) ? *(int32_t *)buffer->message.data.in_line.bytes : 0; + LMResponseBufferFree(buffer); + return result; } #ifdef __OBJC__ static inline kern_return_t LMConnectionSendTwoWayPropertyList(LMConnectionRef connection, SInt32 messageId, id propertyList, LMResponseBuffer *buffer) { - return LMConnectionSendTwoWayData(connection, messageId, propertyList ? LMBridgedCast_(CFDataRef, LMDataForPropertyList(propertyList)) : NULL, buffer); + return LMConnectionSendTwoWayData(connection, messageId, propertyList ? LMBridgedCast_(CFDataRef, LMDataForPropertyList(propertyList)) : NULL, buffer); } static inline id LMResponseConsumePropertyList(LMResponseBuffer *buffer) { - uint32_t length = LMMessageGetDataLength(&buffer->message); - id result; - if (length) { - CFDataRef data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, (const UInt8 *)LMMessageGetData(&buffer->message), length, kCFAllocatorNull); - result = LMPropertyListForData(LMBridgedCast_(NSData *, data)); - CFRelease(data); - } else { - result = nil; - } - LMResponseBufferFree(buffer); - return result; + uint32_t length = LMMessageGetDataLength(&buffer->message); + id result; + if (length) { + CFDataRef data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, (const UInt8 *)LMMessageGetData(&buffer->message), length, kCFAllocatorNull); + result = LMPropertyListForData(LMBridgedCast_(NSData *, data)); + CFRelease(data); + } else { + result = nil; + } + LMResponseBufferFree(buffer); + return result; } #ifdef UIKIT_EXTERN #import typedef struct __attribute__((aligned(0x1))) __attribute__((packed)) { - uint32_t width; - uint32_t height; - uint32_t bitsPerComponent; - uint32_t bitsPerPixel; - uint32_t bytesPerRow; - CGBitmapInfo bitmapInfo; - float scale; - UIImageOrientation orientation; + uint32_t width; + uint32_t height; + uint32_t bitsPerComponent; + uint32_t bitsPerPixel; + uint32_t bytesPerRow; + CGBitmapInfo bitmapInfo; + float scale; + UIImageOrientation orientation; } LMImageHeader; typedef struct { - LMMessage response; - LMImageHeader imageHeader; + LMMessage response; + LMImageHeader imageHeader; } LMImageMessage; static void LMCGDataProviderReleaseCallback(void *info, const void *data, size_t size) { - vm_deallocate(mach_task_self(), (vm_address_t)data, size); + vm_deallocate(mach_task_self(), (vm_address_t)data, size); } static inline UIImage *LMResponseConsumeImage(LMResponseBuffer *buffer) { - if (buffer->message.body.msgh_descriptor_count != 0 && buffer->message.data.out_of_line.descriptor.type == MACH_MSG_OOL_DESCRIPTOR) { - const void *bytes = buffer->message.data.out_of_line.descriptor.address; - const LMImageMessage *message = (const LMImageMessage *)buffer; - const LMImageHeader *header = &message->imageHeader; - CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, bytes, buffer->message.data.out_of_line.descriptor.size, LMCGDataProviderReleaseCallback); - if (provider) { - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGImageRef cgImage = CGImageCreate(header->width, header->height, header->bitsPerComponent, header->bitsPerPixel, header->bytesPerRow, colorSpace, header->bitmapInfo, provider, NULL, false, kCGRenderingIntentDefault); - CGColorSpaceRelease(colorSpace); - CGDataProviderRelease(provider); - if (cgImage) { - UIImage *image; - if ([UIImage respondsToSelector:@selector(imageWithCGImage:scale:orientation:)]) { - image = [UIImage imageWithCGImage:cgImage scale:header->scale orientation:header->orientation]; - } else { - image = [UIImage imageWithCGImage:cgImage]; - } - CGImageRelease(cgImage); - return image; - } - return nil; - } - } - LMResponseBufferFree(buffer); - return nil; + if (buffer->message.body.msgh_descriptor_count != 0 && buffer->message.data.out_of_line.descriptor.type == MACH_MSG_OOL_DESCRIPTOR) { + const void *bytes = buffer->message.data.out_of_line.descriptor.address; + const LMImageMessage *message = (const LMImageMessage *)buffer; + const LMImageHeader *header = &message->imageHeader; + CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, bytes, buffer->message.data.out_of_line.descriptor.size, LMCGDataProviderReleaseCallback); + if (provider) { + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGImageRef cgImage = CGImageCreate(header->width, header->height, header->bitsPerComponent, header->bitsPerPixel, header->bytesPerRow, colorSpace, header->bitmapInfo, provider, NULL, false, kCGRenderingIntentDefault); + CGColorSpaceRelease(colorSpace); + CGDataProviderRelease(provider); + if (cgImage) { + UIImage *image; + if ([UIImage respondsToSelector:@selector(imageWithCGImage:scale:orientation:)]) { + image = [UIImage imageWithCGImage:cgImage scale:header->scale orientation:header->orientation]; + } else { + image = [UIImage imageWithCGImage:cgImage]; + } + CGImageRelease(cgImage); + return image; + } + return nil; + } + } + LMResponseBufferFree(buffer); + return nil; } typedef struct CGAccessSession *CGAccessSessionRef; CGAccessSessionRef CGAccessSessionCreate(CGDataProviderRef provider); void *CGAccessSessionGetBytePointer(CGAccessSessionRef session); -size_t CGAccessSessionGetBytes(CGAccessSessionRef session,void *buffer,size_t bytes); +size_t CGAccessSessionGetBytes(CGAccessSessionRef session, void *buffer, size_t bytes); void CGAccessSessionRelease(CGAccessSessionRef session); static inline kern_return_t LMSendImageReply(mach_port_t replyPort, UIImage *image) { - if (replyPort == MACH_PORT_NULL) - return 0; - LMImageMessage buffer; - memset(&buffer, 0, sizeof(buffer)); - buffer.response.head.msgh_id = 0; - buffer.response.head.msgh_size = sizeof(buffer); - buffer.response.head.msgh_remote_port = replyPort; - buffer.response.head.msgh_local_port = MACH_PORT_NULL; - buffer.response.head.msgh_reserved = 0; - buffer.response.head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE, 0); - CFDataRef imageData = NULL; - CGAccessSessionRef accessSession = NULL; - if (image) { - CGImageRef cgImage = image.CGImage; - if (cgImage) { - buffer.imageHeader.width = CGImageGetWidth(cgImage); - buffer.imageHeader.height = CGImageGetHeight(cgImage); - buffer.imageHeader.bitsPerComponent = CGImageGetBitsPerComponent(cgImage); - buffer.imageHeader.bitsPerPixel = CGImageGetBitsPerPixel(cgImage); - buffer.imageHeader.bytesPerRow = CGImageGetBytesPerRow(cgImage); - buffer.imageHeader.bitmapInfo = CGImageGetBitmapInfo(cgImage); - buffer.imageHeader.scale = [image respondsToSelector:@selector(scale)] ? [image scale] : 1.0f; - buffer.imageHeader.orientation = image.imageOrientation; - CGDataProviderRef dataProvider = CGImageGetDataProvider(cgImage); - bool hasLoadedData = false; - if (&CGAccessSessionCreate != NULL) { - accessSession = CGAccessSessionCreate(dataProvider); - if (accessSession) { - void *pointer = CGAccessSessionGetBytePointer(accessSession); - if (pointer) { - LMMessageAssignOutOfLine(&buffer.response, pointer, buffer.imageHeader.bytesPerRow * buffer.imageHeader.height); - hasLoadedData = true; - } - } - } - if (!hasLoadedData) { - if (accessSession) { - CGAccessSessionRelease(accessSession); - accessSession = NULL; - } - imageData = CGDataProviderCopyData(dataProvider); - if (imageData) { - LMMessageAssignOutOfLine(&buffer.response, CFDataGetBytePtr(imageData), CFDataGetLength(imageData)); - } - } - } - } - // Send message - kern_return_t err = mach_msg(&buffer.response.head, MACH_SEND_MSG, sizeof(buffer), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - if (err) { - // Cleanup leaked SEND_ONCE - mach_port_mod_refs(mach_task_self(), replyPort, MACH_PORT_RIGHT_SEND_ONCE, -1); - } - if (imageData) { - CFRelease(imageData); - } - if (accessSession) { - CGAccessSessionRelease(accessSession); - } - return err; + if (replyPort == MACH_PORT_NULL) + return 0; + LMImageMessage buffer; + memset(&buffer, 0, sizeof(buffer)); + buffer.response.head.msgh_id = 0; + buffer.response.head.msgh_size = sizeof(buffer); + buffer.response.head.msgh_remote_port = replyPort; + buffer.response.head.msgh_local_port = MACH_PORT_NULL; + buffer.response.head.msgh_reserved = 0; + buffer.response.head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE, 0); + CFDataRef imageData = NULL; + CGAccessSessionRef accessSession = NULL; + if (image) { + CGImageRef cgImage = image.CGImage; + if (cgImage) { + buffer.imageHeader.width = CGImageGetWidth(cgImage); + buffer.imageHeader.height = CGImageGetHeight(cgImage); + buffer.imageHeader.bitsPerComponent = CGImageGetBitsPerComponent(cgImage); + buffer.imageHeader.bitsPerPixel = CGImageGetBitsPerPixel(cgImage); + buffer.imageHeader.bytesPerRow = CGImageGetBytesPerRow(cgImage); + buffer.imageHeader.bitmapInfo = CGImageGetBitmapInfo(cgImage); + buffer.imageHeader.scale = [image respondsToSelector:@selector(scale)] ? [image scale] : 1.0f; + buffer.imageHeader.orientation = image.imageOrientation; + CGDataProviderRef dataProvider = CGImageGetDataProvider(cgImage); + bool hasLoadedData = false; + if (&CGAccessSessionCreate != NULL) { + accessSession = CGAccessSessionCreate(dataProvider); + if (accessSession) { + void *pointer = CGAccessSessionGetBytePointer(accessSession); + if (pointer) { + LMMessageAssignOutOfLine(&buffer.response, pointer, buffer.imageHeader.bytesPerRow * buffer.imageHeader.height); + hasLoadedData = true; + } + } + } + if (!hasLoadedData) { + if (accessSession) { + CGAccessSessionRelease(accessSession); + accessSession = NULL; + } + imageData = CGDataProviderCopyData(dataProvider); + if (imageData) { + LMMessageAssignOutOfLine(&buffer.response, CFDataGetBytePtr(imageData), CFDataGetLength(imageData)); + } + } + } + } + // Send message + kern_return_t err = mach_msg(&buffer.response.head, MACH_SEND_MSG, sizeof(buffer), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (err) { + // Cleanup leaked SEND_ONCE + mach_port_mod_refs(mach_task_self(), replyPort, MACH_PORT_RIGHT_SEND_ONCE, -1); + } + if (imageData) { + CFRelease(imageData); + } + if (accessSession) { + CGAccessSessionRelease(accessSession); + } + return err; } #endif diff --git a/LightMessaging/bootstrap.h b/LightMessaging/bootstrap.h index c208bb3a..1e0213e8 100644 --- a/LightMessaging/bootstrap.h +++ b/LightMessaging/bootstrap.h @@ -88,8 +88,8 @@ __BEGIN_DECLS #pragma GCC visibility push(default) -#define BOOTSTRAP_MAX_NAME_LEN 128 -#define BOOTSTRAP_MAX_CMD_LEN 512 +#define BOOTSTRAP_MAX_NAME_LEN 128 +#define BOOTSTRAP_MAX_CMD_LEN 512 typedef char name_t[BOOTSTRAP_MAX_NAME_LEN]; typedef char cmd_t[BOOTSTRAP_MAX_CMD_LEN]; @@ -97,24 +97,24 @@ typedef name_t *name_array_t; typedef int bootstrap_status_t; typedef bootstrap_status_t *bootstrap_status_array_t; typedef unsigned int bootstrap_property_t; -typedef bootstrap_property_t * bootstrap_property_array_t; +typedef bootstrap_property_t *bootstrap_property_array_t; typedef boolean_t *bool_array_t; -#define BOOTSTRAP_MAX_LOOKUP_COUNT 20 +#define BOOTSTRAP_MAX_LOOKUP_COUNT 20 -#define BOOTSTRAP_SUCCESS 0 -#define BOOTSTRAP_NOT_PRIVILEGED 1100 -#define BOOTSTRAP_NAME_IN_USE 1101 -#define BOOTSTRAP_UNKNOWN_SERVICE 1102 -#define BOOTSTRAP_SERVICE_ACTIVE 1103 -#define BOOTSTRAP_BAD_COUNT 1104 -#define BOOTSTRAP_NO_MEMORY 1105 -#define BOOTSTRAP_NO_CHILDREN 1106 +#define BOOTSTRAP_SUCCESS 0 +#define BOOTSTRAP_NOT_PRIVILEGED 1100 +#define BOOTSTRAP_NAME_IN_USE 1101 +#define BOOTSTRAP_UNKNOWN_SERVICE 1102 +#define BOOTSTRAP_SERVICE_ACTIVE 1103 +#define BOOTSTRAP_BAD_COUNT 1104 +#define BOOTSTRAP_NO_MEMORY 1105 +#define BOOTSTRAP_NO_CHILDREN 1106 -#define BOOTSTRAP_STATUS_INACTIVE 0 -#define BOOTSTRAP_STATUS_ACTIVE 1 -#define BOOTSTRAP_STATUS_ON_DEMAND 2 +#define BOOTSTRAP_STATUS_INACTIVE 0 +#define BOOTSTRAP_STATUS_ACTIVE 1 +#define BOOTSTRAP_STATUS_ON_DEMAND 2 /* * After main() starts, it is safe to assume that this variable is always set. @@ -156,11 +156,11 @@ extern mach_port_t bootstrap_port; * Returns BOOTSTRAP_NOT_PRIVILEGED, bootstrap or uid invalid. */ kern_return_t bootstrap_create_server( - mach_port_t bp, - cmd_t server_cmd, - uid_t server_uid, - boolean_t on_demand, - mach_port_t *server_port); + mach_port_t bp, + cmd_t server_cmd, + uid_t server_uid, + boolean_t on_demand, + mach_port_t *server_port); /* * bootstrap_subset() @@ -180,9 +180,9 @@ kern_return_t bootstrap_create_server( * Errors: Returns appropriate kernel errors on rpc failure. */ kern_return_t bootstrap_subset( - mach_port_t bp, - mach_port_t requestor_port, - mach_port_t *subset_port); + mach_port_t bp, + mach_port_t requestor_port, + mach_port_t *subset_port); /* * bootstrap_unprivileged() @@ -200,9 +200,9 @@ kern_return_t bootstrap_subset( * Native launchd jobs are always started with an unprivileged port. */ kern_return_t bootstrap_unprivileged( - mach_port_t bp, - mach_port_t *unpriv_port) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + mach_port_t bp, + mach_port_t *unpriv_port) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; /* * bootstrap_parent() @@ -218,8 +218,8 @@ kern_return_t bootstrap_unprivileged( * token in the message trailer). */ kern_return_t bootstrap_parent( - mach_port_t bp, - mach_port_t *parent_port); + mach_port_t bp, + mach_port_t *parent_port); /* * bootstrap_register() @@ -308,9 +308,9 @@ bootstrap_create_service(mach_port_t bp, name_t service_name, mach_port_t *sp); * registered or checked-in. */ kern_return_t bootstrap_check_in( - mach_port_t bp, - const name_t service_name, - mach_port_t *sp); + mach_port_t bp, + const name_t service_name, + mach_port_t *sp); /* * bootstrap_look_up() @@ -323,9 +323,9 @@ kern_return_t bootstrap_check_in( * Returns BOOTSTRAP_UNKNOWN_SERVICE, if service does not exist. */ kern_return_t bootstrap_look_up( - mach_port_t bp, - const name_t service_name, - mach_port_t *sp); + mach_port_t bp, + const name_t service_name, + mach_port_t *sp); /* * bootstrap_status() @@ -340,10 +340,10 @@ kern_return_t bootstrap_look_up( * for failure. */ kern_return_t bootstrap_status( - mach_port_t bp, - name_t service_name, - bootstrap_status_t *service_active) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + mach_port_t bp, + name_t service_name, + bootstrap_status_t *service_active) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; /* bootstrap_strerror() * diff --git a/LowPowerMode/_PLLowPowerMode.h b/LowPowerMode/_PLLowPowerMode.h index c87de177..eed032d5 100644 --- a/LowPowerMode/_PLLowPowerMode.h +++ b/LowPowerMode/_PLLowPowerMode.h @@ -8,7 +8,6 @@ static NSString *const kPMLPMSourceSiri = @"Siri"; static NSString *const kPMLPMSourceLostMode = @"LostMode"; static NSString *const kPMLPMSourceSystemDisable = @"SystemDisable"; - API_AVAILABLE(ios(15.0)) @interface _PLLowPowerMode : NSObject + (instancetype)sharedInstance; diff --git a/MapKit/MKMapItem+Private.h b/MapKit/MKMapItem+Private.h index 1230b872..6e1a9f75 100644 --- a/MapKit/MKMapItem+Private.h +++ b/MapKit/MKMapItem+Private.h @@ -2,7 +2,7 @@ @class MKPlacemark; -typedef void (^MKMapItemItemsFromHandleCompletion)(NSArray *items); +typedef void (^MKMapItemItemsFromHandleCompletion)(NSArray *items); @interface MKMapItem (Private) diff --git a/MaterialKit/MTLumaDodgePillView.h b/MaterialKit/MTLumaDodgePillView.h index b3e37f20..acdba053 100644 --- a/MaterialKit/MTLumaDodgePillView.h +++ b/MaterialKit/MTLumaDodgePillView.h @@ -1,17 +1,17 @@ #import typedef NS_ENUM(NSUInteger, MTLumaDodgePillStyle) { - MTLumaDodgePillStyleNone, - MTLumaDodgePillStyleThin, - MTLumaDodgePillStyleGray, - MTLumaDodgePillStyleBlack, - MTLumaDodgePillStyleWhite + MTLumaDodgePillStyleNone, + MTLumaDodgePillStyleThin, + MTLumaDodgePillStyleGray, + MTLumaDodgePillStyleBlack, + MTLumaDodgePillStyleWhite }; typedef NS_ENUM(NSUInteger, MTLumaDodgePillBackgroundLuminance) { - MTLumaDodgePillBackgroundLuminanceUnknown, - MTLumaDodgePillBackgroundLuminanceDark, - MTLumaDodgePillBackgroundLuminanceLight + MTLumaDodgePillBackgroundLuminanceUnknown, + MTLumaDodgePillBackgroundLuminanceDark, + MTLumaDodgePillBackgroundLuminanceLight }; @interface MTLumaDodgePillView : UIView diff --git a/MediaPlayer/MPAVRoutingController.h b/MediaPlayer/MPAVRoutingController.h index 4e8269a1..90eee00a 100644 --- a/MediaPlayer/MPAVRoutingController.h +++ b/MediaPlayer/MPAVRoutingController.h @@ -8,7 +8,6 @@ typedef NS_ENUM(NSInteger, MPRouteDiscoveryMode) { MPRouteDiscoveryModeDetailed, }; - @interface MPAVRoutingController : NSObject @property (nonatomic, assign) MPRouteDiscoveryMode discoveryMode; diff --git a/MediaPlayerUI/MPUNowPlayingController.h b/MediaPlayerUI/MPUNowPlayingController.h index dad1ea83..0a724e73 100644 --- a/MediaPlayerUI/MPUNowPlayingController.h +++ b/MediaPlayerUI/MPUNowPlayingController.h @@ -2,7 +2,7 @@ @class MPUNowPlayingController, MPUNowPlayingMetadata; -@protocol MPUNowPlayingDelegate +@protocol MPUNowPlayingDelegate @optional @@ -18,7 +18,7 @@ @interface MPUNowPlayingController : NSObject -@property (nonatomic) id delegate; +@property (nonatomic) id delegate; - (void)startUpdating; - (void)stopUpdating; diff --git a/MobileCoreServices/LSAppLink.h b/MobileCoreServices/LSAppLink.h index e9a49645..af70a1e7 100644 --- a/MobileCoreServices/LSAppLink.h +++ b/MobileCoreServices/LSAppLink.h @@ -3,10 +3,10 @@ @class LSApplicationProxy; typedef NS_ENUM(NSInteger, LSAppLinkOpenStrategy) { - LSAppLinkOpenStrategyUnknown = -1, - LSAppLinkOpenStrategyApp, - LSAppLinkOpenStrategyIdk, - LSAppLinkOpenStrategyBrowser, + LSAppLinkOpenStrategyUnknown = -1, + LSAppLinkOpenStrategyApp, + LSAppLinkOpenStrategyIdk, + LSAppLinkOpenStrategyBrowser, }; API_AVAILABLE(ios(9.0)) diff --git a/MobileCoreServices/LSApplicationProxy.h b/MobileCoreServices/LSApplicationProxy.h index f428c1f1..83754159 100644 --- a/MobileCoreServices/LSApplicationProxy.h +++ b/MobileCoreServices/LSApplicationProxy.h @@ -8,26 +8,26 @@ API_AVAILABLE(ios(4.0)) + (instancetype)applicationProxyForIdentifier:(NSString *)identifier NS_SWIFT_NAME(applicationProxy(forIdentifier:)); @property (nonatomic, readonly) NSString *applicationIdentifier; -@property (nonatomic, readonly) NSString *vendorName API_AVAILABLE(ios(7.0)); -@property (nonatomic, readonly) NSString *itemName API_AVAILABLE(ios(7.1)); -@property (nonatomic, readonly) NSString *sdkVersion API_AVAILABLE(ios(8.0)); -@property (nonatomic, readonly) NSString *teamID API_AVAILABLE(ios(8.0)); +@property (nonatomic, readonly) NSString *vendorName API_AVAILABLE(ios(7.0)); +@property (nonatomic, readonly) NSString *itemName API_AVAILABLE(ios(7.1)); +@property (nonatomic, readonly) NSString *sdkVersion API_AVAILABLE(ios(8.0)); +@property (nonatomic, readonly) NSString *teamID API_AVAILABLE(ios(8.0)); @property (nonatomic, readonly) NSDate *registeredDate API_AVAILABLE(ios(9.0)); @property (nonatomic, readonly) NSString *sourceAppIdentifier API_AVAILABLE(ios(8.2)); // e.g. App Store, TestFlight -@property (nonatomic, readonly) NSArray *plugInKitPlugins API_AVAILABLE(ios(8.0)); -@property (nonatomic, readonly) NSArray *deviceFamily API_AVAILABLE(ios(8.0)); -@property (nonatomic, readonly) NSArray *activityTypes API_AVAILABLE(ios(10.0)); +@property (nonatomic, readonly) NSArray *plugInKitPlugins API_AVAILABLE(ios(8.0)); +@property (nonatomic, readonly) NSArray *deviceFamily API_AVAILABLE(ios(8.0)); +@property (nonatomic, readonly) NSArray *activityTypes API_AVAILABLE(ios(10.0)); @property (nonatomic, readonly, getter=isAppUpdate) BOOL appUpdate API_AVAILABLE(ios(7.0)); @property (nonatomic, readonly, getter=isInstalled) BOOL installed API_AVAILABLE(ios(7.0)); @property (nonatomic, readonly, getter=isNewsstandApp) BOOL newsstandApp API_AVAILABLE(ios(7.0)); -@property (nonatomic, readonly, getter=isPlaceholder) BOOL placeholder API_AVAILABLE(ios(7.0)); -@property (nonatomic, readonly, getter=isRestricted) BOOL restricted API_AVAILABLE(ios(7.0)); +@property (nonatomic, readonly, getter=isPlaceholder) BOOL placeholder API_AVAILABLE(ios(7.0)); +@property (nonatomic, readonly, getter=isRestricted) BOOL restricted API_AVAILABLE(ios(7.0)); @property (nonatomic, readonly, getter=isPurchasedReDownload) BOOL purchasedReDownload API_AVAILABLE(ios(8.0)); @property (nonatomic, readonly, getter=isWatchKitApp) BOOL watchKitApp API_AVAILABLE(ios(8.2)); -@property (nonatomic, readonly, getter=isBetaApp) BOOL betaApp API_AVAILABLE(ios(8.2)); -@property (nonatomic, readonly, getter=isAdHocCodeSigned) BOOL adHocCodeSigned API_AVAILABLE(ios(9.0)); +@property (nonatomic, readonly, getter=isBetaApp) BOOL betaApp API_AVAILABLE(ios(8.2)); +@property (nonatomic, readonly, getter=isAdHocCodeSigned) BOOL adHocCodeSigned API_AVAILABLE(ios(9.0)); @property (nonatomic, readonly, getter=isLaunchProhibited) BOOL launchProhibited API_AVAILABLE(ios(10.0)); @property (nonatomic, readonly, getter=isAppStoreVendable) BOOL appStoreVendable API_AVAILABLE(ios(11.0)); diff --git a/MobileCoreServices/LSApplicationWorkspace.h b/MobileCoreServices/LSApplicationWorkspace.h index e0f2cbf7..f27c87b6 100644 --- a/MobileCoreServices/LSApplicationWorkspace.h +++ b/MobileCoreServices/LSApplicationWorkspace.h @@ -7,50 +7,51 @@ API_AVAILABLE(ios(5.0)) + (instancetype)defaultWorkspace; -- (NSArray *)allApplications API_AVAILABLE(ios(7.0)); -- (NSArray *)allInstalledApplications API_AVAILABLE(ios(7.0)); -- (NSArray *)directionsApplications API_AVAILABLE(ios(6.0)); -- (NSArray *)unrestrictedApplications API_AVAILABLE(ios(7.0)); +- (NSArray *)allApplications API_AVAILABLE(ios(7.0)); +- (NSArray *)allInstalledApplications API_AVAILABLE(ios(7.0)); +- (NSArray *)directionsApplications API_AVAILABLE(ios(6.0)); +- (NSArray *)unrestrictedApplications API_AVAILABLE(ios(7.0)); -- (NSArray *)installedApplications API_AVAILABLE(ios(6.0)); -- (NSArray *)removedSystemApplications API_AVAILABLE(ios(9.3)); -- (BOOL)restoreSystemApplication:(NSString *)bundleID API_AVAILABLE(ios(9.3)); +- (NSArray *)installedApplications API_AVAILABLE(ios(6.0)); +- (NSArray *)removedSystemApplications API_AVAILABLE(ios(9.3)); +- (BOOL)restoreSystemApplication:(NSString *)bundleID API_AVAILABLE(ios(9.3)); -- (NSArray *)applicationsAvailableForHandlingURLScheme:(NSString *)urlScheme; -- (NSArray *)applicationsAvailableForOpeningDocument:(LSDocumentProxy *)document; -- (NSArray *)applicationsAvailableForOpeningURL:(NSURL *)url API_AVAILABLE(ios(10.0)); -- (NSArray *)applicationsAvailableForOpeningURL:(NSURL *)url legacySPI:(BOOL)legacySPI API_AVAILABLE(ios(10.0)); +- (NSArray *)applicationsAvailableForHandlingURLScheme:(NSString *)urlScheme; +- (NSArray *)applicationsAvailableForOpeningDocument:(LSDocumentProxy *)document; +- (NSArray *)applicationsAvailableForOpeningURL:(NSURL *)url API_AVAILABLE(ios(10.0)); +- (NSArray *)applicationsAvailableForOpeningURL:(NSURL *)url legacySPI:(BOOL)legacySPI API_AVAILABLE(ios(10.0)); - (LSApplicationProxy *)applicationForUserActivityDomainName:(NSString *)domain API_AVAILABLE(ios(8.0)); - (LSApplicationProxy *)applicationForUserActivityType:(NSString *)activityType API_AVAILABLE(ios(8.0)); -- (NSArray *)applicationsForUserActivityType:(NSString *)activityType API_AVAILABLE(ios(10.0)); -- (NSArray *)applicationsForUserActivityType:(NSString *)activityType limit:(NSUInteger)limit API_AVAILABLE(ios(10.0));; +- (NSArray *)applicationsForUserActivityType:(NSString *)activityType API_AVAILABLE(ios(10.0)); +- (NSArray *)applicationsForUserActivityType:(NSString *)activityType limit:(NSUInteger)limit API_AVAILABLE(ios(10.0)); +; - (BOOL)getClaimedActivityTypes:(NSSet **)activityTypes domains:(NSSet **)domains API_AVAILABLE(ios(8.0)); - (NSURL *)URLOverrideForURL:(NSURL *)url API_AVAILABLE(ios(6.0)); -- (NSArray *)publicURLSchemes API_AVAILABLE(ios(6.0)); -- (NSArray *)privateURLSchemes API_AVAILABLE(ios(6.0)); +- (NSArray *)publicURLSchemes API_AVAILABLE(ios(6.0)); +- (NSArray *)privateURLSchemes API_AVAILABLE(ios(6.0)); // convience method for the respective openURL with `LSOpenSensitiveURLOption : YES` set in options -- (BOOL)openSensitiveURL:(NSURL *)url withOptions:(NSDictionary *)options API_AVAILABLE(ios(6.0)); -- (BOOL)openSensitiveURL:(NSURL *)url withOptions:(NSDictionary *)options error:(NSError **)error API_AVAILABLE(ios(9.0)); +- (BOOL)openSensitiveURL:(NSURL *)url withOptions:(NSDictionary *)options API_AVAILABLE(ios(6.0)); +- (BOOL)openSensitiveURL:(NSURL *)url withOptions:(NSDictionary *)options error:(NSError **)error API_AVAILABLE(ios(9.0)); - (BOOL)openURL:(NSURL *)url API_AVAILABLE(ios(6.0)); -- (BOOL)openURL:(NSURL *)url withOptions:(NSDictionary *)options API_AVAILABLE(ios(6.0)); -- (BOOL)openURL:(NSURL *)url withOptions:(NSDictionary *)options error:(NSError **)error API_AVAILABLE(ios(6.0)); +- (BOOL)openURL:(NSURL *)url withOptions:(NSDictionary *)options API_AVAILABLE(ios(6.0)); +- (BOOL)openURL:(NSURL *)url withOptions:(NSDictionary *)options error:(NSError **)error API_AVAILABLE(ios(6.0)); - (void)openApplicationWithBundleID:(NSString *)bundleID API_AVAILABLE(ios(7.0)); - (BOOL)registerApplication:(NSURL *)url; - (BOOL)unregisterApplication:(NSURL *)url; -- (BOOL)registerPlugin:(NSURL *)url API_AVAILABLE(ios(8.0)); +- (BOOL)registerPlugin:(NSURL *)url API_AVAILABLE(ios(8.0)); - (BOOL)unregisterPlugin:(NSURL *)url API_AVAILABLE(ios(8.0)); // version unused as of iOS 10.2 // returns the union of matches. pass empty arrays to get all plugins -- (NSArray *)pluginsWithIdentifiers:(NSArray *)identifiers protocols:(NSArray *)protocols version:(id)version API_AVAILABLE(ios(8.0)); +- (NSArray *)pluginsWithIdentifiers:(NSArray *)identifiers protocols:(NSArray *)protocols version:(id)version API_AVAILABLE(ios(8.0)); - (void)enumerateBundlesOfType:(NSInteger)type block:(void (^)(LSBundleProxy *))block; diff --git a/MobileCoreServices/LSBundleProxy.h b/MobileCoreServices/LSBundleProxy.h index b83f7ba4..d6b4eedd 100644 --- a/MobileCoreServices/LSBundleProxy.h +++ b/MobileCoreServices/LSBundleProxy.h @@ -20,11 +20,11 @@ API_AVAILABLE(ios(8.0)) @property (nonatomic, readonly) NSString *bundleType; @property (nonatomic, readonly) NSString *canonicalExecutablePath API_AVAILABLE(ios(10.3)); -@property (nonatomic, readonly) NSDictionary *entitlements; -@property (nonatomic, readonly) NSDictionary *environmentVariables; -@property (nonatomic, readonly) NSDictionary *groupContainerURLs; +@property (nonatomic, readonly) NSDictionary *entitlements; +@property (nonatomic, readonly) NSDictionary *environmentVariables; +@property (nonatomic, readonly) NSDictionary *groupContainerURLs; -@property (nonatomic, copy) NSArray *machOUUIDs; +@property (nonatomic, copy) NSArray *machOUUIDs; @property (nonatomic, readonly) NSString *signerIdentity; @property (nonatomic, readonly, getter=isContainerized) BOOL containerized API_AVAILABLE(ios(11.0)); @property (nonatomic, readonly) BOOL profileValidated API_AVAILABLE(ios(11.0)); diff --git a/MobileCoreServices/LSDocumentProxy.h b/MobileCoreServices/LSDocumentProxy.h index 94d2194f..31d13eaa 100644 --- a/MobileCoreServices/LSDocumentProxy.h +++ b/MobileCoreServices/LSDocumentProxy.h @@ -3,11 +3,11 @@ API_AVAILABLE(ios(5.0)) @interface LSDocumentProxy : LSResourceProxy -@property (readonly, nonatomic) NSString *name API_AVAILABLE(ios(6.0)); +@property (readonly, nonatomic) NSString *name API_AVAILABLE(ios(6.0)); @property (readonly, nonatomic) NSString *typeIdentifier API_AVAILABLE(ios(6.0)); -@property (readonly, nonatomic) NSString *MIMEType API_AVAILABLE(ios(6.0)); -@property (readonly, nonatomic) BOOL sourceIsManaged API_AVAILABLE(ios(7.0)); -@property (readonly, nonatomic) NSURL *URL API_AVAILABLE(ios(9.0)); +@property (readonly, nonatomic) NSString *MIMEType API_AVAILABLE(ios(6.0)); +@property (readonly, nonatomic) BOOL sourceIsManaged API_AVAILABLE(ios(7.0)); +@property (readonly, nonatomic) NSURL *URL API_AVAILABLE(ios(9.0)); @property (readonly, nonatomic) NSString *containerOwnerApplicationIdentifier API_AVAILABLE(ios(9.0)); + (instancetype)documentProxyForName:(NSString *)name type:(NSString *)type MIMEType:(NSString *)MIME; diff --git a/MobileCoreServices/_LSQueryResult.h b/MobileCoreServices/_LSQueryResult.h index 110ee665..0ae4a249 100644 --- a/MobileCoreServices/_LSQueryResult.h +++ b/MobileCoreServices/_LSQueryResult.h @@ -1,6 +1,6 @@ #import API_AVAILABLE(ios(10.0)) -@interface _LSQueryResult : NSObject +@interface _LSQueryResult : NSObject @end diff --git a/MobileGestalt/MobileGestalt.h b/MobileGestalt/MobileGestalt.h index b095fe39..37988161 100644 --- a/MobileGestalt/MobileGestalt.h +++ b/MobileGestalt/MobileGestalt.h @@ -14,18 +14,18 @@ #include typedef enum { - MGDeviceClassInvalid = -1, + MGDeviceClassInvalid = -1, /* 0 is intentionally not in this enum */ - MGDeviceClassiPhone = 1, - MGDeviceClassiPod = 2, - MGDeviceClassiPad = 3, - MGDeviceClassAppleTV = 4, - MGDeviceClassiFPGA = 5, - MGDeviceClassWatch = 6, + MGDeviceClassiPhone = 1, + MGDeviceClassiPod = 2, + MGDeviceClassiPad = 3, + MGDeviceClassAppleTV = 4, + MGDeviceClassiFPGA = 5, + MGDeviceClassWatch = 6, MGDeviceClassAudioAccessory = 7, - MGDeviceClassiBridge = 8, - MGDeviceClassMac = 9, - MGDeviceClassAppleDisplay = 10, + MGDeviceClassiBridge = 8, + MGDeviceClassMac = 9, + MGDeviceClassAppleDisplay = 10, } MGDeviceClass; #pragma mark - API diff --git a/MobileIcons/MobileIcons.h b/MobileIcons/MobileIcons.h index f77f5873..1aec465a 100644 --- a/MobileIcons/MobileIcons.h +++ b/MobileIcons/MobileIcons.h @@ -3,23 +3,23 @@ #if __IPHONE_7_0 typedef NS_ENUM(NSUInteger, MIIconVariant) { - // iphone ipad - MIIconVariantSmall, // 29x29 29x29 - MIIconVariantSpotlight, // 40x40 40x40 - MIIconVariantDefault, // 62x62 78x78 - MIIconVariantGameCenter, // 42x42 78x78 - MIIconVariantDocumentFull, // 37x48 37x48 - MIIconVariantDocumentSmall, // 37x48 37z48 - MIIconVariantSquareBig, // 82x82 128x128 - MIIconVariantSquareDefault, // 62x62 78x78 - MIIconVariantTiny, // 20x20 20x20 - MIIconVariantDocument, // 37x48 247x320 - MIIconVariantDocumentLarge, // 37x48 247x320 - MIIconVariantUnknownGradient, // 300x150 300x150 - MIIconVariantSquareGameCenter, // 42x42 42x42 - MIIconVariantUnknownDefault, // 62x62 78x78 + // iphone ipad + MIIconVariantSmall, // 29x29 29x29 + MIIconVariantSpotlight, // 40x40 40x40 + MIIconVariantDefault, // 62x62 78x78 + MIIconVariantGameCenter, // 42x42 78x78 + MIIconVariantDocumentFull, // 37x48 37x48 + MIIconVariantDocumentSmall, // 37x48 37z48 + MIIconVariantSquareBig, // 82x82 128x128 + MIIconVariantSquareDefault, // 62x62 78x78 + MIIconVariantTiny, // 20x20 20x20 + MIIconVariantDocument, // 37x48 247x320 + MIIconVariantDocumentLarge, // 37x48 247x320 + MIIconVariantUnknownGradient, // 300x150 300x150 + MIIconVariantSquareGameCenter, // 42x42 42x42 + MIIconVariantUnknownDefault, // 62x62 78x78 - /* + /* todo: find out what UnknownGradient and UnknownDefault are for. UnknownGradient is a static gradient on iphone, and half of the icon on ipad. UnknownDefault is the same thing as Default. @@ -27,19 +27,19 @@ typedef NS_ENUM(NSUInteger, MIIconVariant) { }; #else typedef NS_ENUM(NSUInteger, MIIconVariant) { - // iphone ipad - MIIconVariantSmall, // 29x29 29x29 - MIIconVariantSpotlight, // 29x29 50x50 - MIIconVariantDefault, // 59x62 74x78 - MIIconVariantGameCenter, // 44x45 74x78 - MIIconVariantDefaultGrayscale, // 59x62 74x78 - MIIconVariantDocumentFull, // 31x37 64x64 - MIIconVariantDocumentSmall, // 31x37 64x64 - MIIconVariantSquareBig, // 104x104 145x148 - MIIconVariantSquareSmall, // 71x71 92x94 - MIIconVariantTiny, // 20x20 20x20 - MIIconVariantDocument, // 31x37 320x320 - MIIconVariantDocumentLarge, // 31x37 320x320 + // iphone ipad + MIIconVariantSmall, // 29x29 29x29 + MIIconVariantSpotlight, // 29x29 50x50 + MIIconVariantDefault, // 59x62 74x78 + MIIconVariantGameCenter, // 44x45 74x78 + MIIconVariantDefaultGrayscale, // 59x62 74x78 + MIIconVariantDocumentFull, // 31x37 64x64 + MIIconVariantDocumentSmall, // 31x37 64x64 + MIIconVariantSquareBig, // 104x104 145x148 + MIIconVariantSquareSmall, // 71x71 92x94 + MIIconVariantTiny, // 20x20 20x20 + MIIconVariantDocument, // 31x37 320x320 + MIIconVariantDocumentLarge, // 31x37 320x320 }; #endif diff --git a/OnBoardingKit/OBWelcomeController.h b/OnBoardingKit/OBWelcomeController.h index 3f2d2a79..83c5210b 100644 --- a/OnBoardingKit/OBWelcomeController.h +++ b/OnBoardingKit/OBWelcomeController.h @@ -2,7 +2,7 @@ #import "OBBaseWelcomeController.h" API_AVAILABLE(ios(13.0)) -@interface OBWelcomeController : OBBaseWelcomeController +@interface OBWelcomeController : OBBaseWelcomeController @property (nonatomic, retain) UIView *viewIfLoaded; @property (nonatomic, strong) UIColor *backgroundColor; diff --git a/PassKitUI/PKGlyphViewDelegate.h b/PassKitUI/PKGlyphViewDelegate.h index 62a2b720..bfd3a737 100644 --- a/PassKitUI/PKGlyphViewDelegate.h +++ b/PassKitUI/PKGlyphViewDelegate.h @@ -3,7 +3,7 @@ @class PKGlyphView; -@protocol PKGlyphViewDelegate +@protocol PKGlyphViewDelegate @optional - (void)glyphView:(PKGlyphView *)view revealingCheckmark:(BOOL)revealing; diff --git a/PersonaKit/PRLikeness.h b/PersonaKit/PRLikeness.h index a0b40bb9..1497b64b 100644 --- a/PersonaKit/PRLikeness.h +++ b/PersonaKit/PRLikeness.h @@ -7,7 +7,7 @@ typedef NS_ENUM(NSUInteger, PRLikenessScope) { }; API_AVAILABLE(ios(10.0)) -@interface PRLikeness : NSObject +@interface PRLikeness : NSObject @property (assign, setter=setCurrent:, nonatomic) BOOL isCurrent; @@ -51,7 +51,6 @@ API_AVAILABLE(ios(10.0)) + (instancetype)likenessWithPropagatedData:(NSData *)data; - + (NSString *)descriptionForScope:(PRLikenessScope)scope; - (void)clearDirtyProperties; diff --git a/PersonaUI/PRMonogram.h b/PersonaUI/PRMonogram.h index 738c609c..b35c80b2 100644 --- a/PersonaUI/PRMonogram.h +++ b/PersonaUI/PRMonogram.h @@ -10,7 +10,7 @@ API_AVAILABLE(ios(10.0)) + (instancetype)monogram; + (instancetype)monogramWithData:(NSData *)data; -+ (NSArray *)monogramColors; ++ (NSArray *)monogramColors; /**** font info ****/ + (NSUInteger)countOfFonts; @@ -36,6 +36,6 @@ API_AVAILABLE(ios(10.0)) - (UIImage *)snapshotWithSize:(CGSize)size scale:(CGFloat)scale options:(id)options; - (UIImage *)snapshotWithOptions:(id)options; -- (NSDictionary *)stringAttributesForDiameter:(CGFloat)diameter API_AVAILABLE(ios(11.4)); +- (NSDictionary *)stringAttributesForDiameter:(CGFloat)diameter API_AVAILABLE(ios(11.4)); @end diff --git a/PersonaUI/PRMonogramView.h b/PersonaUI/PRMonogramView.h index 0b71d145..cb1fb02b 100644 --- a/PersonaUI/PRMonogramView.h +++ b/PersonaUI/PRMonogramView.h @@ -1,7 +1,7 @@ #import "PRMonogram.h" API_AVAILABLE(ios(10.0)) -@interface PRMonogramView : UIView +@interface PRMonogramView : UIView @property (nonatomic, retain) PRMonogram *monogram; diff --git a/PhotoLibrary/PLWallpaperImageViewController.h b/PhotoLibrary/PLWallpaperImageViewController.h index 5e03240e..cccdbab6 100644 --- a/PhotoLibrary/PLWallpaperImageViewController.h +++ b/PhotoLibrary/PLWallpaperImageViewController.h @@ -1,9 +1,9 @@ #import typedef NS_ENUM(NSUInteger, PLWallpaperMode) { - PLWallpaperModeBoth, - PLWallpaperModeHomeScreen, - PLWallpaperModeLockScreen + PLWallpaperModeBoth, + PLWallpaperModeHomeScreen, + PLWallpaperModeLockScreen }; @interface PLWallpaperImageViewController : UIViewController // PLUIEditImageViewController diff --git a/Preferences/PSEditableTableCell.h b/Preferences/PSEditableTableCell.h index a4814cf7..d90347b9 100644 --- a/Preferences/PSEditableTableCell.h +++ b/Preferences/PSEditableTableCell.h @@ -1,9 +1,9 @@ #import "PSTableCell.h" @interface PSEditableTableCell : PSTableCell { - id _userInfo; - SEL _targetSetter; - id _realTarget; + id _userInfo; + SEL _targetSetter; + id _realTarget; } - (void)controlChanged:(id)changed; diff --git a/Preferences/PSHeaderFooterView.h b/Preferences/PSHeaderFooterView.h index 5b814e4e..f36d4559 100644 --- a/Preferences/PSHeaderFooterView.h +++ b/Preferences/PSHeaderFooterView.h @@ -6,7 +6,7 @@ @protocol PSHeaderFooterView @required -- (UIView *)initWithSpecifier:(PSSpecifier *)specifier; +- (UIView *)initWithSpecifier:(PSSpecifier *)specifier; @optional - (CGFloat)preferredHeightForWidth:(CGFloat)width inTableView:(UITableView *)tableView; diff --git a/Preferences/PSListController.h b/Preferences/PSListController.h index 836e7186..2a094ee6 100644 --- a/Preferences/PSListController.h +++ b/Preferences/PSListController.h @@ -3,8 +3,8 @@ @class PSRootController, PSSpecifier, PSTableCell; -@interface PSListController : PSViewController { - NSMutableArray *_specifiers; +@interface PSListController : PSViewController { + NSMutableArray *_specifiers; } + (BOOL)displaysButtonBar; diff --git a/Preferences/PSSpecifier.h b/Preferences/PSSpecifier.h index 0f551d89..5c2e44e0 100644 --- a/Preferences/PSSpecifier.h +++ b/Preferences/PSSpecifier.h @@ -114,7 +114,7 @@ FOUNDATION_EXPORT NSString *const PSValuesDataSourceKey; // @"valuesDataSource" @interface PSSpecifier : NSObject { @public - SEL action; + SEL action; } + (instancetype)preferenceSpecifierNamed:(NSString *)identifier target:(id)target set:(SEL)set get:(SEL)get detail:(Class)detail cell:(PSCellType)cellType edit:(Class)edit; diff --git a/Preferences/PSSwitchTableCell.h b/Preferences/PSSwitchTableCell.h index af383f32..92bdf8da 100644 --- a/Preferences/PSSwitchTableCell.h +++ b/Preferences/PSSwitchTableCell.h @@ -3,7 +3,7 @@ @class UIActivityIndicatorView; @interface PSSwitchTableCell : PSControlTableCell { - UIActivityIndicatorView *_activityIndicator; + UIActivityIndicatorView *_activityIndicator; } @property (nonatomic) BOOL loading; diff --git a/Preferences/PSSystemPolicyForApp.h b/Preferences/PSSystemPolicyForApp.h index 31914953..4b53d7fc 100644 --- a/Preferences/PSSystemPolicyForApp.h +++ b/Preferences/PSSystemPolicyForApp.h @@ -1,11 +1,11 @@ #import typedef NS_OPTIONS(NSUInteger, PSSystemPolicyOptions) { - PSSystemPolicyOptionsNotifications = 1 << 0, - PSSystemPolicyOptionsContacts = 1 << 2, - PSSystemPolicyOptionsCalendars = 1 << 3, - PSSystemPolicyOptionsReminders = 1 << 4, - PSSystemPolicyOptionsPhotos = 1 << 5 + PSSystemPolicyOptionsNotifications = 1 << 0, + PSSystemPolicyOptionsContacts = 1 << 2, + PSSystemPolicyOptionsCalendars = 1 << 3, + PSSystemPolicyOptionsReminders = 1 << 4, + PSSystemPolicyOptionsPhotos = 1 << 5 }; @class PSSpecifier; @@ -14,7 +14,7 @@ typedef NS_OPTIONS(NSUInteger, PSSystemPolicyOptions) { - (instancetype)initWithBundleIdentifier:(NSString *)bundleIdentifier; -- (NSArray *)specifiersForPolicyOptions:(PSSystemPolicyOptions)options force:(BOOL)force; +- (NSArray *)specifiersForPolicyOptions:(PSSystemPolicyOptions)options force:(BOOL)force; - (PSSpecifier *)notificationSpecifier; diff --git a/Preferences/PSTableCell.h b/Preferences/PSTableCell.h index c1146ab4..adf555df 100644 --- a/Preferences/PSTableCell.h +++ b/Preferences/PSTableCell.h @@ -3,22 +3,22 @@ @class PSSpecifier; typedef NS_ENUM(NSInteger, PSCellType) { - PSGroupCell, - PSLinkCell, - PSLinkListCell, - PSListItemCell, - PSTitleValueCell, - PSSliderCell, - PSSwitchCell, - PSStaticTextCell, - PSEditTextCell, - PSSegmentCell, - PSGiantIconCell, - PSGiantCell, - PSSecureEditTextCell, - PSButtonCell, - PSEditTextViewCell, - PSSpinnerCell + PSGroupCell, + PSLinkCell, + PSLinkListCell, + PSListItemCell, + PSTitleValueCell, + PSSliderCell, + PSSwitchCell, + PSStaticTextCell, + PSEditTextCell, + PSSegmentCell, + PSGiantIconCell, + PSGiantCell, + PSSecureEditTextCell, + PSButtonCell, + PSEditTextViewCell, + PSSpinnerCell }; @interface PSTableCell : UITableViewCell diff --git a/Preferences/PreferencesAppController.h b/Preferences/PreferencesAppController.h index cd083b5f..0c6ff607 100644 --- a/Preferences/PreferencesAppController.h +++ b/Preferences/PreferencesAppController.h @@ -2,7 +2,7 @@ @class PSUIPrefsRootController; -@interface PreferencesAppController : UIApplication/*this is from Preferences.app, not framework*/ +@interface PreferencesAppController : UIApplication /*this is from Preferences.app, not framework*/ @property (nonatomic, retain) PSUIPrefsRootController *rootController; diff --git a/PreferencesUI/DevicePINControllerDelegate.h b/PreferencesUI/DevicePINControllerDelegate.h index 70094bb2..51f0d655 100644 --- a/PreferencesUI/DevicePINControllerDelegate.h +++ b/PreferencesUI/DevicePINControllerDelegate.h @@ -1,5 +1,5 @@ #import -@protocol DevicePINControllerDelegate +@protocol DevicePINControllerDelegate @end diff --git a/PreferencesUI/PSUIPrefsListController.h b/PreferencesUI/PSUIPrefsListController.h index 98946733..6b178469 100644 --- a/PreferencesUI/PSUIPrefsListController.h +++ b/PreferencesUI/PSUIPrefsListController.h @@ -1,10 +1,10 @@ #import #import "DevicePINControllerDelegate.h" -@interface PSUIPrefsListController : PSListController +@interface PSUIPrefsListController : PSListController - (PSSpecifier *)_sidebarSpecifierForCategoryController; --(void)showPINSheet:(id)arg1; +- (void)showPINSheet:(id)arg1; @end \ No newline at end of file diff --git a/QuartzCore/CAFilter.h b/QuartzCore/CAFilter.h index f66527f6..b71e3710 100644 --- a/QuartzCore/CAFilter.h +++ b/QuartzCore/CAFilter.h @@ -2,14 +2,14 @@ #import API_AVAILABLE(ios(2.0)) -@interface CAFilter : NSObject +@interface CAFilter : NSObject @property (readonly) NSString *type; @property (copy) NSString *name; @property (getter=isEnabled) BOOL enabled; @property BOOL cachesInputImage API_AVAILABLE(ios(3.0)); -+ (NSArray *)filterTypes; ++ (NSArray *)filterTypes; + (CAFilter *)filterWithType:(NSString *)type; + (CAFilter *)filterWithName:(NSString *)name; // alias for filterWithType: diff --git a/QuartzCore/CARenderValue.h b/QuartzCore/CARenderValue.h index 700756ea..5086f139 100644 --- a/QuartzCore/CARenderValue.h +++ b/QuartzCore/CARenderValue.h @@ -16,7 +16,6 @@ CA_EXTERN void CARenderSetGlobalFeatureFlags(unsigned flags); CA_EXTERN CARenderObjectRef CARenderRetain(CARenderObjectRef object); CA_EXTERN void CARenderRelease(CARenderObjectRef object); - @interface NSObject (CARenderValue) - (CARenderObjectRef)CA_copyRenderValue; @end diff --git a/QuartzCore/QuartzCore-Structs.h b/QuartzCore/QuartzCore-Structs.h index 57feb5bc..c2d50d45 100644 --- a/QuartzCore/QuartzCore-Structs.h +++ b/QuartzCore/QuartzCore-Structs.h @@ -5,18 +5,17 @@ #import #import - typedef struct { - int x; + int x; } XXStruct_RiyHGD; typedef struct Atomic { - XXStruct_RiyHGD _v; + XXStruct_RiyHGD _v; } Atomic; typedef struct Object { - /*function-pointer*/ void** _field1; - Atomic _field2; + /*function-pointer*/ void **_field1; + Atomic _field2; } Object; typedef struct Timing Timing; @@ -24,55 +23,55 @@ typedef struct Timing Timing; typedef struct Vector Vector; typedef struct Animation { - /*function-pointer*/ void** _field1; - Atomic _field2; - float _field3; - Timing* _field4; - Vector* _field5; - void* _field6; - unsigned _field7; - unsigned _field8; + /*function-pointer*/ void **_field1; + Atomic _field2; + float _field3; + Timing *_field4; + Vector *_field5; + void *_field6; + unsigned _field7; + unsigned _field8; } Animation; -typedef struct _CAAttrList* CAAttrListRef; +typedef struct _CAAttrList *CAAttrListRef; typedef struct Proxy { - /*function-pointer*/ void** _field1; - Atomic _field2; - unsigned long long _field3; + /*function-pointer*/ void **_field1; + Atomic _field2; + unsigned long long _field3; } Proxy; typedef struct Mutex { - pthread_t _m; + pthread_t _m; } Mutex; typedef struct Shmem Shmem; typedef struct Commit Commit; -typedef struct CGColorSpace* CGColorSpaceRef; +typedef struct CGColorSpace *CGColorSpaceRef; @class CAContext, CALayer; typedef struct Context { - unsigned _field1; - struct Context* _field2; - Mutex _field3; - CAContext* _field4; - unsigned _field5; - unsigned _field6; - CALayer* _field7; - struct Context* _field8; - CGColorSpaceRef _field9; - CFDictionaryRef _field10; - unsigned _field11; - unsigned _field12; - CFMachPortRef _field13; - CFRunLoopSourceRef _field14; - Shmem* _field15; - Shmem* _field16; - float _field17; - Commit* _field18; - unsigned _field19 : 1; - unsigned _field20 : 1; - unsigned _field21 : 1; + unsigned _field1; + struct Context *_field2; + Mutex _field3; + CAContext *_field4; + unsigned _field5; + unsigned _field6; + CALayer *_field7; + struct Context *_field8; + CGColorSpaceRef _field9; + CFDictionaryRef _field10; + unsigned _field11; + unsigned _field12; + CFMachPortRef _field13; + CFRunLoopSourceRef _field14; + Shmem *_field15; + Shmem *_field16; + float _field17; + Commit *_field18; + unsigned _field19 : 1; + unsigned _field20 : 1; + unsigned _field21 : 1; } Context; typedef struct LayerExt LayerExt; @@ -85,26 +84,25 @@ template<> struct TypedArray; */ - typedef struct Layer { - /*function-pointer*/ void** _field1; - Atomic _field2; - unsigned _field3; - LayerExt* _field4; - Handle* _field5; - Object* _field6; - CGPoint _field7; - CGSize _field8; - // TypedArray* _field9 - void* _field9; - // TypedArray* _field10; - void* _field10; + /*function-pointer*/ void **_field1; + Atomic _field2; + unsigned _field3; + LayerExt *_field4; + Handle *_field5; + Object *_field6; + CGPoint _field7; + CGSize _field8; + // TypedArray* _field9 + void *_field9; + // TypedArray* _field10; + void *_field10; } Layer; typedef struct Shared Shared; typedef struct SpinLock { - XXStruct_RiyHGD _l; + XXStruct_RiyHGD _l; } SpinLock; typedef struct Level Level; @@ -114,156 +112,156 @@ typedef struct Command Command; typedef struct Deleted Deleted; typedef struct Transaction { - Shared* _field1; - unsigned _field2; - // HashTable* _field3; - void* _field3; - SpinLock* _field4; - unsigned _field5; - Level* _field6; - Command* _field7; - Deleted* _field8; - // List* _field9; - void* _field9; - Context* _field10; - // HashTable* _field11; - void* _field11; - CFRunLoopRef _field12; - CFRunLoopObserverRef _field13; - unsigned _field14 : 1; + Shared *_field1; + unsigned _field2; + // HashTable* _field3; + void *_field3; + SpinLock *_field4; + unsigned _field5; + Level *_field6; + Command *_field7; + Deleted *_field8; + // List* _field9; + void *_field9; + Context *_field10; + // HashTable* _field11; + void *_field11; + CFRunLoopRef _field12; + CFRunLoopObserverRef _field13; + unsigned _field14 : 1; } Transaction; -typedef struct _CALayerState* CALayerStateRef; +typedef struct _CALayerState *CALayerStateRef; -typedef struct _CALayerAnimation* CALayerAnimationRef; +typedef struct _CALayerAnimation *CALayerAnimationRef; @class CALayerArray; typedef struct _CALayerArrayIvars { - CALayer** layers; - unsigned count; - unsigned capacity; - unsigned long mutations; - BOOL retained; + CALayer **layers; + unsigned count; + unsigned capacity; + unsigned long mutations; + BOOL retained; } CALayerArrayIvars; typedef struct { - unsigned long _field1; - id* _field2; - unsigned long* _field3; - unsigned long _field4[5]; + unsigned long _field1; + id *_field2; + unsigned long *_field3; + unsigned long _field4[5]; } XXStruct_kFm5bA; typedef struct CAMediaTimingFunctionPrivate { - float _field1[2]; - float _field2[2]; + float _field1[2]; + float _field2[2]; } CAMediaTimingFunctionPrivate; typedef struct _EAGLNativeWindowObject { - int version; - /*function-pointer*/ void* attach; - /*function-pointer*/ void* detach; - /*function-pointer*/ void* begin; - /*function-pointer*/ void* swap; - /*function-pointer*/ void* collect; + int version; + /*function-pointer*/ void *attach; + /*function-pointer*/ void *detach; + /*function-pointer*/ void *begin; + /*function-pointer*/ void *swap; + /*function-pointer*/ void *collect; } EAGLNativeWindowObject; typedef struct EAGLNativeWindowCallbacksRec { - void* callback_data; - /*function-pointer*/ void* create_buffer; - /*function-pointer*/ void* destroy_buffer; + void *callback_data; + /*function-pointer*/ void *create_buffer; + /*function-pointer*/ void *destroy_buffer; } EAGLNativeWindowCallbacksRec; typedef struct x_list_struct x_list_struct; -typedef struct _CAImageQueue* CAImageQueueRef; +typedef struct _CAImageQueue *CAImageQueueRef; @class CAEAGLLayer; typedef struct _CAEAGLNativeWindow { - EAGLNativeWindowObject _field1; - EAGLNativeWindowCallbacksRec _field2; - x_list_struct* _field3; - Atomic _field4; - SpinLock _field5; - CAImageQueueRef _field6; - CAEAGLLayer* _field7; - x_list_struct* _field8; - unsigned _field9; - IOSurfaceRef _field10; - unsigned _field11 : 1; - unsigned _field12 : 1; + EAGLNativeWindowObject _field1; + EAGLNativeWindowCallbacksRec _field2; + x_list_struct *_field3; + Atomic _field4; + SpinLock _field5; + CAImageQueueRef _field6; + CAEAGLLayer *_field7; + x_list_struct *_field8; + unsigned _field9; + IOSurfaceRef _field10; + unsigned _field11 : 1; + unsigned _field12 : 1; } CAEAGLNativeWindow; typedef struct Display { - /*function-pointer*/ void** _field1; - id _field2; - CFStringRef _field3; - CFStringRef _field4; + /*function-pointer*/ void **_field1; + id _field2; + CFStringRef _field3; + CFStringRef _field4; } Display; typedef struct Condition { - pthread_cond_t _field1; + pthread_cond_t _field1; } Condition; typedef struct _opaque_pthread_t opaque_pthread_t; typedef struct DisplayLink { - /*function-pointer*/ void** _field1; - Display* _field2; - void* _field3; - SEL _field4; - void* _field5; - int _field6; - Mutex _field7; - Condition _field8; - opaque_pthread_t* _field9; - id _field10; - CFRunLoopRef _field11; - // List* _field12; - void* _field12; - unsigned long long _field13; - unsigned long long _field14; - unsigned _field15 : 1; + /*function-pointer*/ void **_field1; + Display *_field2; + void *_field3; + SEL _field4; + void *_field5; + int _field6; + Mutex _field7; + Condition _field8; + opaque_pthread_t *_field9; + id _field10; + CFRunLoopRef _field11; + // List* _field12; + void *_field12; + unsigned long long _field13; + unsigned long long _field14; + unsigned _field15 : 1; } DisplayLink; typedef struct PendingOperation PendingOperation; typedef struct Shape Shape; -typedef struct _CARenderOGLContext* CARenderOGLContextRef; +typedef struct _CARenderOGLContext *CARenderOGLContextRef; typedef struct Server { - /*function-pointer*/ void** _field1; - SpinLock _field2; - Display* _field3; - CFStringRef _field4; - Mutex _field5; - Condition _field6; - unsigned _field7; - Context** _field8; - unsigned _field9; - unsigned _field10; - SpinLock _field11; - PendingOperation* _field12; - Context* _field13; - Context* _field14; - unsigned _field15; - Shape* _field16; - unsigned _field17; - CARenderOGLContextRef _field18; - double _field19; - unsigned _field20 : 1; - unsigned _field21 : 1; - unsigned _field22 : 1; - unsigned _field23 : 1; + /*function-pointer*/ void **_field1; + SpinLock _field2; + Display *_field3; + CFStringRef _field4; + Mutex _field5; + Condition _field6; + unsigned _field7; + Context **_field8; + unsigned _field9; + unsigned _field10; + SpinLock _field11; + PendingOperation *_field12; + Context *_field13; + Context *_field14; + unsigned _field15; + Shape *_field16; + unsigned _field17; + CARenderOGLContextRef _field18; + double _field19; + unsigned _field20 : 1; + unsigned _field21 : 1; + unsigned _field22 : 1; + unsigned _field23 : 1; } Server; typedef struct CAWindowServerImpl { - CFArrayRef _field1; - unsigned _field2; + CFArrayRef _field1; + unsigned _field2; } CAWindowServerImpl; typedef struct { - int _field1; - int _field2; + int _field1; + int _field2; } XXStruct_K5nmsA; diff --git a/SparkAppItem.h b/SparkAppItem.h index 04d1adea..171f18da 100644 --- a/SparkAppItem.h +++ b/SparkAppItem.h @@ -1,8 +1,8 @@ #import @interface SparkAppItem : NSObject -@property (nonatomic, retain) NSString* bundleIdentifier; -@property (nonatomic, retain) NSString* displayName; +@property (nonatomic, retain) NSString *bundleIdentifier; +@property (nonatomic, retain) NSString *displayName; -- (UIImage*)icon; +- (UIImage *)icon; @end diff --git a/SparkAppList.h b/SparkAppList.h index ba71416a..99c7df4c 100644 --- a/SparkAppList.h +++ b/SparkAppList.h @@ -2,16 +2,15 @@ #import #import -@interface SparkAppList : NSObject -{ - id handler; +@interface SparkAppList : NSObject { + id handler; } -- (void)getAppList:(void(^)(NSArray*))handler; +- (void)getAppList:(void (^)(NSArray *))handler; -+ (NSArray*)getAppListForIdentifier:(NSString*)identifier andKey:(NSString*)key; -+ (BOOL)doesIdentifier:(NSString*)identifier andKey:(NSString*)key containBundleIdentifier:(NSString*)bundleIdentifier; -+ (void)setAppList:(NSArray*)appList forIdentifier:(NSString*)identifier andKey:(NSString*)key; ++ (NSArray *)getAppListForIdentifier:(NSString *)identifier andKey:(NSString *)key; ++ (BOOL)doesIdentifier:(NSString *)identifier andKey:(NSString *)key containBundleIdentifier:(NSString *)bundleIdentifier; ++ (void)setAppList:(NSArray *)appList forIdentifier:(NSString *)identifier andKey:(NSString *)key; -+ (void)removeBundleID:(NSString*)bundleID forIdentifier:(NSString*)identifier andKey:(NSString*)key; -+ (void)addBundleID:(NSString*)bundleID forIdentifier:(NSString*)identifier andKey:(NSString*)key; ++ (void)removeBundleID:(NSString *)bundleID forIdentifier:(NSString *)identifier andKey:(NSString *)key; ++ (void)addBundleID:(NSString *)bundleID forIdentifier:(NSString *)identifier andKey:(NSString *)key; @end diff --git a/SparkAppListTableViewController.h b/SparkAppListTableViewController.h index 2fc59c93..c343510e 100644 --- a/SparkAppListTableViewController.h +++ b/SparkAppListTableViewController.h @@ -1,16 +1,16 @@ #import @interface SparkAppListTableViewController : UITableViewController -@property (nonatomic, retain) NSArray* appList; +@property (nonatomic, retain) NSArray *appList; -@property (nonatomic, retain) NSString* preferencesIdentifier; -@property (nonatomic, retain) NSString* preferencesKey; -@property (nonatomic, retain) NSMutableArray* preferencesAppList; +@property (nonatomic, retain) NSString *preferencesIdentifier; +@property (nonatomic, retain) NSString *preferencesKey; +@property (nonatomic, retain) NSMutableArray *preferencesAppList; @property (nonatomic, assign) BOOL showBundleIdentifierOnTap; @property (nonatomic, assign) int maxEnabled; -- (id)initWithIdentifier:(NSString*)identifier andKey:(NSString*)key; -- (void)addCustomExclusion:(NSString*)bundleIdentifier; +- (id)initWithIdentifier:(NSString *)identifier andKey:(NSString *)key; +- (void)addCustomExclusion:(NSString *)bundleIdentifier; @end diff --git a/SparkColourPickerUtils.h b/SparkColourPickerUtils.h index d574dd2b..32ef1f9b 100644 --- a/SparkColourPickerUtils.h +++ b/SparkColourPickerUtils.h @@ -1,17 +1,17 @@ #import @interface SparkColourPickerUtils : NSObject -+ (NSString*)hexStringFromColour:(UIColor*)colour; -+ (NSString*)rgbStringFromColour:(UIColor*)colour; -+ (UIColor*)inverseColour:(UIColor*)colour; -+ (UIColor*)colour:(UIColor*)colour withBrightness:(float)newBrightness; -+ (BOOL)colourIsBlack:(UIColor*)colour; -+ (BOOL)colourIsWhite:(UIColor*)colour; -+ (UIColor*)colourWithString:(NSString*)colourString; -+ (UIColor *)colourWithString:(NSString *)stringToConvert withFallback:(NSString*)fallback; -+ (UIColor *)colourWithString:(NSString *)stringToConvert withFallbackColour:(UIColor*)fallback; -+ (UIColor*)colourWithRGBString:(NSString*)stringToConvert; ++ (NSString *)hexStringFromColour:(UIColor *)colour; ++ (NSString *)rgbStringFromColour:(UIColor *)colour; ++ (UIColor *)inverseColour:(UIColor *)colour; ++ (UIColor *)colour:(UIColor *)colour withBrightness:(float)newBrightness; ++ (BOOL)colourIsBlack:(UIColor *)colour; ++ (BOOL)colourIsWhite:(UIColor *)colour; ++ (UIColor *)colourWithString:(NSString *)colourString; ++ (UIColor *)colourWithString:(NSString *)stringToConvert withFallback:(NSString *)fallback; ++ (UIColor *)colourWithString:(NSString *)stringToConvert withFallbackColour:(UIColor *)fallback; ++ (UIColor *)colourWithRGBString:(NSString *)stringToConvert; + (UIColor *)colourWithHexString:(NSString *)stringToConvert; -+ (BOOL)colourIsLight:(UIColor*)colour; -+ (UIColor*)interpolateFrom:(UIColor*)startColour toColour:(UIColor*)endColour withPercentage:(float)percentage; ++ (BOOL)colourIsLight:(UIColor *)colour; ++ (UIColor *)interpolateFrom:(UIColor *)startColour toColour:(UIColor *)endColour withPercentage:(float)percentage; @end diff --git a/SparkColourPickerView.h b/SparkColourPickerView.h index 4a252120..9c10e0b8 100644 --- a/SparkColourPickerView.h +++ b/SparkColourPickerView.h @@ -1,8 +1,8 @@ #import NS_ASSUME_NONNULL_BEGIN -@protocol SparkColourPickerViewDelegate -- (void)colourPicker:(id)picker didUpdateColour:(UIColor*)colour; +@protocol SparkColourPickerViewDelegate +- (void)colourPicker:(id)picker didUpdateColour:(UIColor *)colour; @end @interface SparkColourPickerView : UIView @@ -11,18 +11,18 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithFrame:(CGRect)frame forceUIMode:(int)uiMode andViewSizeFactor:(float)viewSizeFactor; // These two properties can be set before showing the view to set the initial colour. The unmodified colour is without alpha. -@property (nonatomic, retain) UIColor* currentColour; -@property (nonatomic, retain) UIColor* currentColourUnmodified; +@property (nonatomic, retain) UIColor *currentColour; +@property (nonatomic, retain) UIColor *currentColourUnmodified; @property (nonatomic, assign) float currentColourAlpha; @property (nonatomic, assign) float currentColourBrightness; // The title to display at the top, leave NULL for nothing. -@property (nonatomic, retain) NSString* keyName; +@property (nonatomic, retain) NSString *keyName; // Delegate to call the 'didUpdateColour' method on @property (nonatomic, retain) id delegate; // This is used for showing alerts. -@property (nonatomic, retain) UIViewController* rootViewController; +@property (nonatomic, retain) UIViewController *rootViewController; @end NS_ASSUME_NONNULL_END diff --git a/SpringBoard/SBActivationSettings.h b/SpringBoard/SBActivationSettings.h index f9520192..32fea9f3 100644 --- a/SpringBoard/SBActivationSettings.h +++ b/SpringBoard/SBActivationSettings.h @@ -1,59 +1,59 @@ #import typedef NS_ENUM(NSUInteger, SBActivationSetting) { - SBActivationSettingNotASetting = 0, - SBActivationSettingNoAnimate = 3, - SBActivationSettingAnimationDurationForOthersSuspension, - SBActivationSettingSuspended, - SBActivationSettingSEO, - SBActivationSettingURL, - SBActivationSettingEventOnly, - SBActivationSettingAnimateWithoutPNG, - SBActivationSettingAnimatePreviousWithoutPNG, - SBActivationSettingPreferSceneSnapshots, - SBActivationSettingAnimateLiveContentASAP, - SBActivationSettingAnimationDelay, - SBActivationSettingReverseAnimation, - SBActivationSettingSourceIdentifier, - SBActivationSettingAnnotation, - SBActivationSettingLaunchOptions, - SBActivationSettingLaunchImageName, - SBActivationSettingUserLaunchEventTime, - SBActivationSettingClassicOverride, - SBActivationSettingAppLink, - SBActivationSettingAppLinkState, - SBActivationSettingEscapingAppLink, - SBActivationSettingBreadcrumbSourceIdentifier, - SBActivationSettingBreadcrumbNavigationAction, - SBActivationSettingSpotlightVisible, - SBActivationSettingTodayViewVisible, - SBActivationSettingBannerLongLookVisible, - SBActivationSettingProcessLaunchIntent, - SBActivationSettingFromHomeScreen, - SBActivationSettingFromLocked, - SBActivationSettingFromContinuity, - SBActivationSettingFromBanner, - SBActivationSettingFromBulletinList, - SBActivationSettingFromAssistant, - SBActivationSettingFromStark, - SBActivationSettingFromCC, - SBActivationSettingFromIconWithLeafIdentifier, - SBActivationSettingFromSpotlight, - SBActivationSettingFromBreadcrumb, - SBActivationSettingFromCommandTab, - SBActivationSettingFromSystemServiceRequest, - SBActivationSettingFromTrustedSystemServiceRequest, - SBActivationSettingFromShortcutItem, - SBActivationSettingFromWidget, - SBActivationSettingFromNotificationContentExtension, - SBActivationSettingAsNowPlaying, - SBActivationSettingLaunchForegroundUnderLockScreen, - SBActivationSettingIgnoringOcclusionsReason, - SBActivationSettingSiriContinuityAppSuggestion, - SBActivationSettingDontResetSwitchAppList, - SBActivationSettingAnimateOthersSuspension, - SBActivationSettingFromDeactivatingAlert, - SBActivationSettingAnimationStartForOthersSuspension, + SBActivationSettingNotASetting = 0, + SBActivationSettingNoAnimate = 3, + SBActivationSettingAnimationDurationForOthersSuspension, + SBActivationSettingSuspended, + SBActivationSettingSEO, + SBActivationSettingURL, + SBActivationSettingEventOnly, + SBActivationSettingAnimateWithoutPNG, + SBActivationSettingAnimatePreviousWithoutPNG, + SBActivationSettingPreferSceneSnapshots, + SBActivationSettingAnimateLiveContentASAP, + SBActivationSettingAnimationDelay, + SBActivationSettingReverseAnimation, + SBActivationSettingSourceIdentifier, + SBActivationSettingAnnotation, + SBActivationSettingLaunchOptions, + SBActivationSettingLaunchImageName, + SBActivationSettingUserLaunchEventTime, + SBActivationSettingClassicOverride, + SBActivationSettingAppLink, + SBActivationSettingAppLinkState, + SBActivationSettingEscapingAppLink, + SBActivationSettingBreadcrumbSourceIdentifier, + SBActivationSettingBreadcrumbNavigationAction, + SBActivationSettingSpotlightVisible, + SBActivationSettingTodayViewVisible, + SBActivationSettingBannerLongLookVisible, + SBActivationSettingProcessLaunchIntent, + SBActivationSettingFromHomeScreen, + SBActivationSettingFromLocked, + SBActivationSettingFromContinuity, + SBActivationSettingFromBanner, + SBActivationSettingFromBulletinList, + SBActivationSettingFromAssistant, + SBActivationSettingFromStark, + SBActivationSettingFromCC, + SBActivationSettingFromIconWithLeafIdentifier, + SBActivationSettingFromSpotlight, + SBActivationSettingFromBreadcrumb, + SBActivationSettingFromCommandTab, + SBActivationSettingFromSystemServiceRequest, + SBActivationSettingFromTrustedSystemServiceRequest, + SBActivationSettingFromShortcutItem, + SBActivationSettingFromWidget, + SBActivationSettingFromNotificationContentExtension, + SBActivationSettingAsNowPlaying, + SBActivationSettingLaunchForegroundUnderLockScreen, + SBActivationSettingIgnoringOcclusionsReason, + SBActivationSettingSiriContinuityAppSuggestion, + SBActivationSettingDontResetSwitchAppList, + SBActivationSettingAnimateOthersSuspension, + SBActivationSettingFromDeactivatingAlert, + SBActivationSettingAnimationStartForOthersSuspension, }; @interface SBActivationSettings : NSObject diff --git a/SpringBoard/SBAppSliderController.h b/SpringBoard/SBAppSliderController.h index 5ececc56..b1661f62 100644 --- a/SpringBoard/SBAppSliderController.h +++ b/SpringBoard/SBAppSliderController.h @@ -3,7 +3,7 @@ @class SBAppSliderScrollingViewController; -@interface SBAppSliderController : UIViewController +@interface SBAppSliderController : UIViewController - (NSString *)_displayIDAtIndex:(NSUInteger)index; diff --git a/SpringBoard/SBAppSwitcherController.h b/SpringBoard/SBAppSwitcherController.h index b3229b1f..258521ad 100644 --- a/SpringBoard/SBAppSwitcherController.h +++ b/SpringBoard/SBAppSwitcherController.h @@ -3,7 +3,7 @@ @class SBAppSwitcherPageViewController; -@interface SBAppSwitcherController : UIViewController +@interface SBAppSwitcherController : UIViewController @property (nonatomic, retain) SBAppSwitcherPageViewController *pageController; diff --git a/SpringBoard/SBAppSwitcherPeopleDataSource.h b/SpringBoard/SBAppSwitcherPeopleDataSource.h index 2059acab..3fc21407 100644 --- a/SpringBoard/SBAppSwitcherPeopleDataSource.h +++ b/SpringBoard/SBAppSwitcherPeopleDataSource.h @@ -3,7 +3,7 @@ @protocol SBAppSwitcherPeopleDataSourceConsumer; -@protocol SBAppSwitcherPeopleDataSource +@protocol SBAppSwitcherPeopleDataSource @property (assign, nonatomic) id consumer; diff --git a/SpringBoard/SBAppSwitcherPeopleScrollViewDelegate.h b/SpringBoard/SBAppSwitcherPeopleScrollViewDelegate.h index 5d5644ec..2f60d382 100644 --- a/SpringBoard/SBAppSwitcherPeopleScrollViewDelegate.h +++ b/SpringBoard/SBAppSwitcherPeopleScrollViewDelegate.h @@ -3,7 +3,7 @@ @class SBAppSwitcherPeopleScrollView, SBScrollViewItemWrapper; -@protocol SBAppSwitcherPeopleScrollViewDelegate +@protocol SBAppSwitcherPeopleScrollViewDelegate - (NSInteger)numberOfSectionsInPeopleScrollView:(SBAppSwitcherPeopleScrollView *)peopleScrollView; - (SBScrollViewItemWrapper *)peopleScrollView:(SBAppSwitcherPeopleScrollView *)peopleScrollView itemAtIndexPath:(NSIndexPath *)indexPath; diff --git a/SpringBoard/SBAppViewController.h b/SpringBoard/SBAppViewController.h index 87f145d1..9367a88d 100644 --- a/SpringBoard/SBAppViewController.h +++ b/SpringBoard/SBAppViewController.h @@ -3,7 +3,7 @@ @class SBApplication, SBAppView, SBWorkspaceApplication, SBApplicationSceneEntity; -@interface SBAppViewController : UIViewController +@interface SBAppViewController : UIViewController @property (nonatomic, copy, readonly) NSString *bundleIdentifier; @property (assign, nonatomic) BOOL automatesLifecycle; @property (assign, nonatomic) NSInteger requestedMode; diff --git a/SpringBoard/SBAppViewControllerDelegate.h b/SpringBoard/SBAppViewControllerDelegate.h index d9ed7824..4e47d581 100644 --- a/SpringBoard/SBAppViewControllerDelegate.h +++ b/SpringBoard/SBAppViewControllerDelegate.h @@ -3,7 +3,7 @@ @class SBApplication, SBAppViewController; -@protocol SBAppViewControllerDelegate +@protocol SBAppViewControllerDelegate @optional - (BOOL)appViewController:(SBAppViewController *)controller shouldTransitionToMode:(NSInteger)mode; diff --git a/SpringBoard/SBApplicationHosting.h b/SpringBoard/SBApplicationHosting.h index d9ba8983..7e045fd0 100644 --- a/SpringBoard/SBApplicationHosting.h +++ b/SpringBoard/SBApplicationHosting.h @@ -2,7 +2,7 @@ @class SBApplication; -@protocol SBApplicationHosting +@protocol SBApplicationHosting @required - (SBApplication *)hostedApp; diff --git a/SpringBoard/SBApplicationIcon.h b/SpringBoard/SBApplicationIcon.h index 4c9e1a7d..70bd0eb0 100644 --- a/SpringBoard/SBApplicationIcon.h +++ b/SpringBoard/SBApplicationIcon.h @@ -4,7 +4,8 @@ @class SBApplication; -API_AVAILABLE(ios(3.0)) @interface SBApplicationIcon : SBLeafIcon +API_AVAILABLE(ios(3.0)) +@interface SBApplicationIcon : SBLeafIcon - (instancetype)initWithApplication:(SBApplication *)application; - (UIImage *)generateIconImage:(int)type API_DEPRECATED_WITH_REPLACEMENT("generateIconImageWithInfo", ios(4.0, 13.0)); diff --git a/SpringBoard/SBBannerView.h b/SpringBoard/SBBannerView.h index fe80b6b8..46a08ba2 100644 --- a/SpringBoard/SBBannerView.h +++ b/SpringBoard/SBBannerView.h @@ -1,5 +1,6 @@ #import -NS_CLASS_DEPRECATED_IOS(5_0, 6_0) @interface SBBannerView : UIView +NS_CLASS_DEPRECATED_IOS(5_0, 6_0) +@interface SBBannerView : UIView @end diff --git a/SpringBoard/SBBulletinBannerView.h b/SpringBoard/SBBulletinBannerView.h index b545c6ff..2b3e32e6 100644 --- a/SpringBoard/SBBulletinBannerView.h +++ b/SpringBoard/SBBulletinBannerView.h @@ -3,6 +3,7 @@ @interface SBUIRoundedBannerItemView : UIView // iOS 6 only, but the compiler doesn't need to know that yet. @end -NS_CLASS_AVAILABLE_IOS(6_0) @interface SBBulletinBannerView : SBUIRoundedBannerItemView +NS_CLASS_AVAILABLE_IOS(6_0) +@interface SBBulletinBannerView : SBUIRoundedBannerItemView @end diff --git a/SpringBoard/SBBulletinListCell.h b/SpringBoard/SBBulletinListCell.h index 5fce8673..27206269 100644 --- a/SpringBoard/SBBulletinListCell.h +++ b/SpringBoard/SBBulletinListCell.h @@ -2,8 +2,8 @@ #import typedef enum { - SBBulletinListCellAccessoryStyleNone = 0, - SBBulletinListCellAccessoryStyleDot = 1 + SBBulletinListCellAccessoryStyleNone = 0, + SBBulletinListCellAccessoryStyleDot = 1 } SBBulletinListCellAccessoryStyle; @interface SBBulletinListCell : UITableViewCell diff --git a/SpringBoard/SBBulletinListSection.h b/SpringBoard/SBBulletinListSection.h index ed5bcb5c..bde96b6e 100644 --- a/SpringBoard/SBBulletinListSection.h +++ b/SpringBoard/SBBulletinListSection.h @@ -7,6 +7,6 @@ @interface SBBulletinListSection : NSObject @property (copy, nonatomic) NSString *sectionID; -@property (nonatomic, retain) NSArray *bulletins; +@property (nonatomic, retain) NSArray *bulletins; @end diff --git a/SpringBoard/SBControlCenterController.h b/SpringBoard/SBControlCenterController.h index fd2aeec4..2ee224cd 100644 --- a/SpringBoard/SBControlCenterController.h +++ b/SpringBoard/SBControlCenterController.h @@ -4,8 +4,8 @@ + (instancetype)sharedInstance; -- (void)presentAnimated:(BOOL)animated completion:(void(^)())completion; -- (void)dismissAnimated:(BOOL)animated completion:(void(^)())completion; +- (void)presentAnimated:(BOOL)animated completion:(void (^)())completion; +- (void)dismissAnimated:(BOOL)animated completion:(void (^)())completion; @property (nonatomic, assign, getter=isUILocked) BOOL UILocked; diff --git a/SpringBoard/SBFolder.h b/SpringBoard/SBFolder.h index a888a14f..070888db 100644 --- a/SpringBoard/SBFolder.h +++ b/SpringBoard/SBFolder.h @@ -4,6 +4,6 @@ @interface SBFolder : NSObject -@property (nonatomic, retain, readonly) NSArray *allIcons; +@property (nonatomic, retain, readonly) NSArray *allIcons; @end diff --git a/SpringBoard/SBIconController.h b/SpringBoard/SBIconController.h index 3f8ba603..f6166a17 100644 --- a/SpringBoard/SBIconController.h +++ b/SpringBoard/SBIconController.h @@ -2,8 +2,9 @@ @class SBDockIconListView, SBIconModel, SBRootIconListView, SBRootFolderController, SBIconViewMap, SBIconContentView, SBRootFolder, SBIconListView, SBFolder; -API_AVAILABLE(ios(3.0)) @interface SBIconController : NSObject { - SBIconModel *_iconModel; +API_AVAILABLE(ios(3.0)) +@interface SBIconController : NSObject { + SBIconModel *_iconModel; } + (instancetype)sharedInstance; @@ -12,8 +13,8 @@ API_AVAILABLE(ios(3.0)) @interface SBIconController : NSObject { @property (nonatomic, readonly) SBIconViewMap *homescreenIconViewMap API_AVAILABLE(ios(6.0)); -@property (nonatomic, retain, readonly) SBRootIconListView *currentRootIconList API_AVAILABLE(ios(4.0)); -@property (nonatomic, retain, readonly) SBDockIconListView *dockListView API_AVAILABLE(ios(11.0)); +@property (nonatomic, retain, readonly) SBRootIconListView *currentRootIconList API_AVAILABLE(ios(4.0)); +@property (nonatomic, retain, readonly) SBDockIconListView *dockListView API_AVAILABLE(ios(11.0)); @property (nonatomic, retain, readonly) SBIconContentView *contentView; @property (nonatomic, retain, readonly) SBRootFolderController *_rootFolderController; diff --git a/SpringBoard/SBIconList.h b/SpringBoard/SBIconList.h index 7055ce30..43883eae 100644 --- a/SpringBoard/SBIconList.h +++ b/SpringBoard/SBIconList.h @@ -1,5 +1,6 @@ #import -API_DEPRECATED_WITH_REPLACEMENT("SBIconListView", ios(2.0, 4.0)) @interface SBIconList : UIView +API_DEPRECATED_WITH_REPLACEMENT("SBIconListView", ios(2.0, 4.0)) +@interface SBIconList : UIView @end diff --git a/SpringBoard/SBIconListView.h b/SpringBoard/SBIconListView.h index 2107d5ce..f6438151 100644 --- a/SpringBoard/SBIconListView.h +++ b/SpringBoard/SBIconListView.h @@ -5,10 +5,10 @@ API_AVAILABLE(ios(4.0)) @interface SBIconListView : UIView -@property(readonly, nonatomic) NSUInteger maximumIconCount API_AVAILABLE(ios(13.0)); -@property(readonly, nonatomic) NSUInteger maxIcons API_DEPRECATED_WITH_REPLACEMENT("maximumIconCount", ios(4.0, 13.0)); -@property(readonly, nonatomic) NSUInteger iconColumnsForCurrentOrientation; -@property(readonly, nonatomic) NSUInteger iconRowsForCurrentOrientation; +@property (readonly, nonatomic) NSUInteger maximumIconCount API_AVAILABLE(ios(13.0)); +@property (readonly, nonatomic) NSUInteger maxIcons API_DEPRECATED_WITH_REPLACEMENT("maximumIconCount", ios(4.0, 13.0)); +@property (readonly, nonatomic) NSUInteger iconColumnsForCurrentOrientation; +@property (readonly, nonatomic) NSUInteger iconRowsForCurrentOrientation; - (void)setAlphaForAllIcons:(CGFloat)alpha; diff --git a/SpringBoard/SBIconModel.h b/SpringBoard/SBIconModel.h index 7739ce9e..8d103523 100644 --- a/SpringBoard/SBIconModel.h +++ b/SpringBoard/SBIconModel.h @@ -2,7 +2,8 @@ @class SBApplicationIcon; -API_AVAILABLE(ios(3.0)) @interface SBIconModel : NSObject +API_AVAILABLE(ios(3.0)) +@interface SBIconModel : NSObject - (SBApplicationIcon *)applicationIconForBundleIdentifier:(NSString *)bundleID API_AVAILABLE(ios(8.0)); - (SBApplicationIcon *)applicationIconForDisplayIdentifier:(NSString *)displayIdentifier API_DEPRECATED_WITH_REPLACEMENT("expectedIconForDisplayIdentifier:displayIdentifier", ios(4.0, 7.0)); diff --git a/SpringBoard/SBLockScreenManager.h b/SpringBoard/SBLockScreenManager.h index 38115587..6a1196b7 100644 --- a/SpringBoard/SBLockScreenManager.h +++ b/SpringBoard/SBLockScreenManager.h @@ -2,7 +2,8 @@ @class SBLockScreenViewController, CSCoverSheetViewController; -API_AVAILABLE(ios(7.0)) @interface SBLockScreenManager : NSObject +API_AVAILABLE(ios(7.0)) +@interface SBLockScreenManager : NSObject + (instancetype)sharedInstance; diff --git a/SpringBoard/SBMainWorkspace.h b/SpringBoard/SBMainWorkspace.h index 577dd3a7..10e47daa 100644 --- a/SpringBoard/SBMainWorkspace.h +++ b/SpringBoard/SBMainWorkspace.h @@ -17,7 +17,7 @@ - (void)handleReachabilityModeActivated; - (void)handleReachabilityModeDeactivated; --(void)_suspend; --(void)_resume; +- (void)_suspend; +- (void)_resume; @end diff --git a/SpringBoard/SBNotificationCenterController.h b/SpringBoard/SBNotificationCenterController.h index 3afe2d36..de848968 100644 --- a/SpringBoard/SBNotificationCenterController.h +++ b/SpringBoard/SBNotificationCenterController.h @@ -6,7 +6,7 @@ + (instancetype)sharedInstance; -- (void)presentAnimated:(BOOL)animated completion:(void(^)())completion; +- (void)presentAnimated:(BOOL)animated completion:(void (^)())completion; @property (nonatomic, retain) SBNotificationCenterViewController *viewController; @property (nonatomic, readonly, getter=isVisible) BOOL visible; diff --git a/SpringBoard/SBPreciseClockTimer.h b/SpringBoard/SBPreciseClockTimer.h index 70fd36e2..f170ad27 100644 --- a/SpringBoard/SBPreciseClockTimer.h +++ b/SpringBoard/SBPreciseClockTimer.h @@ -6,7 +6,7 @@ + (instancetype)sharedInstance; -- (NSNumber *)startMinuteUpdatesWithHandler:(void(^)())handler; +- (NSNumber *)startMinuteUpdatesWithHandler:(void (^)())handler; - (void)stopMinuteUpdatesForToken:(NSNumber *)token; @end \ No newline at end of file diff --git a/SpringBoard/SBSystemGestureManager.h b/SpringBoard/SBSystemGestureManager.h index 06d1b22f..61e92452 100644 --- a/SpringBoard/SBSystemGestureManager.h +++ b/SpringBoard/SBSystemGestureManager.h @@ -1,21 +1,21 @@ #import typedef NS_ENUM(int64_t, SBSystemGestureType) { - SBSystemGestureTypeNone, - SBSystemGestureTypeShowNotificationCenter, - SBSystemGestureTypeDismissBanner, - SBSystemGestureTypeShowControlCenter, - SBSystemGestureTypeSuspendApp, - SBSystemGestureTypeSwitcherSlideUp, - SBSystemGestureTypeSwitchApp, - SBSystemGestureTypeSceneResize, - SBSystemGestureTypeSideAppReveal, - SBSystemGestureTypeSideAppGrabberReveal, - SBSystemGestureTypeSideAppGrabberDismiss, - SBSystemGestureTypeSideSwitcherReveal, - SBSystemGestureTypeSideSwitcherGrabberPress, - SBSystemGestureTypeSwitcherForcePress, - SBSystemGestureTypeCarPlayBannerDismiss, + SBSystemGestureTypeNone, + SBSystemGestureTypeShowNotificationCenter, + SBSystemGestureTypeDismissBanner, + SBSystemGestureTypeShowControlCenter, + SBSystemGestureTypeSuspendApp, + SBSystemGestureTypeSwitcherSlideUp, + SBSystemGestureTypeSwitchApp, + SBSystemGestureTypeSceneResize, + SBSystemGestureTypeSideAppReveal, + SBSystemGestureTypeSideAppGrabberReveal, + SBSystemGestureTypeSideAppGrabberDismiss, + SBSystemGestureTypeSideSwitcherReveal, + SBSystemGestureTypeSideSwitcherGrabberPress, + SBSystemGestureTypeSwitcherForcePress, + SBSystemGestureTypeCarPlayBannerDismiss, }; @class SBMainDisplaySystemGestureManager; diff --git a/SpringBoard/SBSystemGestureRecognizerDelegate.h b/SpringBoard/SBSystemGestureRecognizerDelegate.h index bc428b71..d74acc1f 100644 --- a/SpringBoard/SBSystemGestureRecognizerDelegate.h +++ b/SpringBoard/SBSystemGestureRecognizerDelegate.h @@ -1,7 +1,7 @@ #import #import -@protocol SBSystemGestureRecognizerDelegate +@protocol SBSystemGestureRecognizerDelegate @required diff --git a/SpringBoard/SBUIController.h b/SpringBoard/SBUIController.h index d260abc3..cc59edd0 100644 --- a/SpringBoard/SBUIController.h +++ b/SpringBoard/SBUIController.h @@ -2,7 +2,7 @@ @class SBWallpaperView; -@interface SBUIController : NSObject +@interface SBUIController : NSObject + (instancetype)sharedInstance; diff --git a/SpringBoard/SBWallpaperEffectView.h b/SpringBoard/SBWallpaperEffectView.h index f217d933..8f73c8db 100644 --- a/SpringBoard/SBWallpaperEffectView.h +++ b/SpringBoard/SBWallpaperEffectView.h @@ -1,41 +1,41 @@ #import typedef NS_ENUM(NSUInteger, SBWallpaperVariant) { - SBWallpaperVariantStaticWallpaper + SBWallpaperVariantStaticWallpaper }; typedef NS_ENUM(NSUInteger, SBWallpaperStyle) { - SBWallpaperStyleNormal, - SBWallpaperStyleHidden, - SBWallpaperStyleBlack, - SBWallpaperStyleBlur, - SBWallpaperStyleUltraLightBlurOnly, - SBWallpaperStyleSemiLightBlurOnly, - SBWallpaperStyleFlatSemiLightBlurOnly, - SBWallpaperStyleLightBlurOnly, - SBWallpaperStyleDarkBlurOnly, - SBWallpaperStyleUltraLightTintedBlur, - SBWallpaperStyleSemiLightTintedBlur, - SBWallpaperStyleFlatSemiLightTintedBlur, - SBWallpaperStyleLightTintedBlur, - SBWallpaperStyleDarkTintedBlur, - SBWallpaperStyleUltraLightTintOnly, - SBWallpaperStyleSemiLightTintOnly, - SBWallpaperStyleFlatSemiLightTintOnly, - SBWallpaperStyleLightTintOnly, - SBWallpaperStyleDarkTintOnly, - SBWallpaperStyleBackgroundLightBlurOnly, - SBWallpaperStyleBackgroundLightTintedBlur, - SBWallpaperStyleBackgroundLightTintOnly, - SBWallpaperStyleForegroundLightBlurOnly, - SBWallpaperStyleForegroundLightTintedBlur, - SBWallpaperStyleForegroundLightTintOnly, - SBWallpaperStyleSwitcherBackgroundLightBlurOnlt, - SBWallpaperStyleSwitcherBackgroundLightTintedBlur, - SBWallpaperStyleSwitcherBackgroundLightTintOnly, - SBWallpaperStyleSwitcherForegroundLightBlurOnly, - SBWallpaperStyleSwitcherForegroundLightTintedBlur, - SBWallpaperStyleSwitcherForegroundLightTintOnly, + SBWallpaperStyleNormal, + SBWallpaperStyleHidden, + SBWallpaperStyleBlack, + SBWallpaperStyleBlur, + SBWallpaperStyleUltraLightBlurOnly, + SBWallpaperStyleSemiLightBlurOnly, + SBWallpaperStyleFlatSemiLightBlurOnly, + SBWallpaperStyleLightBlurOnly, + SBWallpaperStyleDarkBlurOnly, + SBWallpaperStyleUltraLightTintedBlur, + SBWallpaperStyleSemiLightTintedBlur, + SBWallpaperStyleFlatSemiLightTintedBlur, + SBWallpaperStyleLightTintedBlur, + SBWallpaperStyleDarkTintedBlur, + SBWallpaperStyleUltraLightTintOnly, + SBWallpaperStyleSemiLightTintOnly, + SBWallpaperStyleFlatSemiLightTintOnly, + SBWallpaperStyleLightTintOnly, + SBWallpaperStyleDarkTintOnly, + SBWallpaperStyleBackgroundLightBlurOnly, + SBWallpaperStyleBackgroundLightTintedBlur, + SBWallpaperStyleBackgroundLightTintOnly, + SBWallpaperStyleForegroundLightBlurOnly, + SBWallpaperStyleForegroundLightTintedBlur, + SBWallpaperStyleForegroundLightTintOnly, + SBWallpaperStyleSwitcherBackgroundLightBlurOnlt, + SBWallpaperStyleSwitcherBackgroundLightTintedBlur, + SBWallpaperStyleSwitcherBackgroundLightTintOnly, + SBWallpaperStyleSwitcherForegroundLightBlurOnly, + SBWallpaperStyleSwitcherForegroundLightTintedBlur, + SBWallpaperStyleSwitcherForegroundLightTintOnly, }; @interface SBWallpaperEffectView : UIView diff --git a/SpringBoard/SBWorkspaceApplicationTransitionContext.h b/SpringBoard/SBWorkspaceApplicationTransitionContext.h index b1005346..fa04cbe9 100644 --- a/SpringBoard/SBWorkspaceApplicationTransitionContext.h +++ b/SpringBoard/SBWorkspaceApplicationTransitionContext.h @@ -1,9 +1,9 @@ #import "SBWorkspaceTransitionContext.h" typedef NS_ENUM(NSInteger, SBLayoutRole) { - SBLayoutRoleUnknown, - SBLayoutRoleMainApp, - SBLayoutRoleSideApp + SBLayoutRoleUnknown, + SBLayoutRoleMainApp, + SBLayoutRoleSideApp }; @class SBWorkspaceApplication, SBWorkspaceEntity; diff --git a/SpringBoard/VolumeControl.h b/SpringBoard/VolumeControl.h index e2b99e16..50400188 100644 --- a/SpringBoard/VolumeControl.h +++ b/SpringBoard/VolumeControl.h @@ -8,7 +8,7 @@ API_DEPRECATED_WITH_REPLACEMENT("SBVolumeControl", ios(2.0, 13.0)) - (void)increaseVolume; - (void)decreaseVolume; -- (float)volumeStepUp API_AVAILABLE(ios(6.0)); +- (float)volumeStepUp API_AVAILABLE(ios(6.0)); - (float)volumeStepDown API_AVAILABLE(ios(6.0)); - (float)volume API_AVAILABLE(ios(4.0)); diff --git a/SpringBoardHome/SBHIconGridSize.h b/SpringBoardHome/SBHIconGridSize.h index 0b8c8f57..535d0de2 100644 --- a/SpringBoardHome/SBHIconGridSize.h +++ b/SpringBoardHome/SBHIconGridSize.h @@ -1,6 +1,6 @@ #include typedef struct SBHIconGridSize { - uint16_t columns; - uint16_t rows; + uint16_t columns; + uint16_t rows; } SBHIconGridSize; \ No newline at end of file diff --git a/SpringBoardServices/SBSApplicationShortcutItem.h b/SpringBoardServices/SBSApplicationShortcutItem.h index 7f0cfab4..02d6e677 100644 --- a/SpringBoardServices/SBSApplicationShortcutItem.h +++ b/SpringBoardServices/SBSApplicationShortcutItem.h @@ -12,6 +12,6 @@ @property (nonatomic, copy) SBSApplicationShortcutIcon *icon; @property (nonatomic, copy) NSString *bundleIdentifierToLaunch; -+ (instancetype)staticShortcutItemWithDictionary:(NSDictionary *)dictionary localizationHandler:(/*^block*/id)handler; ++ (instancetype)staticShortcutItemWithDictionary:(NSDictionary *)dictionary localizationHandler:(/*^block*/ id)handler; @end diff --git a/SpringBoardServices/SBSRelaunchAction.h b/SpringBoardServices/SBSRelaunchAction.h index 9db3c02b..52b7ce08 100644 --- a/SpringBoardServices/SBSRelaunchAction.h +++ b/SpringBoardServices/SBSRelaunchAction.h @@ -1,10 +1,10 @@ #import typedef NS_OPTIONS(NSUInteger, SBSRelaunchActionOptions) { - SBSRelaunchActionOptionsNone, - SBSRelaunchActionOptionsRestartRenderServer = 1 << 0, - SBSRelaunchActionOptionsSnapshotTransition = 1 << 1, - SBSRelaunchActionOptionsFadeToBlackTransition = 1 << 2 + SBSRelaunchActionOptionsNone, + SBSRelaunchActionOptionsRestartRenderServer = 1 << 0, + SBSRelaunchActionOptionsSnapshotTransition = 1 << 1, + SBSRelaunchActionOptionsFadeToBlackTransition = 1 << 2 }; @interface SBSRelaunchAction : BSAction diff --git a/SpringBoardUIServices/_SBUIWidgetViewController.h b/SpringBoardUIServices/_SBUIWidgetViewController.h index 4b2244d7..412c9c26 100644 --- a/SpringBoardUIServices/_SBUIWidgetViewController.h +++ b/SpringBoardUIServices/_SBUIWidgetViewController.h @@ -1,6 +1,6 @@ #import "_SBUIWidgetHost.h" -@interface _SBUIWidgetViewController : UIViewController <_SBUIWidgetHost> +@interface _SBUIWidgetViewController : UIViewController<_SBUIWidgetHost> @property (copy) NSString *widgetIdentifier; @property (readonly, assign, nonatomic) CGSize preferredViewSize; // override this to set a height @@ -14,6 +14,6 @@ - (void)invalidatePreferredViewSize; - (void)requestLaunchOfURL:(NSURL *)url; -- (void)requestPresentationOfViewController:(UIViewController *)viewController presentationStyle:(UIModalPresentationStyle)presentationStyle context:(void *)context completion:(void(^)(void))completion; // this method appears to be unimplemented in 7.0 +- (void)requestPresentationOfViewController:(UIViewController *)viewController presentationStyle:(UIModalPresentationStyle)presentationStyle context:(void *)context completion:(void (^)(void))completion; // this method appears to be unimplemented in 7.0 @end diff --git a/TechSupport/TSContactViewController.h b/TechSupport/TSContactViewController.h index a3851d6d..d38ac55a 100644 --- a/TechSupport/TSContactViewController.h +++ b/TechSupport/TSContactViewController.h @@ -21,14 +21,14 @@ * This value is _nil_ by default. When nil, a default placeholder string will * be displayed. The default string is localized. */ -@property(nonatomic, copy) NSString *detailEntryPlaceholderText; +@property (nonatomic, copy) NSString *detailEntryPlaceholderText; /** * The string used for the subject of the generated email. * * This value is _nil_ by default. */ -@property(nonatomic, copy) NSString *subject; +@property (nonatomic, copy) NSString *subject; /** * The string displayed in the generated email, below the device details and @@ -36,7 +36,7 @@ * * This value is _nil_ by default. */ -@property(nonatomic, copy) NSString *messageBody; +@property (nonatomic, copy) NSString *messageBody; /** * A string used for formatting the details input by the user. @@ -44,14 +44,14 @@ * This value is _nil_ by default. Any set value *must* include a "%@" to * represent where the user input will be inserted. */ -@property(nonatomic, copy) NSString *detailFormat; +@property (nonatomic, copy) NSString *detailFormat; /** * A string representing the generator of this email. * * This value is _nil_ by default. */ -@property(nonatomic, copy) NSString *byline; +@property (nonatomic, copy) NSString *byline; /** * A Boolean value that determines whether a user must enter details. @@ -59,7 +59,7 @@ * This value is NO by default. When YES, the user will not be able to generate * the email without entering text into the detail area. */ -@property(nonatomic, assign) BOOL requiresDetailsFromUser; +@property (nonatomic, assign) BOOL requiresDetailsFromUser; /** * Initializer. diff --git a/TechSupport/TSEmailInstruction.h b/TechSupport/TSEmailInstruction.h index bcf33001..f7bdb0dd 100644 --- a/TechSupport/TSEmailInstruction.h +++ b/TechSupport/TSEmailInstruction.h @@ -11,10 +11,10 @@ #import "TSInstruction.h" @interface TSEmailInstruction : TSInstruction -@property(nonatomic, readonly) NSString *toAddress; -@property(nonatomic, readonly) NSArray *ccAddresses; -@property(nonatomic, readonly) NSString *subject; -@property(nonatomic, readonly) BOOL isSupport; +@property (nonatomic, readonly) NSString *toAddress; +@property (nonatomic, readonly) NSArray *ccAddresses; +@property (nonatomic, readonly) NSString *subject; +@property (nonatomic, readonly) BOOL isSupport; @end /* vim: set ft=objc ff=unix sw=4 ts=4 tw=80 expandtab: */ diff --git a/TechSupport/TSHTMLViewController.h b/TechSupport/TSHTMLViewController.h index 9eebf475..32dc878a 100644 --- a/TechSupport/TSHTMLViewController.h +++ b/TechSupport/TSHTMLViewController.h @@ -11,7 +11,7 @@ #import @interface TSHTMLViewController : UIViewController -@property(nonatomic, readonly) UIWebView *webView; +@property (nonatomic, readonly) UIWebView *webView; - (id)initWithHTMLContent:(NSString *)content; - (id)initWithHTMLContent:(NSString *)content dataDetector:(UIDataDetectorTypes)dataDetectors; - (id)initWithURL:(NSURL *)url; diff --git a/TechSupport/TSIncludeInstruction.h b/TechSupport/TSIncludeInstruction.h index 9519852b..40bec037 100644 --- a/TechSupport/TSIncludeInstruction.h +++ b/TechSupport/TSIncludeInstruction.h @@ -17,11 +17,11 @@ typedef enum { } TSIncludeInstructionType; @interface TSIncludeInstruction : TSInstruction -@property(nonatomic, readonly) NSData *content; -@property(nonatomic, readonly) NSString *command; -@property(nonatomic, readonly) NSString *filepath; -@property(nonatomic, readonly) NSString *mimeType; -@property(nonatomic, readonly) TSIncludeInstructionType includeType; +@property (nonatomic, readonly) NSData *content; +@property (nonatomic, readonly) NSString *command; +@property (nonatomic, readonly) NSString *filepath; +@property (nonatomic, readonly) NSString *mimeType; +@property (nonatomic, readonly) TSIncludeInstructionType includeType; @end /* vim: set ft=objc ff=unix sw=4 ts=4 tw=80 expandtab: */ diff --git a/TechSupport/TSInstruction.h b/TechSupport/TSInstruction.h index f584d3dd..8f16c20f 100644 --- a/TechSupport/TSInstruction.h +++ b/TechSupport/TSInstruction.h @@ -13,8 +13,8 @@ @class TSPackage; @interface TSInstruction : NSObject -@property(nonatomic, copy) NSString *title; -@property(nonatomic, readonly) NSArray *tokens; +@property (nonatomic, copy) NSString *title; +@property (nonatomic, readonly) NSArray *tokens; + (instancetype)instructionWithString:(NSString *)string; + (NSArray *)instructionsWithString:(NSString *)string; + (void)flushInstructions; diff --git a/TechSupport/TSLinkInstruction.h b/TechSupport/TSLinkInstruction.h index 06f603ab..4384e93e 100644 --- a/TechSupport/TSLinkInstruction.h +++ b/TechSupport/TSLinkInstruction.h @@ -11,11 +11,11 @@ #import "TSInstruction.h" @interface TSLinkInstruction : TSInstruction -@property(nonatomic, readonly) NSArray *recipients; -@property(nonatomic, readonly) NSString *unlocalizedTitle; -@property(nonatomic, readonly) NSURL *url; -@property(nonatomic, readonly) BOOL isEmail; -@property(nonatomic, readonly) BOOL isSupport; +@property (nonatomic, readonly) NSArray *recipients; +@property (nonatomic, readonly) NSString *unlocalizedTitle; +@property (nonatomic, readonly) NSURL *url; +@property (nonatomic, readonly) BOOL isEmail; +@property (nonatomic, readonly) BOOL isSupport; @end /* vim: set ft=objc ff=unix sw=4 ts=4 tw=80 expandtab: */ diff --git a/TechSupport/TSPackage.h b/TechSupport/TSPackage.h index 9c6190e0..8bc08ba5 100644 --- a/TechSupport/TSPackage.h +++ b/TechSupport/TSPackage.h @@ -14,18 +14,18 @@ @class TSLinkInstruction; @interface TSPackage : NSObject -@property(nonatomic, readonly) NSString *identifier; -@property(nonatomic, readonly) NSString *storeIdentifier; -@property(nonatomic, readonly) NSString *name; -@property(nonatomic, readonly) NSString *author; -@property(nonatomic, readonly) NSString *version; -@property(nonatomic, readonly) NSDate *installDate; -@property(nonatomic, readonly) BOOL isAppStore; -@property(nonatomic, readonly) TSLinkInstruction *storeLink; -@property(nonatomic, readonly) TSLinkInstruction *supportLink; -@property(nonatomic, readonly) NSArray *otherLinks; -@property(nonatomic, readonly) TSIncludeInstruction *preferencesAttachment; -@property(nonatomic, readonly) NSArray *otherAttachments; +@property (nonatomic, readonly) NSString *identifier; +@property (nonatomic, readonly) NSString *storeIdentifier; +@property (nonatomic, readonly) NSString *name; +@property (nonatomic, readonly) NSString *author; +@property (nonatomic, readonly) NSString *version; +@property (nonatomic, readonly) NSDate *installDate; +@property (nonatomic, readonly) BOOL isAppStore; +@property (nonatomic, readonly) TSLinkInstruction *storeLink; +@property (nonatomic, readonly) TSLinkInstruction *supportLink; +@property (nonatomic, readonly) NSArray *otherLinks; +@property (nonatomic, readonly) TSIncludeInstruction *preferencesAttachment; +@property (nonatomic, readonly) NSArray *otherAttachments; + (instancetype)packageForFile:(NSString *)path; + (instancetype)packageWithIdentifier:(NSString *)identifier; - (instancetype)initForFile:(NSString *)path; diff --git a/TextInput/NSString+TIExtras.h b/TextInput/NSString+TIExtras.h index d2fe39a4..665ffb75 100644 --- a/TextInput/NSString+TIExtras.h +++ b/TextInput/NSString+TIExtras.h @@ -1,7 +1,7 @@ #import @interface NSString (TIExtras) - + + (NSString *)stringWithUnichar:(unsigned int)aChar; - (unsigned int)_firstLongCharacter; diff --git a/TextInput/TIKeyboardLayoutFactory.h b/TextInput/TIKeyboardLayoutFactory.h index d6337777..7e85aa99 100644 --- a/TextInput/TIKeyboardLayoutFactory.h +++ b/TextInput/TIKeyboardLayoutFactory.h @@ -7,8 +7,8 @@ + (instancetype)sharedKeyboardFactory; + (NSString *)layoutsFileName; -@property(readonly, nonatomic) void *layoutsLibraryHandle; -@property(retain) NSMutableDictionary *internalCache; +@property (readonly, nonatomic) void *layoutsLibraryHandle; +@property (retain) NSMutableDictionary *internalCache; - (UIKBTree *)keyboardWithName:(NSString *)name inCache:(NSMutableDictionary *)cache; diff --git a/UIFoundation/_UICache.h b/UIFoundation/_UICache.h index e1f7be3f..8545d400 100644 --- a/UIFoundation/_UICache.h +++ b/UIFoundation/_UICache.h @@ -3,7 +3,7 @@ API_AVAILABLE(ios(7.0)) @interface _UICache : NSObject -- (void)setObject:(id)object forKey:(id )key; +- (void)setObject:(id)object forKey:(id)key; - (id)objectForKey:(id)key; - (void)removeObjectForKey:(id)key; - (void)removeAllObjects; diff --git a/UIKit/UIAlertAction+Private.h b/UIKit/UIAlertAction+Private.h index 3c191ca9..02fba4ef 100644 --- a/UIKit/UIAlertAction+Private.h +++ b/UIKit/UIAlertAction+Private.h @@ -21,5 +21,4 @@ @property (nonatomic, setter=_setTitleTextAlignment:) NSTextAlignment _titleTextAlignment; @property (nonatomic, getter=_isChecked, setter=_setChecked:) BOOL _checked; - @end diff --git a/UIKit/UIApplication+Private.h b/UIKit/UIApplication+Private.h index 48041e7a..809b1dde 100644 --- a/UIKit/UIApplication+Private.h +++ b/UIKit/UIApplication+Private.h @@ -3,11 +3,11 @@ @class UIStatusBar; typedef enum { - UIBackgroundStyleDefault, - UIBackgroundStyleTransparent, - UIBackgroundStyleLightBlur, - UIBackgroundStyleDarkBlur, - UIBackgroundStyleDarkTranslucent + UIBackgroundStyleDefault, + UIBackgroundStyleTransparent, + UIBackgroundStyleLightBlur, + UIBackgroundStyleDarkBlur, + UIBackgroundStyleDarkTranslucent } UIBackgroundStyle; @interface UIApplication (Private) diff --git a/UIKit/UIKBTree.h b/UIKit/UIKBTree.h index d0ba7446..96c0d251 100644 --- a/UIKit/UIKBTree.h +++ b/UIKit/UIKBTree.h @@ -35,7 +35,6 @@ @property (retain, nonatomic) UIKBShape *shape; - + (UIKBTree *)treeOfType:(NSInteger)type; - (id)initWithType:(NSInteger)type; diff --git a/UIKit/UIKeyboardImpl.h b/UIKit/UIKeyboardImpl.h index 23819d7d..8ce9d198 100644 --- a/UIKit/UIKeyboardImpl.h +++ b/UIKit/UIKeyboardImpl.h @@ -35,8 +35,8 @@ - (NSInteger)interfaceOrientation; -- (id )inputDelegate; -- (id )asynchronousInputDelegate; +- (id)inputDelegate; +- (id)asynchronousInputDelegate; - (id)delegate; - (BOOL)acceptInputString:(NSString *)input; diff --git a/UIKit/UIKeyboardInputModeController.h b/UIKit/UIKeyboardInputModeController.h index 685b5f5f..b937308e 100644 --- a/UIKit/UIKeyboardInputModeController.h +++ b/UIKit/UIKeyboardInputModeController.h @@ -5,7 +5,7 @@ + (UIKeyboardInputModeController *)sharedInputModeController; @property (atomic, strong, readwrite) NSArray *normalizedInputModes; -@property ( retain, nonatomic) UIKeyboardInputMode *lastUsedInputMode; +@property (retain, nonatomic) UIKeyboardInputMode *lastUsedInputMode; @property (retain, nonatomic) UIKeyboardInputMode *currentInputMode; - (NSArray *)activeInputModes; diff --git a/UIKit/UIPeripheralHost.h b/UIKit/UIPeripheralHost.h index a43e47c7..19b63805 100644 --- a/UIKit/UIPeripheralHost.h +++ b/UIKit/UIPeripheralHost.h @@ -9,7 +9,7 @@ - (UIView *)transformedContainerView; - (UIViewController *)containerRootController; -- (UIResponder *)responder; +- (UIResponder *)responder; - (UIKBRenderConfig *)_renderConfigForCurrentResponder; - (void)updateRenderConfigForCurrentResponder; diff --git a/UIKit/UIScreenEdgePanGestureRecognizer+Private.h b/UIKit/UIScreenEdgePanGestureRecognizer+Private.h index e4e47d73..009ee6c4 100644 --- a/UIKit/UIScreenEdgePanGestureRecognizer+Private.h +++ b/UIKit/UIScreenEdgePanGestureRecognizer+Private.h @@ -1,7 +1,7 @@ #import #import "_UIScreenEdgePanRecognizer.h" -@interface UIScreenEdgePanGestureRecognizer (Private) +@interface UIScreenEdgePanGestureRecognizer (Private) - (instancetype)initWithTarget:(id)target action:(SEL)action type:(UIScreenEdgePanRecognizerType)type; diff --git a/UIKit/UIStatusBar.h b/UIKit/UIStatusBar.h index 710e5140..40f1d7cf 100644 --- a/UIKit/UIStatusBar.h +++ b/UIKit/UIStatusBar.h @@ -3,13 +3,13 @@ @class UIStatusBarForegroundStyleAttributes, UIStatusBarForegroundView; typedef NS_ENUM(NSInteger, UIStatusBarPosition) { - UIStatusBarPositionLeft, - UIStatusBarPositionRight, - UIStatusBarPositionCenter + UIStatusBarPositionLeft, + UIStatusBarPositionRight, + UIStatusBarPositionCenter }; @interface UIStatusBar : UIView { - UIStatusBarForegroundView *_foregroundView; + UIStatusBarForegroundView *_foregroundView; } + (UIStatusBarStyle)defaultStatusBarStyle; diff --git a/UIKit/UIStatusBarForegroundStyleAttributes.h b/UIKit/UIStatusBarForegroundStyleAttributes.h index 618e34a4..ac12c213 100644 --- a/UIKit/UIStatusBarForegroundStyleAttributes.h +++ b/UIKit/UIStatusBarForegroundStyleAttributes.h @@ -5,7 +5,6 @@ - (instancetype)initWithHeight:(CGFloat)height legibilityStyle:(int)legibilityStyle tintColor:(UIColor *)tintColor hasBusyBackground:(BOOL)hasBusyBackground NS_AVAILABLE_IOS(8_3); - (instancetype)initWithHeight:(CGFloat)height legibilityStyle:(int)legibilityStyle tintColor:(UIColor *)tintColor hasBusyBackground:(BOOL)hasBusyBackground idiom:(UIUserInterfaceIdiom)idiom NS_AVAILABLE_IOS(8_3); - @property (nonatomic) CGFloat height; - (UIFont *)textFontForStyle:(UIStatusBarItemViewTextStyle)style; diff --git a/UIKit/UIStatusBarHideAnimationParameters.h b/UIKit/UIStatusBarHideAnimationParameters.h index 91dc0cba..108004b0 100644 --- a/UIKit/UIStatusBarHideAnimationParameters.h +++ b/UIKit/UIStatusBarHideAnimationParameters.h @@ -1,9 +1,9 @@ #import "UIStatusBarAnimationParameters.h" typedef NS_ENUM(NSInteger, UIStatusBarHideAnimation) { - UIStatusBarHideAnimationUnknown0, - UIStatusBarHideAnimationUnknown1, - UIStatusBarHideAnimationUnknown2 + UIStatusBarHideAnimationUnknown0, + UIStatusBarHideAnimationUnknown1, + UIStatusBarHideAnimationUnknown2 }; @interface UIStatusBarHideAnimationParameters : UIStatusBarAnimationParameters diff --git a/UIKit/UIStatusBarItem.h b/UIKit/UIStatusBarItem.h index 108b6d16..f6c8deb3 100644 --- a/UIKit/UIStatusBarItem.h +++ b/UIKit/UIStatusBarItem.h @@ -2,7 +2,7 @@ // this enum was reversed out of iOS 10.2, not clear if it's ABI stable typedef enum { - UIStatusBarItemTypeTime, // this Time has a centerOrder of 1 + UIStatusBarItemTypeTime, // this Time has a centerOrder of 1 UIStatusBarItemTypeQuietModeQuietMode, UIStatusBarItemTypeAirplaneModeAirplane, UIStatusBarItemTypeSignalStrength, diff --git a/UIKit/UIStatusBarItemView.h b/UIKit/UIStatusBarItemView.h index 6e5dd40e..aeef31cf 100644 --- a/UIKit/UIStatusBarItemView.h +++ b/UIKit/UIStatusBarItemView.h @@ -1,8 +1,8 @@ #import typedef NS_ENUM(NSUInteger, UIStatusBarItemViewTextStyle) { - UIStatusBarItemViewTextStyleRegular = 1, - UIStatusBarItemViewTextStyleBold = 3 + UIStatusBarItemViewTextStyleRegular = 1, + UIStatusBarItemViewTextStyleBold = 3 }; typedef NSUInteger UIStatusBarItemViewActions; // TODO diff --git a/UIKit/UITextInputTraits+Private.h b/UIKit/UITextInputTraits+Private.h index 652d90b4..4c0537aa 100644 --- a/UIKit/UITextInputTraits+Private.h +++ b/UIKit/UITextInputTraits+Private.h @@ -1,7 +1,7 @@ #import #import -@interface UITextInputTraits : NSObject +@interface UITextInputTraits : NSObject + (NSInteger)accessibleAppearanceForAppearance:(UIKeyboardAppearance)appearance; diff --git a/UIKit/_UIBackdropView.h b/UIKit/_UIBackdropView.h index ec24fb67..1eba936d 100644 --- a/UIKit/_UIBackdropView.h +++ b/UIKit/_UIBackdropView.h @@ -38,10 +38,10 @@ _UIBackdropViewSettingsLightLeopard 3901 iOS 7.1+ */ typedef NS_ENUM(NSInteger, _UIBackdropViewStyle) { - _UIBackdropViewStyleNone = -2, - _UIBackdropViewStyleLight = 0, - _UIBackdropViewStyleDark, - _UIBackdropViewStyleBlur + _UIBackdropViewStyleNone = -2, + _UIBackdropViewStyleLight = 0, + _UIBackdropViewStyleDark, + _UIBackdropViewStyleBlur }; @interface _UIBackdropView : UIView diff --git a/UIKit/_UIHostedWindowHostingHandle.h b/UIKit/_UIHostedWindowHostingHandle.h index a8e3220f..ac1c5231 100644 --- a/UIKit/_UIHostedWindowHostingHandle.h +++ b/UIKit/_UIHostedWindowHostingHandle.h @@ -2,7 +2,7 @@ #import API_AVAILABLE(ios(7.0)) -@interface _UIHostedWindowHostingHandle : NSObject +@interface _UIHostedWindowHostingHandle : NSObject @property (readonly, nonatomic) unsigned int contextID; @property (readonly, nonatomic) CGAffineTransform rootLayerTransform; diff --git a/UIKit/_UIRemoteView.h b/UIKit/_UIRemoteView.h index d9e24143..ec0a4b1d 100644 --- a/UIKit/_UIRemoteView.h +++ b/UIKit/_UIRemoteView.h @@ -5,7 +5,7 @@ API_AVAILABLE(ios(6.0)) @interface _UIRemoteView : _UILayerHostView @property (retain, nonatomic) _UIHostedWindowHostingHandle *hostedWindowHostingHandle API_AVAILABLE(ios(7.0)); -@property (copy, nonatomic) void(^tintColorDidChangeHandler)(void) API_AVAILABLE(ios(7.0)); +@property (copy, nonatomic) void (^tintColorDidChangeHandler)(void) API_AVAILABLE(ios(7.0)); + (instancetype)viewWithHostedWindowHostingHandle:(_UIHostedWindowHostingHandle *)hostingHandle API_AVAILABLE(ios(7.0)); + (instancetype)viewWithRemoteContextID:(unsigned int)contextID; diff --git a/UserNotificationsUIKit/NCNotificationStaticContentProviding.h b/UserNotificationsUIKit/NCNotificationStaticContentProviding.h index 0732e33e..5dc3d453 100644 --- a/UserNotificationsUIKit/NCNotificationStaticContentProviding.h +++ b/UserNotificationsUIKit/NCNotificationStaticContentProviding.h @@ -1,6 +1,6 @@ #import -@protocol NCNotificationStaticContentProviding +@protocol NCNotificationStaticContentProviding - (UIImage *)icon; diff --git a/UserNotificationsUIKit/NCNotificationViewController.h b/UserNotificationsUIKit/NCNotificationViewController.h index 4cd30803..20883684 100644 --- a/UserNotificationsUIKit/NCNotificationViewController.h +++ b/UserNotificationsUIKit/NCNotificationViewController.h @@ -7,7 +7,7 @@ @interface NCNotificationViewController : UIViewController @property (nonatomic, retain) NCNotificationRequest *notificationRequest; -@property (nonatomic, retain) id staticContentProvider; +@property (nonatomic, retain) id staticContentProvider; - (UIView *)_lookViewIfLoaded; diff --git a/bootstrap.h b/bootstrap.h index fec58545..1167444c 100644 --- a/bootstrap.h +++ b/bootstrap.h @@ -88,8 +88,8 @@ __BEGIN_DECLS #pragma GCC visibility push(default) -#define BOOTSTRAP_MAX_NAME_LEN 128 -#define BOOTSTRAP_MAX_CMD_LEN 512 +#define BOOTSTRAP_MAX_NAME_LEN 128 +#define BOOTSTRAP_MAX_CMD_LEN 512 typedef char name_t[BOOTSTRAP_MAX_NAME_LEN]; typedef char cmd_t[BOOTSTRAP_MAX_CMD_LEN]; @@ -97,24 +97,24 @@ typedef name_t *name_array_t; typedef int bootstrap_status_t; typedef bootstrap_status_t *bootstrap_status_array_t; typedef unsigned int bootstrap_property_t; -typedef bootstrap_property_t * bootstrap_property_array_t; +typedef bootstrap_property_t *bootstrap_property_array_t; typedef boolean_t *bool_array_t; -#define BOOTSTRAP_MAX_LOOKUP_COUNT 20 +#define BOOTSTRAP_MAX_LOOKUP_COUNT 20 -#define BOOTSTRAP_SUCCESS 0 -#define BOOTSTRAP_NOT_PRIVILEGED 1100 -#define BOOTSTRAP_NAME_IN_USE 1101 -#define BOOTSTRAP_UNKNOWN_SERVICE 1102 -#define BOOTSTRAP_SERVICE_ACTIVE 1103 -#define BOOTSTRAP_BAD_COUNT 1104 -#define BOOTSTRAP_NO_MEMORY 1105 -#define BOOTSTRAP_NO_CHILDREN 1106 +#define BOOTSTRAP_SUCCESS 0 +#define BOOTSTRAP_NOT_PRIVILEGED 1100 +#define BOOTSTRAP_NAME_IN_USE 1101 +#define BOOTSTRAP_UNKNOWN_SERVICE 1102 +#define BOOTSTRAP_SERVICE_ACTIVE 1103 +#define BOOTSTRAP_BAD_COUNT 1104 +#define BOOTSTRAP_NO_MEMORY 1105 +#define BOOTSTRAP_NO_CHILDREN 1106 -#define BOOTSTRAP_STATUS_INACTIVE 0 -#define BOOTSTRAP_STATUS_ACTIVE 1 -#define BOOTSTRAP_STATUS_ON_DEMAND 2 +#define BOOTSTRAP_STATUS_INACTIVE 0 +#define BOOTSTRAP_STATUS_ACTIVE 1 +#define BOOTSTRAP_STATUS_ON_DEMAND 2 /* * After main() starts, it is safe to assume that this variable is always set. @@ -156,11 +156,11 @@ extern mach_port_t bootstrap_port; * Returns BOOTSTRAP_NOT_PRIVILEGED, bootstrap or uid invalid. */ kern_return_t bootstrap_create_server( - mach_port_t bp, - cmd_t server_cmd, - uid_t server_uid, - boolean_t on_demand, - mach_port_t *server_port); + mach_port_t bp, + cmd_t server_cmd, + uid_t server_uid, + boolean_t on_demand, + mach_port_t *server_port); /* * bootstrap_subset() @@ -180,9 +180,9 @@ kern_return_t bootstrap_create_server( * Errors: Returns appropriate kernel errors on rpc failure. */ kern_return_t bootstrap_subset( - mach_port_t bp, - mach_port_t requestor_port, - mach_port_t *subset_port); + mach_port_t bp, + mach_port_t requestor_port, + mach_port_t *subset_port); /* * bootstrap_unprivileged() @@ -200,9 +200,9 @@ kern_return_t bootstrap_subset( * Native launchd jobs are always started with an unprivileged port. */ kern_return_t bootstrap_unprivileged( - mach_port_t bp, - mach_port_t *unpriv_port) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + mach_port_t bp, + mach_port_t *unpriv_port) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; /* * bootstrap_parent() @@ -218,8 +218,8 @@ kern_return_t bootstrap_unprivileged( * token in the message trailer). */ kern_return_t bootstrap_parent( - mach_port_t bp, - mach_port_t *parent_port); + mach_port_t bp, + mach_port_t *parent_port); /* * bootstrap_register() @@ -308,9 +308,9 @@ bootstrap_create_service(mach_port_t bp, name_t service_name, mach_port_t *sp); * registered or checked-in. */ kern_return_t bootstrap_check_in( - mach_port_t bp, - const name_t service_name, - mach_port_t *sp); + mach_port_t bp, + const name_t service_name, + mach_port_t *sp); /* * bootstrap_look_up() @@ -323,9 +323,9 @@ kern_return_t bootstrap_check_in( * Returns BOOTSTRAP_UNKNOWN_SERVICE, if service does not exist. */ kern_return_t bootstrap_look_up( - mach_port_t bp, - const name_t service_name, - mach_port_t *sp); + mach_port_t bp, + const name_t service_name, + mach_port_t *sp); /* * bootstrap_status() @@ -340,10 +340,10 @@ kern_return_t bootstrap_look_up( * for failure. */ kern_return_t bootstrap_status( - mach_port_t bp, - name_t service_name, - bootstrap_status_t *service_active) - AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + mach_port_t bp, + name_t service_name, + bootstrap_status_t *service_active) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; /* bootstrap_strerror() * diff --git a/installd/MIBundle.h b/installd/MIBundle.h index 51959cf6..73ca7702 100644 --- a/installd/MIBundle.h +++ b/installd/MIBundle.h @@ -7,14 +7,14 @@ #import typedef NS_ENUM(NSInteger, MIBundleType) { - MIBundleTypeSystemApp = 1, - MIBundleTypeInternalApp, - MIBundleTypeDiskImageApp, - MIBundleTypeUserApp, - MIBundleTypeVPNPlugin, - MIBundleTypeCarrierBundle, - MIBundleTypeAppExtension, - MIBundleTypeFramework + MIBundleTypeSystemApp = 1, + MIBundleTypeInternalApp, + MIBundleTypeDiskImageApp, + MIBundleTypeUserApp, + MIBundleTypeVPNPlugin, + MIBundleTypeCarrierBundle, + MIBundleTypeAppExtension, + MIBundleTypeFramework }; @interface MIBundle : NSObject diff --git a/launch.h b/launch.h index aadc62f5..f27e9c97 100644 --- a/launch.h +++ b/launch.h @@ -102,7 +102,7 @@ __BEGIN_DECLS #define LAUNCH_JOBKEY_THROTTLEINTERVAL "ThrottleInterval" #define LAUNCH_JOBKEY_LAUNCHONLYONCE "LaunchOnlyOnce" #define LAUNCH_JOBKEY_ABANDONPROCESSGROUP "AbandonProcessGroup" -#define LAUNCH_JOBKEY_IGNOREPROCESSGROUPATSHUTDOWN "IgnoreProcessGroupAtShutdown" +#define LAUNCH_JOBKEY_IGNOREPROCESSGROUPATSHUTDOWN "IgnoreProcessGroupAtShutdown" #define LAUNCH_JOBKEY_POLICIES "Policies" #define LAUNCH_JOBKEY_ENABLETRANSACTIONS "EnableTransactions" @@ -120,7 +120,7 @@ __BEGIN_DECLS #define LAUNCH_JOBKEY_KEEPALIVE_PATHSTATE "PathState" #define LAUNCH_JOBKEY_KEEPALIVE_OTHERJOBACTIVE "OtherJobActive" #define LAUNCH_JOBKEY_KEEPALIVE_OTHERJOBENABLED "OtherJobEnabled" -#define LAUNCH_JOBKEY_KEEPALIVE_AFTERINITIALDEMAND "AfterInitialDemand" +#define LAUNCH_JOBKEY_KEEPALIVE_AFTERINITIALDEMAND "AfterInitialDemand" #define LAUNCH_JOBKEY_KEEPALIVE_CRASHED "Crashed" #define LAUNCH_JOBKEY_LAUNCHEVENTS "LaunchEvents" @@ -163,167 +163,145 @@ __BEGIN_DECLS typedef struct _launch_data *launch_data_t; typedef enum { - LAUNCH_DATA_DICTIONARY = 1, - LAUNCH_DATA_ARRAY, - LAUNCH_DATA_FD, - LAUNCH_DATA_INTEGER, - LAUNCH_DATA_REAL, - LAUNCH_DATA_BOOL, - LAUNCH_DATA_STRING, - LAUNCH_DATA_OPAQUE, - LAUNCH_DATA_ERRNO, - LAUNCH_DATA_MACHPORT, + LAUNCH_DATA_DICTIONARY = 1, + LAUNCH_DATA_ARRAY, + LAUNCH_DATA_FD, + LAUNCH_DATA_INTEGER, + LAUNCH_DATA_REAL, + LAUNCH_DATA_BOOL, + LAUNCH_DATA_STRING, + LAUNCH_DATA_OPAQUE, + LAUNCH_DATA_ERRNO, + LAUNCH_DATA_MACHPORT, } launch_data_type_t; __ld_allocator -launch_data_t -launch_data_alloc(launch_data_type_t); + launch_data_t + launch_data_alloc(launch_data_type_t); __ld_allocator -launch_data_t -launch_data_copy(launch_data_t); + launch_data_t + launch_data_copy(launch_data_t); __ld_getter -launch_data_type_t -launch_data_get_type(const launch_data_t); + launch_data_type_t + launch_data_get_type(const launch_data_t); -__ld_setter -void -launch_data_free(launch_data_t); +__ld_setter void + launch_data_free(launch_data_t); -__ld_setter -bool +__ld_setter bool launch_data_dict_insert(launch_data_t, const launch_data_t, const char *); __ld_getter -launch_data_t -launch_data_dict_lookup(const launch_data_t, const char *); + launch_data_t + launch_data_dict_lookup(const launch_data_t, const char *); -__ld_setter -bool +__ld_setter bool launch_data_dict_remove(launch_data_t, const char *); -__ld_iterator(1, 2) -void -launch_data_dict_iterate(const launch_data_t, - void (*)(const launch_data_t, const char *, void *), void *); +__ld_iterator(1, 2) void launch_data_dict_iterate(const launch_data_t, + void (*)(const launch_data_t, const char *, void *), void *); __ld_getter -size_t -launch_data_dict_get_count(const launch_data_t); + size_t + launch_data_dict_get_count(const launch_data_t); -__ld_setter -bool +__ld_setter bool launch_data_array_set_index(launch_data_t, const launch_data_t, size_t); __ld_getter -launch_data_t -launch_data_array_get_index(const launch_data_t, size_t); + launch_data_t + launch_data_array_get_index(const launch_data_t, size_t); __ld_getter -size_t -launch_data_array_get_count(const launch_data_t); + size_t + launch_data_array_get_count(const launch_data_t); __ld_allocator -launch_data_t -launch_data_new_fd(int); + launch_data_t + launch_data_new_fd(int); __ld_allocator -launch_data_t -launch_data_new_machport(mach_port_t); + launch_data_t + launch_data_new_machport(mach_port_t); __ld_allocator -launch_data_t -launch_data_new_integer(long long); + launch_data_t + launch_data_new_integer(long long); __ld_allocator -launch_data_t -launch_data_new_bool(bool); + launch_data_t + launch_data_new_bool(bool); __ld_allocator -launch_data_t -launch_data_new_real(double); + launch_data_t + launch_data_new_real(double); __ld_allocator -launch_data_t -launch_data_new_string(const char *); + launch_data_t + launch_data_new_string(const char *); __ld_allocator -launch_data_t -launch_data_new_opaque(const void *, size_t); + launch_data_t + launch_data_new_opaque(const void *, size_t); - __ld_setter -bool +__ld_setter bool launch_data_set_fd(launch_data_t, int); - __ld_setter -bool -launch_data_set_machport(launch_data_t, mach_port_t); +__ld_setter bool + launch_data_set_machport(launch_data_t, mach_port_t); - __ld_setter -bool +__ld_setter bool launch_data_set_integer(launch_data_t, long long); - __ld_setter -bool +__ld_setter bool launch_data_set_bool(launch_data_t, bool); - __ld_setter -bool +__ld_setter bool launch_data_set_real(launch_data_t, double); - __ld_setter -bool +__ld_setter bool launch_data_set_string(launch_data_t, const char *); - __ld_setter -bool +__ld_setter bool launch_data_set_opaque(launch_data_t, const void *, size_t); -__ld_getter -int +__ld_getter int launch_data_get_fd(const launch_data_t); __ld_getter -mach_port_t -launch_data_get_machport(const launch_data_t); + mach_port_t + launch_data_get_machport(const launch_data_t); -__ld_getter -long long +__ld_getter long long launch_data_get_integer(const launch_data_t); -__ld_getter -bool +__ld_getter bool launch_data_get_bool(const launch_data_t); -__ld_getter -double +__ld_getter double launch_data_get_real(const launch_data_t); -__ld_getter -const char * +__ld_getter const char * launch_data_get_string(const launch_data_t); -__ld_getter -void * +__ld_getter void * launch_data_get_opaque(const launch_data_t); __ld_getter -size_t -launch_data_get_opaque_size(const launch_data_t); + size_t + launch_data_get_opaque_size(const launch_data_t); -__ld_getter -int +__ld_getter int launch_data_get_errno(const launch_data_t); - /* launch_get_fd() * * Use this to get the FD if you're doing asynchronous I/O with select(), * poll() or kevent(). */ -__ld_normal -int +__ld_normal int launch_get_fd(void); /* launch_msg() @@ -331,8 +309,8 @@ launch_get_fd(void); * Use this API to check in. Nothing else. */ __ld_normal -launch_data_t -launch_msg(const launch_data_t); + launch_data_t + launch_msg(const launch_data_t); __END_DECLS diff --git a/libactivator/LAActivator.h b/libactivator/LAActivator.h index 905cda7b..85fedcc9 100644 --- a/libactivator/LAActivator.h +++ b/libactivator/LAActivator.h @@ -6,9 +6,11 @@ // Main event dispatcher that is responsible for sending events, maintaining the list of actions/events, and querying information about them @class LAEvent, LAListenerConfigurationViewController, LAEventConfigurationViewController; -@protocol LAListener, LAEventDataSource; +@protocol LAListener +, LAEventDataSource; -@interface LAActivator : NSObject LA_PRIVATE_IVARS(LAActivator) +@interface LAActivator : NSObject +LA_PRIVATE_IVARS(LAActivator) + (LAActivator *)sharedInstance; @@ -123,10 +125,10 @@ extern LAActivator *LASharedActivator; - (NSString *)localizedDescriptionForListenerName:(NSString *)listenerName; @end -extern NSString * const LAEventModeSpringBoard; -extern NSString * const LAEventModeApplication; -extern NSString * const LAEventModeLockScreen; +extern NSString *const LAEventModeSpringBoard; +extern NSString *const LAEventModeApplication; +extern NSString *const LAEventModeLockScreen; -extern NSString * const LAActivatorAvailableListenersChangedNotification; -extern NSString * const LAActivatorAvailableEventsChangedNotification; -extern NSString * const LAActivatorAssignmentsChangedNotification; +extern NSString *const LAActivatorAvailableListenersChangedNotification; +extern NSString *const LAActivatorAvailableEventsChangedNotification; +extern NSString *const LAActivatorAssignmentsChangedNotification; diff --git a/libactivator/LAEvent.h b/libactivator/LAEvent.h index 1db6a25a..0a046d71 100644 --- a/libactivator/LAEvent.h +++ b/libactivator/LAEvent.h @@ -2,7 +2,8 @@ // Events represent an assignable gesture that has or could occurred -@interface LAEvent : NSObject LA_PRIVATE_IVARS(LAEvent) +@interface LAEvent : NSObject +LA_PRIVATE_IVARS(LAEvent) + (id)eventWithName:(NSString *)name; + (id)eventWithName:(NSString *)name mode:(NSString *)mode; @@ -16,119 +17,119 @@ @end -extern NSString * const LAEventNameMenuPressSingle; -extern NSString * const LAEventNameMenuPressDouble; -extern NSString * const LAEventNameMenuPressTriple; -extern NSString * const LAEventNameMenuHoldShort; -extern NSString * const LAEventNameMenuHoldLong; - -extern NSString * const LAEventNameLockHoldShort; -extern NSString * const LAEventNameLockHoldLong; -extern NSString * const LAEventNameLockPressDouble; -extern NSString * const LAEventNameLockPressWithMenu; - -extern NSString * const LAEventNameSpringBoardPinch; -extern NSString * const LAEventNameSpringBoardSpread; - -extern NSString * const LAEventNameStatusBarSwipeRight; -extern NSString * const LAEventNameStatusBarSwipeLeft; -extern NSString * const LAEventNameStatusBarTapDouble; -extern NSString * const LAEventNameStatusBarTapDoubleLeft; -extern NSString * const LAEventNameStatusBarTapDoubleRight; -extern NSString * const LAEventNameStatusBarTapSingle; -extern NSString * const LAEventNameStatusBarTapSingleLeft; -extern NSString * const LAEventNameStatusBarTapSingleRight; -extern NSString * const LAEventNameStatusBarHold; -extern NSString * const LAEventNameStatusBarHoldLeft; -extern NSString * const LAEventNameStatusBarHoldRight; - -extern NSString * const LAEventNameVolumeDownUp; -extern NSString * const LAEventNameVolumeUpDown; -extern NSString * const LAEventNameVolumeDisplayTap; -extern NSString * const LAEventNameVolumeToggleMuteTwice; -extern NSString * const LAEventNameVolumeDownHoldShort; -extern NSString * const LAEventNameVolumeUpHoldShort; -extern NSString * const LAEventNameVolumeDownPress; -extern NSString * const LAEventNameVolumeUpPress; -extern NSString * const LAEventNameVolumeBothPress; - -extern NSString * const LAEventNameSlideInFromBottom; -extern NSString * const LAEventNameSlideInFromBottomLeft; -extern NSString * const LAEventNameSlideInFromBottomRight; -extern NSString * const LAEventNameSlideInFromLeft; -extern NSString * const LAEventNameSlideInFromRight; -extern NSString * const LAEventNameStatusBarSwipeDown; // Now a slide gesture in iOS5.0+; extern and name kept for backwards compatibility +extern NSString *const LAEventNameMenuPressSingle; +extern NSString *const LAEventNameMenuPressDouble; +extern NSString *const LAEventNameMenuPressTriple; +extern NSString *const LAEventNameMenuHoldShort; +extern NSString *const LAEventNameMenuHoldLong; + +extern NSString *const LAEventNameLockHoldShort; +extern NSString *const LAEventNameLockHoldLong; +extern NSString *const LAEventNameLockPressDouble; +extern NSString *const LAEventNameLockPressWithMenu; + +extern NSString *const LAEventNameSpringBoardPinch; +extern NSString *const LAEventNameSpringBoardSpread; + +extern NSString *const LAEventNameStatusBarSwipeRight; +extern NSString *const LAEventNameStatusBarSwipeLeft; +extern NSString *const LAEventNameStatusBarTapDouble; +extern NSString *const LAEventNameStatusBarTapDoubleLeft; +extern NSString *const LAEventNameStatusBarTapDoubleRight; +extern NSString *const LAEventNameStatusBarTapSingle; +extern NSString *const LAEventNameStatusBarTapSingleLeft; +extern NSString *const LAEventNameStatusBarTapSingleRight; +extern NSString *const LAEventNameStatusBarHold; +extern NSString *const LAEventNameStatusBarHoldLeft; +extern NSString *const LAEventNameStatusBarHoldRight; + +extern NSString *const LAEventNameVolumeDownUp; +extern NSString *const LAEventNameVolumeUpDown; +extern NSString *const LAEventNameVolumeDisplayTap; +extern NSString *const LAEventNameVolumeToggleMuteTwice; +extern NSString *const LAEventNameVolumeDownHoldShort; +extern NSString *const LAEventNameVolumeUpHoldShort; +extern NSString *const LAEventNameVolumeDownPress; +extern NSString *const LAEventNameVolumeUpPress; +extern NSString *const LAEventNameVolumeBothPress; + +extern NSString *const LAEventNameSlideInFromBottom; +extern NSString *const LAEventNameSlideInFromBottomLeft; +extern NSString *const LAEventNameSlideInFromBottomRight; +extern NSString *const LAEventNameSlideInFromLeft; +extern NSString *const LAEventNameSlideInFromRight; +extern NSString *const LAEventNameStatusBarSwipeDown; // Now a slide gesture in iOS5.0+; extern and name kept for backwards compatibility #define LAEventNameSlideInFromTop LAEventNameStatusBarSwipeDown -extern NSString * const LAEventNameSlideInFromTopLeft; -extern NSString * const LAEventNameSlideInFromTopRight; - -extern NSString * const LAEventNameTwoFingerSlideInFromBottom; -extern NSString * const LAEventNameTwoFingerSlideInFromBottomLeft; -extern NSString * const LAEventNameTwoFingerSlideInFromBottomRight; -extern NSString * const LAEventNameTwoFingerSlideInFromLeft; -extern NSString * const LAEventNameTwoFingerSlideInFromRight; -extern NSString * const LAEventNameTwoFingerSlideInFromTop; -extern NSString * const LAEventNameTwoFingerSlideInFromTopLeft; -extern NSString * const LAEventNameTwoFingerSlideInFromTopRight; - -extern NSString * const LAEventNameDragOffBottom; -extern NSString * const LAEventNameDragOffLeft; -extern NSString * const LAEventNameDragOffRight; -extern NSString * const LAEventNameDragOffTop; - -extern NSString * const LAEventScreenBottomSwipeLeft; -extern NSString * const LAEventScreenBottomSwipeRight; -extern NSString * const LAEventScreenLeftSwipeDown; -extern NSString * const LAEventScreenLeftSwipeUp; -extern NSString * const LAEventScreenRightSwipeDown; -extern NSString * const LAEventScreenRightSwipeUp; - -extern NSString * const LAEventNameMotionShake; - -extern NSString * const LAEventNameHeadsetButtonPressSingle; -extern NSString * const LAEventNameHeadsetButtonHoldShort; -extern NSString * const LAEventNameHeadsetConnected; -extern NSString * const LAEventNameHeadsetDisconnected; - -extern NSString * const LAEventNameLockScreenClockDoubleTap; -extern NSString * const LAEventNameLockScreenClockTapHold; -extern NSString * const LAEventNameLockScreenClockSwipeLeft; -extern NSString * const LAEventNameLockScreenClockSwipeRight; -extern NSString * const LAEventNameLockScreenClockSwipeDown; - -extern NSString * const LAEventNamePowerConnected; -extern NSString * const LAEventNamePowerDisconnected; - -extern NSString * const LAEventNameThreeFingerTap; -extern NSString * const LAEventNameThreeFingerPinch; -extern NSString * const LAEventNameThreeFingerSpread; - -extern NSString * const LAEventNameFourFingerTap; -extern NSString * const LAEventNameFourFingerPinch; -extern NSString * const LAEventNameFourFingerSpread; - -extern NSString * const LAEventNameFiveFingerTap; -extern NSString * const LAEventNameFiveFingerPinch; -extern NSString * const LAEventNameFiveFingerSpread; - -extern NSString * const LAEventNameClamshellOpen; -extern NSString * const LAEventNameClamshellClose; - -extern NSString * const LAEventNameSpringBoardIconFlickUp; -extern NSString * const LAEventNameSpringBoardIconFlickDown; -extern NSString * const LAEventNameSpringBoardIconFlickLeft; -extern NSString * const LAEventNameSpringBoardIconFlickRight; - -extern NSString * const LAEventNameDeviceLocked; -extern NSString * const LAEventNameDeviceUnlocked; - -extern NSString * const LAEventNameNetworkJoinedWiFi; -extern NSString * const LAEventNameNetworkLeftWiFi; - -extern NSString * const LAEventNameFingerprintSensorPressSingle; +extern NSString *const LAEventNameSlideInFromTopLeft; +extern NSString *const LAEventNameSlideInFromTopRight; + +extern NSString *const LAEventNameTwoFingerSlideInFromBottom; +extern NSString *const LAEventNameTwoFingerSlideInFromBottomLeft; +extern NSString *const LAEventNameTwoFingerSlideInFromBottomRight; +extern NSString *const LAEventNameTwoFingerSlideInFromLeft; +extern NSString *const LAEventNameTwoFingerSlideInFromRight; +extern NSString *const LAEventNameTwoFingerSlideInFromTop; +extern NSString *const LAEventNameTwoFingerSlideInFromTopLeft; +extern NSString *const LAEventNameTwoFingerSlideInFromTopRight; + +extern NSString *const LAEventNameDragOffBottom; +extern NSString *const LAEventNameDragOffLeft; +extern NSString *const LAEventNameDragOffRight; +extern NSString *const LAEventNameDragOffTop; + +extern NSString *const LAEventScreenBottomSwipeLeft; +extern NSString *const LAEventScreenBottomSwipeRight; +extern NSString *const LAEventScreenLeftSwipeDown; +extern NSString *const LAEventScreenLeftSwipeUp; +extern NSString *const LAEventScreenRightSwipeDown; +extern NSString *const LAEventScreenRightSwipeUp; + +extern NSString *const LAEventNameMotionShake; + +extern NSString *const LAEventNameHeadsetButtonPressSingle; +extern NSString *const LAEventNameHeadsetButtonHoldShort; +extern NSString *const LAEventNameHeadsetConnected; +extern NSString *const LAEventNameHeadsetDisconnected; + +extern NSString *const LAEventNameLockScreenClockDoubleTap; +extern NSString *const LAEventNameLockScreenClockTapHold; +extern NSString *const LAEventNameLockScreenClockSwipeLeft; +extern NSString *const LAEventNameLockScreenClockSwipeRight; +extern NSString *const LAEventNameLockScreenClockSwipeDown; + +extern NSString *const LAEventNamePowerConnected; +extern NSString *const LAEventNamePowerDisconnected; + +extern NSString *const LAEventNameThreeFingerTap; +extern NSString *const LAEventNameThreeFingerPinch; +extern NSString *const LAEventNameThreeFingerSpread; + +extern NSString *const LAEventNameFourFingerTap; +extern NSString *const LAEventNameFourFingerPinch; +extern NSString *const LAEventNameFourFingerSpread; + +extern NSString *const LAEventNameFiveFingerTap; +extern NSString *const LAEventNameFiveFingerPinch; +extern NSString *const LAEventNameFiveFingerSpread; + +extern NSString *const LAEventNameClamshellOpen; +extern NSString *const LAEventNameClamshellClose; + +extern NSString *const LAEventNameSpringBoardIconFlickUp; +extern NSString *const LAEventNameSpringBoardIconFlickDown; +extern NSString *const LAEventNameSpringBoardIconFlickLeft; +extern NSString *const LAEventNameSpringBoardIconFlickRight; + +extern NSString *const LAEventNameDeviceLocked; +extern NSString *const LAEventNameDeviceUnlocked; + +extern NSString *const LAEventNameNetworkJoinedWiFi; +extern NSString *const LAEventNameNetworkLeftWiFi; + +extern NSString *const LAEventNameFingerprintSensorPressSingle; // Icon Gestures -extern NSString * const LAEventUserInfoDisplayIdentifier; -extern NSString * const LAEventUserInfoIconView; +extern NSString *const LAEventUserInfoDisplayIdentifier; +extern NSString *const LAEventUserInfoIconView; -extern NSString * const LAEventUserInfoUnlockedDeviceToSendEvent; +extern NSString *const LAEventUserInfoUnlockedDeviceToSendEvent; diff --git a/libactivator/LAEventDataSource.h b/libactivator/LAEventDataSource.h index ca12b5fb..7259174d 100644 --- a/libactivator/LAEventDataSource.h +++ b/libactivator/LAEventDataSource.h @@ -3,7 +3,7 @@ // Event Data Sources represent the metadata associated with specific events // A data source is constructed automatically for each event in /Library/Activator/Events -@protocol LAEventDataSource +@protocol LAEventDataSource @required - (NSString *)localizedTitleForEventName:(NSString *)eventName; @@ -23,4 +23,3 @@ - (void)eventWithName:(NSString *)eventName didSaveNewConfiguration:(id)configuration; @end - diff --git a/libactivator/LAListener.h b/libactivator/LAListener.h index 5a62c806..0d64f292 100644 --- a/libactivator/LAListener.h +++ b/libactivator/LAListener.h @@ -6,7 +6,7 @@ @class LAActivator, LAEvent, UIImage; -@protocol LAListener +@protocol LAListener @optional - (void)activator:(LAActivator *)activator didChangeToEventMode:(NSString *)eventMode; diff --git a/libactivator/LASettingsViewController.h b/libactivator/LASettingsViewController.h index b5063772..5ff23ebd 100644 --- a/libactivator/LASettingsViewController.h +++ b/libactivator/LASettingsViewController.h @@ -6,34 +6,41 @@ #define LA_SETTINGS_CONTROLLER(superclass) : superclass #endif -@interface LASettingsViewController LA_SETTINGS_CONTROLLER(UIViewController) +@interface LASettingsViewController +LA_SETTINGS_CONTROLLER(UIViewController) + (id)controller; - (id)init; @end -@interface LARootSettingsController LA_SETTINGS_CONTROLLER(LASettingsViewController) +@interface LARootSettingsController +LA_SETTINGS_CONTROLLER(LASettingsViewController) @end -@interface LAModeSettingsController LA_SETTINGS_CONTROLLER(LASettingsViewController) +@interface LAModeSettingsController +LA_SETTINGS_CONTROLLER(LASettingsViewController) - (id)initWithMode:(NSString *)mode; @end -@interface LAEventSettingsController LA_SETTINGS_CONTROLLER(LASettingsViewController) +@interface LAEventSettingsController +LA_SETTINGS_CONTROLLER(LASettingsViewController) - (id)initWithModes:(NSArray *)modes eventName:(NSString *)eventName; @end -@interface LAListenerSettingsViewController LA_SETTINGS_CONTROLLER(LASettingsViewController) +@interface LAListenerSettingsViewController +LA_SETTINGS_CONTROLLER(LASettingsViewController) @property (nonatomic, copy) NSString *listenerName; @end -@interface LAEventConfigurationViewController LA_SETTINGS_CONTROLLER(LASettingsViewController) +@interface LAEventConfigurationViewController +LA_SETTINGS_CONTROLLER(LASettingsViewController) - (id)initWithEventName:(NSString *)eventName; @property (nonatomic, readonly, copy) NSString *eventName; @property (nonatomic, assign) BOOL showsSaveButton; - (BOOL)performSave; @end -@interface LAListenerConfigurationViewController LA_SETTINGS_CONTROLLER(LASettingsViewController) +@interface LAListenerConfigurationViewController +LA_SETTINGS_CONTROLLER(LASettingsViewController) - (id)initWithListenerName:(NSString *)listenerName; @property (nonatomic, readonly, copy) NSString *listenerName; @property (nonatomic, assign) BOOL showsSaveButton; diff --git a/libcolorpicker.h b/libcolorpicker.h index 60a8167e..d98be8bb 100644 --- a/libcolorpicker.h +++ b/libcolorpicker.h @@ -1,4 +1,4 @@ -#import +#import #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ extern "C" { diff --git a/libhooker/libhooker.h b/libhooker/libhooker.h index 546a64bf..6fd7ec3e 100644 --- a/libhooker/libhooker.h +++ b/libhooker/libhooker.h @@ -107,9 +107,9 @@ void LHCloseImage(struct libhooker_image *libhookerImage); * Returns true if all symbols were found */ bool LHFindSymbols(struct libhooker_image *libhookerImage, - const char **symbolNames, - void **searchSyms, - size_t searchSymCount); + const char **symbolNames, + void **searchSyms, + size_t searchSymCount); /*! * @function LHExecMemory diff --git a/libpackageinfo/PIApplePackage.h b/libpackageinfo/PIApplePackage.h index 426e2a50..048a6818 100644 --- a/libpackageinfo/PIApplePackage.h +++ b/libpackageinfo/PIApplePackage.h @@ -10,7 +10,7 @@ #import "PIPackage.h" @interface PIApplePackage : PIPackage -@property(nonatomic, readonly) NSString *containerPath; +@property (nonatomic, readonly) NSString *containerPath; @end /* vim: set ft=objc ff=unix sw=4 ts=4 tw=80 expandtab: */ diff --git a/libpackageinfo/PIPackage.h b/libpackageinfo/PIPackage.h index 53e22c0b..55e44170 100644 --- a/libpackageinfo/PIPackage.h +++ b/libpackageinfo/PIPackage.h @@ -10,17 +10,18 @@ #import @interface PIPackage : NSObject { - @package NSMutableDictionary *packageDetails_; +@package + NSMutableDictionary *packageDetails_; } -@property(nonatomic, readonly) NSString *identifier; -@property(nonatomic, readonly) NSString *storeIdentifier; -@property(nonatomic, readonly) NSString *name; -@property(nonatomic, readonly) NSString *author; -@property(nonatomic, readonly) NSString *maintainer; -@property(nonatomic, readonly) NSString *version; -@property(nonatomic, readonly) NSDate *installDate; -@property(nonatomic, readonly) NSString *bundlePath; -@property(nonatomic, readonly) NSString *libraryPath; +@property (nonatomic, readonly) NSString *identifier; +@property (nonatomic, readonly) NSString *storeIdentifier; +@property (nonatomic, readonly) NSString *name; +@property (nonatomic, readonly) NSString *author; +@property (nonatomic, readonly) NSString *maintainer; +@property (nonatomic, readonly) NSString *version; +@property (nonatomic, readonly) NSDate *installDate; +@property (nonatomic, readonly) NSString *bundlePath; +@property (nonatomic, readonly) NSString *libraryPath; + (instancetype)packageForFile:(NSString *)filepath; + (instancetype)packageWithIdentifier:(NSString *)identifier; - (id)initWithDetails:(NSDictionary *)details; diff --git a/libprefs/prefs.h b/libprefs/prefs.h index 7d80319f..52bbcb98 100644 --- a/libprefs/prefs.h +++ b/libprefs/prefs.h @@ -12,8 +12,10 @@ extern NSString *const PLFilterKey; @property (nonatomic, retain, readonly) NSBundle *preferenceLoaderBundle; @end -@interface PLCustomListController: PSListController { } +@interface PLCustomListController : PSListController { +} @end -@interface PLLocalizedListController: PLCustomListController { } +@interface PLLocalizedListController : PLCustomListController { +} @end diff --git a/libroot/libroot.h b/libroot/libroot.h index b30de03f..9926c59e 100644 --- a/libroot/libroot.h +++ b/libroot/libroot.h @@ -4,7 +4,7 @@ __BEGIN_DECLS _Pragma("GCC visibility push(hidden)") -const char *_Nonnull libroot_dyn_get_root_prefix(void); + const char *_Nonnull libroot_dyn_get_root_prefix(void); const char *_Nonnull libroot_dyn_get_jbroot_prefix(void); const char *_Nonnull libroot_dyn_get_boot_uuid(void); char *_Nullable libroot_dyn_rootfspath(const char *_Nullable path, char *_Nullable resolvedPath); @@ -12,20 +12,20 @@ char *_Nullable libroot_dyn_jbrootpath(const char *_Nullable path, char *_Nullab _Pragma("GCC visibility pop") -__END_DECLS + __END_DECLS #define __CONVERT_PATH_CSTRING(converter, path) ({ \ - static char outPath[PATH_MAX]; \ - converter(path, outPath); \ + static char outPath[PATH_MAX]; \ + converter(path, outPath); \ }) #define JBROOT_PATH_CSTRING(path) __CONVERT_PATH_CSTRING(libroot_dyn_jbrootpath, path) #define ROOTFS_PATH_CSTRING(path) __CONVERT_PATH_CSTRING(libroot_dyn_rootfspath, path) #if __has_attribute(overloadable) -__attribute__((__overloadable__)) -static inline const char *_Nullable __libroot_convert_path(char *_Nullable (*_Nonnull converter)(const char *_Nonnull, char *_Nullable), const char *_Nullable path, char *_Nonnull buf) { - return converter(path, buf); + __attribute__((__overloadable__)) static inline const char *_Nullable __libroot_convert_path(char *_Nullable (*_Nonnull converter)(const char *_Nonnull, char *_Nullable), const char *_Nullable path, char *_Nonnull buf) +{ + return converter(path, buf); } #endif /* __has_attribute(overloadable) */ @@ -33,19 +33,19 @@ static inline const char *_Nullable __libroot_convert_path(char *_Nullable (*_No #import -#define __CONVERT_PATH_NSSTRING(converter, path) ({ \ - char tmpBuf[PATH_MAX]; \ - const char *converted = converter(path.fileSystemRepresentation, tmpBuf); \ - converted ? [NSString stringWithUTF8String:converted] : nil; \ +#define __CONVERT_PATH_NSSTRING(converter, path) ({ \ + char tmpBuf[PATH_MAX]; \ + const char *converted = converter(path.fileSystemRepresentation, tmpBuf); \ + converted ? [NSString stringWithUTF8String:converted] : nil; \ }) #define JBROOT_PATH_NSSTRING(path) __CONVERT_PATH_NSSTRING(libroot_dyn_jbrootpath, path) #define ROOTFS_PATH_NSSTRING(path) __CONVERT_PATH_NSSTRING(libroot_dyn_rootfspath, path) #if __has_attribute(overloadable) -__attribute__((__overloadable__)) -static inline NSString *_Nullable __libroot_convert_path(char *_Nullable (*_Nonnull converter)(const char *_Nonnull, char *_Nullable), NSString *_Nullable path, void *_Nullable const __unused buf) { - return __CONVERT_PATH_NSSTRING(converter, path); +__attribute__((__overloadable__)) static inline NSString *_Nullable __libroot_convert_path(char *_Nullable (*_Nonnull converter)(const char *_Nonnull, char *_Nullable), NSString *_Nullable path, void *_Nullable const __unused buf) +{ + return __CONVERT_PATH_NSSTRING(converter, path); } #endif /* __has_attribute(overloadable) */ @@ -53,18 +53,17 @@ static inline NSString *_Nullable __libroot_convert_path(char *_Nullable (*_Nonn #if __has_attribute(overloadable) -#define __BUFFER_FOR_CHAR_P(x) \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof__(*(x)), char), \ - ({ static char buf[PATH_MAX]; buf; }), \ - NULL \ - ) +#define __BUFFER_FOR_CHAR_P(x) \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof__(*(x)), char), \ + ({ static char buf[PATH_MAX]; buf; }), \ + NULL) -# define JBROOT_PATH(path) __libroot_convert_path(libroot_dyn_jbrootpath, (path), __BUFFER_FOR_CHAR_P(path)) -# define ROOTFS_PATH(path) __libroot_convert_path(libroot_dyn_rootfspath, (path), __BUFFER_FOR_CHAR_P(path)) +#define JBROOT_PATH(path) __libroot_convert_path(libroot_dyn_jbrootpath, (path), __BUFFER_FOR_CHAR_P(path)) +#define ROOTFS_PATH(path) __libroot_convert_path(libroot_dyn_rootfspath, (path), __BUFFER_FOR_CHAR_P(path)) #else -# define JBROOT_PATH(path) _Pragma("GCC error \"JBROOT_PATH is not supported with this compiler, use JBROOT_PATH_CSTRING or JBROOT_PATH_NSSTRING\"") path -# define ROOTFS_PATH(path) _Pragma("GCC error \"ROOTFS_PATH is not supported with this compiler, use ROOTFS_PATH_CSTRING or ROOTFS_PATH_NSSTRING\"") path +#define JBROOT_PATH(path) _Pragma("GCC error \"JBROOT_PATH is not supported with this compiler, use JBROOT_PATH_CSTRING or JBROOT_PATH_NSSTRING\"") path +#define ROOTFS_PATH(path) _Pragma("GCC error \"ROOTFS_PATH is not supported with this compiler, use ROOTFS_PATH_CSTRING or ROOTFS_PATH_NSSTRING\"") path #endif /* __has_attribute(overloadable) */ #define JBRAND libroot_dyn_get_boot_uuid() diff --git a/libstatusbar/LSStatusBarItem.h b/libstatusbar/LSStatusBarItem.h index ded03df1..5de7b5aa 100644 --- a/libstatusbar/LSStatusBarItem.h +++ b/libstatusbar/LSStatusBarItem.h @@ -1,32 +1,28 @@ #import -typedef enum -{ - StatusBarAlignmentLeft = 1, - StatusBarAlignmentRight = 2, - StatusBarAlignmentCenter = 4 +typedef enum { + StatusBarAlignmentLeft = 1, + StatusBarAlignmentRight = 2, + StatusBarAlignmentCenter = 4 } StatusBarAlignment; - // only LSStatusBarItem (API) methods are considered public. -@interface LSStatusBarItem : NSObject -{ +@interface LSStatusBarItem : NSObject { @private - NSString* _identifier; - NSMutableDictionary* _properties; - NSMutableSet* _delegates; - BOOL _manualUpdate; + NSString *_identifier; + NSMutableDictionary *_properties; + NSMutableSet *_delegates; + BOOL _manualUpdate; } @end - // Supported API @interface LSStatusBarItem (API) -- (id) initWithIdentifier: (NSString*) identifier alignment: (StatusBarAlignment) alignment; +- (id)initWithIdentifier:(NSString *)identifier alignment:(StatusBarAlignment)alignment; // bitmasks (e.g. left or right) are not supported yet @property (nonatomic, readonly) StatusBarAlignment alignment; @@ -34,47 +30,41 @@ typedef enum @property (nonatomic, getter=isVisible) BOOL visible; // useful only with left/right alignment - will throw error for center alignment -@property (nonatomic, assign) NSString* imageName; +@property (nonatomic, assign) NSString *imageName; // useful only with center alignment - will throw error otherwise // will not be visible on the lockscreen -@property (nonatomic, assign) NSString* titleString; +@property (nonatomic, assign) NSString *titleString; // useful if you want to override the UIStatusBarCustomItemView drawing. Your class must exist in EVERY UIKit process. -@property (nonatomic, assign) NSString* customViewClass; +@property (nonatomic, assign) NSString *customViewClass; // set to NO and manually call update if you need to make multiple changes @property (nonatomic, getter=isManualUpdate) BOOL manualUpdate; // manually call if manualUpdate = YES -- (void) update; +- (void)update; @end - - - @interface LSStatusBarItem (Unimplemented) - // leave alone unless you want to limit which apps your icon shows up in -@property (nonatomic, assign) NSString* exclusiveToApp; +@property (nonatomic, assign) NSString *exclusiveToApp; // convenience methods? //@property (nonatomic, getter=isSpringBoardOnly) BOOL springBoardOnly; //@property (getter=isCurrentAppOnly) BOOL currentAppOnly; // delegate must respond to @selector(statusBarAction:); only valid from inside of SpringBoard -- (void) addTouchDelegate: (id) delegate; -- (void) removeTouchDelegate: (id) delegate; - +- (void)addTouchDelegate:(id)delegate; +- (void)removeTouchDelegate:(id)delegate; @end - @interface LSStatusBarItem (Private) -+ (void) _updateProperties: (NSMutableDictionary*) properties forIdentifier: (NSString*) identifier; -- (void) _setProperties: (NSDictionary*) dict; ++ (void)_updateProperties:(NSMutableDictionary *)properties forIdentifier:(NSString *)identifier; +- (void)_setProperties:(NSDictionary *)dict; @end diff --git a/libundirect/libundirect.h b/libundirect/libundirect.h index 6b01a0d0..a5ed31fc 100644 --- a/libundirect/libundirect.h +++ b/libundirect/libundirect.h @@ -16,8 +16,7 @@ extern "C" { #endif -typedef enum -{ +typedef enum { OPTION_DO_NOT_SEEK_BACK = 1 << 0 } libundirect_find_options_t; @@ -25,21 +24,21 @@ typedef enum void libundirect_MSHookMessageEx(Class _class, SEL message, IMP hook, IMP *old); // readds a direct method back to the class, requiring the pointer to it -void libundirect_rebind(void* directPtr, Class _class, SEL selector, const char* format); +void libundirect_rebind(void *directPtr, Class _class, SEL selector, const char *format); // seek back to byte -void* libundirect_seek_back(void* startPtr, unsigned char toByte, unsigned int maxSearch); +void *libundirect_seek_back(void *startPtr, unsigned char toByte, unsigned int maxSearch); // find a direct method by searching for unique memory bytes -void* libundirect_find_with_options_and_mask(NSString* imageName, unsigned char* bytesToSearch, unsigned char* byteMask, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options); -void* libundirect_find_with_options(NSString* imageName, unsigned char* bytesToSearch, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options); -void* libundirect_find(NSString* imageName, unsigned char* bytesToSearch, size_t byteCount, unsigned char startByte); +void *libundirect_find_with_options_and_mask(NSString *imageName, unsigned char *bytesToSearch, unsigned char *byteMask, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options); +void *libundirect_find_with_options(NSString *imageName, unsigned char *bytesToSearch, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options); +void *libundirect_find(NSString *imageName, unsigned char *bytesToSearch, size_t byteCount, unsigned char startByte); // find a direct method inside dyld_shared_cache by it's name -void* libundirect_dsc_find(NSString* imageName, Class _class, SEL selector); +void *libundirect_dsc_find(NSString *imageName, Class _class, SEL selector); // find a direct method inside dyld_shared_cache by it's name and rebind it (convenience) -void libundirect_dsc_rebind(NSString* imageName, Class _class, SEL selector, const char* format); +void libundirect_dsc_rebind(NSString *imageName, Class _class, SEL selector, const char *format); // instead of directly hooking, make all libundirect_MSHookMessageEx calls add to a batch queue void libundirect_startBatchHooks(void); @@ -48,10 +47,10 @@ void libundirect_startBatchHooks(void); void libundirect_applyBatchHooks(void); // apply all hooks in batch queue in one shot together with passed additional ones using libhooker API if it exists -void libundirect_applyBatchHooksAndAdditional(const struct LHFunctionHook* additionalHooks, NSUInteger additionalCount); +void libundirect_applyBatchHooksAndAdditional(const struct LHFunctionHook *additionalHooks, NSUInteger additionalCount); // selectors that failed to be added -NSArray* libundirect_failedSelectors(); +NSArray *libundirect_failedSelectors(); #ifdef __cplusplus } @@ -60,5 +59,9 @@ NSArray* libundirect_failedSelectors(); // macros to readd setters and getters for ivars, these can't be hooked as the application still calls the original direct getters and setters // mainly useful to get existing code to just work without having to change everything to use the ivar instead // can only be used from xmi files -#define LIBUNDIRECT_CLASS_ADD_GETTER(classname, type, ivarname, gettername) %hook classname %new - (type)gettername { return [self valueForKey:[NSString stringWithUTF8String:#ivarname]]; } %end -#define LIBUNDIRECT_CLASS_ADD_SETTER(classname, type, ivarname, settername) %hook classname %new - (void)settername:(type)toset { [self setValue:toset forKey:[NSString stringWithUTF8String:#ivarname]]; } %end +#define LIBUNDIRECT_CLASS_ADD_GETTER(classname, type, ivarname, gettername) \ + % hook classname % new - (type)gettername { return [self valueForKey:[NSString stringWithUTF8String:#ivarname]]; } \ + % end +#define LIBUNDIRECT_CLASS_ADD_SETTER(classname, type, ivarname, settername) \ + % hook classname % new - (void)settername : (type)toset { [self setValue:toset forKey:[NSString stringWithUTF8String:#ivarname]]; } \ + % end diff --git a/libundirect/libundirect_dynamic.h b/libundirect/libundirect_dynamic.h index faa78279..f86b9c44 100644 --- a/libundirect/libundirect_dynamic.h +++ b/libundirect/libundirect_dynamic.h @@ -26,199 +26,160 @@ extern "C" { // dynamic header for when you don't want to link against libundirect // for documentation, check out the non-dynamic header -typedef enum -{ +typedef enum { OPTION_DO_NOT_SEEK_BACK = 1 << 0 } libundirect_find_options_t; -__attribute__((unused)) -static void libundirect_MSHookMessageEx(Class _class, SEL message, IMP hook, IMP *old) +__attribute__((unused)) static void libundirect_MSHookMessageEx(Class _class, SEL message, IMP hook, IMP *old) { - static void (*impl_libundirect_MSHookMessageEx)(Class, SEL, IMP, IMP *); - if(!impl_libundirect_MSHookMessageEx) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_MSHookMessageEx = (void (*)(Class, SEL, IMP, IMP *))dlsym(handle, "libundirect_MSHookMessageEx"); - } - if(impl_libundirect_MSHookMessageEx) - { - impl_libundirect_MSHookMessageEx(_class, message, hook, old); - } - else - { - MSHookMessageEx(_class, message, hook, old); - } + static void (*impl_libundirect_MSHookMessageEx)(Class, SEL, IMP, IMP *); + if (!impl_libundirect_MSHookMessageEx) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_MSHookMessageEx = (void (*)(Class, SEL, IMP, IMP *))dlsym(handle, "libundirect_MSHookMessageEx"); + } + if (impl_libundirect_MSHookMessageEx) { + impl_libundirect_MSHookMessageEx(_class, message, hook, old); + } else { + MSHookMessageEx(_class, message, hook, old); + } } -__attribute__((unused)) -static void libundirect_rebind(void* directPtr, Class _class, SEL selector, const char* format) +__attribute__((unused)) static void libundirect_rebind(void *directPtr, Class _class, SEL selector, const char *format) { - static void (*impl_libundirect_rebind)(void*, Class, SEL, const char*); - if(!impl_libundirect_rebind) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_rebind = (void (*)(void*, Class, SEL, const char*))dlsym(handle, "libundirect_rebind"); - } - if(impl_libundirect_rebind) - { - impl_libundirect_rebind(directPtr, _class, selector, format); - } + static void (*impl_libundirect_rebind)(void *, Class, SEL, const char *); + if (!impl_libundirect_rebind) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_rebind = (void (*)(void *, Class, SEL, const char *))dlsym(handle, "libundirect_rebind"); + } + if (impl_libundirect_rebind) { + impl_libundirect_rebind(directPtr, _class, selector, format); + } } -__attribute__((unused)) -static void* libundirect_seek_back(void* startPtr, unsigned char toByte, unsigned int maxSearch) +__attribute__((unused)) static void *libundirect_seek_back(void *startPtr, unsigned char toByte, unsigned int maxSearch) { - static void* (*impl_libundirect_seek_back)(void*, unsigned char, unsigned int); - if(!impl_libundirect_seek_back) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_seek_back = (void* (*)(void*, unsigned char, unsigned int))dlsym(handle, "libundirect_seek_back"); - } - if(impl_libundirect_seek_back) - { - return impl_libundirect_seek_back(startPtr, toByte, maxSearch); - } - return NULL; + static void *(*impl_libundirect_seek_back)(void *, unsigned char, unsigned int); + if (!impl_libundirect_seek_back) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_seek_back = (void *(*)(void *, unsigned char, unsigned int))dlsym(handle, "libundirect_seek_back"); + } + if (impl_libundirect_seek_back) { + return impl_libundirect_seek_back(startPtr, toByte, maxSearch); + } + return NULL; } -__attribute__((unused)) -static void* libundirect_find_with_options_and_mask(NSString* imageName, unsigned char* bytesToSearch, unsigned char* byteMask, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options) +__attribute__((unused)) static void *libundirect_find_with_options_and_mask(NSString *imageName, unsigned char *bytesToSearch, unsigned char *byteMask, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options) { - static void* (*impl_libundirect_find_with_options_and_mask)(NSString*, unsigned char*, unsigned char*, size_t, unsigned char, unsigned int, libundirect_find_options_t); - if(!impl_libundirect_find_with_options_and_mask) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_find_with_options_and_mask = (void* (*)(NSString*, unsigned char*, unsigned char*, size_t, unsigned char, unsigned int, libundirect_find_options_t))dlsym(handle, "libundirect_find_with_options_and_mask"); - } - if(impl_libundirect_find_with_options_and_mask) - { - return impl_libundirect_find_with_options_and_mask(imageName, bytesToSearch, byteMask, byteCount, startByte, seekbackMax, options); - } - return NULL; + static void *(*impl_libundirect_find_with_options_and_mask)(NSString *, unsigned char *, unsigned char *, size_t, unsigned char, unsigned int, libundirect_find_options_t); + if (!impl_libundirect_find_with_options_and_mask) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_find_with_options_and_mask = (void *(*)(NSString *, unsigned char *, unsigned char *, size_t, unsigned char, unsigned int, libundirect_find_options_t))dlsym(handle, "libundirect_find_with_options_and_mask"); + } + if (impl_libundirect_find_with_options_and_mask) { + return impl_libundirect_find_with_options_and_mask(imageName, bytesToSearch, byteMask, byteCount, startByte, seekbackMax, options); + } + return NULL; } -__attribute__((unused)) -static void* libundirect_find_with_options(NSString* imageName, unsigned char* bytesToSearch, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options) +__attribute__((unused)) static void *libundirect_find_with_options(NSString *imageName, unsigned char *bytesToSearch, size_t byteCount, unsigned char startByte, unsigned int seekbackMax, libundirect_find_options_t options) { - static void* (*impl_libundirect_find_with_options)(NSString*, unsigned char*, size_t, unsigned char, unsigned int, libundirect_find_options_t); - if(!impl_libundirect_find_with_options) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_find_with_options = (void* (*)(NSString*, unsigned char*, size_t, unsigned char, unsigned int, libundirect_find_options_t))dlsym(handle, "libundirect_find_with_options"); - } - if(impl_libundirect_find_with_options) - { - return impl_libundirect_find_with_options(imageName, bytesToSearch, byteCount, startByte, seekbackMax, options); - } - return NULL; + static void *(*impl_libundirect_find_with_options)(NSString *, unsigned char *, size_t, unsigned char, unsigned int, libundirect_find_options_t); + if (!impl_libundirect_find_with_options) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_find_with_options = (void *(*)(NSString *, unsigned char *, size_t, unsigned char, unsigned int, libundirect_find_options_t))dlsym(handle, "libundirect_find_with_options"); + } + if (impl_libundirect_find_with_options) { + return impl_libundirect_find_with_options(imageName, bytesToSearch, byteCount, startByte, seekbackMax, options); + } + return NULL; } -__attribute__((unused)) -static void* libundirect_find(NSString* imageName, unsigned char* bytesToSearch, size_t byteCount, unsigned char startByte) +__attribute__((unused)) static void *libundirect_find(NSString *imageName, unsigned char *bytesToSearch, size_t byteCount, unsigned char startByte) { - static void* (*impl_libundirect_find)(NSString*, unsigned char*, size_t, unsigned char); - if(!impl_libundirect_find) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_find = (void* (*)(NSString*, unsigned char*, size_t, unsigned char))dlsym(handle, "libundirect_find"); - } - if(impl_libundirect_find) - { - return impl_libundirect_find(imageName, bytesToSearch, byteCount, startByte); - } - return NULL; + static void *(*impl_libundirect_find)(NSString *, unsigned char *, size_t, unsigned char); + if (!impl_libundirect_find) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_find = (void *(*)(NSString *, unsigned char *, size_t, unsigned char))dlsym(handle, "libundirect_find"); + } + if (impl_libundirect_find) { + return impl_libundirect_find(imageName, bytesToSearch, byteCount, startByte); + } + return NULL; } -__attribute__((unused)) -static void* libundirect_dsc_find(NSString* imageName, Class _class, SEL selector) +__attribute__((unused)) static void *libundirect_dsc_find(NSString *imageName, Class _class, SEL selector) { - static void* (*impl_libundirect_dsc_find)(NSString*, Class, SEL); - if(!impl_libundirect_dsc_find) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_dsc_find = (void* (*)(NSString*, Class, SEL))dlsym(handle, "libundirect_dsc_find"); - } - if(impl_libundirect_dsc_find) - { - return impl_libundirect_dsc_find(imageName, _class, selector); - } - return NULL; + static void *(*impl_libundirect_dsc_find)(NSString *, Class, SEL); + if (!impl_libundirect_dsc_find) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_dsc_find = (void *(*)(NSString *, Class, SEL))dlsym(handle, "libundirect_dsc_find"); + } + if (impl_libundirect_dsc_find) { + return impl_libundirect_dsc_find(imageName, _class, selector); + } + return NULL; } -__attribute__((unused)) -static void libundirect_dsc_rebind(NSString* imageName, Class _class, SEL selector, const char* format) +__attribute__((unused)) static void libundirect_dsc_rebind(NSString *imageName, Class _class, SEL selector, const char *format) { - static void (*impl_libundirect_dsc_rebind)(NSString*, Class, SEL, const char*); - if(!impl_libundirect_dsc_rebind) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_dsc_rebind = (void (*)(NSString*, Class, SEL, const char*))dlsym(handle, "libundirect_dsc_rebind"); - } - if(impl_libundirect_dsc_rebind) - { - return impl_libundirect_dsc_rebind(imageName, _class, selector, format); - } + static void (*impl_libundirect_dsc_rebind)(NSString *, Class, SEL, const char *); + if (!impl_libundirect_dsc_rebind) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_dsc_rebind = (void (*)(NSString *, Class, SEL, const char *))dlsym(handle, "libundirect_dsc_rebind"); + } + if (impl_libundirect_dsc_rebind) { + return impl_libundirect_dsc_rebind(imageName, _class, selector, format); + } } -__attribute__((unused)) -static NSArray* libundirect_failedSelectors() +__attribute__((unused)) static NSArray *libundirect_failedSelectors() { - static NSArray* (*impl_libundirect_failedSelectors)(); - if(!impl_libundirect_failedSelectors) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_failedSelectors = (NSArray* (*)(void))dlsym(handle, "libundirect_failedSelectors"); - } - if(impl_libundirect_failedSelectors) - { - return impl_libundirect_failedSelectors(); - } - return (NSArray*)nil; + static NSArray *(*impl_libundirect_failedSelectors)(); + if (!impl_libundirect_failedSelectors) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_failedSelectors = (NSArray * (*)(void)) dlsym(handle, "libundirect_failedSelectors"); + } + if (impl_libundirect_failedSelectors) { + return impl_libundirect_failedSelectors(); + } + return (NSArray *)nil; } -__attribute__((unused)) -static void libundirect_startBatchHooks(void) +__attribute__((unused)) static void libundirect_startBatchHooks(void) { - static void (*impl_libundirect_startBatchHooks)(); - if(!impl_libundirect_startBatchHooks) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_startBatchHooks = (void (*)(void))dlsym(handle, "libundirect_startBatchHooks"); - } - if(impl_libundirect_startBatchHooks) - { - impl_libundirect_startBatchHooks(); - } + static void (*impl_libundirect_startBatchHooks)(); + if (!impl_libundirect_startBatchHooks) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_startBatchHooks = (void (*)(void))dlsym(handle, "libundirect_startBatchHooks"); + } + if (impl_libundirect_startBatchHooks) { + impl_libundirect_startBatchHooks(); + } } -__attribute__((unused)) -static void libundirect_applyBatchHooksAndAdditional(const struct LHFunctionHook* additionalHooks, NSUInteger additionalCount) +__attribute__((unused)) static void libundirect_applyBatchHooksAndAdditional(const struct LHFunctionHook *additionalHooks, NSUInteger additionalCount) { - static void (*impl_libundirect_applyBatchHooksAndAdditional)(const struct LHFunctionHook*, NSUInteger); - if(!impl_libundirect_applyBatchHooksAndAdditional) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_applyBatchHooksAndAdditional = (void (*)(const struct LHFunctionHook*, NSUInteger))dlsym(handle, "libundirect_applyBatchHooksAndAdditional"); - } - if(impl_libundirect_applyBatchHooksAndAdditional) - { - impl_libundirect_applyBatchHooksAndAdditional(additionalHooks, additionalCount); - } + static void (*impl_libundirect_applyBatchHooksAndAdditional)(const struct LHFunctionHook *, NSUInteger); + if (!impl_libundirect_applyBatchHooksAndAdditional) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_applyBatchHooksAndAdditional = (void (*)(const struct LHFunctionHook *, NSUInteger))dlsym(handle, "libundirect_applyBatchHooksAndAdditional"); + } + if (impl_libundirect_applyBatchHooksAndAdditional) { + impl_libundirect_applyBatchHooksAndAdditional(additionalHooks, additionalCount); + } } -__attribute__((unused)) -static void libundirect_applyBatchHooks() +__attribute__((unused)) static void libundirect_applyBatchHooks() { - static void (*impl_libundirect_applyBatchHooks)(); - if(!impl_libundirect_applyBatchHooks) - { - void* handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); - impl_libundirect_applyBatchHooks = (void (*)(void))dlsym(handle, "libundirect_failedSelectors"); - } - if(impl_libundirect_applyBatchHooks) - { - return impl_libundirect_applyBatchHooks(); - } + static void (*impl_libundirect_applyBatchHooks)(); + if (!impl_libundirect_applyBatchHooks) { + void *handle = dlopen(LIBUNDIRECT_PATH, RTLD_LAZY); + impl_libundirect_applyBatchHooks = (void (*)(void))dlsym(handle, "libundirect_failedSelectors"); + } + if (impl_libundirect_applyBatchHooks) { + return impl_libundirect_applyBatchHooks(); + } } #ifdef __cplusplus @@ -228,5 +189,9 @@ static void libundirect_applyBatchHooks() // macros to readd setters and getters for ivars, these can't be hooked as the application still calls the original direct getters and setters // mainly useful to get existing code to just work without having to change everything to use the ivar instead // can only be used from xmi files -#define LIBUNDIRECT_CLASS_ADD_GETTER(classname, type, ivarname, gettername) %hook classname %new - (type)gettername { return [self valueForKey:[NSString stringWithUTF8String:#ivarname]]; } %end -#define LIBUNDIRECT_CLASS_ADD_SETTER(classname, type, ivarname, settername) %hook classname %new - (void)settername:(type)toset { [self setValue:toset forKey:[NSString stringWithUTF8String:#ivarname]]; } %end \ No newline at end of file +#define LIBUNDIRECT_CLASS_ADD_GETTER(classname, type, ivarname, gettername) \ + % hook classname % new - (type)gettername { return [self valueForKey:[NSString stringWithUTF8String:#ivarname]]; } \ + % end +#define LIBUNDIRECT_CLASS_ADD_SETTER(classname, type, ivarname, settername) \ + % hook classname % new - (void)settername : (type)toset { [self setValue:toset forKey:[NSString stringWithUTF8String:#ivarname]]; } \ + % end \ No newline at end of file diff --git a/libundirect/libundirect_hookoverwrite.h b/libundirect/libundirect_hookoverwrite.h index e201c07c..39f88aa7 100644 --- a/libundirect/libundirect_hookoverwrite.h +++ b/libundirect/libundirect_hookoverwrite.h @@ -3,7 +3,7 @@ extern "C" { #endif inline static void libundirect_MSHookMessageEx_wrapper(Class _class, SEL message, IMP hook, IMP *old) { - libundirect_MSHookMessageEx(_class, message, hook, old); + libundirect_MSHookMessageEx(_class, message, hook, old); } #define MSHookMessageEx libundirect_MSHookMessageEx_wrapper #ifdef __cplusplus diff --git a/rocketbootstrap/rocketbootstrap.h b/rocketbootstrap/rocketbootstrap.h index 2e3f6c8f..16f22ed3 100644 --- a/rocketbootstrap/rocketbootstrap.h +++ b/rocketbootstrap/rocketbootstrap.h @@ -7,7 +7,6 @@ __BEGIN_DECLS kern_return_t rocketbootstrap_look_up(mach_port_t bp, const name_t service_name, mach_port_t *sp); - kern_return_t rocketbootstrap_unlock(const name_t service_name); // Errors if not in a privileged process such as SpringBoard or backboardd kern_return_t rocketbootstrap_register(mach_port_t bp, const name_t service_name, mach_port_t sp); // Errors if not in a privileged process such as SpringBoard or backboardd diff --git a/rocketbootstrap/rocketbootstrap_dynamic.h b/rocketbootstrap/rocketbootstrap_dynamic.h index 16f41534..d6b0860a 100644 --- a/rocketbootstrap/rocketbootstrap_dynamic.h +++ b/rocketbootstrap/rocketbootstrap_dynamic.h @@ -2,92 +2,86 @@ // Set ROCKETBOOTSTRAP_LOAD_DYNAMIC and then include rocketbootstrap.h #include -__attribute__((unused)) -static kern_return_t rocketbootstrap_look_up(mach_port_t bp, const name_t service_name, mach_port_t *sp) +__attribute__((unused)) static kern_return_t rocketbootstrap_look_up(mach_port_t bp, const name_t service_name, mach_port_t *sp) { - static kern_return_t (*impl)(mach_port_t bp, const name_t service_name, mach_port_t *sp); - if (!impl) { - void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); - if (handle) - impl = dlsym(handle, "rocketbootstrap_look_up"); - if (!impl) - impl = bootstrap_look_up; - } - return impl(bp, service_name, sp); + static kern_return_t (*impl)(mach_port_t bp, const name_t service_name, mach_port_t *sp); + if (!impl) { + void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); + if (handle) + impl = dlsym(handle, "rocketbootstrap_look_up"); + if (!impl) + impl = bootstrap_look_up; + } + return impl(bp, service_name, sp); } -__attribute__((unused)) -static kern_return_t rocketbootstrap_unlock(const name_t service_name) +__attribute__((unused)) static kern_return_t rocketbootstrap_unlock(const name_t service_name) { - static kern_return_t (*impl)(const name_t service_name); - if (!impl) { - void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); - if (handle) - impl = dlsym(handle, "rocketbootstrap_unlock"); - if (!impl) - return -1; - } - return impl(service_name); + static kern_return_t (*impl)(const name_t service_name); + if (!impl) { + void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); + if (handle) + impl = dlsym(handle, "rocketbootstrap_unlock"); + if (!impl) + return -1; + } + return impl(service_name); } #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -__attribute__((unused)) -static kern_return_t rocketbootstrap_register(mach_port_t bp, const name_t service_name, mach_port_t sp) +__attribute__((unused)) static kern_return_t rocketbootstrap_register(mach_port_t bp, const name_t service_name, mach_port_t sp) { - static kern_return_t (*impl)(mach_port_t bp, const name_t service_name, mach_port_t sp); - if (!impl) { - void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); - if (handle) - impl = dlsym(handle, "rocketbootstrap_register"); - if (!impl) - impl = bootstrap_register; - } - return impl(bp, service_name, sp); + static kern_return_t (*impl)(mach_port_t bp, const name_t service_name, mach_port_t sp); + if (!impl) { + void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); + if (handle) + impl = dlsym(handle, "rocketbootstrap_register"); + if (!impl) + impl = bootstrap_register; + } + return impl(bp, service_name, sp); } #pragma GCC diagnostic warning "-Wdeprecated-declarations" #ifdef __COREFOUNDATION_CFMESSAGEPORT__ -__attribute__((unused)) -static CFMessagePortRef rocketbootstrap_cfmessageportcreateremote(CFAllocatorRef allocator, CFStringRef name) +__attribute__((unused)) static CFMessagePortRef rocketbootstrap_cfmessageportcreateremote(CFAllocatorRef allocator, CFStringRef name) { - static CFMessagePortRef (*impl)(CFAllocatorRef allocator, CFStringRef name); - if (!impl) { - void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); - if (handle) - impl = dlsym(handle, "rocketbootstrap_cfmessageportcreateremote"); - if (!impl) - impl = CFMessagePortCreateRemote; - } - return impl(allocator, name); + static CFMessagePortRef (*impl)(CFAllocatorRef allocator, CFStringRef name); + if (!impl) { + void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); + if (handle) + impl = dlsym(handle, "rocketbootstrap_cfmessageportcreateremote"); + if (!impl) + impl = CFMessagePortCreateRemote; + } + return impl(allocator, name); } -__attribute__((unused)) -static kern_return_t rocketbootstrap_cfmessageportexposelocal(CFMessagePortRef messagePort) +__attribute__((unused)) static kern_return_t rocketbootstrap_cfmessageportexposelocal(CFMessagePortRef messagePort) { - static kern_return_t (*impl)(CFMessagePortRef messagePort); - if (!impl) { - void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); - if (handle) - impl = dlsym(handle, "rocketbootstrap_cfmessageportexposelocal"); - if (!impl) - return -1; - } - return impl(messagePort); + static kern_return_t (*impl)(CFMessagePortRef messagePort); + if (!impl) { + void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); + if (handle) + impl = dlsym(handle, "rocketbootstrap_cfmessageportexposelocal"); + if (!impl) + return -1; + } + return impl(messagePort); } #endif #ifdef __OBJC__ @class CPDistributedMessagingCenter; -__attribute__((unused)) -static void rocketbootstrap_distributedmessagingcenter_apply(CPDistributedMessagingCenter *messaging_center) +__attribute__((unused)) static void rocketbootstrap_distributedmessagingcenter_apply(CPDistributedMessagingCenter *messaging_center) { - static void (*impl)(CPDistributedMessagingCenter *messagingCenter); - if (!impl) { - void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); - if (handle) - impl = dlsym(handle, "rocketbootstrap_distributedmessagingcenter_apply"); - if (!impl) - return; - } - impl(messaging_center); + static void (*impl)(CPDistributedMessagingCenter * messagingCenter); + if (!impl) { + void *handle = dlopen("/usr/lib/librocketbootstrap.dylib", RTLD_LAZY); + if (handle) + impl = dlsym(handle, "rocketbootstrap_distributedmessagingcenter_apply"); + if (!impl) + return; + } + impl(messaging_center); } #endif diff --git a/rootless.h b/rootless.h index 0fa50e3f..d9b21efa 100644 --- a/rootless.h +++ b/rootless.h @@ -26,10 +26,11 @@ _Pragma("message(\"'XINA_SUPPORT' is deprecated. libroot will now handle this fo #define ROOT_PATH_NS_VAR(path) [@THEOS_PACKAGE_INSTALL_PREFIX stringByAppendingPathComponent:path] #define ROOT_PATH_VAR(path) sizeof(THEOS_PACKAGE_INSTALL_PREFIX) > 1 ? ({ \ - char outPath[PATH_MAX]; \ - strlcpy(outPath, THEOS_PACKAGE_INSTALL_PREFIX, PATH_MAX); \ - strlcat(outPath, path, PATH_MAX); \ - outPath; \ -}) : path + char outPath[PATH_MAX]; \ + strlcpy(outPath, THEOS_PACKAGE_INSTALL_PREFIX, PATH_MAX); \ + strlcat(outPath, path, PATH_MAX); \ + outPath; \ +}) \ + : path #endif diff --git a/sandbox.h b/sandbox.h index f12601c0..65ec326a 100644 --- a/sandbox.h +++ b/sandbox.h @@ -1,5 +1,5 @@ #if __has_include_next() -# include_next +#include_next #endif #include #include @@ -9,16 +9,16 @@ // https://github.com/applesrc/clang/blob/bb8f644/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_mac_spi.cc enum sandbox_filter_type { - SANDBOX_FILTER_NONE, - SANDBOX_FILTER_PATH, - SANDBOX_FILTER_GLOBAL_NAME, - SANDBOX_FILTER_LOCAL_NAME, - SANDBOX_FILTER_APPLEEVENT_DESTINATION, - SANDBOX_FILTER_RIGHT_NAME, - SANDBOX_FILTER_PREFERENCE_DOMAIN, - SANDBOX_FILTER_KEXT_BUNDLE_ID, - SANDBOX_FILTER_INFO_TYPE, - SANDBOX_FILTER_NOTIFICATION + SANDBOX_FILTER_NONE, + SANDBOX_FILTER_PATH, + SANDBOX_FILTER_GLOBAL_NAME, + SANDBOX_FILTER_LOCAL_NAME, + SANDBOX_FILTER_APPLEEVENT_DESTINATION, + SANDBOX_FILTER_RIGHT_NAME, + SANDBOX_FILTER_PREFERENCE_DOMAIN, + SANDBOX_FILTER_KEXT_BUNDLE_ID, + SANDBOX_FILTER_INFO_TYPE, + SANDBOX_FILTER_NOTIFICATION }; typedef struct sandbox_profile { diff --git a/theos/BackwardsCompat.h b/theos/BackwardsCompat.h index fca83bce..ddaf28a9 100644 --- a/theos/BackwardsCompat.h +++ b/theos/BackwardsCompat.h @@ -1,32 +1,35 @@ #ifndef __has_feature - #define __has_feature(feature) 0 +#define __has_feature(feature) 0 #endif // The following block originally from Ryan Petrich, licensed under GNU GPL v3 // https://github.com/rpetrich/theos/blob/master/Prefix.pch #ifndef __clang__ - #define weak assign - #define strong retain +#define weak assign +#define strong retain - // Fix old GCC versions not identifying the correct response type on - // [[NSDictionary alloc] initWithContentsOfFile:...] and other similar calls - #define THEOS_WORKAROUND_ALLOC(type) @interface type() + (type *)alloc; @end - THEOS_WORKAROUND_ALLOC(NSDictionary); - THEOS_WORKAROUND_ALLOC(NSMutableDictionary); - THEOS_WORKAROUND_ALLOC(NSArray); - THEOS_WORKAROUND_ALLOC(NSMutableArray); - #undef THEOS_WORKAROUND_ALLOC +// Fix old GCC versions not identifying the correct response type on +// [[NSDictionary alloc] initWithContentsOfFile:...] and other similar calls +#define THEOS_WORKAROUND_ALLOC(type) \ + @interface type () \ + +(type *)alloc; \ + @end +THEOS_WORKAROUND_ALLOC(NSDictionary); +THEOS_WORKAROUND_ALLOC(NSMutableDictionary); +THEOS_WORKAROUND_ALLOC(NSArray); +THEOS_WORKAROUND_ALLOC(NSMutableArray); +#undef THEOS_WORKAROUND_ALLOC - // Workaround NS_AVAILABLE being used in enums, by disabling entirely :( - #undef NS_AVAILABLE - #define NS_AVAILABLE(osx, ios) +// Workaround NS_AVAILABLE being used in enums, by disabling entirely :( +#undef NS_AVAILABLE +#define NS_AVAILABLE(osx, ios) #endif #if !__has_feature(nullability) - #define NS_ASSUME_NONNULL_BEGIN - #define NS_ASSUME_NONNULL_END - #define nullable - #define nonnull - #define _Nullable - #define _Nonnull +#define NS_ASSUME_NONNULL_BEGIN +#define NS_ASSUME_NONNULL_END +#define nullable +#define nonnull +#define _Nullable +#define _Nonnull #endif