]> git.saurik.com Git - apple/configd.git/blob - configd.tproj/_SCD.h
configd-1061.40.2.tar.gz
[apple/configd.git] / configd.tproj / _SCD.h
1 /*
2 * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2009, 2011, 2015, 2016, 2018, 2019 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 /*
25 * Modification History
26 *
27 * June 1, 2001 Allan Nathanson <ajn@apple.com>
28 * - public API conversion
29 *
30 * June 2, 2000 Allan Nathanson <ajn@apple.com>
31 * - initial revision
32 */
33
34
35 #ifndef _S_SCD_H
36 #define _S_SCD_H
37
38 #include <sys/cdefs.h>
39
40
41 /*
42 * keys in the "storeData" dictionary
43 */
44
45 /*
46 * data associated with a key
47 */
48 #define kSCDData CFSTR("data")
49 /*
50 * client session ids watching a key and, since we can possibly have
51 * multiple regex keys which reference the key, a count of active
52 * references
53 */
54 #define kSCDWatchers CFSTR("watchers")
55 #define kSCDWatcherRefs CFSTR("watcherRefs")
56 /*
57 * client session id for per-session keys.
58 */
59 #define kSCDSession CFSTR("session")
60
61
62 extern CFMutableDictionaryRef storeData;
63 extern CFMutableDictionaryRef patternData;
64 extern CFMutableSetRef changedKeys;
65 extern CFMutableSetRef deferredRemovals;
66 extern CFMutableSetRef removedSessionKeys;
67 extern CFMutableSetRef needsNotification;
68
69
70 __BEGIN_DECLS
71
72 int
73 __SCDynamicStoreOpen (SCDynamicStoreRef *store,
74 CFStringRef name);
75 int
76 __SCDynamicStoreClose (SCDynamicStoreRef *store);
77
78 int
79 __SCDynamicStorePush (void);
80
81 int
82 __SCDynamicStoreCopyKeyList (SCDynamicStoreRef store,
83 CFStringRef prefix,
84 Boolean isRegex,
85 CFArrayRef *subKeys);
86
87 int
88 __SCDynamicStoreAddValue (SCDynamicStoreRef store,
89 CFStringRef key,
90 CFDataRef value);
91
92 int
93 __SCDynamicStoreCopyValue (SCDynamicStoreRef store,
94 CFStringRef key,
95 CFDataRef *value,
96 Boolean internal);
97
98 int
99 __SCDynamicStoreCopyMultiple (SCDynamicStoreRef store,
100 CFArrayRef keys,
101 CFArrayRef patterns,
102 CFDictionaryRef *values);
103
104 int
105 __SCDynamicStoreSetValue (SCDynamicStoreRef store,
106 CFStringRef key,
107 CFDataRef value,
108 Boolean internal);
109
110 int
111 __SCDynamicStoreSetMultiple (SCDynamicStoreRef store,
112 CFDictionaryRef keysToSet,
113 CFArrayRef keysToRemove,
114 CFArrayRef keysToNotify);
115
116 int
117 __SCDynamicStoreRemoveValue (SCDynamicStoreRef store,
118 CFStringRef key,
119 Boolean internal);
120
121 int
122 __SCDynamicStoreNotifyValue (SCDynamicStoreRef store,
123 CFStringRef key,
124 Boolean internal);
125
126 int
127 __SCDynamicStoreSnapshot (SCDynamicStoreRef store);
128
129 int
130 __SCDynamicStoreAddWatchedKey (SCDynamicStoreRef store,
131 CFStringRef key,
132 Boolean isRegex,
133 Boolean internal);
134
135 int
136 __SCDynamicStoreRemoveWatchedKey (SCDynamicStoreRef store,
137 CFStringRef key,
138 Boolean isRegex,
139 Boolean internal);
140
141 int
142 __SCDynamicStoreSetNotificationKeys (SCDynamicStoreRef store,
143 CFArrayRef keys,
144 CFArrayRef patterns);
145
146 int
147 __SCDynamicStoreCopyNotifiedKeys (SCDynamicStoreRef store,
148 CFArrayRef *notifierKeys);
149
150 int
151 __SCDynamicStoreNotifyMachPort (SCDynamicStoreRef store,
152 mach_msg_id_t msgid,
153 mach_port_t port);
154
155 int
156 __SCDynamicStoreNotifyFileDescriptor (SCDynamicStoreRef store);
157
158 int
159 __SCDynamicStoreNotifyCancel (SCDynamicStoreRef store);
160
161 void
162 _addWatcher (CFNumberRef sessionNum,
163 CFStringRef watchedKey);
164
165 void
166 _removeWatcher (CFNumberRef sessionNum,
167 CFStringRef watchedKey);
168
169 void
170 pushNotifications (void);
171
172 __END_DECLS
173
174 #endif /* !_S_SCD_H */