]> git.saurik.com Git - apple/configd.git/blob - configd.tproj/_SCD.h
6cc7046a267459128a935e2b10f3df86a8466783
[apple/configd.git] / configd.tproj / _SCD.h
1 /*
2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 /*
27 * Modification History
28 *
29 * June 1, 2001 Allan Nathanson <ajn@apple.com>
30 * - public API conversion
31 *
32 * June 2, 2000 Allan Nathanson <ajn@apple.com>
33 * - initial revision
34 */
35
36
37 #ifndef _S_SCD_H
38 #define _S_SCD_H
39
40 #include <sys/cdefs.h>
41
42
43 /*
44 * keys in the "storeData" dictionary
45 */
46
47 /*
48 * data associated with a key
49 */
50 #define kSCDData CFSTR("data")
51 /*
52 * client session ids watching a key and, since we can possibly have
53 * multiple regex keys which reference the key, a count of active
54 * references
55 */
56 #define kSCDWatchers CFSTR("watchers")
57 #define kSCDWatcherRefs CFSTR("watcherRefs")
58 /*
59 * client session id for per-session keys.
60 */
61 #define kSCDSession CFSTR("session")
62
63
64 /*
65 * keys in the "sessionData" dictionary
66 */
67
68 /*
69 * the name of the calling application / plug-in
70 */
71 #define kSCDName CFSTR("name")
72 /*
73 * keys which have changed since last call to SCDNotifierGetChanges()
74 */
75 #define kSCDChangedKeys CFSTR("changedKeys")
76 /*
77 * keys which are to be removed when the session is closed
78 */
79 #define kSCDSessionKeys CFSTR("sessionKeys")
80
81
82 extern int storeLocked;
83 extern CFMutableDictionaryRef storeData;
84 extern CFMutableDictionaryRef sessionData;
85 extern CFMutableDictionaryRef patternData;
86 extern CFMutableSetRef changedKeys;
87 extern CFMutableSetRef deferredRemovals;
88 extern CFMutableSetRef removedSessionKeys;
89 extern CFMutableSetRef needsNotification;
90
91 extern CFMutableDictionaryRef storeData_s;
92 extern CFMutableDictionaryRef patternData_s;
93 extern CFMutableSetRef changedKeys_s;
94 extern CFMutableSetRef deferredRemovals_s;
95 extern CFMutableSetRef removedSessionKeys_s;
96
97
98 __BEGIN_DECLS
99
100 int
101 __SCDynamicStoreOpen (SCDynamicStoreRef *store,
102 CFStringRef name);
103 int
104 __SCDynamicStoreClose (SCDynamicStoreRef *store,
105 Boolean internal);
106
107 int
108 __SCDynamicStoreLock (SCDynamicStoreRef store,
109 Boolean recursive);
110
111 int
112 __SCDynamicStoreUnlock (SCDynamicStoreRef store,
113 Boolean recursive);
114
115 int
116 __SCDynamicStoreCopyKeyList (SCDynamicStoreRef store,
117 CFStringRef prefix,
118 Boolean isRegex,
119 CFArrayRef *subKeys);
120
121 int
122 __SCDynamicStoreAddValue (SCDynamicStoreRef store,
123 CFStringRef key,
124 CFDataRef value);
125
126 int
127 __SCDynamicStoreAddTemporaryValue (SCDynamicStoreRef store,
128 CFStringRef key,
129 CFDataRef value);
130
131 int
132 __SCDynamicStoreCopyValue (SCDynamicStoreRef store,
133 CFStringRef key,
134 CFDataRef *value,
135 Boolean internal);
136
137 int
138 __SCDynamicStoreCopyMultiple (SCDynamicStoreRef store,
139 CFArrayRef keys,
140 CFArrayRef patterns,
141 CFDictionaryRef *values);
142
143 int
144 __SCDynamicStoreSetValue (SCDynamicStoreRef store,
145 CFStringRef key,
146 CFDataRef value,
147 Boolean internal);
148
149 int
150 __SCDynamicStoreSetMultiple (SCDynamicStoreRef store,
151 CFDictionaryRef keysToSet,
152 CFArrayRef keysToRemove,
153 CFArrayRef keysToNotify);
154
155 int
156 __SCDynamicStoreRemoveValue (SCDynamicStoreRef store,
157 CFStringRef key,
158 Boolean internal);
159
160 int
161 __SCDynamicStoreTouchValue (SCDynamicStoreRef store,
162 CFStringRef key);
163
164 int
165 __SCDynamicStoreNotifyValue (SCDynamicStoreRef store,
166 CFStringRef key,
167 Boolean internal);
168
169 int
170 __SCDynamicStoreSnapshot (SCDynamicStoreRef store);
171
172 int
173 __SCDynamicStoreAddWatchedKey (SCDynamicStoreRef store,
174 CFStringRef key,
175 Boolean isRegex,
176 Boolean internal);
177
178 int
179 __SCDynamicStoreRemoveWatchedKey (SCDynamicStoreRef store,
180 CFStringRef key,
181 Boolean isRegex,
182 Boolean internal);
183
184 int
185 __SCDynamicStoreSetNotificationKeys (SCDynamicStoreRef store,
186 CFArrayRef keys,
187 CFArrayRef patterns);
188
189 int
190 __SCDynamicStoreCopyNotifiedKeys (SCDynamicStoreRef store,
191 CFArrayRef *notifierKeys);
192
193 int
194 __SCDynamicStoreNotifyMachPort (SCDynamicStoreRef store,
195 mach_msg_id_t msgid,
196 mach_port_t *port);
197
198 int
199 __SCDynamicStoreNotifyFileDescriptor (SCDynamicStoreRef store,
200 int32_t identifier,
201 int *fd);
202
203 int
204 __SCDynamicStoreNotifySignal (SCDynamicStoreRef store,
205 pid_t pid,
206 int sig);
207
208 int
209 __SCDynamicStoreNotifyCancel (SCDynamicStoreRef store);
210
211 void
212 _swapLockedStoreData ();
213
214 void
215 _addWatcher (CFNumberRef sessionNum,
216 CFStringRef watchedKey);
217
218 void
219 _removeWatcher (CFNumberRef sessionNum,
220 CFStringRef watchedKey);
221
222 __END_DECLS
223
224 #endif /* !_S_SCD_H */