2 * Copyright (c) 2000-2004, 2006, 2009 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCDYNAMICSTOREINTERNAL_H
25 #define _SCDYNAMICSTOREINTERNAL_H
27 #include <Availability.h>
28 #include <TargetConditionals.h>
29 #include <sys/cdefs.h>
31 #include <dispatch/dispatch.h>
32 #endif // !TARGET_OS_IPHONE
33 #include <sys/types.h>
34 #include <mach/mach.h>
37 #include <CoreFoundation/CoreFoundation.h>
38 #include <CoreFoundation/CFRuntime.h>
39 #include <SystemConfiguration/SCDynamicStore.h>
42 /* Define the status of any registered notification. */
44 NotifierNotRegistered
= 0,
46 Using_NotifierInformViaCallback
,
47 Using_NotifierInformViaMachPort
,
48 Using_NotifierInformViaFD
,
49 Using_NotifierInformViaSignal
,
50 Using_NotifierInformViaRunLoop
,
51 Using_NotifierInformViaDispatch
52 } __SCDynamicStoreNotificationStatus
;
57 /* base CFType information */
60 /* server side of the "configd" session */
63 /* per-session flags */
65 Boolean useSessionKeys
;
67 /* current status of notification requests */
68 __SCDynamicStoreNotificationStatus notifyStatus
;
70 /* "client" information associated with SCDynamicStoreCreateRunLoopSource() */
72 CFRunLoopSourceRef rls
;
73 SCDynamicStoreCallBack rlsFunction
;
74 SCDynamicStoreContext rlsContext
;
76 /* "client" information associated with SCDynamicStoreNotifyCallback() */
77 SCDynamicStoreCallBack_v1 callbackFunction
;
78 void *callbackArgument
;
79 CFMachPortRef callbackPort
;
80 CFRunLoopSourceRef callbackRLS
;
83 /* "client" information associated with SCDynamicStoreSetDispatchQueue() */
84 dispatch_queue_t dispatchQueue
;
85 dispatch_source_t callbackSource
;
86 dispatch_queue_t callbackQueue
;
87 #endif // !TARGET_OS_IPHONE
89 /* "server" SCDynamicStoreKeys being watched */
91 CFMutableSetRef patterns
;
93 /* "server" information associated with SCDynamicStoreNotifyMachPort() */
94 mach_port_t notifyPort
;
95 mach_msg_id_t notifyPortIdentifier
;
97 /* "server" information associated with SCDynamicStoreNotifyFileDescriptor() */
99 int notifyFileIdentifier
;
101 /* "server" information associated with SCDynamicStoreNotifySignal() */
103 task_t notifySignalTask
;
105 } SCDynamicStorePrivate
, *SCDynamicStorePrivateRef
;
110 SCDynamicStorePrivateRef
111 __SCDynamicStoreCreatePrivate (CFAllocatorRef allocator
,
112 const CFStringRef name
,
113 SCDynamicStoreCallBack callout
,
114 SCDynamicStoreContext
*context
);
118 #endif /* _SCDYNAMICSTOREINTERNAL_H */