]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCPrivate.h
configd-53.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCPrivate.h
1 /*
2 * Copyright (c) 2000-2002 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 _SCPRIVATE_H
24 #define _SCPRIVATE_H
25
26 #include <sys/cdefs.h>
27
28 #include <CoreFoundation/CoreFoundation.h>
29
30 #include <SystemConfiguration/SCDynamicStorePrivate.h>
31 #include <SystemConfiguration/SCDynamicStoreSetSpecificPrivate.h>
32
33 #include <SystemConfiguration/SCPreferencesPrivate.h>
34
35 /* framework variables */
36 extern Boolean _sc_debug; /* TRUE if debugging enabled */
37 extern Boolean _sc_verbose; /* TRUE if verbose logging enabled */
38 extern Boolean _sc_log; /* TRUE if SCLog() output goes to syslog */
39
40 __BEGIN_DECLS
41
42 /*!
43 @function _SCErrorSet
44 @discussion Returns a last SystemConfiguration.framework API error code.
45 @result The last error encountered.
46 */
47 void _SCErrorSet (int error);
48
49 /*
50 @function _SCSerialize
51 @discussion Serialize a CFPropertyList object for passing
52 to/from configd.
53 @param obj CFPropertyList object to serialize
54 @param xml A pointer to a CFDataRef, NULL if data should be
55 vm_allocated.
56 @param data A pointer to the newly allocated/serialized data
57 @param dataLen A pointer to the length in bytes of the newly
58 allocated/serialized data
59 */
60 Boolean _SCSerialize (CFPropertyListRef obj,
61 CFDataRef *xml,
62 void **dataRef,
63 CFIndex *dataLen);
64
65 /*
66 @function _SCUnserialize
67 @discussion Unserialize a stream of bytes passed from/to configd
68 into a CFPropertyList object.
69 @param obj A pointer to memory that will be filled with the CFPropertyList
70 associated with the stream of bytes.
71 @param data A pointer to the serialized data
72 @param dataLen A pointer to the length of the serialized data
73 */
74 Boolean _SCUnserialize (CFPropertyListRef *obj,
75 void *dataRef,
76 CFIndex dataLen);
77
78 /*
79 @function SCLog
80 @discussion Conditionally issue a log message.
81 @param condition A boolean value indicating if the message should be logged
82 @param level A syslog(3) logging priority.
83 @param formatString The format string
84 @result The specified message will be written to the system message
85 logger (See syslogd(8)).
86 */
87 void SCLog (Boolean condition,
88 int level,
89 CFStringRef formatString,
90 ...);
91
92 /*
93 @function SCPrint
94 @discussion Conditionally issue a debug message.
95 @param condition A boolean value indicating if the message should be written
96 @param stream The output stream for the log message.
97 @param formatString The format string
98 @result The specified message will be written to the specified output
99 stream.
100 */
101 void SCPrint (Boolean condition,
102 FILE *stream,
103 CFStringRef formatString,
104 ...);
105
106 __END_DECLS
107
108 #endif /* _SCPRIVATE_H */