chore(macos): vendor system-sdk dependency
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
--- !tapi-tbd
|
||||
tbd-version: 4
|
||||
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
|
||||
arm64e-macos, arm64e-maccatalyst ]
|
||||
uuids:
|
||||
- target: x86_64-macos
|
||||
value: 047F8361-0A74-3753-BA4F-991447B4C7D6
|
||||
- target: x86_64-maccatalyst
|
||||
value: 047F8361-0A74-3753-BA4F-991447B4C7D6
|
||||
- target: arm64-macos
|
||||
value: 00000000-0000-0000-0000-000000000000
|
||||
- target: arm64-maccatalyst
|
||||
value: 00000000-0000-0000-0000-000000000000
|
||||
- target: arm64e-macos
|
||||
value: 002C7E5D-60B6-30F2-9C7B-54F85CC3C104
|
||||
- target: arm64e-maccatalyst
|
||||
value: 002C7E5D-60B6-30F2-9C7B-54F85CC3C104
|
||||
install-name: '/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration'
|
||||
exports:
|
||||
- targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
|
||||
arm64-macos, arm64-maccatalyst ]
|
||||
symbols: [ _DAApprovalSessionCreate, _DAApprovalSessionGetTypeID, _DAApprovalSessionScheduleWithRunLoop,
|
||||
_DAApprovalSessionUnscheduleFromRunLoop, _DADiskClaim, _DADiskCopyDescription,
|
||||
_DADiskCopyIOMedia, _DADiskCopyWholeDisk, _DADiskCreateFromBSDName,
|
||||
_DADiskCreateFromIOMedia, _DADiskCreateFromVolumePath, _DADiskEject,
|
||||
_DADiskGetBSDName, _DADiskGetOptions, _DADiskGetTypeID, _DADiskIsClaimed,
|
||||
_DADiskMount, _DADiskMountWithArguments, _DADiskRename, _DADiskSetOptions,
|
||||
_DADiskUnclaim, _DADiskUnmount, _DADissenterCreate, _DADissenterGetProcessID,
|
||||
_DADissenterGetStatus, _DADissenterGetStatusString, _DARegisterDiskAppearedCallback,
|
||||
_DARegisterDiskDescriptionChangedCallback, _DARegisterDiskDisappearedCallback,
|
||||
_DARegisterDiskEjectApprovalCallback, _DARegisterDiskListCompleteCallback,
|
||||
_DARegisterDiskMountApprovalCallback, _DARegisterDiskPeekCallback,
|
||||
_DARegisterDiskUnmountApprovalCallback, _DARegisterIdleCallback,
|
||||
_DASessionCreate, _DASessionGetTypeID, _DASessionScheduleWithRunLoop,
|
||||
_DASessionSetDispatchQueue, _DASessionUnscheduleFromRunLoop,
|
||||
_DAUnregisterApprovalCallback, _DAUnregisterCallback, __DADiskCreateFromSerialization,
|
||||
__DADiskGetSession, __DADiskSetAdoption, __DADiskSetEncoding,
|
||||
__DAmkdir, __DArmdir, _kDAApprovalRunLoopMode, _kDADiskDescriptionAppearanceTimeKey,
|
||||
_kDADiskDescriptionBusNameKey, _kDADiskDescriptionBusPathKey,
|
||||
_kDADiskDescriptionDeviceGUIDKey, _kDADiskDescriptionDeviceInternalKey,
|
||||
_kDADiskDescriptionDeviceModelKey, _kDADiskDescriptionDevicePathKey,
|
||||
_kDADiskDescriptionDeviceProtocolKey, _kDADiskDescriptionDeviceRevisionKey,
|
||||
_kDADiskDescriptionDeviceTDMLockedKey, _kDADiskDescriptionDeviceUnitKey,
|
||||
_kDADiskDescriptionDeviceVendorKey, _kDADiskDescriptionMatchMediaUnformatted,
|
||||
_kDADiskDescriptionMatchMediaWhole, _kDADiskDescriptionMatchVolumeMountable,
|
||||
_kDADiskDescriptionMatchVolumeUnrecognized, _kDADiskDescriptionMediaBSDMajorKey,
|
||||
_kDADiskDescriptionMediaBSDMinorKey, _kDADiskDescriptionMediaBSDNameKey,
|
||||
_kDADiskDescriptionMediaBSDUnitKey, _kDADiskDescriptionMediaBlockSizeKey,
|
||||
_kDADiskDescriptionMediaContentKey, _kDADiskDescriptionMediaEjectableKey,
|
||||
_kDADiskDescriptionMediaEncryptedKey, _kDADiskDescriptionMediaEncryptionDetailKey,
|
||||
_kDADiskDescriptionMediaIconKey, _kDADiskDescriptionMediaKindKey,
|
||||
_kDADiskDescriptionMediaLeafKey, _kDADiskDescriptionMediaMatchKey,
|
||||
_kDADiskDescriptionMediaNameKey, _kDADiskDescriptionMediaPathKey,
|
||||
_kDADiskDescriptionMediaRemovableKey, _kDADiskDescriptionMediaSizeKey,
|
||||
_kDADiskDescriptionMediaTypeKey, _kDADiskDescriptionMediaUUIDKey,
|
||||
_kDADiskDescriptionMediaWholeKey, _kDADiskDescriptionMediaWritableKey,
|
||||
_kDADiskDescriptionVolumeKindKey, _kDADiskDescriptionVolumeMountableKey,
|
||||
_kDADiskDescriptionVolumeNameKey, _kDADiskDescriptionVolumeNetworkKey,
|
||||
_kDADiskDescriptionVolumePathKey, _kDADiskDescriptionVolumeTypeKey,
|
||||
_kDADiskDescriptionVolumeUUIDKey, _kDADiskDescriptionWatchVolumeName,
|
||||
_kDADiskDescriptionWatchVolumePath ]
|
||||
...
|
||||
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __DISKARBITRATION_DADISK__
|
||||
#define __DISKARBITRATION_DADISK__
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <IOKit/IOKitLib.h>
|
||||
|
||||
#include <DiskArbitration/DASession.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CF_ASSUME_NONNULL_BEGIN
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
extern const CFStringRef kDADiskDescriptionVolumeKindKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionVolumeMountableKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionVolumeNameKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionVolumeNetworkKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionVolumePathKey; /* ( CFURL ) */
|
||||
extern const CFStringRef kDADiskDescriptionVolumeTypeKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionVolumeUUIDKey; /* ( CFUUID ) */
|
||||
|
||||
extern const CFStringRef kDADiskDescriptionMediaBlockSizeKey; /* ( CFNumber ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaBSDMajorKey; /* ( CFNumber ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaBSDMinorKey; /* ( CFNumber ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaBSDNameKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaBSDUnitKey; /* ( CFNumber ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaContentKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaEjectableKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaIconKey; /* ( CFDictionary ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaKindKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaLeafKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaNameKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaPathKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaRemovableKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaSizeKey; /* ( CFNumber ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaTypeKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaUUIDKey; /* ( CFUUID ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaWholeKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaWritableKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaEncryptedKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionMediaEncryptionDetailKey; /* ( CFNumber ) */
|
||||
|
||||
extern const CFStringRef kDADiskDescriptionDeviceGUIDKey; /* ( CFData ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceInternalKey; /* ( CFBoolean ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceModelKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionDevicePathKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceProtocolKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceRevisionKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceUnitKey; /* ( CFNumber ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceVendorKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionDeviceTDMLockedKey; /* ( CFBoolean ) */
|
||||
|
||||
extern const CFStringRef kDADiskDescriptionBusNameKey; /* ( CFString ) */
|
||||
extern const CFStringRef kDADiskDescriptionBusPathKey; /* ( CFString ) */
|
||||
|
||||
#ifndef __DISKARBITRATIOND__
|
||||
|
||||
/*!
|
||||
* @typedef DADiskRef
|
||||
* Type of a reference to DADisk instances.
|
||||
*/
|
||||
|
||||
typedef struct CF_BRIDGED_TYPE( id ) __DADisk * DADiskRef;
|
||||
|
||||
/*!
|
||||
* @function DADiskGetTypeID
|
||||
* @abstract Returns the type identifier of all DADisk instances.
|
||||
*/
|
||||
|
||||
extern CFTypeID DADiskGetTypeID( void );
|
||||
|
||||
/*!
|
||||
* @function DADiskCreateFromBSDName
|
||||
* @abstract Creates a new disk object.
|
||||
* @param allocator The allocator object to be used to allocate memory.
|
||||
* @param session The DASession in which to contact Disk Arbitration.
|
||||
* @param name The BSD device name.
|
||||
* @result A reference to a new DADisk.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
extern DADiskRef __nullable DADiskCreateFromBSDName( CFAllocatorRef __nullable allocator, DASessionRef session, const char * name );
|
||||
|
||||
/*!
|
||||
* @function DADiskCreateFromIOMedia
|
||||
* @abstract Creates a new disk object.
|
||||
* @param allocator The allocator object to be used to allocate memory.
|
||||
* @param session The DASession in which to contact Disk Arbitration.
|
||||
* @param media The I/O Kit media object.
|
||||
* @result A reference to a new DADisk.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
extern DADiskRef __nullable DADiskCreateFromIOMedia( CFAllocatorRef __nullable allocator, DASessionRef session, io_service_t media );
|
||||
|
||||
/*!
|
||||
* @function DADiskCreateFromVolumePath
|
||||
* @abstract Creates a new disk object.
|
||||
* @param allocator The allocator object to be used to allocate memory.
|
||||
* @param session The DASession in which to contact Disk Arbitration.
|
||||
* @param path The BSD mount point.
|
||||
* @result A reference to a new DADisk.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
extern DADiskRef __nullable DADiskCreateFromVolumePath( CFAllocatorRef __nullable allocator, DASessionRef session, CFURLRef path );
|
||||
|
||||
/*!
|
||||
* @function DADiskGetBSDName
|
||||
* @abstract Obtains the BSD device name for the specified disk.
|
||||
* @param disk The DADisk for which to obtain the BSD device name.
|
||||
* @result The disk's BSD device name.
|
||||
* @discussion
|
||||
* The BSD device name can be used with opendev() to open the BSD device.
|
||||
*/
|
||||
|
||||
extern const char * __nullable DADiskGetBSDName( DADiskRef disk );
|
||||
|
||||
/*!
|
||||
* @function DADiskCopyIOMedia
|
||||
* @abstract Obtains the I/O Kit media object for the specified disk.
|
||||
* @param disk The DADisk for which to obtain the I/O Kit media object.
|
||||
* @result The disk's I/O Kit media object.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with IOObjectRelease().
|
||||
*/
|
||||
|
||||
extern io_service_t DADiskCopyIOMedia( DADiskRef disk );
|
||||
|
||||
/*!
|
||||
* @function DADiskCopyDescription
|
||||
* @abstract Obtains the Disk Arbitration description of the specified disk.
|
||||
* @param disk The DADisk for which to obtain the Disk Arbitration description.
|
||||
* @result The disk's Disk Arbitration description.
|
||||
* @discussion
|
||||
* This function will contact Disk Arbitration to acquire the latest description
|
||||
* of the specified disk, unless this function is called on a disk object passed
|
||||
* within the context of a registered callback, in which case the description is
|
||||
* current as of that callback event.
|
||||
*
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
extern CFDictionaryRef __nullable DADiskCopyDescription( DADiskRef disk );
|
||||
|
||||
/*!
|
||||
* @function DADiskCopyWholeDisk
|
||||
* @abstract Obtain the associated whole disk object for the specified disk.
|
||||
* @param disk The disk object.
|
||||
* @result The disk's associated whole disk object.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
extern DADiskRef __nullable DADiskCopyWholeDisk( DADiskRef disk );
|
||||
|
||||
#endif /* !__DISKARBITRATIOND__ */
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
CF_ASSUME_NONNULL_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !__DISKARBITRATION_DADISK__ */
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __DISKARBITRATION_DADISSENTER__
|
||||
#define __DISKARBITRATION_DADISSENTER__
|
||||
|
||||
#include <mach/error.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CF_ASSUME_NONNULL_BEGIN
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
#define err_local_diskarbitration err_sub( 0x368 )
|
||||
|
||||
/*!
|
||||
* @enum DAReturn
|
||||
* @abstract A return code.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDAReturnSuccess = 0,
|
||||
kDAReturnError = err_local | err_local_diskarbitration | 0x01, /* ( 0xF8DA0001 ) */
|
||||
kDAReturnBusy = err_local | err_local_diskarbitration | 0x02, /* ( 0xF8DA0002 ) */
|
||||
kDAReturnBadArgument = err_local | err_local_diskarbitration | 0x03, /* ( 0xF8DA0003 ) */
|
||||
kDAReturnExclusiveAccess = err_local | err_local_diskarbitration | 0x04, /* ( 0xF8DA0004 ) */
|
||||
kDAReturnNoResources = err_local | err_local_diskarbitration | 0x05, /* ( 0xF8DA0005 ) */
|
||||
kDAReturnNotFound = err_local | err_local_diskarbitration | 0x06, /* ( 0xF8DA0006 ) */
|
||||
kDAReturnNotMounted = err_local | err_local_diskarbitration | 0x07, /* ( 0xF8DA0007 ) */
|
||||
kDAReturnNotPermitted = err_local | err_local_diskarbitration | 0x08, /* ( 0xF8DA0008 ) */
|
||||
kDAReturnNotPrivileged = err_local | err_local_diskarbitration | 0x09, /* ( 0xF8DA0009 ) */
|
||||
kDAReturnNotReady = err_local | err_local_diskarbitration | 0x0A, /* ( 0xF8DA000A ) */
|
||||
kDAReturnNotWritable = err_local | err_local_diskarbitration | 0x0B, /* ( 0xF8DA000B ) */
|
||||
kDAReturnUnsupported = err_local | err_local_diskarbitration | 0x0C /* ( 0xF8DA000C ) */
|
||||
};
|
||||
|
||||
typedef mach_error_t DAReturn;
|
||||
|
||||
#ifndef __DISKARBITRATIOND__
|
||||
|
||||
/*!
|
||||
* @typedef DADissenterRef
|
||||
* Type of a reference to DADissenter instances.
|
||||
*/
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE( id ) __DADissenter * DADissenterRef;
|
||||
|
||||
/*!
|
||||
* @function DADissenterCreate
|
||||
* @abstract Creates a new dissenter object.
|
||||
* @param allocator The allocator object to be used to allocate memory.
|
||||
* @param status The return code.
|
||||
* @param string The return code string. Pass NULL for no reason.
|
||||
* @result A reference to a new DADissenter.
|
||||
*/
|
||||
|
||||
extern DADissenterRef DADissenterCreate( CFAllocatorRef __nullable allocator, DAReturn status, CFStringRef __nullable string );
|
||||
|
||||
/*!
|
||||
* @function DADissenterGetStatus
|
||||
* @abstract Obtains the return code.
|
||||
* @param dissenter The DADissenter for which to obtain the return code.
|
||||
* @result The return code. A BSD return code, if applicable, is encoded with unix_err().
|
||||
*/
|
||||
|
||||
extern DAReturn DADissenterGetStatus( DADissenterRef dissenter );
|
||||
|
||||
/*!
|
||||
* @function DADissenterGetStatusString
|
||||
* @abstract Obtains the return code string.
|
||||
* @param dissenter The DADissenter for which to obtain the return code string.
|
||||
* @result The return code string.
|
||||
*/
|
||||
|
||||
extern CFStringRef __nullable DADissenterGetStatusString( DADissenterRef dissenter );
|
||||
|
||||
#endif /* !__DISKARBITRATIOND__ */
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
CF_ASSUME_NONNULL_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !__DISKARBITRATION_DADISSENTER__ */
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __DISKARBITRATION_DASESSION__
|
||||
#define __DISKARBITRATION_DASESSION__
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CF_ASSUME_NONNULL_BEGIN
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
#ifndef __DISKARBITRATIOND__
|
||||
|
||||
/*!
|
||||
* @typedef DASessionRef
|
||||
* Type of a reference to DASession instances.
|
||||
*/
|
||||
|
||||
typedef struct CF_BRIDGED_TYPE( id ) __DASession * DASessionRef;
|
||||
|
||||
/*!
|
||||
* @function DASessionGetTypeID
|
||||
* @abstract Returns the type identifier of all DASession instances.
|
||||
*/
|
||||
|
||||
extern CFTypeID DASessionGetTypeID( void );
|
||||
|
||||
/*!
|
||||
* @function DASessionCreate
|
||||
* @abstract Creates a new session.
|
||||
* @result A reference to a new DASession.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it.
|
||||
*/
|
||||
|
||||
extern DASessionRef __nullable DASessionCreate( CFAllocatorRef __nullable allocator );
|
||||
|
||||
/*!
|
||||
* @function DASessionScheduleWithRunLoop
|
||||
* @abstract Schedules the session on a run loop.
|
||||
* @param session The session which is being scheduled.
|
||||
* @param runLoop The run loop on which the session should be scheduled.
|
||||
* @param runLoopMode The run loop mode in which the session should be scheduled.
|
||||
*/
|
||||
|
||||
extern void DASessionScheduleWithRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode );
|
||||
|
||||
/*!
|
||||
* @function DASessionUnscheduleFromRunLoop
|
||||
* @abstract Unschedules the session from a run loop.
|
||||
* @param session The session which is being unscheduled.
|
||||
* @param runLoop The run loop on which the session is scheduled.
|
||||
* @param runLoopMode The run loop mode in which the session is scheduled.
|
||||
*/
|
||||
|
||||
extern void DASessionUnscheduleFromRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode );
|
||||
|
||||
/*!
|
||||
* @function DASessionSetDispatchQueue
|
||||
* @abstract Schedules the session on a dispatch queue.
|
||||
* @param session The session which is being scheduled.
|
||||
* @param queue The dispatch queue on which the session should be scheduled. Pass NULL to unschedule.
|
||||
*/
|
||||
|
||||
extern void DASessionSetDispatchQueue( DASessionRef session, dispatch_queue_t __nullable queue );
|
||||
|
||||
/*
|
||||
* @typedef DAApprovalSessionRef
|
||||
* Type of a reference to DAApprovalSession instances.
|
||||
*/
|
||||
|
||||
typedef struct CF_BRIDGED_TYPE( id ) __DASession * DAApprovalSessionRef CF_SWIFT_UNAVAILABLE( "Use DASessionRef instead" );
|
||||
|
||||
/*
|
||||
* @function DAApprovalSessionGetTypeID
|
||||
* @abstract Returns the type identifier of all DAApprovalSession instances.
|
||||
*/
|
||||
|
||||
extern CFTypeID DAApprovalSessionGetTypeID( void ) CF_SWIFT_UNAVAILABLE( "Use DASessionGetTypeID instead" );
|
||||
|
||||
/*
|
||||
* @function DAApprovalSessionCreate
|
||||
* @abstract Creates a new approval session.
|
||||
* @result A reference to a new DAApprovalSession.
|
||||
* @discussion
|
||||
* The caller of this function receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it.
|
||||
*/
|
||||
|
||||
extern DAApprovalSessionRef __nullable DAApprovalSessionCreate( CFAllocatorRef __nullable allocator ) CF_SWIFT_UNAVAILABLE( "Use DASessionCreate instead" );
|
||||
|
||||
/*
|
||||
* @function DAApprovalSessionScheduleWithRunLoop
|
||||
* @abstract Schedules the approval session on a run loop.
|
||||
* @param session The approval session which is being scheduled.
|
||||
* @param runLoop The run loop on which the approval session should be scheduled.
|
||||
* @param runLoopMode The run loop mode in which the approval session should be scheduled.
|
||||
*/
|
||||
|
||||
extern void DAApprovalSessionScheduleWithRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ) CF_SWIFT_UNAVAILABLE( "Use DASessionSetDispatchQueue instead" );
|
||||
|
||||
/*
|
||||
* @function DAApprovalSessionUnscheduleFromRunLoop
|
||||
* @abstract Unschedules the approval session from a run loop.
|
||||
* @param session The approval session which is being unscheduled.
|
||||
* @param runLoop The run loop on which the approval session is scheduled.
|
||||
* @param runLoopMode The run loop mode in which the approval session is scheduled.
|
||||
*/
|
||||
|
||||
extern void DAApprovalSessionUnscheduleFromRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ) CF_SWIFT_UNAVAILABLE( "Use DASessionSetDispatchQueue instead" );
|
||||
|
||||
#endif /* !__DISKARBITRATIOND__ */
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
CF_ASSUME_NONNULL_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !__DISKARBITRATION_DASESSION__ */
|
||||
@@ -0,0 +1,580 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __DISKARBITRATION_DISKARBITRATION__
|
||||
#define __DISKARBITRATION_DISKARBITRATION__
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#include <DiskArbitration/DADisk.h>
|
||||
#include <DiskArbitration/DADissenter.h>
|
||||
#include <DiskArbitration/DASession.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
CF_ASSUME_NONNULL_BEGIN
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
/*!
|
||||
* @enum DADiskMountOptions
|
||||
* @abstract Options for DADiskMount().
|
||||
* @constant kDADiskMountOptionWhole Mount the volumes tied to the whole disk object.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDADiskMountOptionDefault = 0x00000000,
|
||||
kDADiskMountOptionWhole = 0x00000001
|
||||
};
|
||||
|
||||
typedef UInt32 DADiskMountOptions;
|
||||
|
||||
/*!
|
||||
* @enum DADiskRenameOptions
|
||||
* @abstract Options for DADiskRename().
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDADiskRenameOptionDefault = 0x00000000
|
||||
};
|
||||
|
||||
typedef UInt32 DADiskRenameOptions;
|
||||
|
||||
/*!
|
||||
* @enum DADiskUnmountOptions
|
||||
* @abstract Options for DADiskUnmount().
|
||||
* @constant kDADiskUnmountOptionForce Unmount the volume even if files are still active.
|
||||
* @constant kDADiskUnmountOptionWhole Unmount the volumes tied to the whole disk object.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDADiskUnmountOptionDefault = 0x00000000,
|
||||
kDADiskUnmountOptionForce = 0x00080000,
|
||||
kDADiskUnmountOptionWhole = 0x00000001
|
||||
};
|
||||
|
||||
typedef UInt32 DADiskUnmountOptions;
|
||||
|
||||
/*!
|
||||
* @enum DADiskEjectOptions
|
||||
* @abstract Options for DADiskEject().
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDADiskEjectOptionDefault = 0x00000000
|
||||
};
|
||||
|
||||
typedef UInt32 DADiskEjectOptions;
|
||||
|
||||
/*!
|
||||
* @enum DADiskClaimOptions
|
||||
* @abstract Options for DADiskClaim().
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDADiskClaimOptionDefault = 0x00000000
|
||||
};
|
||||
|
||||
typedef UInt32 DADiskClaimOptions;
|
||||
|
||||
/*!
|
||||
* @enum DADiskOptions
|
||||
* @abstract Options for DADiskGetOptions() and DADiskSetOptions().
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
kDADiskOptionDefault = 0x00000000
|
||||
};
|
||||
|
||||
typedef UInt32 DADiskOptions;
|
||||
|
||||
/*!
|
||||
* @constant kDADiskDescriptionMatchMediaUnformatted
|
||||
* Predefined CFDictionary object containing a set of disk description keys and values
|
||||
* appropriate for matching unformatted media using DARegister*Callback().
|
||||
*/
|
||||
|
||||
extern CFDictionaryRef kDADiskDescriptionMatchMediaUnformatted;
|
||||
|
||||
/*!
|
||||
* @constant kDADiskDescriptionMatchMediaWhole
|
||||
* Predefined CFDictionary object containing a set of disk description keys and values
|
||||
* appropriate for matching whole media using DARegister*Callback().
|
||||
*/
|
||||
|
||||
extern CFDictionaryRef kDADiskDescriptionMatchMediaWhole;
|
||||
|
||||
/*!
|
||||
* @constant kDADiskDescriptionMatchVolumeMountable
|
||||
* Predefined CFDictionary object containing a set of disk description keys and values
|
||||
* appropriate for matching mountable volumes using DARegister*Callback().
|
||||
*/
|
||||
|
||||
extern CFDictionaryRef kDADiskDescriptionMatchVolumeMountable;
|
||||
|
||||
/*!
|
||||
* @constant kDADiskDescriptionMatchVolumeUnrecognized
|
||||
* Predefined CFDictionary object containing a set of disk description keys and values
|
||||
* appropriate for matching unrecognized volumes using DARegister*Callback().
|
||||
*/
|
||||
|
||||
extern CFDictionaryRef kDADiskDescriptionMatchVolumeUnrecognized;
|
||||
|
||||
/*!
|
||||
* @constant kDADiskDescriptionWatchVolumeName
|
||||
* Predefined CFArray object containing a set of disk description keys appropriate for
|
||||
* watching volume name changes using DARegisterDiskDescriptionChangedCallback().
|
||||
*/
|
||||
|
||||
extern CFArrayRef kDADiskDescriptionWatchVolumeName;
|
||||
|
||||
/*!
|
||||
* @constant kDADiskDescriptionWatchVolumePath
|
||||
* Predefined CFArray object containing a set of disk description keys appropriate for
|
||||
* watching volume mount changes using DARegisterDiskDescriptionChangedCallback().
|
||||
*/
|
||||
|
||||
extern CFArrayRef kDADiskDescriptionWatchVolumePath;
|
||||
|
||||
#ifndef __DISKARBITRATIOND__
|
||||
|
||||
/*!
|
||||
* @typedef DADiskAppearedCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskAppearedCallback().
|
||||
* @param disk A disk object.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskAppearedCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskAppearedCallback
|
||||
* @abstract Registers a callback function to be called whenever a disk has appeared.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param callback The callback function to call when a disk has appeared.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskAppearedCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
DADiskAppearedCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskDescriptionChangedCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskDescriptionChangedCallback().
|
||||
* @param disk A disk object.
|
||||
* @param keys A list of changed keys.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskDescriptionChangedCallback )( DADiskRef disk, CFArrayRef keys, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskDescriptionChangedCallback
|
||||
* @abstract Registers a callback function to be called whenever a disk description has changed.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param watch The disk description keys to watch. Pass NULL for all keys.
|
||||
* @param callback The callback function to call when a watched key changes.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskDescriptionChangedCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
CFArrayRef __nullable watch,
|
||||
DADiskDescriptionChangedCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskDisappearedCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskDisappearedCallback().
|
||||
* @param disk A disk object.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskDisappearedCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskDisappearedCallback
|
||||
* @abstract Registers a callback function to be called whenever a disk has disappeared.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param callback The callback function to call when a disk has disappeared.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskDisappearedCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
DADiskDisappearedCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskMountCallback
|
||||
* @abstract Type of the callback function used by DADiskMount().
|
||||
* @param disk The disk object.
|
||||
* @param dissenter A dissenter object on failure or NULL on success.
|
||||
* @param context The user-defined context parameter given to the mount function.
|
||||
* @discussion
|
||||
* If the disk is already mounted, then status code in the dissenter object will be set to kDAReturnBusy
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskMountCallback )( DADiskRef disk, DADissenterRef __nullable dissenter, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskMount
|
||||
* @abstract Mounts the volume at the specified disk object.
|
||||
* @param disk The disk object.
|
||||
* @param path The mount path. Pass NULL for a "standard" mount path.
|
||||
* @param options The mount options.
|
||||
* @param callback The callback function to call once the mount completes.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DADiskMount( DADiskRef disk,
|
||||
CFURLRef __nullable path,
|
||||
DADiskMountOptions options,
|
||||
DADiskMountCallback __nullable callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskMountWithArguments
|
||||
* @abstract Mounts the volume at the specified disk object, with the specified mount options.
|
||||
* @param disk The disk object.
|
||||
* @param path The mount path. Pass NULL for a "standard" mount path.
|
||||
* @param options The mount options.
|
||||
* @param callback The callback function to call once the mount completes.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
* @param arguments The null-terminated list of mount options to pass to /sbin/mount -o.
|
||||
*/
|
||||
|
||||
extern void DADiskMountWithArguments( DADiskRef disk,
|
||||
CFURLRef __nullable path,
|
||||
DADiskMountOptions options,
|
||||
DADiskMountCallback __nullable callback,
|
||||
void * __nullable context,
|
||||
CFStringRef __nullable arguments[_Nullable] );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskMountApprovalCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskMountApprovalCallback().
|
||||
* @param disk A disk object.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
* @result A dissenter reference. Pass NULL to approve.
|
||||
* @discussion
|
||||
* The caller of this callback receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
typedef DADissenterRef __nullable ( *DADiskMountApprovalCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskMountApprovalCallback
|
||||
* @abstract Registers a callback function to be called whenever a volume is to be mounted.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param callback The callback function to call when a volume is to be mounted.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskMountApprovalCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
DADiskMountApprovalCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskRenameCallback
|
||||
* @abstract Type of the callback function used by DADiskRename().
|
||||
* @param disk The disk object.
|
||||
* @param dissenter A dissenter object on failure or NULL on success.
|
||||
* @param context The user-defined context parameter given to the rename function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskRenameCallback )( DADiskRef disk, DADissenterRef __nullable dissenter, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskRename
|
||||
* @abstract Renames the volume at the specified disk object.
|
||||
* @param disk The disk object.
|
||||
* @param options The rename options.
|
||||
* @param callback The callback function to call once the rename completes.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DADiskRename( DADiskRef disk,
|
||||
CFStringRef name,
|
||||
DADiskRenameOptions options,
|
||||
DADiskRenameCallback __nullable callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskUnmountCallback
|
||||
* @abstract Type of the callback function used by DADiskUnmount().
|
||||
* @param disk The disk object.
|
||||
* @param dissenter A dissenter object on failure or NULL on success.
|
||||
* @param context The user-defined context parameter given to the unmount function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskUnmountCallback )( DADiskRef disk, DADissenterRef __nullable dissenter, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskUnmount
|
||||
* @abstract Unmounts the volume at the specified disk object.
|
||||
* @param disk The disk object.
|
||||
* @param options The unmount options.
|
||||
* @param callback The callback function to call once the unmount completes.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DADiskUnmount( DADiskRef disk,
|
||||
DADiskUnmountOptions options,
|
||||
DADiskUnmountCallback __nullable callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskUnmountApprovalCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskUnmountApprovalCallback().
|
||||
* @param disk A disk object.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
* @result A dissenter reference. Pass NULL to approve.
|
||||
* @discussion
|
||||
* The caller of this callback receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
typedef DADissenterRef __nullable ( *DADiskUnmountApprovalCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskUnmountApprovalCallback
|
||||
* @abstract Registers a callback function to be called whenever a volume is to be unmounted.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param callback The callback function to call when a volume is to be unmounted.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskUnmountApprovalCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
DADiskUnmountApprovalCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskEjectCallback
|
||||
* @abstract Type of the callback function used by DADiskEject().
|
||||
* @param disk The disk object.
|
||||
* @param dissenter A dissenter object on failure or NULL on success.
|
||||
* @param context The user-defined context parameter given to the eject function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskEjectCallback )( DADiskRef disk, DADissenterRef __nullable dissenter, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskEject
|
||||
* @abstract Ejects the specified disk object.
|
||||
* @param disk The disk object.
|
||||
* @param options The eject options.
|
||||
* @param callback The callback function to call once the ejection completes.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DADiskEject( DADiskRef disk,
|
||||
DADiskEjectOptions options,
|
||||
DADiskEjectCallback __nullable callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskEjectApprovalCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskEjectApprovalCallback().
|
||||
* @param disk A disk object.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
* @result A dissenter reference. Pass NULL to approve.
|
||||
* @discussion
|
||||
* The caller of this callback receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
typedef DADissenterRef __nullable ( *DADiskEjectApprovalCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskEjectApprovalCallback
|
||||
* @abstract Registers a callback function to be called whenever a volume is to be ejected.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param callback The callback function to call when a volume is to be ejected.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskEjectApprovalCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
DADiskEjectApprovalCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskClaimCallback
|
||||
* @abstract Type of the callback function used by DADiskClaim().
|
||||
* @param disk The disk object.
|
||||
* @param dissenter A dissenter object on failure or NULL on success.
|
||||
* @param context The user-defined context parameter given to the claim function.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskClaimCallback )( DADiskRef disk, DADissenterRef __nullable dissenter, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskClaimReleaseCallback
|
||||
* @abstract Type of the callback function used by DADiskClaim().
|
||||
* @param disk The disk object.
|
||||
* @param context The user-defined context parameter given to the claim function.
|
||||
* @result A dissenter reference. Pass NULL to release claim.
|
||||
* @discussion
|
||||
* The caller of this callback receives a reference to the returned object. The
|
||||
* caller also implicitly retains the object and is responsible for releasing it
|
||||
* with CFRelease().
|
||||
*/
|
||||
|
||||
typedef DADissenterRef __nullable ( *DADiskClaimReleaseCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskClaim
|
||||
* @abstract Claims the specified disk object for exclusive use.
|
||||
* @param disk The disk object.
|
||||
* @param options The claim options.
|
||||
* @param release The callback function to call when the claim is to be released.
|
||||
* @param releaseContext The user-defined context parameter to pass to the callback function.
|
||||
* @param callback The callback function to call once the claim completes.
|
||||
* @param callbackContext The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DADiskClaim( DADiskRef disk,
|
||||
DADiskClaimOptions options,
|
||||
DADiskClaimReleaseCallback __nullable release,
|
||||
void * __nullable releaseContext,
|
||||
DADiskClaimCallback __nullable callback,
|
||||
void * __nullable callbackContext );
|
||||
|
||||
/*!
|
||||
* @function DADiskIsClaimed
|
||||
* @abstract Reports whether or not the disk is claimed.
|
||||
* @param disk The disk object.
|
||||
* @result TRUE if the disk is claimed, otherwise FALSE.
|
||||
*/
|
||||
|
||||
extern Boolean DADiskIsClaimed( DADiskRef disk );
|
||||
|
||||
/*!
|
||||
* @function DADiskUnclaim
|
||||
* @abstract Unclaims the specified disk object.
|
||||
* @param disk The disk object.
|
||||
*/
|
||||
|
||||
extern void DADiskUnclaim( DADiskRef disk );
|
||||
|
||||
/*!
|
||||
* @typedef DADiskPeekCallback
|
||||
* @abstract Type of the callback function used by DARegisterDiskPeekCallback().
|
||||
* @param disk A disk object.
|
||||
* @param context The user-defined context parameter given to the registration function.
|
||||
* @discussion
|
||||
* The peek callback functions are called in a specific order, from lowest order to highest
|
||||
* order. DADiskClaim() could be used here to claim the disk object and DADiskSetOptions()
|
||||
* could be used here to set up options on the disk object.
|
||||
*/
|
||||
|
||||
typedef void ( *DADiskPeekCallback )( DADiskRef disk, void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DARegisterDiskPeekCallback
|
||||
* @abstract Registers a callback function to be called whenever a disk has been probed.
|
||||
* @param session The session object.
|
||||
* @param match The disk description keys to match. Pass NULL for all disk objects.
|
||||
* @param order The callback order, from lowest to highest. Pass 0 for the default.
|
||||
* @param callback The callback function to call when a disk has been probed.
|
||||
* @param context The user-defined context parameter to pass to the callback function.
|
||||
*/
|
||||
|
||||
extern void DARegisterDiskPeekCallback( DASessionRef session,
|
||||
CFDictionaryRef __nullable match,
|
||||
CFIndex order,
|
||||
DADiskPeekCallback callback,
|
||||
void * __nullable context );
|
||||
|
||||
/*!
|
||||
* @function DADiskGetOptions
|
||||
* @abstract Obtains the options for the specified disk.
|
||||
* @param disk The disk object for which to obtain the options.
|
||||
* @result The options.
|
||||
*/
|
||||
|
||||
extern DADiskOptions DADiskGetOptions( DADiskRef disk );
|
||||
|
||||
/*!
|
||||
* @function DADiskSetOptions
|
||||
* @abstract Sets the options for the specified disk.
|
||||
* @param disk The disk object for which to set the options.
|
||||
* @param options The options to set or clear.
|
||||
* @param value Pass TRUE to set options; otherwise pass FALSE to clear options.
|
||||
* @result A result code.
|
||||
*/
|
||||
|
||||
extern DAReturn DADiskSetOptions( DADiskRef disk, DADiskOptions options, Boolean value );
|
||||
|
||||
/*!
|
||||
* @function DAUnregisterCallback
|
||||
* @abstract Unregisters a registered callback function.
|
||||
* @param session The session object.
|
||||
* @param callback The registered callback function.
|
||||
* @param context The user-defined context parameter.
|
||||
*/
|
||||
|
||||
extern void DAUnregisterCallback( DASessionRef session, void * callback, void * __nullable context );
|
||||
|
||||
/*
|
||||
* @function DAUnregisterApprovalCallback
|
||||
* @abstract Unregisters a registered callback function.
|
||||
* @param session The session object.
|
||||
* @param callback The registered callback function.
|
||||
* @param context The user-defined context parameter.
|
||||
*/
|
||||
|
||||
extern void DAUnregisterApprovalCallback( DASessionRef session, void * callback, void * __nullable context ) CF_SWIFT_UNAVAILABLE( "Use DAUnregisterCallback instead" );
|
||||
|
||||
#endif /* !__DISKARBITRATIOND__ */
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
CF_ASSUME_NONNULL_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !__DISKARBITRATION_DISKARBITRATION__ */
|
||||
@@ -0,0 +1,9 @@
|
||||
framework module DiskArbitration [extern_c] [system]
|
||||
{
|
||||
umbrella header "DiskArbitration.h"
|
||||
export *
|
||||
module *
|
||||
{
|
||||
export *
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user