]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCPPath.h
configd-24.1.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCPPath.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 #ifndef _SCPPATH_H
24 #define _SCPPATH_H
25
26 #include <CoreFoundation/CoreFoundation.h>
27 #include <sys/cdefs.h>
28
29 /*!
30 @header SCPPath.h
31 The SystemConfiguration framework provides access to the data used
32 to configure a running system.
33
34 Specifically, the SCPPathXXX() API's allow an application to
35 load and store XML configuration data in a controlled
36 manner and provides the necessary notifications to other
37 applications which need to be aware of configuration
38 changes.
39
40 The SCPPathXXX() API's make certain assumptions about the layout
41 of the preferences data. These APIs view the data as a
42 collection of dictionaries of key/value pairs and an
43 associated path name. The root path ("/") identifies
44 the top-level dictionary. Additional path components
45 specify the keys for sub-dictionaries.
46
47 For example, the following dictionary can be access via
48 two paths. The root ("/") path would return a property
49 list with all keys and values. The path "/path1" would
50 only return the dictionary with the "key3" and "key4"
51 properties.
52
53 <dict>
54 <key>key1</key>
55 <string>val1</string>
56 <key>key2</key>
57 <string>val2</string>
58 <key>path1</key>
59 <dict>
60 <key>key3</key>
61 <string>val3</string>
62 <key>key4</key>
63 <string>val4</string>
64 </dict>
65 </dict>
66
67 The APIs provided by this framework communicate with the "configd"
68 daemon for any tasks requiring synchronization and/or
69 notification.
70 */
71
72
73 __BEGIN_DECLS
74
75 /*!
76 @function SCPPathCreateUniqueChild
77 @discussion Creates a new path component within the dictionary
78 hierarchy.
79 @param session Pass the SCPSessionRef handle which should be used to
80 communicate with the APIs.
81 @param prefix Pass a string which represents the parent path.
82 @param newPath A pointer to memory which will be filled with an
83 string representing the new child path.
84 @result A constant of type SCPStatus indicating the success (or
85 failure) of the call. Possible return values include: SCP_OK,
86 SCP_NOKEY.
87 */
88 SCPStatus SCPPathCreateUniqueChild (SCPSessionRef session,
89 CFStringRef prefix,
90 CFStringRef *newPath);
91
92 /*!
93 @function SCPPathGetValue
94 @discussion Returns the dictionary associated with the specified
95 path.
96 @param session Pass the SCPSessionRef handle which should be used to
97 communicate with the APIs.
98 @param path Pass a string whcih represents the path to be returned.
99 @param value A pointer to memory which will be filled with an
100 dictionary associated with the specified path.
101 @result A constant of type SCPStatus indicating the success (or
102 failure) of the call. Possible return values include: SCP_OK,
103 SCP_NOKEY.
104 */
105 SCPStatus SCPPathGetValue (SCPSessionRef session,
106 CFStringRef path,
107 CFDictionaryRef *value);
108
109 /*!
110 @function SCPPathGetLink
111 @discussion Returns the link (if one exists) associatd with the
112 specified path.
113 @param session Pass the SCPSessionRef handle which should be used to
114 communicate with the APIs.
115 @param path Pass a string whcih represents the path to be returned.
116 @param link A pointer to memory which will be filled with a
117 string reflecting the link found at the specified path.
118 If no link was present at the specified path a status
119 value of SCP_NOKEY will be returned.
120 @result A constant of type SCPStatus indicating the success (or
121 failure) of the call. Possible return values include: SCP_OK,
122 SCP_NOKEY.
123 */
124 SCPStatus SCPPathGetLink (SCPSessionRef session,
125 CFStringRef path,
126 CFStringRef *link);
127
128 /*!
129 @function SCPPathSetValue
130 @discussion Associates a dictionary with the specified path.
131 @param session Pass the SCPSessionRef handle which should be used to
132 communicate with the APIs.
133 @param path Pass a string whcih represents the path to be returned.
134 @param value Pass a dictionary which represents the data to be
135 stored at the specified path.
136 @result A constant of type SCPStatus indicating the success (or
137 failure) of the call. Possible return values include: SCP_OK.
138 */
139 SCPStatus SCPPathSetValue (SCPSessionRef session,
140 CFStringRef path,
141 CFDictionaryRef value);
142
143 /*!
144 @function SCPPathSetLink
145 @discussion Associates a link to a second dictionary at the
146 specified path.
147 @param session Pass the SCPSessionRef handle which should be used to
148 communicate with the APIs.
149 @param path Pass a string whcih represents the path to be returned.
150 @param value Pass a string which represents the path to be stored
151 at the specified path.
152 @result A constant of type SCPStatus indicating the success (or
153 failure) of the call. Possible return values include: SCP_OK,
154 SCP_NOKEY.
155 */
156 SCPStatus SCPPathSetLink (SCPSessionRef session,
157 CFStringRef path,
158 CFStringRef link);
159
160 /*!
161 @function SCPPathRemove
162 @discussion Removes the data associated with the specified path.
163 @param session Pass the SCPSessionRef handle which should be used to
164 communicate with the APIs.
165 @param path Pass a string whcih represents the path to be returned.
166 @result A constant of type SCPStatus indicating the success (or
167 failure) of the call. Possible return values include: SCP_OK,
168 SCP_NOKEY.
169 */
170 SCPStatus SCPPathRemove (SCPSessionRef session,
171 CFStringRef path);
172
173 __END_DECLS
174
175 #endif /* _SCPPATH_H */