PageRenderTime 45ms CodeModel.GetById 33ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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