WSTypes.pas 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. {
  2. File: OSServices/WSTypes.h
  3. Contains: *** DEPRECATED *** WebServicesCore Method Invocation API
  4. Copyright: (c) 2002-2011 Apple Inc. All rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. {
  10. Modified for use with Free Pascal
  11. Version 308
  12. Please report any bugs to <[email protected]>
  13. }
  14. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  15. {$mode macpas}
  16. {$modeswitch cblocks}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit WSTypes;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  24. {$setc GAP_INTERFACES_VERSION := $0308}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  40. {$setc __ppc64__ := 1}
  41. {$elsec}
  42. {$setc __ppc64__ := 0}
  43. {$endc}
  44. {$ifc not defined __i386__ and defined CPUI386}
  45. {$setc __i386__ := 1}
  46. {$elsec}
  47. {$setc __i386__ := 0}
  48. {$endc}
  49. {$ifc not defined __x86_64__ and defined CPUX86_64}
  50. {$setc __x86_64__ := 1}
  51. {$elsec}
  52. {$setc __x86_64__ := 0}
  53. {$endc}
  54. {$ifc not defined __arm__ and defined CPUARM}
  55. {$setc __arm__ := 1}
  56. {$elsec}
  57. {$setc __arm__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm64__ and defined CPUAARCH64}
  60. {$setc __arm64__ := 1}
  61. {$elsec}
  62. {$setc __arm64__ := 0}
  63. {$endc}
  64. {$ifc defined cpu64}
  65. {$setc __LP64__ := 1}
  66. {$elsec}
  67. {$setc __LP64__ := 0}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  70. {$error Conflicting definitions for __ppc__ and __i386__}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__}
  73. {$setc TARGET_CPU_PPC := TRUE}
  74. {$setc TARGET_CPU_PPC64 := FALSE}
  75. {$setc TARGET_CPU_X86 := FALSE}
  76. {$setc TARGET_CPU_X86_64 := FALSE}
  77. {$setc TARGET_CPU_ARM := FALSE}
  78. {$setc TARGET_CPU_ARM64 := FALSE}
  79. {$setc TARGET_OS_MAC := TRUE}
  80. {$setc TARGET_OS_IPHONE := FALSE}
  81. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  82. {$setc TARGET_OS_EMBEDDED := FALSE}
  83. {$elifc defined __ppc64__ and __ppc64__}
  84. {$setc TARGET_CPU_PPC := FALSE}
  85. {$setc TARGET_CPU_PPC64 := TRUE}
  86. {$setc TARGET_CPU_X86 := FALSE}
  87. {$setc TARGET_CPU_X86_64 := FALSE}
  88. {$setc TARGET_CPU_ARM := FALSE}
  89. {$setc TARGET_CPU_ARM64 := FALSE}
  90. {$setc TARGET_OS_MAC := TRUE}
  91. {$setc TARGET_OS_IPHONE := FALSE}
  92. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  93. {$setc TARGET_OS_EMBEDDED := FALSE}
  94. {$elifc defined __i386__ and __i386__}
  95. {$setc TARGET_CPU_PPC := FALSE}
  96. {$setc TARGET_CPU_PPC64 := FALSE}
  97. {$setc TARGET_CPU_X86 := TRUE}
  98. {$setc TARGET_CPU_X86_64 := FALSE}
  99. {$setc TARGET_CPU_ARM := FALSE}
  100. {$setc TARGET_CPU_ARM64 := FALSE}
  101. {$ifc defined iphonesim}
  102. {$setc TARGET_OS_MAC := FALSE}
  103. {$setc TARGET_OS_IPHONE := TRUE}
  104. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  105. {$elsec}
  106. {$setc TARGET_OS_MAC := TRUE}
  107. {$setc TARGET_OS_IPHONE := FALSE}
  108. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  109. {$endc}
  110. {$setc TARGET_OS_EMBEDDED := FALSE}
  111. {$elifc defined __x86_64__ and __x86_64__}
  112. {$setc TARGET_CPU_PPC := FALSE}
  113. {$setc TARGET_CPU_PPC64 := FALSE}
  114. {$setc TARGET_CPU_X86 := FALSE}
  115. {$setc TARGET_CPU_X86_64 := TRUE}
  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 __arm__ and __arm__}
  129. {$setc TARGET_CPU_PPC := FALSE}
  130. {$setc TARGET_CPU_PPC64 := FALSE}
  131. {$setc TARGET_CPU_X86 := FALSE}
  132. {$setc TARGET_CPU_X86_64 := FALSE}
  133. {$setc TARGET_CPU_ARM := TRUE}
  134. {$setc TARGET_CPU_ARM64 := FALSE}
  135. {$setc TARGET_OS_MAC := FALSE}
  136. {$setc TARGET_OS_IPHONE := TRUE}
  137. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  138. {$setc TARGET_OS_EMBEDDED := TRUE}
  139. {$elifc defined __arm64__ and __arm64__}
  140. {$setc TARGET_CPU_PPC := FALSE}
  141. {$setc TARGET_CPU_PPC64 := FALSE}
  142. {$setc TARGET_CPU_X86 := FALSE}
  143. {$setc TARGET_CPU_X86_64 := FALSE}
  144. {$setc TARGET_CPU_ARM := FALSE}
  145. {$setc TARGET_CPU_ARM64 := TRUE}
  146. {$ifc defined ios}
  147. {$setc TARGET_OS_MAC := FALSE}
  148. {$setc TARGET_OS_IPHONE := TRUE}
  149. {$setc TARGET_OS_EMBEDDED := TRUE}
  150. {$elsec}
  151. {$setc TARGET_OS_MAC := TRUE}
  152. {$setc TARGET_OS_IPHONE := FALSE}
  153. {$setc TARGET_OS_EMBEDDED := FALSE}
  154. {$endc}
  155. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  156. {$elsec}
  157. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  158. {$endc}
  159. {$ifc defined __LP64__ and __LP64__ }
  160. {$setc TARGET_CPU_64 := TRUE}
  161. {$elsec}
  162. {$setc TARGET_CPU_64 := FALSE}
  163. {$endc}
  164. {$ifc defined FPC_BIG_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  167. {$elifc defined FPC_LITTLE_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  170. {$elsec}
  171. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  172. {$endc}
  173. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  174. {$setc CALL_NOT_IN_CARBON := FALSE}
  175. {$setc OLDROUTINENAMES := FALSE}
  176. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  177. {$setc OPAQUE_UPP_TYPES := TRUE}
  178. {$setc OTCARBONAPPLICATION := TRUE}
  179. {$setc OTKERNEL := FALSE}
  180. {$setc PM_USE_SESSION_APIS := TRUE}
  181. {$setc TARGET_API_MAC_CARBON := TRUE}
  182. {$setc TARGET_API_MAC_OS8 := FALSE}
  183. {$setc TARGET_API_MAC_OSX := TRUE}
  184. {$setc TARGET_CARBON := TRUE}
  185. {$setc TARGET_CPU_68K := FALSE}
  186. {$setc TARGET_CPU_MIPS := FALSE}
  187. {$setc TARGET_CPU_SPARC := FALSE}
  188. {$setc TARGET_OS_UNIX := FALSE}
  189. {$setc TARGET_OS_WIN32 := FALSE}
  190. {$setc TARGET_RT_MAC_68881 := FALSE}
  191. {$setc TARGET_RT_MAC_CFM := FALSE}
  192. {$setc TARGET_RT_MAC_MACHO := TRUE}
  193. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  194. {$setc TYPE_BOOL := FALSE}
  195. {$setc TYPE_EXTENDED := FALSE}
  196. {$setc TYPE_LONGLONG := TRUE}
  197. uses MacTypes,CFBase;
  198. {$endc} {not MACOSALLINCLUDE}
  199. {$ifc TARGET_OS_MAC}
  200. {
  201. WSTypes
  202. }
  203. {
  204. WebServicesCore error codes
  205. }
  206. {$ALIGN MAC68K}
  207. const
  208. errWSInternalError = -65793; { An internal framework error }
  209. errWSTransportError = -65794; { A network error occurred }
  210. errWSParseError = -65795; { The server response wasn't valid XML }
  211. errWSTimeoutError = -65796; { The invocation timed out }
  212. {
  213. * WSTypeID
  214. *
  215. * Discussion:
  216. * Internally, WebServicesCore uses the following enumeration when
  217. * serializing between CoreFoundation and XML types. Because CFTypes
  218. * are defined at runtime, it isn't always possible to produce a
  219. * static mapping to a particular CFTypeRef. This enum and
  220. * associated API allows for static determination of the expected
  221. * serialization.
  222. }
  223. type
  224. WSTypeID = SInt32;
  225. const
  226. {
  227. * No mapping is known for this type
  228. }
  229. eWSUnknownType = 0;
  230. {
  231. * CFNullRef
  232. }
  233. eWSNullType = 1;
  234. {
  235. * CFBooleanRef
  236. }
  237. eWSBooleanType = 2;
  238. {
  239. * CFNumberRef for 8, 16, 32 bit integers
  240. }
  241. eWSIntegerType = 3;
  242. {
  243. * CFNumberRef for long double real numbers
  244. }
  245. eWSDoubleType = 4;
  246. {
  247. * CFStringRef
  248. }
  249. eWSStringType = 5;
  250. {
  251. * CFDateRef
  252. }
  253. eWSDateType = 6;
  254. {
  255. * CFDataRef
  256. }
  257. eWSDataType = 7;
  258. {
  259. * CFArrayRef
  260. }
  261. eWSArrayType = 8;
  262. {
  263. * CFDictionaryRef
  264. }
  265. eWSDictionaryType = 9;
  266. type
  267. WSClientContextRetainCallBackProcPtr = function( info: UnivPtr ): UnivPtr;
  268. WSClientContextReleaseCallBackProcPtr = procedure( info: UnivPtr );
  269. WSClientContextCopyDescriptionCallBackProcPtr = function( info: UnivPtr ): CFStringRef;
  270. {
  271. * WSClientContext
  272. *
  273. * Discussion:
  274. * Several calls in WebServicesCore take a callback with an optional
  275. * context pointer. The context is copied and the info pointer
  276. * retained. When the callback is made, the info pointer is passed
  277. * to the callback.
  278. }
  279. type
  280. WSClientContext = record
  281. {
  282. * set to zero (0)
  283. }
  284. version: CFIndex;
  285. {
  286. * info pointer to be passed to the callback
  287. }
  288. info: UnivPtr;
  289. {
  290. * callback made on the info pointer. This field may be NULL.
  291. }
  292. retain: WSClientContextRetainCallBackProcPtr;
  293. {
  294. * callback made on the info pointer. This field may be NULL.
  295. }
  296. release: WSClientContextReleaseCallBackProcPtr;
  297. {
  298. * callback made on the info pointer. This field may be NULL.
  299. }
  300. copyDescription: WSClientContextCopyDescriptionCallBackProcPtr;
  301. end;
  302. {
  303. Web Service protocol types. These constant strings specify the type
  304. of web service method invocation created. These are passed to
  305. WSMethodInvocationCreate.
  306. For information on these service types, see:
  307. XML-RPC: <http://www.xml-rpc.com/spec/>
  308. SOAP 1.1: <http://www.w3.org/TR/SOAP/>
  309. SOAP 1.2: <http://www.w3.org/2002/ws/>
  310. }
  311. var kWSXMLRPCProtocol: CFStringRef; external name '_kWSXMLRPCProtocol'; (* attribute const *)
  312. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_8,__IPHONE_NA,__IPHONE_NA) *)
  313. var kWSSOAP1999Protocol: CFStringRef; external name '_kWSSOAP1999Protocol'; (* attribute const *)
  314. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_8,__IPHONE_NA,__IPHONE_NA) *)
  315. var kWSSOAP2001Protocol: CFStringRef; external name '_kWSSOAP2001Protocol'; (* attribute const *)
  316. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_8,__IPHONE_NA,__IPHONE_NA) *)
  317. {
  318. * WSGetWSTypeIDFromCFType() *** DEPRECATED ***
  319. *
  320. * Discussion:
  321. * Returns the WSTypeID associated with CFTypeRef. There is not a
  322. * one to one mapping between CFTypeID and WSTypesID therefore an
  323. * actual instance of a CFType must be passed.
  324. *
  325. * Mac OS X threading:
  326. * Thread safe
  327. *
  328. * Parameters:
  329. *
  330. * ref:
  331. * a CFTypeRef object
  332. *
  333. * Result:
  334. * the WSTypeID used in serializing the object. If no WSTypeID
  335. * matches, eWSUnknownType is returned.
  336. *
  337. * Availability:
  338. * Mac OS X: in version 10.2 and later but deprecated in 10.8
  339. * CarbonLib: not available
  340. * Non-Carbon CFM: not available
  341. }
  342. function WSGetWSTypeIDFromCFType( ref: CFTypeRef ): WSTypeID; external name '_WSGetWSTypeIDFromCFType';
  343. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_8,__IPHONE_NA,__IPHONE_NA) *)
  344. {
  345. * WSGetCFTypeIDFromWSTypeID() *** DEPRECATED ***
  346. *
  347. * Discussion:
  348. * Returns the CFTypeID that is associated with a given WSTypeID.
  349. * CFTypeIDs are only valid during a particular instance of a
  350. * process and should not be used as static values.
  351. *
  352. * Mac OS X threading:
  353. * Thread safe
  354. *
  355. * Parameters:
  356. *
  357. * typeID:
  358. * a WSTypeID constant
  359. *
  360. * Result:
  361. * a CFTypeID, or 0 if not found
  362. *
  363. * Availability:
  364. * Mac OS X: in version 10.2 and later but deprecated in 10.8
  365. * CarbonLib: not available
  366. * Non-Carbon CFM: not available
  367. }
  368. function WSGetCFTypeIDFromWSTypeID( typeID: WSTypeID ): CFTypeID; external name '_WSGetCFTypeIDFromWSTypeID';
  369. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_8,__IPHONE_NA,__IPHONE_NA) *)
  370. {$endc} {TARGET_OS_MAC}
  371. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  372. end.
  373. {$endc} {not MACOSALLINCLUDE}