2 * Copyright (c) 2000, 2001, 2003-2005, 2007 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 _SCPREFERENCESINTERNAL_H
25 #define _SCPREFERENCESINTERNAL_H
27 #include <sys/types.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <CoreFoundation/CFRuntime.h>
32 #include <SystemConfiguration/SCPreferences.h>
33 #include <SystemConfiguration/SCDynamicStore.h>
36 #define PREFS_DEFAULT_DIR CFSTR("/Library/Preferences/SystemConfiguration")
37 #define PREFS_DEFAULT_CONFIG CFSTR("preferences.plist")
39 #define PREFS_DEFAULT_DIR_OLD CFSTR("/var/db/SystemConfiguration")
40 #define PREFS_DEFAULT_CONFIG_OLD CFSTR("preferences.xml")
42 #define PREFS_DEFAULT_USER_DIR CFSTR("Library/Preferences")
45 /* Define the per-preference-handle structure */
48 /* base CFType information */
60 /* configuration file */
64 /* preferences lock, lock file */
69 /* configuration file signature */
73 SCDynamicStoreRef session
;
75 /* configd session keys */
76 CFStringRef sessionKeyCommit
;
77 CFStringRef sessionKeyApply
;
79 /* run loop source, callout, context, rl scheduling info */
80 CFRunLoopSourceRef rls
;
81 SCPreferencesCallBack rlsFunction
;
82 SCPreferencesContext rlsContext
;
83 CFMutableArrayRef rlList
;
86 CFMutableDictionaryRef prefs
;
93 /* authorization, helper */
94 CFDataRef authorizationData
;
97 } SCPreferencesPrivate
, *SCPreferencesPrivateRef
;
100 /* Define signature data */
102 dev_t st_dev
; /* inode's device */
103 ino_t st_ino
; /* inode's number */
104 struct timespec st_mtimespec
; /* time of last data modification */
105 off_t st_size
; /* file size, in bytes */
106 } SCPSignatureData
, *SCPSignatureDataRef
;
112 __SCPreferencesCreate_helper (SCPreferencesRef prefs
);
115 __SCPreferencesAccess (SCPreferencesRef prefs
);
118 __SCPreferencesAddSession (SCPreferencesRef prefs
);
121 __SCPSignatureFromStatbuf (const struct stat
*statBuf
);
124 __SCPreferencesPath (CFAllocatorRef allocator
,
126 Boolean useNewPrefs
);
129 _SCPNotificationKey (CFAllocatorRef allocator
,
135 #endif /* _SCPREFERENCESINTERNAL_H */