URLAccess.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. {
  2. File: SecurityHI/URLAccess.h
  3. Contains: URL Access Interfaces.
  4. Version: SecurityHI-55002~751
  5. Copyright: © 1994-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. unit URLAccess;
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc not defined __arm64__ and defined CPUAARCH64}
  63. {$setc __arm64__ := 1}
  64. {$elsec}
  65. {$setc __arm64__ := 0}
  66. {$endc}
  67. {$ifc defined cpu64}
  68. {$setc __LP64__ := 1}
  69. {$elsec}
  70. {$setc __LP64__ := 0}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  73. {$error Conflicting definitions for __ppc__ and __i386__}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__}
  76. {$setc TARGET_CPU_PPC := TRUE}
  77. {$setc TARGET_CPU_PPC64 := FALSE}
  78. {$setc TARGET_CPU_X86 := FALSE}
  79. {$setc TARGET_CPU_X86_64 := FALSE}
  80. {$setc TARGET_CPU_ARM := FALSE}
  81. {$setc TARGET_CPU_ARM64 := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __ppc64__ and __ppc64__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := TRUE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_CPU_ARM64 := FALSE}
  93. {$setc TARGET_OS_MAC := TRUE}
  94. {$setc TARGET_OS_IPHONE := FALSE}
  95. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  96. {$setc TARGET_OS_EMBEDDED := FALSE}
  97. {$elifc defined __i386__ and __i386__}
  98. {$setc TARGET_CPU_PPC := FALSE}
  99. {$setc TARGET_CPU_PPC64 := FALSE}
  100. {$setc TARGET_CPU_X86 := TRUE}
  101. {$setc TARGET_CPU_X86_64 := FALSE}
  102. {$setc TARGET_CPU_ARM := FALSE}
  103. {$setc TARGET_CPU_ARM64 := FALSE}
  104. {$ifc defined iphonesim}
  105. {$setc TARGET_OS_MAC := FALSE}
  106. {$setc TARGET_OS_IPHONE := TRUE}
  107. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  108. {$elsec}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$endc}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __x86_64__ and __x86_64__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := TRUE}
  119. {$setc TARGET_CPU_ARM := FALSE}
  120. {$setc TARGET_CPU_ARM64 := FALSE}
  121. {$ifc defined iphonesim}
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  125. {$elsec}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$endc}
  130. {$setc TARGET_OS_EMBEDDED := FALSE}
  131. {$elifc defined __arm__ and __arm__}
  132. {$setc TARGET_CPU_PPC := FALSE}
  133. {$setc TARGET_CPU_PPC64 := FALSE}
  134. {$setc TARGET_CPU_X86 := FALSE}
  135. {$setc TARGET_CPU_X86_64 := FALSE}
  136. {$setc TARGET_CPU_ARM := TRUE}
  137. {$setc TARGET_CPU_ARM64 := FALSE}
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  141. {$setc TARGET_OS_EMBEDDED := TRUE}
  142. {$elifc defined __arm64__ and __arm64__}
  143. {$setc TARGET_CPU_PPC := FALSE}
  144. {$setc TARGET_CPU_PPC64 := FALSE}
  145. {$setc TARGET_CPU_X86 := FALSE}
  146. {$setc TARGET_CPU_X86_64 := FALSE}
  147. {$setc TARGET_CPU_ARM := FALSE}
  148. {$setc TARGET_CPU_ARM64 := TRUE}
  149. {$ifc defined ios}
  150. {$setc TARGET_OS_MAC := FALSE}
  151. {$setc TARGET_OS_IPHONE := TRUE}
  152. {$setc TARGET_OS_EMBEDDED := TRUE}
  153. {$elsec}
  154. {$setc TARGET_OS_MAC := TRUE}
  155. {$setc TARGET_OS_IPHONE := FALSE}
  156. {$setc TARGET_OS_EMBEDDED := FALSE}
  157. {$endc}
  158. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  159. {$elsec}
  160. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  161. {$endc}
  162. {$ifc defined __LP64__ and __LP64__ }
  163. {$setc TARGET_CPU_64 := TRUE}
  164. {$elsec}
  165. {$setc TARGET_CPU_64 := FALSE}
  166. {$endc}
  167. {$ifc defined FPC_BIG_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  170. {$elifc defined FPC_LITTLE_ENDIAN}
  171. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  172. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  173. {$elsec}
  174. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  175. {$endc}
  176. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  177. {$setc CALL_NOT_IN_CARBON := FALSE}
  178. {$setc OLDROUTINENAMES := FALSE}
  179. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  180. {$setc OPAQUE_UPP_TYPES := TRUE}
  181. {$setc OTCARBONAPPLICATION := TRUE}
  182. {$setc OTKERNEL := FALSE}
  183. {$setc PM_USE_SESSION_APIS := TRUE}
  184. {$setc TARGET_API_MAC_CARBON := TRUE}
  185. {$setc TARGET_API_MAC_OS8 := FALSE}
  186. {$setc TARGET_API_MAC_OSX := TRUE}
  187. {$setc TARGET_CARBON := TRUE}
  188. {$setc TARGET_CPU_68K := FALSE}
  189. {$setc TARGET_CPU_MIPS := FALSE}
  190. {$setc TARGET_CPU_SPARC := FALSE}
  191. {$setc TARGET_OS_UNIX := FALSE}
  192. {$setc TARGET_OS_WIN32 := FALSE}
  193. {$setc TARGET_RT_MAC_68881 := FALSE}
  194. {$setc TARGET_RT_MAC_CFM := FALSE}
  195. {$setc TARGET_RT_MAC_MACHO := TRUE}
  196. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  197. {$setc TYPE_BOOL := FALSE}
  198. {$setc TYPE_EXTENDED := FALSE}
  199. {$setc TYPE_LONGLONG := TRUE}
  200. uses MacTypes,Files,CodeFragments,MacErrors,Events;
  201. {$endc} {not MACOSALLINCLUDE}
  202. {$ifc TARGET_OS_MAC}
  203. {$ALIGN MAC68K}
  204. { Data structures and types }
  205. type
  206. URLReference = ^OpaqueURLReference; { an opaque type }
  207. OpaqueURLReference = record end;
  208. URLReferencePtr = ^URLReference; { when a var xx:URLReference parameter can be nil, it is changed to xx: URLReferencePtr }
  209. URLOpenFlags = UInt32;
  210. const
  211. kURLReplaceExistingFlag = 1 shl 0;
  212. kURLBinHexFileFlag = 1 shl 1; { Binhex before uploading if necessary}
  213. kURLExpandFileFlag = 1 shl 2; { Use StuffIt engine to expand file if necessary}
  214. kURLDisplayProgressFlag = 1 shl 3;
  215. kURLDisplayAuthFlag = 1 shl 4; { Display auth dialog if guest connection fails}
  216. kURLUploadFlag = 1 shl 5; { Do an upload instead of a download}
  217. kURLIsDirectoryHintFlag = 1 shl 6; { Hint: the URL is a directory}
  218. kURLDoNotTryAnonymousFlag = 1 shl 7; { Don't try to connect anonymously before getting logon info}
  219. kURLDirectoryListingFlag = 1 shl 8; { Download the directory listing, not the whole directory}
  220. kURLExpandAndVerifyFlag = 1 shl 9; { Expand file and then verify using signature resource}
  221. kURLNoAutoRedirectFlag = 1 shl 10; { Do not automatically redirect to new URL}
  222. kURLDebinhexOnlyFlag = 1 shl 11; { Do not use Stuffit Expander - just internal debinhex engine}
  223. kURLDoNotDeleteOnErrorFlag = 1 shl 12; { Do not delete the downloaded file if an error or abort occurs.}
  224. { This flag applies to downloading only and should be used if}
  225. { interested in later resuming the download.}
  226. kURLResumeDownloadFlag = 1 shl 13; { The passed in file is partially downloaded, attempt to resume}
  227. { it. Currently works for HTTP only. If no FSSpec passed in,}
  228. { this flag will be ignored. Overriden by kURLReplaceExistingFlag. }
  229. kURLReservedFlag = $80000000; { reserved for Apple internal use}
  230. type
  231. URLState = UInt32;
  232. const
  233. kURLNullState = 0;
  234. kURLInitiatingState = 1;
  235. kURLLookingUpHostState = 2;
  236. kURLConnectingState = 3;
  237. kURLResourceFoundState = 4;
  238. kURLDownloadingState = 5;
  239. kURLDataAvailableState = $10 + kURLDownloadingState;
  240. kURLTransactionCompleteState = 6;
  241. kURLErrorOccurredState = 7;
  242. kURLAbortingState = 8;
  243. kURLCompletedState = 9;
  244. kURLUploadingState = 10;
  245. type
  246. URLEvent = UInt32;
  247. const
  248. kURLInitiatedEvent = kURLInitiatingState;
  249. kURLResourceFoundEvent = kURLResourceFoundState;
  250. kURLDownloadingEvent = kURLDownloadingState;
  251. kURLAbortInitiatedEvent = kURLAbortingState;
  252. kURLCompletedEvent = kURLCompletedState;
  253. kURLErrorOccurredEvent = kURLErrorOccurredState;
  254. kURLDataAvailableEvent = kURLDataAvailableState;
  255. kURLTransactionCompleteEvent = kURLTransactionCompleteState;
  256. kURLUploadingEvent = kURLUploadingState;
  257. kURLSystemEvent = 29;
  258. kURLPercentEvent = 30;
  259. kURLPeriodicEvent = 31;
  260. kURLPropertyChangedEvent = 32;
  261. type
  262. URLEventMask = UNSIGNEDLONG;
  263. const
  264. kURLInitiatedEventMask = 1 shl (kURLInitiatedEvent - 1);
  265. kURLResourceFoundEventMask = 1 shl (kURLResourceFoundEvent - 1);
  266. kURLDownloadingMask = 1 shl (kURLDownloadingEvent - 1);
  267. kURLUploadingMask = 1 shl (kURLUploadingEvent - 1);
  268. kURLAbortInitiatedMask = 1 shl (kURLAbortInitiatedEvent - 1);
  269. kURLCompletedEventMask = 1 shl (kURLCompletedEvent - 1);
  270. kURLErrorOccurredEventMask = 1 shl (kURLErrorOccurredEvent - 1);
  271. kURLDataAvailableEventMask = 1 shl (kURLDataAvailableEvent - 1);
  272. kURLTransactionCompleteEventMask = 1 shl (kURLTransactionCompleteEvent - 1);
  273. kURLSystemEventMask = 1 shl (kURLSystemEvent - 1);
  274. kURLPercentEventMask = 1 shl (kURLPercentEvent - 1);
  275. kURLPeriodicEventMask = 1 shl (kURLPeriodicEvent - 1);
  276. kURLPropertyChangedEventMask = 1 shl (kURLPropertyChangedEvent - 1);
  277. kURLAllBufferEventsMask = kURLDataAvailableEventMask + kURLTransactionCompleteEventMask;
  278. kURLAllNonBufferEventsMask = kURLInitiatedEventMask + kURLDownloadingMask + kURLUploadingMask + kURLAbortInitiatedMask + kURLCompletedEventMask + kURLErrorOccurredEventMask + kURLPercentEventMask + kURLPeriodicEventMask + kURLPropertyChangedEventMask;
  279. kURLAllEventsMask = -1;
  280. type
  281. URLCallbackInfo = record
  282. version: UInt32;
  283. urlRef: URLReference;
  284. proprty: ConstCStringPtr;
  285. currentSize: UInt32;
  286. systemEvent: EventRecordPtr;
  287. end;
  288. { authentication type flags}
  289. const
  290. kUserNameAndPasswordFlag = $00000001;
  291. const
  292. kURLURL = 'URLString';
  293. const
  294. kURLResourceSize = 'URLResourceSize';
  295. const
  296. kURLLastModifiedTime = 'URLLastModifiedTime';
  297. const
  298. kURLMIMEType = 'URLMIMEType';
  299. const
  300. kURLFileType = 'URLFileType';
  301. const
  302. kURLFileCreator = 'URLFileCreator';
  303. const
  304. kURLCharacterSet = 'URLCharacterSet';
  305. const
  306. kURLResourceName = 'URLResourceName';
  307. const
  308. kURLHost = 'URLHost';
  309. const
  310. kURLAuthType = 'URLAuthType';
  311. const
  312. kURLUserName = 'URLUserName';
  313. const
  314. kURLPassword = 'URLPassword';
  315. const
  316. kURLStatusString = 'URLStatusString';
  317. const
  318. kURLIsSecure = 'URLIsSecure';
  319. const
  320. kURLCertificate = 'URLCertificate';
  321. const
  322. kURLTotalItems = 'URLTotalItems';
  323. const
  324. kURLConnectTimeout = 'URLConnectTimeout';
  325. { http and https properties}
  326. const
  327. kURLHTTPRequestMethod = 'URLHTTPRequestMethod';
  328. const
  329. kURLHTTPRequestHeader = 'URLHTTPRequestHeader';
  330. const
  331. kURLHTTPRequestBody = 'URLHTTPRequestBody';
  332. const
  333. kURLHTTPRespHeader = 'URLHTTPRespHeader';
  334. const
  335. kURLHTTPUserAgent = 'URLHTTPUserAgent';
  336. const
  337. kURLHTTPRedirectedURL = 'URLHTTPRedirectedURL';
  338. const
  339. kURLSSLCipherSuite = 'URLSSLCipherSuite';
  340. {$ifc not TARGET_CPU_64}
  341. {
  342. * URLGetURLAccessVersion() *** DEPRECATED ***
  343. *
  344. * Deprecated:
  345. * Return the version number ( in the same format as a
  346. * NumVersionVariant.whole ) of the URLAccess libraries
  347. * available.
  348. * URLAccess is deprecated on Mac OS X. See Technical Q&A 1291 for
  349. * more information on the replacements available.
  350. * http://developer.apple.com/qa/qa2001/qa1291.html
  351. *
  352. * Availability:
  353. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  354. * CarbonLib: in CarbonLib 1.0 and later
  355. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  356. }
  357. function URLGetURLAccessVersion( var returnVers: UInt32 ): OSStatus; external name '_URLGetURLAccessVersion';
  358. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  359. {$ifc TARGET_RT_MAC_CFM}
  360. // #define URLAccessAvailable() ((URLGetURLAccessVersion != (void*)kUnresolvedCFragSymbolAddress) )
  361. {$elsec}
  362. {$ifc TARGET_RT_MAC_MACHO}
  363. { URL Access is always available on OS X }
  364. // #define URLAccessAvailable() (true)
  365. {$endc}
  366. {$endc} { }
  367. {$endc} {not TARGET_CPU_64}
  368. type
  369. URLNotifyProcPtr = function( userContext: UnivPtr; event: URLEvent; var callbackInfo: URLCallbackInfo ): OSStatus;
  370. URLSystemEventProcPtr = function( userContext: UnivPtr; var event: EventRecord ): OSStatus;
  371. URLNotifyUPP = URLNotifyProcPtr;
  372. URLSystemEventUPP = URLSystemEventProcPtr;
  373. {
  374. * NewURLNotifyUPP()
  375. *
  376. * Availability:
  377. * Mac OS X: in version 10.0 and later in Carbon.framework
  378. * CarbonLib: in CarbonLib 1.0 and later
  379. * Non-Carbon CFM: available as macro/inline
  380. }
  381. function NewURLNotifyUPP( userRoutine: URLNotifyProcPtr ): URLNotifyUPP; external name '_NewURLNotifyUPP';
  382. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  383. {
  384. * NewURLSystemEventUPP()
  385. *
  386. * Availability:
  387. * Mac OS X: in version 10.0 and later in Carbon.framework
  388. * CarbonLib: in CarbonLib 1.0 and later
  389. * Non-Carbon CFM: available as macro/inline
  390. }
  391. function NewURLSystemEventUPP( userRoutine: URLSystemEventProcPtr ): URLSystemEventUPP; external name '_NewURLSystemEventUPP';
  392. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  393. {
  394. * DisposeURLNotifyUPP()
  395. *
  396. * Availability:
  397. * Mac OS X: in version 10.0 and later in Carbon.framework
  398. * CarbonLib: in CarbonLib 1.0 and later
  399. * Non-Carbon CFM: available as macro/inline
  400. }
  401. procedure DisposeURLNotifyUPP( userUPP: URLNotifyUPP ); external name '_DisposeURLNotifyUPP';
  402. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  403. {
  404. * DisposeURLSystemEventUPP()
  405. *
  406. * Availability:
  407. * Mac OS X: in version 10.0 and later in Carbon.framework
  408. * CarbonLib: in CarbonLib 1.0 and later
  409. * Non-Carbon CFM: available as macro/inline
  410. }
  411. procedure DisposeURLSystemEventUPP( userUPP: URLSystemEventUPP ); external name '_DisposeURLSystemEventUPP';
  412. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  413. {
  414. * InvokeURLNotifyUPP()
  415. *
  416. * Availability:
  417. * Mac OS X: in version 10.0 and later in Carbon.framework
  418. * CarbonLib: in CarbonLib 1.0 and later
  419. * Non-Carbon CFM: available as macro/inline
  420. }
  421. function InvokeURLNotifyUPP( userContext: UnivPtr; event: URLEvent; var callbackInfo: URLCallbackInfo; userUPP: URLNotifyUPP ): OSStatus; external name '_InvokeURLNotifyUPP';
  422. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  423. {
  424. * InvokeURLSystemEventUPP()
  425. *
  426. * Availability:
  427. * Mac OS X: in version 10.0 and later in Carbon.framework
  428. * CarbonLib: in CarbonLib 1.0 and later
  429. * Non-Carbon CFM: available as macro/inline
  430. }
  431. function InvokeURLSystemEventUPP( userContext: UnivPtr; var event: EventRecord; userUPP: URLSystemEventUPP ): OSStatus; external name '_InvokeURLSystemEventUPP';
  432. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  433. {$ifc not TARGET_CPU_64}
  434. {
  435. * URLSimpleDownload() *** DEPRECATED ***
  436. *
  437. * Availability:
  438. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  439. * CarbonLib: in CarbonLib 1.0 and later
  440. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  441. }
  442. function URLSimpleDownload( url: ConstCStringPtr; destination: FSSpecPtr { can be NULL }; destinationHandle: Handle { can be NULL }; openFlags: URLOpenFlags; eventProc: URLSystemEventUPP { can be NULL }; userContext: UnivPtr { can be NULL } ): OSStatus; external name '_URLSimpleDownload';
  443. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  444. {
  445. * URLDownload() *** DEPRECATED ***
  446. *
  447. * Availability:
  448. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  449. * CarbonLib: in CarbonLib 1.0 and later
  450. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  451. }
  452. function URLDownload( urlRef: URLReference; destination: FSSpecPtr { can be NULL }; destinationHandle: Handle { can be NULL }; openFlags: URLOpenFlags; eventProc: URLSystemEventUPP { can be NULL }; userContext: UnivPtr { can be NULL } ): OSStatus; external name '_URLDownload';
  453. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  454. {
  455. * URLSimpleUpload() *** DEPRECATED ***
  456. *
  457. * Availability:
  458. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  459. * CarbonLib: in CarbonLib 1.0 and later
  460. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  461. }
  462. function URLSimpleUpload( url: ConstCStringPtr; const (*var*) source: FSSpec; openFlags: URLOpenFlags; eventProc: URLSystemEventUPP { can be NULL }; userContext: UnivPtr { can be NULL } ): OSStatus; external name '_URLSimpleUpload';
  463. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  464. {
  465. * URLUpload() *** DEPRECATED ***
  466. *
  467. * Availability:
  468. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  469. * CarbonLib: in CarbonLib 1.0 and later
  470. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  471. }
  472. function URLUpload( urlRef: URLReference; const (*var*) source: FSSpec; openFlags: URLOpenFlags; eventProc: URLSystemEventUPP { can be NULL }; userContext: UnivPtr { can be NULL } ): OSStatus; external name '_URLUpload';
  473. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  474. {
  475. * URLNewReference() *** DEPRECATED ***
  476. *
  477. * Availability:
  478. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  479. * CarbonLib: in CarbonLib 1.0 and later
  480. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  481. }
  482. function URLNewReference( url: ConstCStringPtr; var urlRef: URLReference ): OSStatus; external name '_URLNewReference';
  483. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  484. {
  485. * URLDisposeReference() *** DEPRECATED ***
  486. *
  487. * Availability:
  488. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  489. * CarbonLib: in CarbonLib 1.0 and later
  490. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  491. }
  492. function URLDisposeReference( urlRef: URLReference ): OSStatus; external name '_URLDisposeReference';
  493. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  494. {
  495. * URLOpen() *** DEPRECATED ***
  496. *
  497. * Availability:
  498. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  499. * CarbonLib: in CarbonLib 1.0 and later
  500. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  501. }
  502. function URLOpen( urlRef: URLReference; fileSpec: FSSpecPtr { can be NULL }; openFlags: URLOpenFlags; notifyProc: URLNotifyUPP { can be NULL }; eventRegister: URLEventMask; userContext: UnivPtr { can be NULL } ): OSStatus; external name '_URLOpen';
  503. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  504. {
  505. * URLAbort() *** DEPRECATED ***
  506. *
  507. * Availability:
  508. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  509. * CarbonLib: in CarbonLib 1.0 and later
  510. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  511. }
  512. function URLAbort( urlRef: URLReference ): OSStatus; external name '_URLAbort';
  513. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  514. {
  515. * URLGetDataAvailable() *** DEPRECATED ***
  516. *
  517. * Availability:
  518. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  519. * CarbonLib: in CarbonLib 1.0 and later
  520. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  521. }
  522. function URLGetDataAvailable( urlRef: URLReference; var dataSize: Size ): OSStatus; external name '_URLGetDataAvailable';
  523. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  524. {
  525. * URLGetBuffer() *** DEPRECATED ***
  526. *
  527. * Availability:
  528. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  529. * CarbonLib: in CarbonLib 1.0 and later
  530. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  531. }
  532. function URLGetBuffer( urlRef: URLReference; var buffer: UnivPtr; var bufferSize: Size ): OSStatus; external name '_URLGetBuffer';
  533. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  534. {
  535. * URLReleaseBuffer() *** DEPRECATED ***
  536. *
  537. * Availability:
  538. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  539. * CarbonLib: in CarbonLib 1.0 and later
  540. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  541. }
  542. function URLReleaseBuffer( urlRef: URLReference; buffer: UnivPtr ): OSStatus; external name '_URLReleaseBuffer';
  543. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  544. {
  545. * URLGetProperty() *** DEPRECATED ***
  546. *
  547. * Availability:
  548. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  549. * CarbonLib: in CarbonLib 1.0 and later
  550. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  551. }
  552. function URLGetProperty( urlRef: URLReference; proprty: ConstCStringPtr; propertyBuffer: UnivPtr; bufferSize: Size ): OSStatus; external name '_URLGetProperty';
  553. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  554. {
  555. * URLGetPropertySize() *** DEPRECATED ***
  556. *
  557. * Availability:
  558. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  559. * CarbonLib: in CarbonLib 1.0 and later
  560. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  561. }
  562. function URLGetPropertySize( urlRef: URLReference; proprty: ConstCStringPtr; var propertySize: Size ): OSStatus; external name '_URLGetPropertySize';
  563. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  564. {
  565. * URLSetProperty() *** DEPRECATED ***
  566. *
  567. * Availability:
  568. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  569. * CarbonLib: in CarbonLib 1.0 and later
  570. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  571. }
  572. function URLSetProperty( urlRef: URLReference; proprty: ConstCStringPtr; propertyBuffer: UnivPtr; bufferSize: Size ): OSStatus; external name '_URLSetProperty';
  573. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  574. {
  575. * URLGetCurrentState() *** DEPRECATED ***
  576. *
  577. * Availability:
  578. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  579. * CarbonLib: in CarbonLib 1.0 and later
  580. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  581. }
  582. function URLGetCurrentState( urlRef: URLReference; var state: URLState ): OSStatus; external name '_URLGetCurrentState';
  583. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  584. {
  585. * URLGetError() *** DEPRECATED ***
  586. *
  587. * Availability:
  588. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  589. * CarbonLib: in CarbonLib 1.0 and later
  590. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  591. }
  592. function URLGetError( urlRef: URLReference; var urlError: OSStatus ): OSStatus; external name '_URLGetError';
  593. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  594. {
  595. * URLIdle() *** DEPRECATED ***
  596. *
  597. * Availability:
  598. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  599. * CarbonLib: in CarbonLib 1.0 and later
  600. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  601. }
  602. function URLIdle: OSStatus; external name '_URLIdle';
  603. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  604. {
  605. * URLGetFileInfo() *** DEPRECATED ***
  606. *
  607. * Availability:
  608. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  609. * CarbonLib: in CarbonLib 1.0 and later
  610. * Non-Carbon CFM: in URLAccessLib 1.0 and later
  611. }
  612. function URLGetFileInfo( fName: StringPtr; var fType: OSType; var fCreator: OSType ): OSStatus; external name '_URLGetFileInfo';
  613. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  614. {$endc} {not TARGET_CPU_64}
  615. {$endc} {TARGET_OS_MAC}
  616. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  617. end.
  618. {$endc} {not MACOSALLINCLUDE}