]>
git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCPreferencesPath.h
ba887c344befba5763b0e161cdfa4be02b6f5157
2 * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SCPREFERENCESPATH_H
25 #define _SCPREFERENCESPATH_H
27 #include <sys/cdefs.h>
28 #include <CoreFoundation/CoreFoundation.h>
29 #include <SystemConfiguration/SCPreferences.h>
33 @header SCPreferencesPath
34 @discussion The SCPreferencesPath API allows an application to
35 load and store XML configuration data in a controlled
36 manner and provide the necessary notifications to other
37 applications that need to be aware of configuration
40 The functions in the SCPreferencesPath API make certain
41 assumptions about the layout of the preferences data.
42 These functions view the data as a collection of dictionaries
43 of key-value pairs and an associated path name.
44 The root path ("/") identifies the top-level dictionary.
45 Additional path components specify the keys for subdictionaries.
47 For example, the following dictionary can be accessed via
48 two paths. The root ("/") path would return a dictionary
49 with all keys and values. The path "/path1" would only
50 return the dictionary with the "key3" and "key4" properties.
70 Each dictionary can also include the kSCResvLink ("__LINK__") key.
71 The value associated with this key is interpreted as a link to
72 another path. If this key is present, a call to the
73 SCPreferencesPathGetValue function returns the dictionary
74 specified by the link.
81 @function SCPreferencesPathCreateUniqueChild
82 @discussion Creates a new path component within the dictionary
84 @param prefs The preferences session.
85 @param prefix A string that represents the parent path.
86 @result Returns a string representing the new (unique) child path; NULL
87 if the specified path does not exist.
90 SCPreferencesPathCreateUniqueChild (
91 SCPreferencesRef prefs
,
96 @function SCPreferencesPathGetValue
97 @discussion Returns the dictionary associated with the specified
99 @param prefs The preferences session.
100 @param path A string that represents the path to be returned.
101 @result Returns the dictionary associated with the specified path; NULL
102 if the path does not exist.
105 SCPreferencesPathGetValue (
106 SCPreferencesRef prefs
,
111 @function SCPreferencesPathGetLink
112 @discussion Returns the link (if one exists) associated with the
114 @param prefs The preferences session.
115 @param path A string that represents the path to be returned.
116 @result Returns the dictionary associated with the specified path; NULL
117 if the path is not a link or does not exist.
120 SCPreferencesPathGetLink (
121 SCPreferencesRef prefs
,
126 @function SCPreferencesPathSetValue
127 @discussion Associates a dictionary with the specified path.
128 @param prefs The preferences session.
129 @param path A string that represents the path to be updated.
130 @param value A dictionary that represents the data to be
131 stored at the specified path.
132 @result Returns TRUE if successful; FALSE otherwise.
135 SCPreferencesPathSetValue (
136 SCPreferencesRef prefs
,
138 CFDictionaryRef value
142 @function SCPreferencesPathSetLink
143 @discussion Associates a link to a second dictionary at the
145 @param prefs The preferences session.
146 @param path A string that represents the path to be updated.
147 @param link A string that represents the link to be stored
148 at the specified path.
149 @result Returns TRUE if successful; FALSE otherwise.
152 SCPreferencesPathSetLink (
153 SCPreferencesRef prefs
,
159 @function SCPreferencesPathRemoveValue
160 @discussion Removes the data associated with the specified path.
161 @param prefs The preferences session.
162 @param path A string that represents the path to be returned.
163 @result Returns TRUE if successful; FALSE otherwise.
166 SCPreferencesPathRemoveValue (
167 SCPreferencesRef prefs
,
173 #endif /* _SCPREFERENCESPATH_H */