]>
git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCPreferencesPath.h
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef _SCPREFERENCESPATH_H
24 #define _SCPREFERENCESPATH_H
26 #include <sys/cdefs.h>
27 #include <CoreFoundation/CoreFoundation.h>
28 #include <SystemConfiguration/SCPreferences.h>
32 @header SCPreferencesPath
33 The SCPreferencesPathXXX() APIs allow an application to
34 load and store XML configuration data in a controlled
35 manner and provide the necessary notifications to other
36 applications that need to be aware of configuration
39 The SCPreferencesPathXXX() APIs make certain assumptions
40 about the layout of the preferences data. These APIs view
41 the data as a collection of dictionaries of key/value pairs
42 and an associated path name. The root path ("/") identifies
43 the top-level dictionary. Additional path components
44 specify the keys for sub-dictionaries.
46 For example, the following dictionary can be accessed via
47 two paths. The root ("/") path would return a dictionary
48 with all keys and values. The path "/path1" would only
49 return the dictionary with the "key3" and "key4" properties.
53 <BR> <key>key1</key>
54 <BR> <string>val1</string>
55 <BR> <key>key2</key>
56 <BR> <string>val2</string>
57 <BR> <key>path1</key>
59 <BR> <key>key3</key>
60 <BR> <string>val3</string>
61 <BR> <key>key4</key>
62 <BR> <string>val4</string>
67 Each dictionary can also include the kSCResvLink key. The
68 value associated with this key is interpreted as a "link" to
69 another path. If this key is present, a call to the
70 SCPreferencesPathGetValue() API will return the dictionary
71 specified by the link.
73 The APIs provided by this framework communicate with the "configd"
74 daemon for any tasks requiring synchronization and/or notification.
81 @function SCPreferencesPathCreateUniqueChild
82 @discussion Creates a new path component within the dictionary
84 @param session The SCPreferencesRef handle that should be used to
85 communicate with the APIs.
86 @param prefix A string that represents the parent path.
87 @result A string representing the new (unique) child path; NULL
88 if the specified path does not exist.
91 SCPreferencesPathCreateUniqueChild (
92 SCPreferencesRef session
,
97 @function SCPreferencesPathGetValue
98 @discussion Returns the dictionary associated with the specified
100 @param session The SCPreferencesRef handle that should be used to
101 communicate with the APIs.
102 @param path A string that represents the path to be returned.
103 @result The dictionary associated with the specified path; NULL
104 if the path does not exist.
107 SCPreferencesPathGetValue (
108 SCPreferencesRef session
,
113 @function SCPreferencesPathGetLink
114 @discussion Returns the link (if one exists) associated with the
116 @param session The SCPreferencesRef handle that should be used to
117 communicate with the APIs.
118 @param path A string that represents the path to be returned.
119 @result The dictionary associated with the specified path; NULL
120 if the path is not a link or does not exist.
123 SCPreferencesPathGetLink (
124 SCPreferencesRef session
,
129 @function SCPreferencesPathSetValue
130 @discussion Associates a dictionary with the specified path.
131 @param session The SCPreferencesRef handle that should be used to
132 communicate with the APIs.
133 @param path A string that represents the path to be updated.
134 @param value A dictionary that represents the data to be
135 stored at the specified path.
136 @result A boolean indicating the success (or failure) of the call.
139 SCPreferencesPathSetValue (
140 SCPreferencesRef session
,
142 CFDictionaryRef value
146 @function SCPreferencesPathSetLink
147 @discussion Associates a link to a second dictionary at the
149 @param session The SCPreferencesRef handle that should be used to
150 communicate with the APIs.
151 @param path A string that represents the path to be updated.
152 @param link A string that represents the link to be stored
153 at the specified path.
154 @result A boolean indicating the success (or failure) of the call.
157 SCPreferencesPathSetLink (
158 SCPreferencesRef session
,
164 @function SCPreferencesPathRemoveValue
165 @discussion Removes the data associated with the specified path.
166 @param session The SCPreferencesRef handle that should be used to
167 communicate with the APIs.
168 @param path A string that represents the path to be returned.
169 @result A boolean indicating the success (or failure) of the call.
172 SCPreferencesPathRemoveValue (
173 SCPreferencesRef session
,
179 #endif /* _SCPREFERENCESPATH_H */