]> git.saurik.com Git - apple/configd.git/blob - configd.tproj/_SCD.h
configd-212.2.tar.gz
[apple/configd.git] / configd.tproj / _SCD.h
1 /*
2 * Copyright (c) 2000, 2001, 2003, 2004, 2006 Apple Computer, 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 /*
63 * keys in the "sessionData" dictionary
64 */
65
66 /*
67 * the name of the calling application / plug-in
68 */
69 #define kSCDName CFSTR("name")
70 /*
71 * keys which have changed since last call to SCDNotifierGetChanges()
72 */
73 #define kSCDChangedKeys CFSTR("changedKeys")
74 /*
75 * keys which are to be removed when the session is closed
76 */
77 #define kSCDSessionKeys CFSTR("sessionKeys")
78
79
80 extern int storeLocked;
81 extern CFMutableDictionaryRef storeData;
82 extern CFMutableDictionaryRef sessionData;
83 extern CFMutableDictionaryRef patternData;
84 extern CFMutableSetRef changedKeys;
85 extern CFMutableSetRef deferredRemovals;
86 extern CFMutableSetRef removedSessionKeys;
87 extern CFMutableSetRef needsNotification;
88
89 extern CFMutableDictionaryRef storeData_s;
90 extern CFMutableDictionaryRef patternData_s;
91 extern CFMutableSetRef changedKeys_s;
92 extern CFMutableSetRef deferredRemovals_s;
93 extern CFMutableSetRef removedSessionKeys_s;
94
95
96 __BEGIN_DECLS
97
98 int
99 __SCDynamicStoreOpen (SCDynamicStoreRef *store,
100 CFStringRef name);
101 int
102 __SCDynamicStoreClose (SCDynamicStoreRef *store,
103 Boolean internal);
104
105 int
106 __SCDynamicStoreLock (SCDynamicStoreRef store,
107 Boolean recursive);
108
109 int
110 __SCDynamicStoreUnlock (SCDynamicStoreRef store,
111 Boolean recursive);
112
113 int
114 __SCDynamicStoreCopyKeyList (SCDynamicStoreRef store,
115 CFStringRef prefix,
116 Boolean isRegex,
117 CFArrayRef *subKeys);
118
119 int
120 __SCDynamicStoreAddValue (SCDynamicStoreRef store,
121 CFStringRef key,
122 CFDataRef value,
123 Boolean internal);
124
125 int
126 __SCDynamicStoreCopyValue (SCDynamicStoreRef store,
127 CFStringRef key,
128 CFDataRef *value,
129 Boolean internal);
130
131 int
132 __SCDynamicStoreCopyMultiple (SCDynamicStoreRef store,
133 CFArrayRef keys,
134 CFArrayRef patterns,
135 CFDictionaryRef *values);
136
137 int
138 __SCDynamicStoreSetValue (SCDynamicStoreRef store,
139 CFStringRef key,
140 CFDataRef value,
141 Boolean internal);
142
143 int
144 __SCDynamicStoreSetMultiple (SCDynamicStoreRef store,
145 CFDictionaryRef keysToSet,
146 CFArrayRef keysToRemove,
147 CFArrayRef keysToNotify);
148
149 int
150 __SCDynamicStoreRemoveValue (SCDynamicStoreRef store,
151 CFStringRef key,
152 Boolean internal);
153
154 int
155 __SCDynamicStoreTouchValue (SCDynamicStoreRef store,
156 CFStringRef key);
157
158 int
159 __SCDynamicStoreNotifyValue (SCDynamicStoreRef store,
160 CFStringRef key,
161 Boolean internal);
162
163 int
164 __SCDynamicStoreSnapshot (SCDynamicStoreRef store);
165
166 int
167 __SCDynamicStoreAddWatchedKey (SCDynamicStoreRef store,
168 CFStringRef key,
169 Boolean isRegex,
170 Boolean internal);
171
172 int
173 __SCDynamicStoreRemoveWatchedKey (SCDynamicStoreRef store,
174 CFStringRef key,
175 Boolean isRegex,
176 Boolean internal);
177
178 int
179 __SCDynamicStoreSetNotificationKeys (SCDynamicStoreRef store,
180 CFArrayRef keys,
181 CFArrayRef patterns);
182
183 int
184 __SCDynamicStoreCopyNotifiedKeys (SCDynamicStoreRef store,
185 CFArrayRef *notifierKeys);
186
187 int
188 __SCDynamicStoreNotifyMachPort (SCDynamicStoreRef store,
189 mach_msg_id_t msgid,
190 mach_port_t *port);
191
192 int
193 __SCDynamicStoreNotifyFileDescriptor (SCDynamicStoreRef store,
194 int32_t identifier,
195 int *fd);
196
197 int
198 __SCDynamicStoreNotifySignal (SCDynamicStoreRef store,
199 pid_t pid,
200 int sig);
201
202 int
203 __SCDynamicStoreNotifyCancel (SCDynamicStoreRef store);
204
205 void
206 _swapLockedStoreData (void);
207
208 void
209 _addWatcher (CFNumberRef sessionNum,
210 CFStringRef watchedKey);
211
212 void
213 _removeWatcher (CFNumberRef sessionNum,
214 CFStringRef watchedKey);
215
216 void
217 pushNotifications (void);
218
219 __END_DECLS
220
221 #endif /* !_S_SCD_H */