]> git.saurik.com Git - apple/configd.git/blob - configd.tproj/_SCD.h
configd-802.20.7.tar.gz
[apple/configd.git] / configd.tproj / _SCD.h
1 /*
2 * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2009, 2011, 2015 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 /*
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 CFMutableDictionaryRef storeData;
81 extern CFMutableDictionaryRef sessionData;
82 extern CFMutableDictionaryRef patternData;
83 extern CFMutableSetRef changedKeys;
84 extern CFMutableSetRef deferredRemovals;
85 extern CFMutableSetRef removedSessionKeys;
86 extern CFMutableSetRef needsNotification;
87
88
89 __BEGIN_DECLS
90
91 int
92 __SCDynamicStoreOpen (SCDynamicStoreRef *store,
93 CFStringRef name);
94 int
95 __SCDynamicStoreClose (SCDynamicStoreRef *store);
96
97 int
98 __SCDynamicStorePush (void);
99
100 int
101 __SCDynamicStoreCopyKeyList (SCDynamicStoreRef store,
102 CFStringRef prefix,
103 Boolean isRegex,
104 CFArrayRef *subKeys);
105
106 int
107 __SCDynamicStoreAddValue (SCDynamicStoreRef store,
108 CFStringRef key,
109 CFDataRef value);
110
111 int
112 __SCDynamicStoreCopyValue (SCDynamicStoreRef store,
113 CFStringRef key,
114 CFDataRef *value,
115 Boolean internal);
116
117 int
118 __SCDynamicStoreCopyMultiple (SCDynamicStoreRef store,
119 CFArrayRef keys,
120 CFArrayRef patterns,
121 CFDictionaryRef *values);
122
123 int
124 __SCDynamicStoreSetValue (SCDynamicStoreRef store,
125 CFStringRef key,
126 CFDataRef value,
127 Boolean internal);
128
129 int
130 __SCDynamicStoreSetMultiple (SCDynamicStoreRef store,
131 CFDictionaryRef keysToSet,
132 CFArrayRef keysToRemove,
133 CFArrayRef keysToNotify);
134
135 int
136 __SCDynamicStoreRemoveValue (SCDynamicStoreRef store,
137 CFStringRef key,
138 Boolean internal);
139
140 int
141 __SCDynamicStoreNotifyValue (SCDynamicStoreRef store,
142 CFStringRef key,
143 Boolean internal);
144
145 int
146 __SCDynamicStoreSnapshot (SCDynamicStoreRef store);
147
148 int
149 __SCDynamicStoreAddWatchedKey (SCDynamicStoreRef store,
150 CFStringRef key,
151 Boolean isRegex,
152 Boolean internal);
153
154 int
155 __SCDynamicStoreRemoveWatchedKey (SCDynamicStoreRef store,
156 CFStringRef key,
157 Boolean isRegex,
158 Boolean internal);
159
160 int
161 __SCDynamicStoreSetNotificationKeys (SCDynamicStoreRef store,
162 CFArrayRef keys,
163 CFArrayRef patterns);
164
165 int
166 __SCDynamicStoreCopyNotifiedKeys (SCDynamicStoreRef store,
167 CFArrayRef *notifierKeys);
168
169 int
170 __SCDynamicStoreNotifyMachPort (SCDynamicStoreRef store,
171 mach_msg_id_t msgid,
172 mach_port_t port);
173
174 int
175 __SCDynamicStoreNotifyFileDescriptor (SCDynamicStoreRef store);
176
177 int
178 __SCDynamicStoreNotifySignal (SCDynamicStoreRef store,
179 pid_t pid,
180 int sig);
181
182 int
183 __SCDynamicStoreNotifyCancel (SCDynamicStoreRef store);
184
185 void
186 _addWatcher (CFNumberRef sessionNum,
187 CFStringRef watchedKey);
188
189 void
190 _removeWatcher (CFNumberRef sessionNum,
191 CFStringRef watchedKey);
192
193 void
194 pushNotifications (FILE *_configd_trace);
195
196 __END_DECLS
197
198 #endif /* !_S_SCD_H */