/opensource.apple.com/source/configd/configd-135/SystemConfiguration.fproj/SCPrivate.h
C++ Header | 298 lines | 143 code | 28 blank | 127 comment | 0 complexity | fbf6ca32e0f7463742d00b1a0e02d5cd MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0, BSD-3-Clause, GPL-3.0, MPL-2.0, LGPL-2.0, LGPL-2.1, CC-BY-SA-3.0, IPL-1.0, ISC, AGPL-1.0, AGPL-3.0, JSON, Apache-2.0, 0BSD
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>SCPrivate.h</title>
- <style type="text/css">
- .enscript-comment { font-style: italic; color: rgb(178,34,34); }
- .enscript-function-name { font-weight: bold; color: rgb(0,0,255); }
- .enscript-variable-name { font-weight: bold; color: rgb(184,134,11); }
- .enscript-keyword { font-weight: bold; color: rgb(160,32,240); }
- .enscript-reference { font-weight: bold; color: rgb(95,158,160); }
- .enscript-string { font-weight: bold; color: rgb(188,143,143); }
- .enscript-builtin { font-weight: bold; color: rgb(218,112,214); }
- .enscript-type { font-weight: bold; color: rgb(34,139,34); }
- .enscript-highlight { text-decoration: underline; color: 0; }
- </style>
- </head>
- <body id="top">
- <h1 style="margin:8px;" id="f1">SCPrivate.h <span style="font-weight: normal; font-size: 0.5em;">[<a href="?txt">plain text</a>]</span></h1>
- <hr/>
- <div></div>
- <pre>
- <span class="enscript-comment">/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * <a href="http://www.opensource.apple.com/apsl/">http://www.opensource.apple.com/apsl/</a> and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */</span>
- #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">_SCPRIVATE_H</span>
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">_SCPRIVATE_H</span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><sys/cdefs.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><sys/socket.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><sys/syslog.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><mach/message.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><CoreFoundation/CoreFoundation.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><SystemConfiguration/SCDynamicStorePrivate.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><SystemConfiguration/SCDynamicStoreCopySpecificPrivate.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><SystemConfiguration/SCDynamicStoreSetSpecificPrivate.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><SystemConfiguration/SCPreferencesPrivate.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><SystemConfiguration/SCPreferencesGetSpecificPrivate.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><SystemConfiguration/SCPreferencesSetSpecificPrivate.h></span>
- <span class="enscript-comment">/*!
- @header SCPrivate
- */</span>
- <span class="enscript-comment">/* framework variables */</span>
- <span class="enscript-type">extern</span> Boolean _sc_debug; <span class="enscript-comment">/* TRUE if debugging enabled */</span>
- <span class="enscript-type">extern</span> Boolean _sc_verbose; <span class="enscript-comment">/* TRUE if verbose logging enabled */</span>
- <span class="enscript-type">extern</span> Boolean _sc_log; <span class="enscript-comment">/* TRUE if SCLog() output goes to syslog */</span>
- __BEGIN_DECLS
- <span class="enscript-comment">/*!
- @function _SCErrorSet
- @discussion Sets the last SystemConfiguration.framework API error code.
- @param error The error encountered.
- */</span>
- <span class="enscript-type">void</span> _SCErrorSet (<span class="enscript-type">int</span> error);
- <span class="enscript-comment">/*!
- @function _SCSerialize
- @discussion Serialize a CFPropertyList object for passing
- to/from configd.
- @param obj CFPropertyList object to serialize
- @param xml A pointer to a CFDataRef, NULL if data should be
- vm_allocated.
- @param dataRef A pointer to the newly allocated/serialized data
- @param dataLen A pointer to the length in bytes of the newly
- allocated/serialized data
- */</span>
- Boolean _SCSerialize (CFPropertyListRef obj,
- CFDataRef *xml,
- <span class="enscript-type">void</span> **dataRef,
- CFIndex *dataLen);
- <span class="enscript-comment">/*!
- @function _SCUnserialize
- @discussion Unserialize a stream of bytes passed from/to configd
- into a CFPropertyList object.
- @param obj A pointer to memory that will be filled with the CFPropertyList
- associated with the stream of bytes.
- @param xml CFDataRef with the serialized data
- @param dataRef A pointer to the serialized data
- @param dataLen A pointer to the length of the serialized data
- Specify either "xml" or "data/dataLen".
- */</span>
- Boolean _SCUnserialize (CFPropertyListRef *obj,
- CFDataRef xml,
- <span class="enscript-type">void</span> *dataRef,
- CFIndex dataLen);
- <span class="enscript-comment">/*!
- @function _SCSerializeString
- @discussion Serialize a CFString object for passing
- to/from configd.
- @param str CFString key to serialize
- @param data A pointer to a CFDataRef, NULL if storage should be
- vm_allocated.
- @param dataRef A pointer to the newly allocated/serialized data
- @param dataLen A pointer to the length in bytes of the newly
- allocated/serialized data
- */</span>
- Boolean _SCSerializeString (CFStringRef str,
- CFDataRef *data,
- <span class="enscript-type">void</span> **dataRef,
- CFIndex *dataLen);
- <span class="enscript-comment">/*!
- @function _SCUnserializeString
- @discussion Unserialize a stream of bytes passed from/to configd
- into a CFString object.
- @param str A pointer to memory that will be filled with the CFPropertyList
- associated with the stream of bytes.
- @param utf8 CFDataRef with the serialized data
- @param dataRef A pointer to the serialized data
- @param dataLen A pointer to the length of the serialized data
- Specify either "utf8" or "data/dataLen".
- */</span>
- Boolean _SCUnserializeString (CFStringRef *str,
- CFDataRef utf8,
- <span class="enscript-type">void</span> *dataRef,
- CFIndex dataLen);
- <span class="enscript-comment">/*!
- @function _SCSerializeData
- @discussion Serialize a CFData object for passing
- to/from configd.
- @param data CFData key to serialize
- @param dataRef A pointer to the newly allocated/serialized data
- @param dataLen A pointer to the length in bytes of the newly
- allocated/serialized data
- */</span>
- Boolean _SCSerializeData (CFDataRef data,
- <span class="enscript-type">void</span> **dataRef,
- CFIndex *dataLen);
- <span class="enscript-comment">/*!
- @function _SCUnserializeData
- @discussion Unserialize a stream of bytes passed from/to configd
- into a CFData object.
- @param data A pointer to memory that will be filled with the CFPropertyList
- associated with the stream of bytes.
- @param dataRef A pointer to the serialized data
- @param dataLen A pointer to the length of the serialized data
- */</span>
- Boolean _SCUnserializeData (CFDataRef *data,
- <span class="enscript-type">void</span> *dataRef,
- CFIndex dataLen);
- <span class="enscript-comment">/*!
- @function _SCSerializeMultiple
- @discussion Convert a CFDictionary containing a set of CFPropertlyList
- values into a CFDictionary containing a set of serialized CFData
- values.
- @param dict The CFDictionary with CFPropertyList values.
- @result The serialized CFDictionary with CFData values
- */</span>
- CFDictionaryRef _SCSerializeMultiple (CFDictionaryRef dict);
- <span class="enscript-comment">/*!
- @function _SCUnserializeMultiple
- @discussion Convert a CFDictionary containing a set of CFData
- values into a CFDictionary containing a set of serialized
- CFPropertlyList values.
- @param dict The CFDictionary with CFData values.
- @result The serialized CFDictionary with CFPropertyList values
- */</span>
- CFDictionaryRef _SCUnserializeMultiple (CFDictionaryRef dict);
- <span class="enscript-comment">/*!
- @function _SC_cfstring_to_cstring
- @discussion Extracts a C-string from a CFString.
- @param cfstr The CFString to extract the data from.
- @param buf A user provided buffer of the specified length. If NULL,
- a new buffer will be allocated to contain the C-string. It
- is the responsiblity of the caller to free an allocated
- buffer.
- @param bufLen The size of the user provided buffer.
- @param encoding The string encoding
- @result If the extraction (conversion) is successful then a pointer
- to the user provided (or allocated) buffer is returned, NULL
- if the string could not be extracted.
- */</span>
- <span class="enscript-type">char</span> * _SC_cfstring_to_cstring (CFStringRef cfstr,
- <span class="enscript-type">char</span> *buf,
- <span class="enscript-type">int</span> bufLen,
- CFStringEncoding encoding);
- <span class="enscript-comment">/*!
- * @function _SC_sockaddr_to_string
- * @discussion Formats a "struct sockaddr" for reporting
- * @param address The address to format
- * @param buf A user provided buffer of the specified length.
- * @param bufLen The size of the user provided buffer.
- */</span>
- <span class="enscript-type">void</span> _SC_sockaddr_to_string (<span class="enscript-type">const</span> <span class="enscript-type">struct</span> sockaddr *address,
- <span class="enscript-type">char</span> *buf,
- size_t bufLen);
- <span class="enscript-comment">/*!
- @function SCLog
- @discussion Conditionally issue a log message.
- @param condition A boolean value indicating if the message should be logged
- @param level A syslog(3) logging priority.
- @param formatString The format string
- @result The specified message will be written to the system message
- logger (See syslogd(8)).
- */</span>
- <span class="enscript-type">void</span> SCLog (Boolean condition,
- <span class="enscript-type">int</span> level,
- CFStringRef formatString,
- ...);
- <span class="enscript-comment">/*!
- @function SCPrint
- @discussion Conditionally issue a debug message.
- @param condition A boolean value indicating if the message should be written
- @param stream The output stream for the log message.
- @param formatString The format string
- @result The message will be written to the specified stream
- stream.
- */</span>
- <span class="enscript-type">void</span> SCPrint (Boolean condition,
- FILE *stream,
- CFStringRef formatString,
- ...);
- <span class="enscript-comment">/*!
- @function SCTrace
- @discussion Conditionally issue a debug message with a time stamp.
- @param condition A boolean value indicating if the message should be written
- @param stream The output stream for the log message.
- @param formatString The format string
- @result The message will be written to the specified stream
- stream.
- */</span>
- <span class="enscript-type">void</span> SCTrace (Boolean condition,
- FILE *stream,
- CFStringRef formatString,
- ...);
- <span class="enscript-comment">/*
- * object / CFRunLoop management
- */</span>
- <span class="enscript-type">void</span>
- <span class="enscript-function-name">_SC_signalRunLoop</span> (CFTypeRef obj,
- CFRunLoopSourceRef rls,
- CFArrayRef rlList);
- Boolean
- <span class="enscript-function-name">_SC_isScheduled</span> (CFTypeRef obj,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode,
- CFMutableArrayRef rlList);
- <span class="enscript-type">void</span>
- <span class="enscript-function-name">_SC_schedule</span> (CFTypeRef obj,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode,
- CFMutableArrayRef rlList);
- Boolean
- <span class="enscript-function-name">_SC_unschedule</span> (CFTypeRef obj,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode,
- CFMutableArrayRef rlList,
- Boolean all);
- __END_DECLS
- #<span class="enscript-reference">endif</span> <span class="enscript-comment">/* _SCPRIVATE_H */</span>
- </pre>
- <hr />
- </body></html>