]>
Commit | Line | Data |
---|---|---|
5958d7c0 | 1 | /* |
edebe297 | 2 | * Copyright (c) 2000, 2001, 2003, 2004, 2006 Apple Computer, Inc. All rights reserved. |
5958d7c0 A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
009ee3c6 | 5 | * |
009ee3c6 A |
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 | |
5958d7c0 A |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
009ee3c6 A |
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 | * | |
5958d7c0 A |
21 | * @APPLE_LICENSE_HEADER_END@ |
22 | */ | |
23 | ||
0fae82ee A |
24 | /* |
25 | * Modification History | |
26 | * | |
27 | * June 1, 2001 Allan Nathanson <ajn@apple.com> | |
28 | * - public API conversion | |
29 | * | |
dbf6a266 | 30 | * June 2, 2000 Allan Nathanson <ajn@apple.com> |
0fae82ee A |
31 | * - initial revision |
32 | */ | |
33 | ||
5958d7c0 A |
34 | |
35 | #ifndef _S_SCD_H | |
36 | #define _S_SCD_H | |
37 | ||
38 | #include <sys/cdefs.h> | |
39 | ||
40 | ||
41 | /* | |
0fae82ee | 42 | * keys in the "storeData" dictionary |
5958d7c0 A |
43 | */ |
44 | ||
45 | /* | |
46 | * data associated with a key | |
47 | */ | |
48 | #define kSCDData CFSTR("data") | |
5958d7c0 A |
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") | |
5958d7c0 A |
74 | /* |
75 | * keys which are to be removed when the session is closed | |
76 | */ | |
77 | #define kSCDSessionKeys CFSTR("sessionKeys") | |
78 | ||
79 | ||
0fae82ee A |
80 | extern int storeLocked; |
81 | extern CFMutableDictionaryRef storeData; | |
5958d7c0 | 82 | extern CFMutableDictionaryRef sessionData; |
009ee3c6 | 83 | extern CFMutableDictionaryRef patternData; |
5958d7c0 A |
84 | extern CFMutableSetRef changedKeys; |
85 | extern CFMutableSetRef deferredRemovals; | |
86 | extern CFMutableSetRef removedSessionKeys; | |
87 | extern CFMutableSetRef needsNotification; | |
88 | ||
0fae82ee | 89 | extern CFMutableDictionaryRef storeData_s; |
009ee3c6 | 90 | extern CFMutableDictionaryRef patternData_s; |
5958d7c0 A |
91 | extern CFMutableSetRef changedKeys_s; |
92 | extern CFMutableSetRef deferredRemovals_s; | |
93 | extern CFMutableSetRef removedSessionKeys_s; | |
94 | ||
5958d7c0 A |
95 | |
96 | __BEGIN_DECLS | |
97 | ||
0fae82ee A |
98 | int |
99 | __SCDynamicStoreOpen (SCDynamicStoreRef *store, | |
100 | CFStringRef name); | |
101 | int | |
009ee3c6 A |
102 | __SCDynamicStoreClose (SCDynamicStoreRef *store, |
103 | Boolean internal); | |
0fae82ee A |
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, | |
dbf6a266 A |
122 | CFDataRef value, |
123 | Boolean internal); | |
0fae82ee A |
124 | |
125 | int | |
126 | __SCDynamicStoreCopyValue (SCDynamicStoreRef store, | |
127 | CFStringRef key, | |
009ee3c6 A |
128 | CFDataRef *value, |
129 | Boolean internal); | |
130 | ||
131 | int | |
132 | __SCDynamicStoreCopyMultiple (SCDynamicStoreRef store, | |
133 | CFArrayRef keys, | |
134 | CFArrayRef patterns, | |
135 | CFDictionaryRef *values); | |
0fae82ee A |
136 | |
137 | int | |
138 | __SCDynamicStoreSetValue (SCDynamicStoreRef store, | |
139 | CFStringRef key, | |
009ee3c6 A |
140 | CFDataRef value, |
141 | Boolean internal); | |
142 | ||
143 | int | |
144 | __SCDynamicStoreSetMultiple (SCDynamicStoreRef store, | |
145 | CFDictionaryRef keysToSet, | |
146 | CFArrayRef keysToRemove, | |
147 | CFArrayRef keysToNotify); | |
0fae82ee A |
148 | |
149 | int | |
150 | __SCDynamicStoreRemoveValue (SCDynamicStoreRef store, | |
009ee3c6 A |
151 | CFStringRef key, |
152 | Boolean internal); | |
0fae82ee A |
153 | |
154 | int | |
155 | __SCDynamicStoreTouchValue (SCDynamicStoreRef store, | |
156 | CFStringRef key); | |
157 | ||
158 | int | |
159 | __SCDynamicStoreNotifyValue (SCDynamicStoreRef store, | |
009ee3c6 A |
160 | CFStringRef key, |
161 | Boolean internal); | |
0fae82ee A |
162 | |
163 | int | |
164 | __SCDynamicStoreSnapshot (SCDynamicStoreRef store); | |
165 | ||
166 | int | |
167 | __SCDynamicStoreAddWatchedKey (SCDynamicStoreRef store, | |
168 | CFStringRef key, | |
009ee3c6 A |
169 | Boolean isRegex, |
170 | Boolean internal); | |
0fae82ee A |
171 | |
172 | int | |
173 | __SCDynamicStoreRemoveWatchedKey (SCDynamicStoreRef store, | |
174 | CFStringRef key, | |
009ee3c6 A |
175 | Boolean isRegex, |
176 | Boolean internal); | |
177 | ||
178 | int | |
179 | __SCDynamicStoreSetNotificationKeys (SCDynamicStoreRef store, | |
180 | CFArrayRef keys, | |
181 | CFArrayRef patterns); | |
0fae82ee A |
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 | |
edebe297 | 206 | _swapLockedStoreData (void); |
0fae82ee A |
207 | |
208 | void | |
209 | _addWatcher (CFNumberRef sessionNum, | |
210 | CFStringRef watchedKey); | |
211 | ||
0fae82ee A |
212 | void |
213 | _removeWatcher (CFNumberRef sessionNum, | |
214 | CFStringRef watchedKey); | |
215 | ||
dbf6a266 | 216 | void |
edebe297 | 217 | pushNotifications (void); |
dbf6a266 | 218 | |
5958d7c0 A |
219 | __END_DECLS |
220 | ||
221 | #endif /* !_S_SCD_H */ |