DHCPClientPreferences.pas 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. {
  2. * Copyright (c) 2001, 2004, 2005, 2008 Apple Inc. All rights reserved.
  3. *
  4. * @APPLE_LICENSE_HEADER_START@
  5. *
  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
  11. * file.
  12. *
  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.
  20. *
  21. * @APPLE_LICENSE_HEADER_END@
  22. }
  23. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  24. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  25. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  26. {
  27. Modified for use with Free Pascal
  28. Version 308
  29. Please report any bugs to <[email protected]>
  30. }
  31. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  32. {$mode macpas}
  33. {$modeswitch cblocks}
  34. {$packenum 1}
  35. {$macro on}
  36. {$inline on}
  37. {$calling mwpascal}
  38. unit DHCPClientPreferences;
  39. interface
  40. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  41. {$setc GAP_INTERFACES_VERSION := $0308}
  42. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  43. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  44. {$endc}
  45. {$ifc defined CPUPOWERPC and defined CPUI386}
  46. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  47. {$endc}
  48. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  49. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  50. {$endc}
  51. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  52. {$setc __ppc__ := 1}
  53. {$elsec}
  54. {$setc __ppc__ := 0}
  55. {$endc}
  56. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  57. {$setc __ppc64__ := 1}
  58. {$elsec}
  59. {$setc __ppc64__ := 0}
  60. {$endc}
  61. {$ifc not defined __i386__ and defined CPUI386}
  62. {$setc __i386__ := 1}
  63. {$elsec}
  64. {$setc __i386__ := 0}
  65. {$endc}
  66. {$ifc not defined __x86_64__ and defined CPUX86_64}
  67. {$setc __x86_64__ := 1}
  68. {$elsec}
  69. {$setc __x86_64__ := 0}
  70. {$endc}
  71. {$ifc not defined __arm__ and defined CPUARM}
  72. {$setc __arm__ := 1}
  73. {$elsec}
  74. {$setc __arm__ := 0}
  75. {$endc}
  76. {$ifc not defined __arm64__ and defined CPUAARCH64}
  77. {$setc __arm64__ := 1}
  78. {$elsec}
  79. {$setc __arm64__ := 0}
  80. {$endc}
  81. {$ifc defined cpu64}
  82. {$setc __LP64__ := 1}
  83. {$elsec}
  84. {$setc __LP64__ := 0}
  85. {$endc}
  86. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  87. {$error Conflicting definitions for __ppc__ and __i386__}
  88. {$endc}
  89. {$ifc defined __ppc__ and __ppc__}
  90. {$setc TARGET_CPU_PPC := TRUE}
  91. {$setc TARGET_CPU_PPC64 := FALSE}
  92. {$setc TARGET_CPU_X86 := FALSE}
  93. {$setc TARGET_CPU_X86_64 := FALSE}
  94. {$setc TARGET_CPU_ARM := FALSE}
  95. {$setc TARGET_CPU_ARM64 := FALSE}
  96. {$setc TARGET_OS_MAC := TRUE}
  97. {$setc TARGET_OS_IPHONE := FALSE}
  98. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  99. {$setc TARGET_OS_EMBEDDED := FALSE}
  100. {$elifc defined __ppc64__ and __ppc64__}
  101. {$setc TARGET_CPU_PPC := FALSE}
  102. {$setc TARGET_CPU_PPC64 := TRUE}
  103. {$setc TARGET_CPU_X86 := FALSE}
  104. {$setc TARGET_CPU_X86_64 := FALSE}
  105. {$setc TARGET_CPU_ARM := FALSE}
  106. {$setc TARGET_CPU_ARM64 := FALSE}
  107. {$setc TARGET_OS_MAC := TRUE}
  108. {$setc TARGET_OS_IPHONE := FALSE}
  109. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  110. {$setc TARGET_OS_EMBEDDED := FALSE}
  111. {$elifc defined __i386__ and __i386__}
  112. {$setc TARGET_CPU_PPC := FALSE}
  113. {$setc TARGET_CPU_PPC64 := FALSE}
  114. {$setc TARGET_CPU_X86 := TRUE}
  115. {$setc TARGET_CPU_X86_64 := FALSE}
  116. {$setc TARGET_CPU_ARM := FALSE}
  117. {$setc TARGET_CPU_ARM64 := FALSE}
  118. {$ifc defined(iphonesim)}
  119. {$setc TARGET_OS_MAC := FALSE}
  120. {$setc TARGET_OS_IPHONE := TRUE}
  121. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  122. {$elsec}
  123. {$setc TARGET_OS_MAC := TRUE}
  124. {$setc TARGET_OS_IPHONE := FALSE}
  125. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  126. {$endc}
  127. {$setc TARGET_OS_EMBEDDED := FALSE}
  128. {$elifc defined __x86_64__ and __x86_64__}
  129. {$setc TARGET_CPU_PPC := FALSE}
  130. {$setc TARGET_CPU_PPC64 := FALSE}
  131. {$setc TARGET_CPU_X86 := FALSE}
  132. {$setc TARGET_CPU_X86_64 := TRUE}
  133. {$setc TARGET_CPU_ARM := FALSE}
  134. {$setc TARGET_CPU_ARM64 := FALSE}
  135. {$ifc defined(iphonesim)}
  136. {$setc TARGET_OS_MAC := FALSE}
  137. {$setc TARGET_OS_IPHONE := TRUE}
  138. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  139. {$elsec}
  140. {$setc TARGET_OS_MAC := TRUE}
  141. {$setc TARGET_OS_IPHONE := FALSE}
  142. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  143. {$endc}
  144. {$setc TARGET_OS_EMBEDDED := FALSE}
  145. {$elifc defined __arm__ and __arm__}
  146. {$setc TARGET_CPU_PPC := FALSE}
  147. {$setc TARGET_CPU_PPC64 := FALSE}
  148. {$setc TARGET_CPU_X86 := FALSE}
  149. {$setc TARGET_CPU_X86_64 := FALSE}
  150. {$setc TARGET_CPU_ARM := TRUE}
  151. {$setc TARGET_CPU_ARM64 := FALSE}
  152. { will require compiler define when/if other Apple devices with ARM cpus ship }
  153. {$setc TARGET_OS_MAC := FALSE}
  154. {$setc TARGET_OS_IPHONE := TRUE}
  155. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  156. {$setc TARGET_OS_EMBEDDED := TRUE}
  157. {$elifc defined __arm64__ and __arm64__}
  158. {$setc TARGET_CPU_PPC := FALSE}
  159. {$setc TARGET_CPU_PPC64 := FALSE}
  160. {$setc TARGET_CPU_X86 := FALSE}
  161. {$setc TARGET_CPU_X86_64 := FALSE}
  162. {$setc TARGET_CPU_ARM := FALSE}
  163. {$setc TARGET_CPU_ARM64 := TRUE}
  164. { will require compiler define when/if other Apple devices with ARM cpus ship }
  165. {$setc TARGET_OS_MAC := FALSE}
  166. {$setc TARGET_OS_IPHONE := TRUE}
  167. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  168. {$setc TARGET_OS_EMBEDDED := TRUE}
  169. {$elsec}
  170. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  171. {$endc}
  172. {$ifc defined __LP64__ and __LP64__ }
  173. {$setc TARGET_CPU_64 := TRUE}
  174. {$elsec}
  175. {$setc TARGET_CPU_64 := FALSE}
  176. {$endc}
  177. {$ifc defined FPC_BIG_ENDIAN}
  178. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  179. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  180. {$elifc defined FPC_LITTLE_ENDIAN}
  181. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  182. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  183. {$elsec}
  184. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  185. {$endc}
  186. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  187. {$setc CALL_NOT_IN_CARBON := FALSE}
  188. {$setc OLDROUTINENAMES := FALSE}
  189. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  190. {$setc OPAQUE_UPP_TYPES := TRUE}
  191. {$setc OTCARBONAPPLICATION := TRUE}
  192. {$setc OTKERNEL := FALSE}
  193. {$setc PM_USE_SESSION_APIS := TRUE}
  194. {$setc TARGET_API_MAC_CARBON := TRUE}
  195. {$setc TARGET_API_MAC_OS8 := FALSE}
  196. {$setc TARGET_API_MAC_OSX := TRUE}
  197. {$setc TARGET_CARBON := TRUE}
  198. {$setc TARGET_CPU_68K := FALSE}
  199. {$setc TARGET_CPU_MIPS := FALSE}
  200. {$setc TARGET_CPU_SPARC := FALSE}
  201. {$setc TARGET_OS_UNIX := FALSE}
  202. {$setc TARGET_OS_WIN32 := FALSE}
  203. {$setc TARGET_RT_MAC_68881 := FALSE}
  204. {$setc TARGET_RT_MAC_CFM := FALSE}
  205. {$setc TARGET_RT_MAC_MACHO := TRUE}
  206. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  207. {$setc TYPE_BOOL := FALSE}
  208. {$setc TYPE_EXTENDED := FALSE}
  209. {$setc TYPE_LONGLONG := TRUE}
  210. uses MacTypes,CFBase;
  211. {$endc} {not MACOSALLINCLUDE}
  212. {$ifc TARGET_OS_MAC}
  213. {!
  214. @header DHCPClientPreferences
  215. @discussion The DHCPClientPreferences API allows applications to get and update DHCP preferences.
  216. DHCP preferences are in the form of DHCP option codes, which are defined in RFC 2132.
  217. }
  218. {!
  219. @function DHCPClientPreferencesSetApplicationOptions
  220. @discussion Updates the DHCP client preferences to include the
  221. given list of options for the given application ID.
  222. @param applicationID The application's preference ID, for example:
  223. "com.apple.SystemPreferences".
  224. @param options An array of 8-bit values containing the
  225. DHCP option codes (see RFC 2132) for this application ID.
  226. A NULL value will clear the list of options for this
  227. application ID.
  228. @param count The number of elements in the options parameter.
  229. @result Returns TRUE if the operation succeeded, FALSE otherwise.
  230. }
  231. function DHCPClientPreferencesSetApplicationOptions( applicationID: CFStringRef; options: UInt8Ptr; count: CFIndex ): Boolean; external name '_DHCPClientPreferencesSetApplicationOptions';
  232. (* __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA) *)
  233. {!
  234. @function DHCPClientPreferencesCopyApplicationOptions
  235. @discussion Copies the requested DHCP options for the
  236. given application ID.
  237. @param applicationID The application's preference ID, for example
  238. "com.apple.SystemPreferences".
  239. @param count The number of elements in the returned array.
  240. @result Returns the list of options for the given application ID, or
  241. NULL if no options are defined or an error occurred.
  242. When you are finished, use free() to release a non-NULL return value.
  243. }
  244. function DHCPClientPreferencesCopyApplicationOptions( applicationID: CFStringRef; var count: CFIndex ): UInt8Ptr; external name '_DHCPClientPreferencesCopyApplicationOptions';
  245. (* __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA) *)
  246. {$endc} {TARGET_OS_MAC}
  247. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  248. end.
  249. {$endc} {not MACOSALLINCLUDE}