2  * Copyright (c) 2000, 2001, 2003-2005, 2007-2011 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> 
  34 #include <dispatch/dispatch.h> 
  37 #define PREFS_DEFAULT_DIR               CFSTR("/Library/Preferences/SystemConfiguration") 
  38 #define PREFS_DEFAULT_CONFIG            CFSTR("preferences.plist") 
  40 #define PREFS_DEFAULT_DIR_OLD           CFSTR("/var/db/SystemConfiguration") 
  41 #define PREFS_DEFAULT_CONFIG_OLD        CFSTR("preferences.xml") 
  43 #define PREFS_DEFAULT_USER_DIR          CFSTR("Library/Preferences") 
  46 /* Define the per-preference-handle structure */ 
  49         /* base CFType information */ 
  62         CFDictionaryRef         options
; 
  64         /* configuration file */ 
  68         /* preferences lock, lock file */ 
  72         struct timeval          lockTime
; 
  74         /* configuration file signature */ 
  78         SCDynamicStoreRef       session
; 
  80         /* configd session keys */ 
  81         CFStringRef             sessionKeyLock
; 
  82         CFStringRef             sessionKeyCommit
; 
  83         CFStringRef             sessionKeyApply
; 
  85         /* run loop source, callout, context, rl scheduling info */ 
  87         CFRunLoopSourceRef      rls
; 
  88         SCPreferencesCallBack   rlsFunction
; 
  89         SCPreferencesContext    rlsContext
; 
  90         CFMutableArrayRef       rlList
; 
  91         dispatch_queue_t        dispatchQueue
;          // SCPreferencesSetDispatchQueue 
  94         CFMutableDictionaryRef  prefs
; 
 101         /* authorization, helper */ 
 102         CFDataRef               authorizationData
; 
 103         mach_port_t             helper_port
; 
 105 } SCPreferencesPrivate
, *SCPreferencesPrivateRef
; 
 108 /* Define signature data */ 
 110         int64_t         st_dev
;         /* inode's device */ 
 111         uint64_t        st_ino
;         /* inode's number */ 
 112         uint64_t        tv_sec
;         /* time of last data modification */ 
 114         off_t           st_size
;        /* file size, in bytes */ 
 115 } SCPSignatureData
, *SCPSignatureDataRef
; 
 121 __SCPreferencesCreate_helper            (SCPreferencesRef       prefs
); 
 124 __SCPreferencesAccess                   (SCPreferencesRef       prefs
); 
 127 __SCPreferencesAddSession               (SCPreferencesRef       prefs
); 
 130 __SCPSignatureFromStatbuf               (const struct stat      
*statBuf
); 
 133 __SCPreferencesPath                     (CFAllocatorRef         allocator
, 
 135                                          Boolean                useNewPrefs
); 
 138 _SCPNotificationKey                     (CFAllocatorRef         allocator
, 
 144 #endif /* _SCPREFERENCESINTERNAL_H */