1/* 2 * Copyright (c) 1998-2013 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24#ifndef __DISKARBITRATION_DADISSENTER__ 25#define __DISKARBITRATION_DADISSENTER__ 26 27#include <mach/error.h> 28#include <CoreFoundation/CoreFoundation.h> 29 30#ifdef __cplusplus 31extern "C" { 32#endif /* __cplusplus */ 33 34#define err_local_diskarbitration err_sub( 0x368 ) 35 36/*! 37 * @enum DAReturn 38 * @abstract A return code. 39 */ 40 41enum 42{ 43 kDAReturnSuccess = 0, 44 kDAReturnError = err_local | err_local_diskarbitration | 0x01, /* ( 0xF8DA0001 ) */ 45 kDAReturnBusy = err_local | err_local_diskarbitration | 0x02, /* ( 0xF8DA0002 ) */ 46 kDAReturnBadArgument = err_local | err_local_diskarbitration | 0x03, /* ( 0xF8DA0003 ) */ 47 kDAReturnExclusiveAccess = err_local | err_local_diskarbitration | 0x04, /* ( 0xF8DA0004 ) */ 48 kDAReturnNoResources = err_local | err_local_diskarbitration | 0x05, /* ( 0xF8DA0005 ) */ 49 kDAReturnNotFound = err_local | err_local_diskarbitration | 0x06, /* ( 0xF8DA0006 ) */ 50 kDAReturnNotMounted = err_local | err_local_diskarbitration | 0x07, /* ( 0xF8DA0007 ) */ 51 kDAReturnNotPermitted = err_local | err_local_diskarbitration | 0x08, /* ( 0xF8DA0008 ) */ 52 kDAReturnNotPrivileged = err_local | err_local_diskarbitration | 0x09, /* ( 0xF8DA0009 ) */ 53 kDAReturnNotReady = err_local | err_local_diskarbitration | 0x0A, /* ( 0xF8DA000A ) */ 54 kDAReturnNotWritable = err_local | err_local_diskarbitration | 0x0B, /* ( 0xF8DA000B ) */ 55 kDAReturnUnsupported = err_local | err_local_diskarbitration | 0x0C /* ( 0xF8DA000C ) */ 56}; 57 58typedef mach_error_t DAReturn; 59 60#ifndef __DISKARBITRATIOND__ 61 62/*! 63 * @typedef DADissenterRef 64 * Type of a reference to DADissenter instances. 65 */ 66 67typedef const struct __DADissenter * DADissenterRef; 68 69/*! 70 * @function DADissenterCreate 71 * @abstract Creates a new dissenter object. 72 * @param allocator The allocator object to be used to allocate memory. 73 * @param status The return code. 74 * @param string The return code string. Pass NULL for no reason. 75 * @result A reference to a new DADissenter. 76 */ 77 78extern DADissenterRef DADissenterCreate( CFAllocatorRef allocator, DAReturn status, CFStringRef string ); 79 80/*! 81 * @function DADissenterGetStatus 82 * @abstract Obtains the return code. 83 * @param dissenter The DADissenter for which to obtain the return code. 84 * @result The return code. A BSD return code, if applicable, is encoded with unix_err(). 85 */ 86 87extern DAReturn DADissenterGetStatus( DADissenterRef dissenter ); 88 89/*! 90 * @function DADissenterGetStatusString 91 * @abstract Obtains the return code string. 92 * @param dissenter The DADissenter for which to obtain the return code string. 93 * @result The return code string. 94 */ 95 96extern CFStringRef DADissenterGetStatusString( DADissenterRef dissenter ); 97 98#endif /* !__DISKARBITRATIOND__ */ 99 100#ifdef __cplusplus 101} 102#endif /* __cplusplus */ 103 104#endif /* !__DISKARBITRATION_DADISSENTER__ */ 105