PageRenderTime 56ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title>SCPrivate.h</title>
  6. <style type="text/css">
  7. .enscript-comment { font-style: italic; color: rgb(178,34,34); }
  8. .enscript-function-name { font-weight: bold; color: rgb(0,0,255); }
  9. .enscript-variable-name { font-weight: bold; color: rgb(184,134,11); }
  10. .enscript-keyword { font-weight: bold; color: rgb(160,32,240); }
  11. .enscript-reference { font-weight: bold; color: rgb(95,158,160); }
  12. .enscript-string { font-weight: bold; color: rgb(188,143,143); }
  13. .enscript-builtin { font-weight: bold; color: rgb(218,112,214); }
  14. .enscript-type { font-weight: bold; color: rgb(34,139,34); }
  15. .enscript-highlight { text-decoration: underline; color: 0; }
  16. </style>
  17. </head>
  18. <body id="top">
  19. <h1 style="margin:8px;" id="f1">SCPrivate.h&nbsp;&nbsp;&nbsp;<span style="font-weight: normal; font-size: 0.5em;">[<a href="?txt">plain text</a>]</span></h1>
  20. <hr/>
  21. <div></div>
  22. <pre>
  23. <span class="enscript-comment">/*
  24. * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
  25. *
  26. * @APPLE_LICENSE_HEADER_START@
  27. *
  28. * This file contains Original Code and/or Modifications of Original Code
  29. * as defined in and that are subject to the Apple Public Source License
  30. * Version 2.0 (the 'License'). You may not use this file except in
  31. * compliance with the License. Please obtain a copy of the License at
  32. * <a href="http://www.opensource.apple.com/apsl/">http://www.opensource.apple.com/apsl/</a> and read it before using this
  33. * file.
  34. *
  35. * The Original Code and all software distributed under the License are
  36. * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  37. * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  38. * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  39. * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  40. * Please see the License for the specific language governing rights and
  41. * limitations under the License.
  42. *
  43. * @APPLE_LICENSE_HEADER_END@
  44. */</span>
  45. #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">_SCPRIVATE_H</span>
  46. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">_SCPRIVATE_H</span>
  47. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;sys/cdefs.h&gt;</span>
  48. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;sys/socket.h&gt;</span>
  49. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;sys/syslog.h&gt;</span>
  50. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;mach/message.h&gt;</span>
  51. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;CoreFoundation/CoreFoundation.h&gt;</span>
  52. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;SystemConfiguration/SCDynamicStorePrivate.h&gt;</span>
  53. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;SystemConfiguration/SCDynamicStoreCopySpecificPrivate.h&gt;</span>
  54. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;SystemConfiguration/SCDynamicStoreSetSpecificPrivate.h&gt;</span>
  55. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;SystemConfiguration/SCPreferencesPrivate.h&gt;</span>
  56. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;SystemConfiguration/SCPreferencesGetSpecificPrivate.h&gt;</span>
  57. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;SystemConfiguration/SCPreferencesSetSpecificPrivate.h&gt;</span>
  58. <span class="enscript-comment">/*!
  59. @header SCPrivate
  60. */</span>
  61. <span class="enscript-comment">/* framework variables */</span>
  62. <span class="enscript-type">extern</span> Boolean _sc_debug; <span class="enscript-comment">/* TRUE if debugging enabled */</span>
  63. <span class="enscript-type">extern</span> Boolean _sc_verbose; <span class="enscript-comment">/* TRUE if verbose logging enabled */</span>
  64. <span class="enscript-type">extern</span> Boolean _sc_log; <span class="enscript-comment">/* TRUE if SCLog() output goes to syslog */</span>
  65. __BEGIN_DECLS
  66. <span class="enscript-comment">/*!
  67. @function _SCErrorSet
  68. @discussion Sets the last SystemConfiguration.framework API error code.
  69. @param error The error encountered.
  70. */</span>
  71. <span class="enscript-type">void</span> _SCErrorSet (<span class="enscript-type">int</span> error);
  72. <span class="enscript-comment">/*!
  73. @function _SCSerialize
  74. @discussion Serialize a CFPropertyList object for passing
  75. to/from configd.
  76. @param obj CFPropertyList object to serialize
  77. @param xml A pointer to a CFDataRef, NULL if data should be
  78. vm_allocated.
  79. @param dataRef A pointer to the newly allocated/serialized data
  80. @param dataLen A pointer to the length in bytes of the newly
  81. allocated/serialized data
  82. */</span>
  83. Boolean _SCSerialize (CFPropertyListRef obj,
  84. CFDataRef *xml,
  85. <span class="enscript-type">void</span> **dataRef,
  86. CFIndex *dataLen);
  87. <span class="enscript-comment">/*!
  88. @function _SCUnserialize
  89. @discussion Unserialize a stream of bytes passed from/to configd
  90. into a CFPropertyList object.
  91. @param obj A pointer to memory that will be filled with the CFPropertyList
  92. associated with the stream of bytes.
  93. @param xml CFDataRef with the serialized data
  94. @param dataRef A pointer to the serialized data
  95. @param dataLen A pointer to the length of the serialized data
  96. Specify either &quot;xml&quot; or &quot;data/dataLen&quot;.
  97. */</span>
  98. Boolean _SCUnserialize (CFPropertyListRef *obj,
  99. CFDataRef xml,
  100. <span class="enscript-type">void</span> *dataRef,
  101. CFIndex dataLen);
  102. <span class="enscript-comment">/*!
  103. @function _SCSerializeString
  104. @discussion Serialize a CFString object for passing
  105. to/from configd.
  106. @param str CFString key to serialize
  107. @param data A pointer to a CFDataRef, NULL if storage should be
  108. vm_allocated.
  109. @param dataRef A pointer to the newly allocated/serialized data
  110. @param dataLen A pointer to the length in bytes of the newly
  111. allocated/serialized data
  112. */</span>
  113. Boolean _SCSerializeString (CFStringRef str,
  114. CFDataRef *data,
  115. <span class="enscript-type">void</span> **dataRef,
  116. CFIndex *dataLen);
  117. <span class="enscript-comment">/*!
  118. @function _SCUnserializeString
  119. @discussion Unserialize a stream of bytes passed from/to configd
  120. into a CFString object.
  121. @param str A pointer to memory that will be filled with the CFPropertyList
  122. associated with the stream of bytes.
  123. @param utf8 CFDataRef with the serialized data
  124. @param dataRef A pointer to the serialized data
  125. @param dataLen A pointer to the length of the serialized data
  126. Specify either &quot;utf8&quot; or &quot;data/dataLen&quot;.
  127. */</span>
  128. Boolean _SCUnserializeString (CFStringRef *str,
  129. CFDataRef utf8,
  130. <span class="enscript-type">void</span> *dataRef,
  131. CFIndex dataLen);
  132. <span class="enscript-comment">/*!
  133. @function _SCSerializeData
  134. @discussion Serialize a CFData object for passing
  135. to/from configd.
  136. @param data CFData key to serialize
  137. @param dataRef A pointer to the newly allocated/serialized data
  138. @param dataLen A pointer to the length in bytes of the newly
  139. allocated/serialized data
  140. */</span>
  141. Boolean _SCSerializeData (CFDataRef data,
  142. <span class="enscript-type">void</span> **dataRef,
  143. CFIndex *dataLen);
  144. <span class="enscript-comment">/*!
  145. @function _SCUnserializeData
  146. @discussion Unserialize a stream of bytes passed from/to configd
  147. into a CFData object.
  148. @param data A pointer to memory that will be filled with the CFPropertyList
  149. associated with the stream of bytes.
  150. @param dataRef A pointer to the serialized data
  151. @param dataLen A pointer to the length of the serialized data
  152. */</span>
  153. Boolean _SCUnserializeData (CFDataRef *data,
  154. <span class="enscript-type">void</span> *dataRef,
  155. CFIndex dataLen);
  156. <span class="enscript-comment">/*!
  157. @function _SCSerializeMultiple
  158. @discussion Convert a CFDictionary containing a set of CFPropertlyList
  159. values into a CFDictionary containing a set of serialized CFData
  160. values.
  161. @param dict The CFDictionary with CFPropertyList values.
  162. @result The serialized CFDictionary with CFData values
  163. */</span>
  164. CFDictionaryRef _SCSerializeMultiple (CFDictionaryRef dict);
  165. <span class="enscript-comment">/*!
  166. @function _SCUnserializeMultiple
  167. @discussion Convert a CFDictionary containing a set of CFData
  168. values into a CFDictionary containing a set of serialized
  169. CFPropertlyList values.
  170. @param dict The CFDictionary with CFData values.
  171. @result The serialized CFDictionary with CFPropertyList values
  172. */</span>
  173. CFDictionaryRef _SCUnserializeMultiple (CFDictionaryRef dict);
  174. <span class="enscript-comment">/*!
  175. @function _SC_cfstring_to_cstring
  176. @discussion Extracts a C-string from a CFString.
  177. @param cfstr The CFString to extract the data from.
  178. @param buf A user provided buffer of the specified length. If NULL,
  179. a new buffer will be allocated to contain the C-string. It
  180. is the responsiblity of the caller to free an allocated
  181. buffer.
  182. @param bufLen The size of the user provided buffer.
  183. @param encoding The string encoding
  184. @result If the extraction (conversion) is successful then a pointer
  185. to the user provided (or allocated) buffer is returned, NULL
  186. if the string could not be extracted.
  187. */</span>
  188. <span class="enscript-type">char</span> * _SC_cfstring_to_cstring (CFStringRef cfstr,
  189. <span class="enscript-type">char</span> *buf,
  190. <span class="enscript-type">int</span> bufLen,
  191. CFStringEncoding encoding);
  192. <span class="enscript-comment">/*!
  193. * @function _SC_sockaddr_to_string
  194. * @discussion Formats a &quot;struct sockaddr&quot; for reporting
  195. * @param address The address to format
  196. * @param buf A user provided buffer of the specified length.
  197. * @param bufLen The size of the user provided buffer.
  198. */</span>
  199. <span class="enscript-type">void</span> _SC_sockaddr_to_string (<span class="enscript-type">const</span> <span class="enscript-type">struct</span> sockaddr *address,
  200. <span class="enscript-type">char</span> *buf,
  201. size_t bufLen);
  202. <span class="enscript-comment">/*!
  203. @function SCLog
  204. @discussion Conditionally issue a log message.
  205. @param condition A boolean value indicating if the message should be logged
  206. @param level A syslog(3) logging priority.
  207. @param formatString The format string
  208. @result The specified message will be written to the system message
  209. logger (See syslogd(8)).
  210. */</span>
  211. <span class="enscript-type">void</span> SCLog (Boolean condition,
  212. <span class="enscript-type">int</span> level,
  213. CFStringRef formatString,
  214. ...);
  215. <span class="enscript-comment">/*!
  216. @function SCPrint
  217. @discussion Conditionally issue a debug message.
  218. @param condition A boolean value indicating if the message should be written
  219. @param stream The output stream for the log message.
  220. @param formatString The format string
  221. @result The message will be written to the specified stream
  222. stream.
  223. */</span>
  224. <span class="enscript-type">void</span> SCPrint (Boolean condition,
  225. FILE *stream,
  226. CFStringRef formatString,
  227. ...);
  228. <span class="enscript-comment">/*!
  229. @function SCTrace
  230. @discussion Conditionally issue a debug message with a time stamp.
  231. @param condition A boolean value indicating if the message should be written
  232. @param stream The output stream for the log message.
  233. @param formatString The format string
  234. @result The message will be written to the specified stream
  235. stream.
  236. */</span>
  237. <span class="enscript-type">void</span> SCTrace (Boolean condition,
  238. FILE *stream,
  239. CFStringRef formatString,
  240. ...);
  241. <span class="enscript-comment">/*
  242. * object / CFRunLoop management
  243. */</span>
  244. <span class="enscript-type">void</span>
  245. <span class="enscript-function-name">_SC_signalRunLoop</span> (CFTypeRef obj,
  246. CFRunLoopSourceRef rls,
  247. CFArrayRef rlList);
  248. Boolean
  249. <span class="enscript-function-name">_SC_isScheduled</span> (CFTypeRef obj,
  250. CFRunLoopRef runLoop,
  251. CFStringRef runLoopMode,
  252. CFMutableArrayRef rlList);
  253. <span class="enscript-type">void</span>
  254. <span class="enscript-function-name">_SC_schedule</span> (CFTypeRef obj,
  255. CFRunLoopRef runLoop,
  256. CFStringRef runLoopMode,
  257. CFMutableArrayRef rlList);
  258. Boolean
  259. <span class="enscript-function-name">_SC_unschedule</span> (CFTypeRef obj,
  260. CFRunLoopRef runLoop,
  261. CFStringRef runLoopMode,
  262. CFMutableArrayRef rlList,
  263. Boolean all);
  264. __END_DECLS
  265. #<span class="enscript-reference">endif</span> <span class="enscript-comment">/* _SCPRIVATE_H */</span>
  266. </pre>
  267. <hr />
  268. </body></html>