/packages/univint/src/Resources.pas

https://github.com/slibre/freepascal · Pascal · 1324 lines · 111 code · 150 blank · 1063 comment · 0 complexity · d7724f7c93b4848feaff34e3b7182dbf MD5 · raw file

  1. {
  2. File: CarbonCore/Resources.h
  3. Contains: Resource Manager Interfaces.
  4. The contents of this header file are deprecated.
  5. Use Foundation or CoreFoundation bundles instead.
  6. Copyright: © 1985-2011 by Apple Inc. All rights reserved.
  7. }
  8. { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
  9. { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, September 2012 }
  10. {
  11. Modified for use with Free Pascal
  12. Version 308
  13. Please report any bugs to <gpc@microbizz.nl>
  14. }
  15. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$calling mwpascal}
  21. unit Resources;
  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 defined cpu64}
  60. {$setc __LP64__ := 1}
  61. {$elsec}
  62. {$setc __LP64__ := 0}
  63. {$endc}
  64. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  65. {$error Conflicting definitions for __ppc__ and __i386__}
  66. {$endc}
  67. {$ifc defined __ppc__ and __ppc__}
  68. {$setc TARGET_CPU_PPC := TRUE}
  69. {$setc TARGET_CPU_PPC64 := FALSE}
  70. {$setc TARGET_CPU_X86 := FALSE}
  71. {$setc TARGET_CPU_X86_64 := FALSE}
  72. {$setc TARGET_CPU_ARM := FALSE}
  73. {$setc TARGET_OS_MAC := TRUE}
  74. {$setc TARGET_OS_IPHONE := FALSE}
  75. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  76. {$setc TARGET_OS_EMBEDDED := FALSE}
  77. {$elifc defined __ppc64__ and __ppc64__}
  78. {$setc TARGET_CPU_PPC := FALSE}
  79. {$setc TARGET_CPU_PPC64 := TRUE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __i386__ and __i386__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := FALSE}
  90. {$setc TARGET_CPU_X86 := TRUE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$ifc defined(iphonesim)}
  94. {$setc TARGET_OS_MAC := FALSE}
  95. {$setc TARGET_OS_IPHONE := TRUE}
  96. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  97. {$elsec}
  98. {$setc TARGET_OS_MAC := TRUE}
  99. {$setc TARGET_OS_IPHONE := FALSE}
  100. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  101. {$endc}
  102. {$setc TARGET_OS_EMBEDDED := FALSE}
  103. {$elifc defined __x86_64__ and __x86_64__}
  104. {$setc TARGET_CPU_PPC := FALSE}
  105. {$setc TARGET_CPU_PPC64 := FALSE}
  106. {$setc TARGET_CPU_X86 := FALSE}
  107. {$setc TARGET_CPU_X86_64 := TRUE}
  108. {$setc TARGET_CPU_ARM := FALSE}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$setc TARGET_OS_EMBEDDED := FALSE}
  113. {$elifc defined __arm__ and __arm__}
  114. {$setc TARGET_CPU_PPC := FALSE}
  115. {$setc TARGET_CPU_PPC64 := FALSE}
  116. {$setc TARGET_CPU_X86 := FALSE}
  117. {$setc TARGET_CPU_X86_64 := FALSE}
  118. {$setc TARGET_CPU_ARM := TRUE}
  119. { will require compiler define when/if other Apple devices with ARM cpus ship }
  120. {$setc TARGET_OS_MAC := FALSE}
  121. {$setc TARGET_OS_IPHONE := TRUE}
  122. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  123. {$setc TARGET_OS_EMBEDDED := TRUE}
  124. {$elsec}
  125. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  126. {$endc}
  127. {$ifc defined __LP64__ and __LP64__ }
  128. {$setc TARGET_CPU_64 := TRUE}
  129. {$elsec}
  130. {$setc TARGET_CPU_64 := FALSE}
  131. {$endc}
  132. {$ifc defined FPC_BIG_ENDIAN}
  133. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  134. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  135. {$elifc defined FPC_LITTLE_ENDIAN}
  136. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  137. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  138. {$elsec}
  139. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  140. {$endc}
  141. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  142. {$setc CALL_NOT_IN_CARBON := FALSE}
  143. {$setc OLDROUTINENAMES := FALSE}
  144. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  145. {$setc OPAQUE_UPP_TYPES := TRUE}
  146. {$setc OTCARBONAPPLICATION := TRUE}
  147. {$setc OTKERNEL := FALSE}
  148. {$setc PM_USE_SESSION_APIS := TRUE}
  149. {$setc TARGET_API_MAC_CARBON := TRUE}
  150. {$setc TARGET_API_MAC_OS8 := FALSE}
  151. {$setc TARGET_API_MAC_OSX := TRUE}
  152. {$setc TARGET_CARBON := TRUE}
  153. {$setc TARGET_CPU_68K := FALSE}
  154. {$setc TARGET_CPU_MIPS := FALSE}
  155. {$setc TARGET_CPU_SPARC := FALSE}
  156. {$setc TARGET_OS_UNIX := FALSE}
  157. {$setc TARGET_OS_WIN32 := FALSE}
  158. {$setc TARGET_RT_MAC_68881 := FALSE}
  159. {$setc TARGET_RT_MAC_CFM := FALSE}
  160. {$setc TARGET_RT_MAC_MACHO := TRUE}
  161. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  162. {$setc TYPE_BOOL := FALSE}
  163. {$setc TYPE_EXTENDED := FALSE}
  164. {$setc TYPE_LONGLONG := TRUE}
  165. uses MacTypes,Files;
  166. {$endc} {not MACOSALLINCLUDE}
  167. {$ifc TARGET_OS_MAC}
  168. {$ALIGN POWER}
  169. {
  170. These typedefs were originally created for the Copland Resource Mangager
  171. }
  172. type
  173. ResID = SInt16;
  174. ResAttributes = SInt16;
  175. ResFileAttributes = SInt16;
  176. ResourceCount = SInt16;
  177. ResourceIndex = SInt16;
  178. ResFileRefNum = FSIORefNum;
  179. { Resource Attribute Bits }
  180. const
  181. resSysRefBit = 7; {reference to system/local reference}
  182. resSysHeapBit = 6; {In system/in application heap}
  183. resPurgeableBit = 5; {Purgeable/not purgeable}
  184. resLockedBit = 4; {Locked/not locked}
  185. resProtectedBit = 3; {Protected/not protected}
  186. resPreloadBit = 2; {Read in at OpenResource?}
  187. resChangedBit = 1; {Existing resource changed since last update}
  188. { Resource Attribute Masks}
  189. const
  190. resSysHeap = 64; {System or application heap?}
  191. resPurgeable = 32; {Purgeable resource?}
  192. resLocked = 16; {Load it in locked?}
  193. resProtected = 8; {Protected?}
  194. resPreload = 4; {Load in on OpenResFile?}
  195. resChanged = 2; {Resource changed?}
  196. { Resource Fork Attribute Bits}
  197. const
  198. mapReadOnlyBit = 7; {is this file read-only?}
  199. mapCompactBit = 6; {Is a compact necessary?}
  200. mapChangedBit = 5; {Is it necessary to write map?}
  201. { Resource Fork Attribute Masks}
  202. const
  203. mapReadOnly = 128; {Resource file read-only}
  204. mapCompact = 64; {Compact resource file}
  205. mapChanged = 32; {Write map out at update}
  206. { Resource File Ref Num constants}
  207. const
  208. kResFileNotOpened = -1; {ref num return as error when opening a resource file}
  209. kSystemResFile = 0; {this is the default ref num to the system file}
  210. type
  211. ResErrProcPtr = procedure( thErr: OSErr );
  212. ResErrUPP = ResErrProcPtr;
  213. {
  214. * NewResErrUPP()
  215. *
  216. * Availability:
  217. * Mac OS X: in version 10.0 and later in CoreServices.framework
  218. * CarbonLib: in CarbonLib 1.0 and later
  219. * Non-Carbon CFM: available as macro/inline
  220. }
  221. function NewResErrUPP( userRoutine: ResErrProcPtr ): ResErrUPP; external name '_NewResErrUPP';
  222. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  223. {
  224. * DisposeResErrUPP()
  225. *
  226. * Availability:
  227. * Mac OS X: in version 10.0 and later in CoreServices.framework
  228. * CarbonLib: in CarbonLib 1.0 and later
  229. * Non-Carbon CFM: available as macro/inline
  230. }
  231. procedure DisposeResErrUPP( userUPP: ResErrUPP ); external name '_DisposeResErrUPP';
  232. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  233. {
  234. * InvokeResErrUPP()
  235. *
  236. * Availability:
  237. * Mac OS X: in version 10.0 and later in CoreServices.framework
  238. * CarbonLib: in CarbonLib 1.0 and later
  239. * Non-Carbon CFM: available as macro/inline
  240. }
  241. procedure InvokeResErrUPP( thErr: OSErr; userUPP: ResErrUPP ); external name '_InvokeResErrUPP';
  242. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  243. { QuickTime 3.0}
  244. type
  245. ResourceEndianFilterPtr = function( theResource: Handle; currentlyNativeEndian: Boolean ): OSErr;
  246. {
  247. * CloseResFile()
  248. *
  249. * Mac OS X threading:
  250. * Not thread safe
  251. *
  252. * Availability:
  253. * Mac OS X: in version 10.0 and later in CoreServices.framework
  254. * CarbonLib: in CarbonLib 1.0 and later
  255. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  256. }
  257. procedure CloseResFile( refNum: ResFileRefNum ); external name '_CloseResFile';
  258. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  259. {
  260. * ResError()
  261. *
  262. * Mac OS X threading:
  263. * Not thread safe
  264. *
  265. * Availability:
  266. * Mac OS X: in version 10.0 and later in CoreServices.framework
  267. * CarbonLib: in CarbonLib 1.0 and later
  268. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  269. }
  270. function ResError: OSErr; external name '_ResError';
  271. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  272. {
  273. * CurResFile()
  274. *
  275. * Mac OS X threading:
  276. * Not thread safe
  277. *
  278. * Availability:
  279. * Mac OS X: in version 10.0 and later in CoreServices.framework
  280. * CarbonLib: in CarbonLib 1.0 and later
  281. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  282. }
  283. function CurResFile: ResFileRefNum; external name '_CurResFile';
  284. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  285. {
  286. * HomeResFile()
  287. *
  288. * Mac OS X threading:
  289. * Not thread safe
  290. *
  291. * Availability:
  292. * Mac OS X: in version 10.0 and later in CoreServices.framework
  293. * CarbonLib: in CarbonLib 1.0 and later
  294. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  295. }
  296. function HomeResFile( theResource: Handle ): ResFileRefNum; external name '_HomeResFile';
  297. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  298. {
  299. * UseResFile()
  300. *
  301. * Mac OS X threading:
  302. * Not thread safe
  303. *
  304. * Availability:
  305. * Mac OS X: in version 10.0 and later in CoreServices.framework
  306. * CarbonLib: in CarbonLib 1.0 and later
  307. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  308. }
  309. procedure UseResFile( refNum: ResFileRefNum ); external name '_UseResFile';
  310. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  311. {
  312. * CountTypes()
  313. *
  314. * Mac OS X threading:
  315. * Not thread safe
  316. *
  317. * Availability:
  318. * Mac OS X: in version 10.0 and later in CoreServices.framework
  319. * CarbonLib: in CarbonLib 1.0 and later
  320. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  321. }
  322. function CountTypes: ResourceCount; external name '_CountTypes';
  323. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  324. {
  325. * Count1Types()
  326. *
  327. * Mac OS X threading:
  328. * Not thread safe
  329. *
  330. * Availability:
  331. * Mac OS X: in version 10.0 and later in CoreServices.framework
  332. * CarbonLib: in CarbonLib 1.0 and later
  333. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  334. }
  335. function Count1Types: ResourceCount; external name '_Count1Types';
  336. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  337. {
  338. * GetIndType()
  339. *
  340. * Mac OS X threading:
  341. * Not thread safe
  342. *
  343. * Availability:
  344. * Mac OS X: in version 10.0 and later in CoreServices.framework
  345. * CarbonLib: in CarbonLib 1.0 and later
  346. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  347. }
  348. procedure GetIndType( var theType: ResType; itemIndex: ResourceIndex ); external name '_GetIndType';
  349. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  350. {
  351. * Get1IndType()
  352. *
  353. * Mac OS X threading:
  354. * Not thread safe
  355. *
  356. * Availability:
  357. * Mac OS X: in version 10.0 and later in CoreServices.framework
  358. * CarbonLib: in CarbonLib 1.0 and later
  359. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  360. }
  361. procedure Get1IndType( var theType: ResType; itemIndex: ResourceIndex ); external name '_Get1IndType';
  362. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  363. {
  364. * SetResLoad()
  365. *
  366. * Mac OS X threading:
  367. * Not thread safe
  368. *
  369. * Availability:
  370. * Mac OS X: in version 10.0 and later in CoreServices.framework
  371. * CarbonLib: in CarbonLib 1.0 and later
  372. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  373. }
  374. procedure SetResLoad( load: Boolean ); external name '_SetResLoad';
  375. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  376. {
  377. * CountResources()
  378. *
  379. * Mac OS X threading:
  380. * Not thread safe
  381. *
  382. * Availability:
  383. * Mac OS X: in version 10.0 and later in CoreServices.framework
  384. * CarbonLib: in CarbonLib 1.0 and later
  385. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  386. }
  387. function CountResources( theType: ResType ): ResourceCount; external name '_CountResources';
  388. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  389. {
  390. * Count1Resources()
  391. *
  392. * Mac OS X threading:
  393. * Not thread safe
  394. *
  395. * Availability:
  396. * Mac OS X: in version 10.0 and later in CoreServices.framework
  397. * CarbonLib: in CarbonLib 1.0 and later
  398. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  399. }
  400. function Count1Resources( theType: ResType ): ResourceCount; external name '_Count1Resources';
  401. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  402. {
  403. * GetIndResource()
  404. *
  405. * Mac OS X threading:
  406. * Not thread safe
  407. *
  408. * Availability:
  409. * Mac OS X: in version 10.0 and later in CoreServices.framework
  410. * CarbonLib: in CarbonLib 1.0 and later
  411. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  412. }
  413. function GetIndResource( theType: ResType; itemIndex: ResourceIndex ): Handle; external name '_GetIndResource';
  414. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  415. {
  416. * Get1IndResource()
  417. *
  418. * Mac OS X threading:
  419. * Not thread safe
  420. *
  421. * Availability:
  422. * Mac OS X: in version 10.0 and later in CoreServices.framework
  423. * CarbonLib: in CarbonLib 1.0 and later
  424. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  425. }
  426. function Get1IndResource( theType: ResType; itemIndex: ResourceIndex ): Handle; external name '_Get1IndResource';
  427. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  428. {
  429. * GetResource()
  430. *
  431. * Mac OS X threading:
  432. * Not thread safe
  433. *
  434. * Availability:
  435. * Mac OS X: in version 10.0 and later in CoreServices.framework
  436. * CarbonLib: in CarbonLib 1.0 and later
  437. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  438. }
  439. function GetResource( theType: ResType; theID: ResID ): Handle; external name '_GetResource';
  440. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  441. {
  442. * Get1Resource()
  443. *
  444. * Mac OS X threading:
  445. * Not thread safe
  446. *
  447. * Availability:
  448. * Mac OS X: in version 10.0 and later in CoreServices.framework
  449. * CarbonLib: in CarbonLib 1.0 and later
  450. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  451. }
  452. function Get1Resource( theType: ResType; theID: ResID ): Handle; external name '_Get1Resource';
  453. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  454. {
  455. * GetNamedResource()
  456. *
  457. * Mac OS X threading:
  458. * Not thread safe
  459. *
  460. * Availability:
  461. * Mac OS X: in version 10.0 and later in CoreServices.framework
  462. * CarbonLib: in CarbonLib 1.0 and later
  463. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  464. }
  465. function GetNamedResource( theType: ResType; const (*var*) name: Str255 ): Handle; external name '_GetNamedResource';
  466. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  467. {
  468. * Get1NamedResource()
  469. *
  470. * Mac OS X threading:
  471. * Not thread safe
  472. *
  473. * Availability:
  474. * Mac OS X: in version 10.0 and later in CoreServices.framework
  475. * CarbonLib: in CarbonLib 1.0 and later
  476. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  477. }
  478. function Get1NamedResource( theType: ResType; const (*var*) name: Str255 ): Handle; external name '_Get1NamedResource';
  479. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  480. {
  481. * [Mac]LoadResource()
  482. *
  483. * Mac OS X threading:
  484. * Not thread safe
  485. *
  486. * Availability:
  487. * Mac OS X: in version 10.0 and later in CoreServices.framework
  488. * CarbonLib: in CarbonLib 1.0 and later
  489. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  490. }
  491. procedure MacLoadResource( theResource: Handle ); external name '_MacLoadResource';
  492. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  493. {
  494. * ReleaseResource()
  495. *
  496. * Mac OS X threading:
  497. * Not thread safe
  498. *
  499. * Availability:
  500. * Mac OS X: in version 10.0 and later in CoreServices.framework
  501. * CarbonLib: in CarbonLib 1.0 and later
  502. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  503. }
  504. procedure ReleaseResource( theResource: Handle ); external name '_ReleaseResource';
  505. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  506. {
  507. * DetachResource()
  508. *
  509. * Mac OS X threading:
  510. * Not thread safe
  511. *
  512. * Availability:
  513. * Mac OS X: in version 10.0 and later in CoreServices.framework
  514. * CarbonLib: in CarbonLib 1.0 and later
  515. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  516. }
  517. procedure DetachResource( theResource: Handle ); external name '_DetachResource';
  518. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  519. {
  520. * UniqueID()
  521. *
  522. * Mac OS X threading:
  523. * Not thread safe
  524. *
  525. * Availability:
  526. * Mac OS X: in version 10.0 and later in CoreServices.framework
  527. * CarbonLib: in CarbonLib 1.0 and later
  528. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  529. }
  530. function UniqueID( theType: ResType ): ResID; external name '_UniqueID';
  531. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  532. {
  533. * Unique1ID()
  534. *
  535. * Mac OS X threading:
  536. * Not thread safe
  537. *
  538. * Availability:
  539. * Mac OS X: in version 10.0 and later in CoreServices.framework
  540. * CarbonLib: in CarbonLib 1.0 and later
  541. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  542. }
  543. function Unique1ID( theType: ResType ): ResID; external name '_Unique1ID';
  544. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  545. {
  546. * GetResAttrs()
  547. *
  548. * Mac OS X threading:
  549. * Not thread safe
  550. *
  551. * Availability:
  552. * Mac OS X: in version 10.0 and later in CoreServices.framework
  553. * CarbonLib: in CarbonLib 1.0 and later
  554. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  555. }
  556. function GetResAttrs( theResource: Handle ): ResAttributes; external name '_GetResAttrs';
  557. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  558. {
  559. * GetResInfo()
  560. *
  561. * Mac OS X threading:
  562. * Not thread safe
  563. *
  564. * Availability:
  565. * Mac OS X: in version 10.0 and later in CoreServices.framework
  566. * CarbonLib: in CarbonLib 1.0 and later
  567. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  568. }
  569. procedure GetResInfo( theResource: Handle; var theID: ResID; var theType: ResType; var name: Str255 ); external name '_GetResInfo';
  570. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  571. {
  572. * SetResInfo()
  573. *
  574. * Mac OS X threading:
  575. * Not thread safe
  576. *
  577. * Availability:
  578. * Mac OS X: in version 10.0 and later in CoreServices.framework
  579. * CarbonLib: in CarbonLib 1.0 and later
  580. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  581. }
  582. procedure SetResInfo( theResource: Handle; theID: ResID; const (*var*) name: Str255 ); external name '_SetResInfo';
  583. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  584. {
  585. * AddResource()
  586. *
  587. * Mac OS X threading:
  588. * Not thread safe
  589. *
  590. * Availability:
  591. * Mac OS X: in version 10.0 and later in CoreServices.framework
  592. * CarbonLib: in CarbonLib 1.0 and later
  593. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  594. }
  595. procedure AddResource( theData: Handle; theType: ResType; theID: ResID; const (*var*) name: Str255 ); external name '_AddResource';
  596. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  597. {
  598. * GetResourceSizeOnDisk()
  599. *
  600. * Mac OS X threading:
  601. * Not thread safe
  602. *
  603. * Availability:
  604. * Mac OS X: in version 10.0 and later in CoreServices.framework
  605. * CarbonLib: in CarbonLib 1.0 and later
  606. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  607. }
  608. function GetResourceSizeOnDisk( theResource: Handle ): SIGNEDLONG; external name '_GetResourceSizeOnDisk';
  609. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  610. {
  611. * GetMaxResourceSize()
  612. *
  613. * Mac OS X threading:
  614. * Not thread safe
  615. *
  616. * Availability:
  617. * Mac OS X: in version 10.0 and later in CoreServices.framework
  618. * CarbonLib: in CarbonLib 1.0 and later
  619. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  620. }
  621. function GetMaxResourceSize( theResource: Handle ): SIGNEDLONG; external name '_GetMaxResourceSize';
  622. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  623. {
  624. * SetResAttrs()
  625. *
  626. * Mac OS X threading:
  627. * Not thread safe
  628. *
  629. * Availability:
  630. * Mac OS X: in version 10.0 and later in CoreServices.framework
  631. * CarbonLib: in CarbonLib 1.0 and later
  632. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  633. }
  634. procedure SetResAttrs( theResource: Handle; attrs: ResAttributes ); external name '_SetResAttrs';
  635. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  636. {
  637. * ChangedResource()
  638. *
  639. * Mac OS X threading:
  640. * Not thread safe
  641. *
  642. * Availability:
  643. * Mac OS X: in version 10.0 and later in CoreServices.framework
  644. * CarbonLib: in CarbonLib 1.0 and later
  645. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  646. }
  647. procedure ChangedResource( theResource: Handle ); external name '_ChangedResource';
  648. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  649. {
  650. * RemoveResource()
  651. *
  652. * Mac OS X threading:
  653. * Not thread safe
  654. *
  655. * Availability:
  656. * Mac OS X: in version 10.0 and later in CoreServices.framework
  657. * CarbonLib: in CarbonLib 1.0 and later
  658. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  659. }
  660. procedure RemoveResource( theResource: Handle ); external name '_RemoveResource';
  661. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  662. {
  663. * UpdateResFile()
  664. *
  665. * Mac OS X threading:
  666. * Not thread safe
  667. *
  668. * Availability:
  669. * Mac OS X: in version 10.0 and later in CoreServices.framework
  670. * CarbonLib: in CarbonLib 1.0 and later
  671. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  672. }
  673. procedure UpdateResFile( refNum: ResFileRefNum ); external name '_UpdateResFile';
  674. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  675. {
  676. * WriteResource()
  677. *
  678. * Mac OS X threading:
  679. * Not thread safe
  680. *
  681. * Availability:
  682. * Mac OS X: in version 10.0 and later in CoreServices.framework
  683. * CarbonLib: in CarbonLib 1.0 and later
  684. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  685. }
  686. procedure WriteResource( theResource: Handle ); external name '_WriteResource';
  687. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  688. {
  689. * SetResPurge()
  690. *
  691. * Mac OS X threading:
  692. * Not thread safe
  693. *
  694. * Availability:
  695. * Mac OS X: in version 10.0 and later in CoreServices.framework
  696. * CarbonLib: in CarbonLib 1.0 and later
  697. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  698. }
  699. procedure SetResPurge( install: Boolean ); external name '_SetResPurge';
  700. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  701. {
  702. * GetResFileAttrs()
  703. *
  704. * Mac OS X threading:
  705. * Not thread safe
  706. *
  707. * Availability:
  708. * Mac OS X: in version 10.0 and later in CoreServices.framework
  709. * CarbonLib: in CarbonLib 1.0 and later
  710. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  711. }
  712. function GetResFileAttrs( refNum: ResFileRefNum ): ResFileAttributes; external name '_GetResFileAttrs';
  713. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  714. {
  715. * SetResFileAttrs()
  716. *
  717. * Mac OS X threading:
  718. * Not thread safe
  719. *
  720. * Availability:
  721. * Mac OS X: in version 10.0 and later in CoreServices.framework
  722. * CarbonLib: in CarbonLib 1.0 and later
  723. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  724. }
  725. procedure SetResFileAttrs( refNum: ResFileRefNum; attrs: ResFileAttributes ); external name '_SetResFileAttrs';
  726. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  727. {
  728. * ReadPartialResource()
  729. *
  730. * Mac OS X threading:
  731. * Not thread safe
  732. *
  733. * Availability:
  734. * Mac OS X: in version 10.0 and later in CoreServices.framework
  735. * CarbonLib: in CarbonLib 1.0 and later
  736. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  737. }
  738. procedure ReadPartialResource( theResource: Handle; offset: SIGNEDLONG; buffer: UnivPtr; count: SIGNEDLONG ); external name '_ReadPartialResource';
  739. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  740. {
  741. * WritePartialResource()
  742. *
  743. * Mac OS X threading:
  744. * Not thread safe
  745. *
  746. * Availability:
  747. * Mac OS X: in version 10.0 and later in CoreServices.framework
  748. * CarbonLib: in CarbonLib 1.0 and later
  749. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  750. }
  751. procedure WritePartialResource( theResource: Handle; offset: SIGNEDLONG; buffer: {const} UnivPtr; count: SIGNEDLONG ); external name '_WritePartialResource';
  752. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  753. {
  754. * SetResourceSize()
  755. *
  756. * Mac OS X threading:
  757. * Not thread safe
  758. *
  759. * Availability:
  760. * Mac OS X: in version 10.0 and later in CoreServices.framework
  761. * CarbonLib: in CarbonLib 1.0 and later
  762. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  763. }
  764. procedure SetResourceSize( theResource: Handle; newSize: SIGNEDLONG ); external name '_SetResourceSize';
  765. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  766. {
  767. * GetNextFOND()
  768. *
  769. * Mac OS X threading:
  770. * Not thread safe
  771. *
  772. * Availability:
  773. * Mac OS X: in version 10.0 and later in CoreServices.framework
  774. * CarbonLib: in CarbonLib 1.0 and later
  775. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  776. }
  777. function GetNextFOND( fondHandle: Handle ): Handle; external name '_GetNextFOND';
  778. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  779. { QuickTime 3.0}
  780. {
  781. * RegisterResourceEndianFilter()
  782. *
  783. * Availability:
  784. * Mac OS X: not available
  785. * CarbonLib: not available
  786. * Non-Carbon CFM: not available
  787. }
  788. {
  789. _________________________________________________________________________________________________________
  790. ¥ RESOURCE CHAIN LOCATION - for use with the Resource Manager chain manipulation routines under Carbon.
  791. _________________________________________________________________________________________________________
  792. }
  793. type
  794. RsrcChainLocation = SInt16;
  795. const
  796. kRsrcChainBelowSystemMap = 0; { Below the system's resource map}
  797. kRsrcChainBelowApplicationMap = 1; { Below the application's resource map}
  798. kRsrcChainAboveApplicationMap = 2; { Above the application's resource map}
  799. kRsrcChainAboveAllMaps = 4; { Above all resource maps}
  800. {
  801. If the file is already in the resource chain, it is removed and re-inserted at the specified location
  802. If the file has been detached, it is added to the resource chain at the specified location
  803. Returns resFNotFound if it's not currently open.
  804. }
  805. {
  806. * InsertResourceFile()
  807. *
  808. * Mac OS X threading:
  809. * Not thread safe
  810. *
  811. * Availability:
  812. * Mac OS X: in version 10.0 and later in CoreServices.framework
  813. * CarbonLib: in CarbonLib 1.0 and later
  814. * Non-Carbon CFM: not available
  815. }
  816. function InsertResourceFile( refNum: ResFileRefNum; where: RsrcChainLocation ): OSErr; external name '_InsertResourceFile';
  817. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  818. {
  819. If the file is not currently in the resource chain, this returns resNotFound
  820. Otherwise, the resource file is removed from the resource chain.
  821. }
  822. {
  823. * DetachResourceFile()
  824. *
  825. * Mac OS X threading:
  826. * Not thread safe
  827. *
  828. * Availability:
  829. * Mac OS X: in version 10.0 and later in CoreServices.framework
  830. * CarbonLib: in CarbonLib 1.0 and later
  831. * Non-Carbon CFM: not available
  832. }
  833. function DetachResourceFile( refNum: ResFileRefNum ): OSErr; external name '_DetachResourceFile';
  834. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  835. {
  836. GetTopResourceFile returns the refNum of the top most resource map in the current resource chain. If
  837. the resource chain is empty it returns resFNotFound.
  838. }
  839. {
  840. * GetTopResourceFile()
  841. *
  842. * Mac OS X threading:
  843. * Not thread safe
  844. *
  845. * Availability:
  846. * Mac OS X: in version 10.0 and later in CoreServices.framework
  847. * CarbonLib: in CarbonLib 1.0.2 and later
  848. * Non-Carbon CFM: not available
  849. }
  850. function GetTopResourceFile( var refNum: ResFileRefNum ): OSErr; external name '_GetTopResourceFile';
  851. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  852. {
  853. GetNextResourceFile can be used to iterate over resource files in the resource chain. By passing a
  854. valid refNum in curRefNum it will return in nextRefNum the refNum of the next file in
  855. the chain. If curRefNum is not found in the resource chain, GetNextResourceFile returns resFNotFound.
  856. When the end of the chain is reached GetNextResourceFile will return noErr and nextRefNum will be NIL.
  857. }
  858. {
  859. * GetNextResourceFile()
  860. *
  861. * Mac OS X threading:
  862. * Not thread safe
  863. *
  864. * Availability:
  865. * Mac OS X: in version 10.0 and later in CoreServices.framework
  866. * CarbonLib: in CarbonLib 1.0.2 and later
  867. * Non-Carbon CFM: not available
  868. }
  869. function GetNextResourceFile( curRefNum: ResFileRefNum; var nextRefNum: ResFileRefNum ): OSErr; external name '_GetNextResourceFile';
  870. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  871. {
  872. * FSOpenResFile()
  873. *
  874. * Mac OS X threading:
  875. * Not thread safe
  876. *
  877. * Availability:
  878. * Mac OS X: in version 10.0 and later in CoreServices.framework
  879. * CarbonLib: in CarbonLib 1.1 and later
  880. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  881. }
  882. function FSOpenResFile( const (*var*) ref: FSRef; permission: SInt8 ): ResFileRefNum; external name '_FSOpenResFile';
  883. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  884. {
  885. * FSCreateResFile()
  886. *
  887. * Mac OS X threading:
  888. * Not thread safe
  889. *
  890. * Availability:
  891. * Mac OS X: in version 10.0 and later in CoreServices.framework
  892. * CarbonLib: in CarbonLib 1.1 and later
  893. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  894. }
  895. procedure FSCreateResFile( const (*var*) parentRef: FSRef; nameLength: UniCharCount; name: UniCharPtr; whichInfo: FSCatalogInfoBitmap; {const} catalogInfo: FSCatalogInfoPtr { can be NULL }; newRef: FSRefPtr { can be NULL }; newSpec: FSSpecPtr { can be NULL } ); external name '_FSCreateResFile';
  896. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  897. {
  898. Returns true if the resource file is already open and known by the Resource Manager (i.e., it is
  899. either in the current resource chain or it's a detached resource file.) If it's in the resource
  900. chain, the inChain Boolean is set to true on exit and true is returned. If it's an open file, but
  901. the file is currently detached, inChain is set to false and true is returned. If the file is open,
  902. the refNum to the file is returned.
  903. }
  904. {
  905. * FSResourceFileAlreadyOpen()
  906. *
  907. * Mac OS X threading:
  908. * Not thread safe
  909. *
  910. * Availability:
  911. * Mac OS X: in version 10.0 and later in CoreServices.framework
  912. * CarbonLib: in CarbonLib 1.1 and later
  913. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  914. }
  915. function FSResourceFileAlreadyOpen( const (*var*) resourceFileRef: FSRef; var inChain: Boolean; var refNum: ResFileRefNum ): Boolean; external name '_FSResourceFileAlreadyOpen';
  916. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  917. {
  918. FSOpenOrphanResFile should be used to open a resource file that is persistent across all contexts,
  919. because using OpenResFile normally loads a map and all preloaded resources into the application
  920. context. FSOpenOrphanResFile loads everything into the system context and detaches the file
  921. from the context in which it was opened. If the file is already in the resource chain and a new
  922. instance is not opened, FSOpenOrphanResFile will return a paramErr.
  923. Use with care, as can and will fail if the map is very large or a lot of preload
  924. resources exist.
  925. }
  926. {
  927. * FSOpenOrphanResFile()
  928. *
  929. * Mac OS X threading:
  930. * Not thread safe
  931. *
  932. * Availability:
  933. * Mac OS X: in version 10.5 and later in CoreServices.framework
  934. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.5 and later
  935. * Non-Carbon CFM: not available
  936. }
  937. function FSOpenOrphanResFile( const (*var*) ref: FSRef; permission: SignedByte; var refNum: ResFileRefNum ): OSErr; external name '_FSOpenOrphanResFile';
  938. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  939. {
  940. * FSCreateResourceFile()
  941. *
  942. * Summary:
  943. * Creates a new resource file.
  944. *
  945. * Discussion:
  946. * This function creates a new file and initializes the specified
  947. * named fork as an empty resource fork. This function allows for
  948. * the creation of data fork only files which can be used for
  949. * storing resources. Passing in a null name defaults to using the
  950. * data fork.
  951. *
  952. * Mac OS X threading:
  953. * Not thread safe
  954. *
  955. * Parameters:
  956. *
  957. * parentRef:
  958. * The directory where the file is to be created
  959. *
  960. * nameLength:
  961. * Number of Unicode characters in the file's name
  962. *
  963. * name:
  964. * A pointer to the Unicode name
  965. *
  966. * whichInfo:
  967. * Which catalog info fields to set
  968. *
  969. * catalogInfo:
  970. * The values for catalog info fields to set; may be NULL
  971. *
  972. * forkNameLength:
  973. * The length of the fork name (in Unicode characters)
  974. *
  975. * forkName:
  976. * The name of the fork to initialize (in Unicode); may be NULL
  977. *
  978. * newRef:
  979. * A pointer to the FSRef for the new file; may be NULL
  980. *
  981. * newSpec:
  982. * A pointer to the FSSpec for the new directory; may be NULL.
  983. * Ignored on 64 bit.
  984. *
  985. * Availability:
  986. * Mac OS X: in version 10.0 and later in CoreServices.framework
  987. * CarbonLib: in CarbonLib 1.3 and later
  988. * Non-Carbon CFM: not available
  989. }
  990. function FSCreateResourceFile( const (*var*) parentRef: FSRef; nameLength: UniCharCount; name: UniCharPtr; whichInfo: FSCatalogInfoBitmap; {const} catalogInfo: FSCatalogInfoPtr { can be NULL }; forkNameLength: UniCharCount; {const} forkName: UniCharPtr { can be NULL }; newRef: FSRefPtr { can be NULL }; newSpec: FSSpecPtr { can be NULL } ): OSErr; external name '_FSCreateResourceFile';
  991. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  992. {
  993. * FSCreateResourceFork()
  994. *
  995. * Summary:
  996. * Creates the named forked and initializes it as an empty resource
  997. * fork.
  998. *
  999. * Discussion:
  1000. * This function allows a resource fork to be added to an existing
  1001. * file. Passing in a null forkname will result in the data fork
  1002. * being used. If the named fork already exists this function does
  1003. * nothing and returns errFSForkExists.
  1004. *
  1005. * Mac OS X threading:
  1006. * Not thread safe
  1007. *
  1008. * Parameters:
  1009. *
  1010. * ref:
  1011. * The file to add the fork to
  1012. *
  1013. * forkNameLength:
  1014. * The length of the fork name (in Unicode characters)
  1015. *
  1016. * forkName:
  1017. * The name of the fork to open (in Unicode); may be NULL
  1018. *
  1019. * flags:
  1020. * Pass in zero
  1021. *
  1022. * Availability:
  1023. * Mac OS X: in version 10.2 and later in CoreServices.framework
  1024. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1025. * Non-Carbon CFM: not available
  1026. }
  1027. function FSCreateResourceFork( const (*var*) ref: FSRef; forkNameLength: UniCharCount; {const} forkName: UniCharPtr { can be NULL }; flags: UInt32 ): OSErr; external name '_FSCreateResourceFork';
  1028. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  1029. {
  1030. * FSOpenResourceFile()
  1031. *
  1032. * Summary:
  1033. * Opens the specified named fork as a resource fork.
  1034. *
  1035. * Discussion:
  1036. * This function allows any named fork of a file to be used for
  1037. * storing resources. Passing in a null forkname will result in the
  1038. * data fork being used.
  1039. *
  1040. * Mac OS X threading:
  1041. * Not thread safe
  1042. *
  1043. * Parameters:
  1044. *
  1045. * ref:
  1046. * The file containing the fork to open
  1047. *
  1048. * forkNameLength:
  1049. * The length of the fork name (in Unicode characters)
  1050. *
  1051. * forkName:
  1052. * The name of the fork to open (in Unicode); may be NULL
  1053. *
  1054. * permissions:
  1055. * The access (read and/or write) you want
  1056. *
  1057. * refNum:
  1058. * On exit the reference number for accessing the open fork
  1059. *
  1060. * Availability:
  1061. * Mac OS X: in version 10.0 and later in CoreServices.framework
  1062. * CarbonLib: in CarbonLib 1.3 and later
  1063. * Non-Carbon CFM: not available
  1064. }
  1065. function FSOpenResourceFile( const (*var*) ref: FSRef; forkNameLength: UniCharCount; {const} forkName: UniCharPtr { can be NULL }; permissions: SInt8; var refNum: ResFileRefNum ): OSErr; external name '_FSOpenResourceFile';
  1066. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA) *)
  1067. { Deprecated Functions -------------------------------------------------------}
  1068. { use FSOpenResourceFile instead}
  1069. {$ifc not TARGET_CPU_64}
  1070. {
  1071. * OpenRFPerm() *** DEPRECATED ***
  1072. *
  1073. * Mac OS X threading:
  1074. * Not thread safe
  1075. *
  1076. * Availability:
  1077. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1078. * CarbonLib: in CarbonLib 1.0 and later
  1079. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1080. }
  1081. function OpenRFPerm( const (*var*) fileName: Str255; vRefNum: FSVolumeRefNum; permission: SInt8 ): ResFileRefNum; external name '_OpenRFPerm';
  1082. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1083. { use FSOpenResourceFile instead}
  1084. {
  1085. * HOpenResFile() *** DEPRECATED ***
  1086. *
  1087. * Mac OS X threading:
  1088. * Not thread safe
  1089. *
  1090. * Availability:
  1091. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1092. * CarbonLib: in CarbonLib 1.0 and later
  1093. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1094. }
  1095. function HOpenResFile( vRefNum: FSVolumeRefNum; dirID: SIGNEDLONG; const (*var*) fileName: Str255; permission: SInt8 ): ResFileRefNum; external name '_HOpenResFile';
  1096. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1097. { use FSCreateResourceFile instead}
  1098. {
  1099. * HCreateResFile() *** DEPRECATED ***
  1100. *
  1101. * Mac OS X threading:
  1102. * Not thread safe
  1103. *
  1104. * Availability:
  1105. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1106. * CarbonLib: in CarbonLib 1.0 and later
  1107. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1108. }
  1109. procedure HCreateResFile( vRefNum: FSVolumeRefNum; dirID: SIGNEDLONG; const (*var*) fileName: Str255 ); external name '_HCreateResFile';
  1110. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1111. { use FSOpenResourceFile instead}
  1112. {
  1113. * FSpOpenResFile() *** DEPRECATED ***
  1114. *
  1115. * Mac OS X threading:
  1116. * Not thread safe
  1117. *
  1118. * Availability:
  1119. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1120. * CarbonLib: in CarbonLib 1.0 and later
  1121. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1122. }
  1123. function FSpOpenResFile( const (*var*) spec: FSSpec; permission: SignedByte ): ResFileRefNum; external name '_FSpOpenResFile';
  1124. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1125. { use FSCreateResourceFile instead}
  1126. {
  1127. * FSpCreateResFile() *** DEPRECATED ***
  1128. *
  1129. * Mac OS X threading:
  1130. * Not thread safe
  1131. *
  1132. * Availability:
  1133. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1134. * CarbonLib: in CarbonLib 1.0 and later
  1135. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1136. }
  1137. procedure FSpCreateResFile( const (*var*) spec: FSSpec; creator: OSType; fileType: OSType; scriptTag: ScriptCode ); external name '_FSpCreateResFile';
  1138. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1139. { use FSResourceFileAlreadyOpen instead}
  1140. {
  1141. * FSpResourceFileAlreadyOpen() *** DEPRECATED ***
  1142. *
  1143. * Mac OS X threading:
  1144. * Not thread safe
  1145. *
  1146. * Availability:
  1147. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1148. * CarbonLib: in CarbonLib 1.0 and later
  1149. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  1150. }
  1151. function FSpResourceFileAlreadyOpen( const (*var*) resourceFile: FSSpec; var inChain: Boolean; var refNum: ResFileRefNum ): Boolean; external name '_FSpResourceFileAlreadyOpen';
  1152. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1153. { use FSOpenOrphanResFile instead}
  1154. {
  1155. * FSpOpenOrphanResFile() *** DEPRECATED ***
  1156. *
  1157. * Mac OS X threading:
  1158. * Not thread safe
  1159. *
  1160. * Availability:
  1161. * Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  1162. * CarbonLib: in CarbonLib 1.0 and later
  1163. * Non-Carbon CFM: not available
  1164. }
  1165. function FSpOpenOrphanResFile( const (*var*) spec: FSSpec; permission: SignedByte; var refNum: ResFileRefNum ): OSErr; external name '_FSpOpenOrphanResFile';
  1166. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
  1167. {$endc} {not TARGET_CPU_64}
  1168. {$endc} {TARGET_OS_MAC}
  1169. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1170. end.
  1171. {$endc} {not MACOSALLINCLUDE}