]>
git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCPreferencesPath.h
2 * Copyright (c) 2000, 2001, 2004, 2005, 2008 Apple 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 #ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
26 #include <SystemConfiguration/_SCPreferencesPath.h>
27 #else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
28 #define _SCPREFERENCESPATH_H
30 #include <Availability.h>
31 #include <sys/cdefs.h>
32 #include <CoreFoundation/CoreFoundation.h>
33 #include <SystemConfiguration/SCPreferences.h>
37 @header SCPreferencesPath
38 @discussion The SCPreferencesPath API allows an application to
39 load and store XML configuration data in a controlled
40 manner and provide the necessary notifications to other
41 applications that need to be aware of configuration
44 The functions in the SCPreferencesPath API make certain
45 assumptions about the layout of the preferences data.
46 These functions view the data as a collection of dictionaries
47 of key-value pairs and an associated path name.
48 The root path ("/") identifies the top-level dictionary.
49 Additional path components specify the keys for subdictionaries.
51 For example, the following dictionary can be accessed via
52 two paths. The root ("/") path would return a dictionary
53 with all keys and values. The path "/path1" would only
54 return the dictionary with the "key3" and "key4" properties.
74 Each dictionary can also include the kSCResvLink ("__LINK__") key.
75 The value associated with this key is interpreted as a link to
76 another path. If this key is present, a call to the
77 SCPreferencesPathGetValue function returns the dictionary
78 specified by the link.
85 @function SCPreferencesPathCreateUniqueChild
86 @discussion Creates a new path component within the dictionary
88 @param prefs The preferences session.
89 @param prefix A string that represents the parent path.
90 @result Returns a string representing the new (unique) child path; NULL
91 if the specified path does not exist.
94 SCPreferencesPathCreateUniqueChild (
95 SCPreferencesRef prefs
,
97 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
100 @function SCPreferencesPathGetValue
101 @discussion Returns the dictionary associated with the specified
103 @param prefs The preferences session.
104 @param path A string that represents the path to be returned.
105 @result Returns the dictionary associated with the specified path; NULL
106 if the path does not exist.
109 SCPreferencesPathGetValue (
110 SCPreferencesRef prefs
,
112 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
115 @function SCPreferencesPathGetLink
116 @discussion Returns the link (if one exists) associated with the
118 @param prefs The preferences session.
119 @param path A string that represents the path to be returned.
120 @result Returns the dictionary associated with the specified path; NULL
121 if the path is not a link or does not exist.
124 SCPreferencesPathGetLink (
125 SCPreferencesRef prefs
,
127 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
130 @function SCPreferencesPathSetValue
131 @discussion Associates a dictionary with the specified path.
132 @param prefs The preferences session.
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 Returns TRUE if successful; FALSE otherwise.
139 SCPreferencesPathSetValue (
140 SCPreferencesRef prefs
,
142 CFDictionaryRef value
143 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
146 @function SCPreferencesPathSetLink
147 @discussion Associates a link to a second dictionary at the
149 @param prefs The preferences session.
150 @param path A string that represents the path to be updated.
151 @param link A string that represents the link to be stored
152 at the specified path.
153 @result Returns TRUE if successful; FALSE otherwise.
156 SCPreferencesPathSetLink (
157 SCPreferencesRef prefs
,
160 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
163 @function SCPreferencesPathRemoveValue
164 @discussion Removes the data associated with the specified path.
165 @param prefs The preferences session.
166 @param path A string that represents the path to be returned.
167 @result Returns TRUE if successful; FALSE otherwise.
170 SCPreferencesPathRemoveValue (
171 SCPreferencesRef prefs
,
173 ) __OSX_AVAILABLE_STARTING(__MAC_10_1
,__IPHONE_2_0
/*SPI*/);
177 #endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
178 #endif /* _SCPREFERENCESPATH_H */