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 __DISKARBITRATIOND_DASESSION__ 25#define __DISKARBITRATIOND_DASESSION__ 26 27#include <CoreFoundation/CoreFoundation.h> 28#include <DiskArbitration/DiskArbitration.h> 29#include <Security/Authorization.h> 30 31#ifdef __cplusplus 32extern "C" { 33#endif /* __cplusplus */ 34 35enum 36{ 37 kDASessionOptionNoTimeout = 0x01000000 38}; 39 40typedef UInt32 DASessionOption; 41 42typedef UInt32 DASessionOptions; 43 44enum 45{ 46 kDASessionStateIdle = 0x00000001, 47 kDASessionStateTimeout = 0x01000000, 48 kDASessionStateZombie = 0x10000000 49}; 50 51typedef UInt32 DASessionState; 52 53typedef struct __DACallback * DACallbackRef; 54 55typedef struct __DASession * DASessionRef; 56 57///w:start 58extern const char * _DASessionGetName( DASessionRef session ); 59///w:stop 60extern DASessionRef DASessionCreate( CFAllocatorRef allocator, const char * _name, pid_t _pid ); 61extern AuthorizationRef DASessionGetAuthorization( DASessionRef session ); 62extern CFMutableArrayRef DASessionGetCallbackQueue( DASessionRef session ); 63extern CFMutableArrayRef DASessionGetCallbackRegister( DASessionRef session ); 64extern mach_port_t DASessionGetID( DASessionRef session ); 65extern Boolean DASessionGetOption( DASessionRef session, DASessionOption option ); 66extern DASessionOptions DASessionGetOptions( DASessionRef session ); 67extern mach_port_t DASessionGetServerPort( DASessionRef session ); 68extern Boolean DASessionGetState( DASessionRef session, DASessionState state ); 69extern CFTypeID DASessionGetTypeID( void ); 70extern void DASessionInitialize( void ); 71extern void DASessionQueueCallback( DASessionRef session, DACallbackRef callback ); 72extern void DASessionRegisterCallback( DASessionRef session, DACallbackRef callback ); 73extern void DASessionScheduleWithRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); 74extern void DASessionSetAuthorization( DASessionRef session, AuthorizationRef authorization ); 75extern void DASessionSetClientPort( DASessionRef session, mach_port_t client ); 76extern void DASessionSetOption( DASessionRef session, DASessionOption option, Boolean value ); 77extern void DASessionSetOptions( DASessionRef session, DASessionOptions options, Boolean value ); 78extern void DASessionSetState( DASessionRef session, DASessionState state, Boolean value ); 79extern void DASessionUnregisterCallback( DASessionRef session, DACallbackRef callback ); 80extern void DASessionUnscheduleFromRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); 81 82#ifdef __cplusplus 83} 84#endif /* __cplusplus */ 85 86#endif /* !__DISKARBITRATIOND_DASESSION__ */ 87