CodeFragments.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. {
  2. File: CodeFragments.p
  3. Contains: Public Code Fragment Manager Interfaces.
  4. Version: Technology: Forte CFM and Carbon
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1992-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. ¥
  13. ===========================================================================================
  14. The Code Fragment Manager API
  15. =============================
  16. }
  17. {
  18. Modified for use with Free Pascal
  19. Version 200
  20. Please report any bugs to <[email protected]>
  21. }
  22. {$mode macpas}
  23. {$packenum 1}
  24. {$macro on}
  25. {$inline on}
  26. {$CALLING MWPASCAL}
  27. unit CodeFragments;
  28. interface
  29. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  30. {$setc GAP_INTERFACES_VERSION := $0200}
  31. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  32. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  33. {$endc}
  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. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  41. {$setc __ppc__ := 1}
  42. {$elsec}
  43. {$setc __ppc__ := 0}
  44. {$endc}
  45. {$ifc not defined __i386__ and defined CPUI386}
  46. {$setc __i386__ := 1}
  47. {$elsec}
  48. {$setc __i386__ := 0}
  49. {$endc}
  50. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  51. {$error Conflicting definitions for __ppc__ and __i386__}
  52. {$endc}
  53. {$ifc defined __ppc__ and __ppc__}
  54. {$setc TARGET_CPU_PPC := TRUE}
  55. {$setc TARGET_CPU_X86 := FALSE}
  56. {$elifc defined __i386__ and __i386__}
  57. {$setc TARGET_CPU_PPC := FALSE}
  58. {$setc TARGET_CPU_X86 := TRUE}
  59. {$elsec}
  60. {$error Neither __ppc__ nor __i386__ is defined.}
  61. {$endc}
  62. {$setc TARGET_CPU_PPC_64 := FALSE}
  63. {$ifc defined FPC_BIG_ENDIAN}
  64. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  65. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  66. {$elifc defined FPC_LITTLE_ENDIAN}
  67. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  68. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  69. {$elsec}
  70. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  71. {$endc}
  72. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  73. {$setc CALL_NOT_IN_CARBON := FALSE}
  74. {$setc OLDROUTINENAMES := FALSE}
  75. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  76. {$setc OPAQUE_UPP_TYPES := TRUE}
  77. {$setc OTCARBONAPPLICATION := TRUE}
  78. {$setc OTKERNEL := FALSE}
  79. {$setc PM_USE_SESSION_APIS := TRUE}
  80. {$setc TARGET_API_MAC_CARBON := TRUE}
  81. {$setc TARGET_API_MAC_OS8 := FALSE}
  82. {$setc TARGET_API_MAC_OSX := TRUE}
  83. {$setc TARGET_CARBON := TRUE}
  84. {$setc TARGET_CPU_68K := FALSE}
  85. {$setc TARGET_CPU_MIPS := FALSE}
  86. {$setc TARGET_CPU_SPARC := FALSE}
  87. {$setc TARGET_OS_MAC := TRUE}
  88. {$setc TARGET_OS_UNIX := FALSE}
  89. {$setc TARGET_OS_WIN32 := FALSE}
  90. {$setc TARGET_RT_MAC_68881 := FALSE}
  91. {$setc TARGET_RT_MAC_CFM := FALSE}
  92. {$setc TARGET_RT_MAC_MACHO := TRUE}
  93. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  94. {$setc TYPE_BOOL := FALSE}
  95. {$setc TYPE_EXTENDED := FALSE}
  96. {$setc TYPE_LONGLONG := TRUE}
  97. uses MacTypes,CFBundle,Files,Multiprocessing;
  98. {$ALIGN MAC68K}
  99. {
  100. ¤
  101. ===========================================================================================
  102. General Types and Constants
  103. ===========================
  104. }
  105. const
  106. kCFragResourceType = $63667267 (* 'cfrg' *);
  107. kCFragResourceID = 0;
  108. kCFragLibraryFileType = $73686C62 (* 'shlb' *);
  109. kCFragAllFileTypes = $FFFFFFFF;
  110. type
  111. CFragArchitecture = OSType;
  112. const
  113. { Values for type CFragArchitecture. }
  114. kPowerPCCFragArch = $70777063 (* 'pwpc' *);
  115. kMotorola68KCFragArch = $6D36386B (* 'm68k' *);
  116. kAnyCFragArch = $3F3F3F3F;
  117. {$ifc TARGET_CPU_PPC}
  118. kCompiledCFragArch = $70777063 (* 'pwpc' *);
  119. {$endc}
  120. {$ifc TARGET_CPU_68K}
  121. kCompiledCFragArch = $6D36386B (* 'm68k' *);
  122. {$endc}
  123. {$ifc TARGET_CPU_X86}
  124. kCompiledCFragArch = $6E6F6E65 (* 'none' *);
  125. {$endc}
  126. type
  127. CFragVersionNumber = UInt32;
  128. const
  129. kNullCFragVersion = 0;
  130. kWildcardCFragVersion = $FFFFFFFF;
  131. type
  132. CFragUsage = UInt8;
  133. const
  134. { Values for type CFragUsage. }
  135. kImportLibraryCFrag = 0; { Standard CFM import library. }
  136. kApplicationCFrag = 1; { MacOS application. }
  137. kDropInAdditionCFrag = 2; { Application or library private extension/plug-in }
  138. kStubLibraryCFrag = 3; { Import library used for linking only }
  139. kWeakStubLibraryCFrag = 4; { Import library used for linking only and will be automatically weak linked }
  140. kIsCompleteCFrag = 0; { A "base" fragment, not an update. }
  141. kFirstCFragUpdate = 1; { The first update, others are numbered 2, 3, ... }
  142. kCFragGoesToEOF = 0;
  143. type
  144. CFragLocatorKind = UInt8;
  145. const
  146. { Values for type CFragLocatorKind. }
  147. kMemoryCFragLocator = 0; { Container is in memory. }
  148. kDataForkCFragLocator = 1; { Container is in a file's data fork. }
  149. kResourceCFragLocator = 2; { Container is in a file's resource fork. }
  150. kNamedFragmentCFragLocator = 4; { ! Reserved for possible future use! }
  151. kCFBundleCFragLocator = 5; { Container is in the executable of a CFBundle }
  152. kCFBundleIntCFragLocator = 6; { passed to init routines in lieu of kCFBundleCFragLocator }
  153. {
  154. --------------------------------------------------------------------------------------
  155. A 'cfrg' resource consists of a header followed by a sequence of variable length
  156. members. The constant kDefaultCFragNameLen only provides for a legal ANSI declaration
  157. and for a reasonable display in a debugger. The actual name field is cut to fit.
  158. There may be "extensions" after the name, the memberSize field includes them. The
  159. general form of an extension is a 16 bit type code followed by a 16 bit size in bytes.
  160. Only one standard extension type is defined at present, it is used by SOM's searching
  161. mechanism.
  162. }
  163. type
  164. CFragUsage1UnionPtr = ^CFragUsage1Union;
  165. CFragUsage1Union = record
  166. case SInt16 of
  167. { ! Meaning differs depending on value of "usage". }
  168. 0: (
  169. appStackSize: UInt32; { If the fragment is an application. (Not used by CFM!) }
  170. );
  171. end;
  172. CFragUsage2UnionPtr = ^CFragUsage2Union;
  173. CFragUsage2Union = record
  174. case SInt16 of
  175. { ! Meaning differs depending on value of "usage". }
  176. 0: (
  177. appSubdirID: SInt16; { If the fragment is an application. }
  178. );
  179. 1: (
  180. libFlags: UInt16; { If the fragment is an import library. }
  181. );
  182. end;
  183. const
  184. { Bit masks for the CFragUsage2Union libFlags variant. }
  185. kCFragLibUsageMapPrivatelyMask = $0001; { Put container in app heap if necessary. }
  186. type
  187. CFragWhere1UnionPtr = ^CFragWhere1Union;
  188. CFragWhere1Union = record
  189. case SInt16 of
  190. { ! Meaning differs depending on value of "where". }
  191. 0: (
  192. spaceID: UInt32; { If the fragment is in memory. (Actually an AddressSpaceID.) }
  193. );
  194. end;
  195. CFragWhere2UnionPtr = ^CFragWhere2Union;
  196. CFragWhere2Union = record
  197. case SInt16 of
  198. { ! Meaning differs depending on value of "where". }
  199. 0: (
  200. reserved: UInt16;
  201. );
  202. end;
  203. const
  204. kDefaultCFragNameLen = 16;
  205. type
  206. CFragResourceMemberPtr = ^CFragResourceMember;
  207. CFragResourceMember = record
  208. architecture: CFragArchitecture;
  209. reservedA: UInt16; { ! Must be zero! }
  210. reservedB: SInt8; { ! Must be zero! }
  211. updateLevel: SInt8;
  212. currentVersion: CFragVersionNumber;
  213. oldDefVersion: CFragVersionNumber;
  214. uUsage1: CFragUsage1Union;
  215. uUsage2: CFragUsage2Union;
  216. usage: SInt8;
  217. where: SInt8;
  218. offset: UInt32;
  219. length: UInt32;
  220. uWhere1: CFragWhere1Union;
  221. uWhere2: CFragWhere2Union;
  222. extensionCount: UInt16; { The number of extensions beyond the name. }
  223. memberSize: UInt16; { Size in bytes, includes all extensions. }
  224. name: packed array [0..15] of UInt8; { ! Actually a sized PString. }
  225. end;
  226. CFragResourceExtensionHeaderPtr = ^CFragResourceExtensionHeader;
  227. CFragResourceExtensionHeader = record
  228. extensionKind: UInt16;
  229. extensionSize: UInt16;
  230. end;
  231. CFragResourceSearchExtensionPtr = ^CFragResourceSearchExtension;
  232. CFragResourceSearchExtension = record
  233. header: CFragResourceExtensionHeader;
  234. libKind: OSType;
  235. qualifiers: SInt8; { ! Actually four PStrings. }
  236. end;
  237. const
  238. kCFragResourceSearchExtensionKind = $30EE;
  239. type
  240. CFragResourcePtr = ^CFragResource;
  241. CFragResource = record
  242. reservedA: UInt32; { ! Must be zero! }
  243. reservedB: UInt32; { ! Must be zero! }
  244. reservedC: UInt16; { ! Must be zero! }
  245. version: UInt16;
  246. reservedD: UInt32; { ! Must be zero! }
  247. reservedE: UInt32; { ! Must be zero! }
  248. reservedF: UInt32; { ! Must be zero! }
  249. reservedG: UInt32; { ! Must be zero! }
  250. reservedH: UInt16; { ! Must be zero! }
  251. memberCount: UInt16;
  252. firstMember: CFragResourceMember;
  253. end;
  254. CFragResourceHandle = ^CFragResourcePtr;
  255. const
  256. kCurrCFragResourceVersion = 1;
  257. type
  258. CFragContextID = MPProcessID;
  259. CFragConnectionID = ^SInt32; { an opaque 32-bit type }
  260. CFragConnectionIDPtr = ^CFragConnectionID; { when a var xx:CFragConnectionID parameter can be nil, it is changed to xx: CFragConnectionIDPtr }
  261. CFragClosureID = ^SInt32; { an opaque 32-bit type }
  262. CFragClosureIDPtr = ^CFragClosureID; { when a var xx:CFragClosureID parameter can be nil, it is changed to xx: CFragClosureIDPtr }
  263. CFragContainerID = ^SInt32; { an opaque 32-bit type }
  264. CFragContainerIDPtr = ^CFragContainerID; { when a var xx:CFragContainerID parameter can be nil, it is changed to xx: CFragContainerIDPtr }
  265. CFragLoadOptions = OptionBits;
  266. mainAddrPtr = ^Ptr; { when a var mainAddr: Ptr parameter can be nil, it is changed to mainAddr: mainAddrPtr }
  267. symAddrPtr = ^Ptr; { when a var symAddr: Ptr parameter can be nil, it is changed to symAddr: symAddrPtr }
  268. const
  269. { Values for type CFragLoadOptions. }
  270. kReferenceCFrag = $0001; { Try to use existing copy, increment reference counts. }
  271. kFindCFrag = $0002; { Try find an existing copy, do not increment reference counts. }
  272. kPrivateCFragCopy = $0005; { Prepare a new private copy. (kReferenceCFrag | 0x0004) }
  273. kUnresolvedCFragSymbolAddress = 0;
  274. type
  275. CFragSymbolClass = UInt8;
  276. CFragSymbolClassPtr = ^CFragSymbolClass; { when a var xx:CFragSymbolClass parameter can be nil, it is changed to xx: CFragSymbolClassPtr }
  277. const
  278. { Values for type CFragSymbolClass. }
  279. kCodeCFragSymbol = 0;
  280. kDataCFragSymbol = 1;
  281. kTVectorCFragSymbol = 2;
  282. kTOCCFragSymbol = 3;
  283. kGlueCFragSymbol = 4;
  284. {
  285. ¤
  286. ===========================================================================================
  287. Macros and Functions
  288. ====================
  289. }
  290. {
  291. * GetSharedLibrary()
  292. *
  293. * Discussion:
  294. * The connID, mainAddr, and errMessage parameters may be NULL with
  295. * MacOS 8.5 and later. Passing NULL as those parameters when
  296. * running Mac OS 8.1 and earlier systems will corrupt low-memory.
  297. *
  298. * Availability:
  299. * Non-Carbon CFM: in CFragManager 1.0 and later
  300. * CarbonLib: in CarbonLib 1.0 and later
  301. * Mac OS X: in version 10.0 and later
  302. }
  303. function GetSharedLibrary(const (*var*) libName: Str63; archType: CFragArchitecture; options: CFragLoadOptions; var connID: CFragConnectionID; var mainAddr: Ptr; var errMessage: Str255): OSErr; external name '_GetSharedLibrary';
  304. {
  305. * GetDiskFragment()
  306. *
  307. * Availability:
  308. * Non-Carbon CFM: in CFragManager 1.0 and later
  309. * CarbonLib: in CarbonLib 1.0 and later
  310. * Mac OS X: in version 10.0 and later
  311. }
  312. function GetDiskFragment(const (*var*) fileSpec: FSSpec; offset: UInt32; length: UInt32; fragName: ConstStringPtr; options: CFragLoadOptions; connID: CFragConnectionIDPtr; mainAddr: mainAddrPtr; errMessage: StringPtr): OSErr; external name '_GetDiskFragment';
  313. {
  314. * GetMemFragment()
  315. *
  316. * Availability:
  317. * Non-Carbon CFM: in CFragManager 1.0 and later
  318. * CarbonLib: in CarbonLib 1.0 and later
  319. * Mac OS X: in version 10.0 and later
  320. }
  321. function GetMemFragment(memAddr: UnivPtr; length: UInt32; fragName: ConstStringPtr; options: CFragLoadOptions; connID: CFragConnectionIDPtr; mainAddr: mainAddrPtr; errMessage: StringPtr): OSErr; external name '_GetMemFragment';
  322. {
  323. * CloseConnection()
  324. *
  325. * Availability:
  326. * Non-Carbon CFM: in CFragManager 1.0 and later
  327. * CarbonLib: in CarbonLib 1.0 and later
  328. * Mac OS X: in version 10.0 and later
  329. }
  330. function CloseConnection(var connID: CFragConnectionID): OSErr; external name '_CloseConnection';
  331. {
  332. * FindSymbol()
  333. *
  334. * Availability:
  335. * Non-Carbon CFM: in CFragManager 1.0 and later
  336. * CarbonLib: in CarbonLib 1.0 and later
  337. * Mac OS X: in version 10.0 and later
  338. }
  339. function FindSymbol(connID: CFragConnectionID; const (*var*) symName: Str255; symAddr: symAddrPtr; symClass: CFragSymbolClassPtr): OSErr; external name '_FindSymbol';
  340. {
  341. * CountSymbols()
  342. *
  343. * Availability:
  344. * Non-Carbon CFM: in CFragManager 1.0 and later
  345. * CarbonLib: in CarbonLib 1.0 and later
  346. * Mac OS X: in version 10.0 and later
  347. }
  348. function CountSymbols(connID: CFragConnectionID; var symCount: SInt32): OSErr; external name '_CountSymbols';
  349. {
  350. * GetIndSymbol()
  351. *
  352. * Availability:
  353. * Non-Carbon CFM: in CFragManager 1.0 and later
  354. * CarbonLib: in CarbonLib 1.0 and later
  355. * Mac OS X: in version 10.0 and later
  356. }
  357. function GetIndSymbol(connID: CFragConnectionID; symIndex: SInt32; symName: StringPtr; symAddr: symAddrPtr; symClass: CFragSymbolClassPtr): OSErr; external name '_GetIndSymbol';
  358. {
  359. ¤
  360. ===========================================================================================
  361. Initialization & Termination Routines
  362. =====================================
  363. }
  364. {
  365. -----------------------------------------------------------------------------------------
  366. A fragment's initialization and termination routines are called when a new incarnation of
  367. the fragment is created or destroyed, respectively. Exactly when this occurs depends on
  368. what kinds of section sharing the fragment has and how the fragment is prepared. Import
  369. libraries have at most one incarnation per process. Fragments prepared with option
  370. kPrivateCFragCopy may have many incarnations per process.
  371. The initialization function is passed a pointer to an initialization information structure
  372. and returns an OSErr. If an initialization function returns a non-zero value the entire
  373. closure of which it is a part fails. The C prototype for an initialization function is:
  374. OSErr CFragInitFunction ( const CFragInitBlock * initBlock );
  375. The termination procedure takes no parameters and returns nothing. The C prototype for a
  376. termination procedure is:
  377. void CFragTermProcedure ( void );
  378. Note that since the initialization and termination routines are themselves "CFM"-style
  379. routines whether or not they have the "pascal" keyword is irrelevant.
  380. }
  381. {
  382. -----------------------------------------------------------------------------------------
  383. ! Note:
  384. ! The "System7" portion of these type names was introduced during the evolution towards
  385. ! the now defunct Copland version of Mac OS. Copland was to be called System 8 and there
  386. ! were slightly different types for System 7 and System 8. The "generic" type names were
  387. ! conditionally defined for the desired target system.
  388. ! Always use the generic types, e.g. CFragInitBlock! The "System7" names have been kept
  389. ! only to avoid perturbing code that (improperly) used the target specific type.
  390. }
  391. type
  392. CFragSystem7MemoryLocatorPtr = ^CFragSystem7MemoryLocator;
  393. CFragSystem7MemoryLocator = record
  394. address: LogicalAddress;
  395. length: UInt32;
  396. inPlace: boolean;
  397. reservedA: SInt8; { ! Must be zero! }
  398. reservedB: UInt16; { ! Must be zero! }
  399. end;
  400. CFragSystem7DiskFlatLocatorPtr = ^CFragSystem7DiskFlatLocator;
  401. CFragSystem7DiskFlatLocator = record
  402. fileSpec: FSSpecPtr;
  403. offset: UInt32;
  404. length: UInt32;
  405. end;
  406. { ! This must have a file specification at the same offset as a disk flat locator! }
  407. CFragSystem7SegmentedLocatorPtr = ^CFragSystem7SegmentedLocator;
  408. CFragSystem7SegmentedLocator = record
  409. fileSpec: FSSpecPtr;
  410. rsrcType: OSType;
  411. rsrcID: SInt16;
  412. reservedA: UInt16; { ! Must be zero! }
  413. end;
  414. {
  415. The offset and length for a "Bundle" locator refers to the offset in
  416. the CFM executable contained by the bundle.
  417. }
  418. CFragCFBundleLocatorPtr = ^CFragCFBundleLocator;
  419. CFragCFBundleLocator = record
  420. fragmentBundle: CFBundleRef; { Do not call CFRelease on this bundle! }
  421. offset: UInt32;
  422. length: UInt32;
  423. end;
  424. CFragSystem7LocatorPtr = ^CFragSystem7Locator;
  425. CFragSystem7Locator = record
  426. where: SInt32;
  427. case SInt16 of
  428. 0: (
  429. onDisk: CFragSystem7DiskFlatLocator;
  430. );
  431. 1: (
  432. inMem: CFragSystem7MemoryLocator;
  433. );
  434. 2: (
  435. inSegs: CFragSystem7SegmentedLocator;
  436. );
  437. 3: (
  438. inBundle: CFragCFBundleLocator;
  439. );
  440. end;
  441. CFragSystem7InitBlockPtr = ^CFragSystem7InitBlock;
  442. CFragSystem7InitBlock = record
  443. contextID: CFragContextID;
  444. closureID: CFragClosureID;
  445. connectionID: CFragConnectionID;
  446. fragLocator: CFragSystem7Locator;
  447. libName: StringPtr;
  448. reservedA: UInt32; { ! Must be zero! }
  449. end;
  450. CFragInitBlock = CFragSystem7InitBlock;
  451. CFragInitBlockPtr = ^CFragInitBlock;
  452. { These init/term routine types are only of value to CFM itself. }
  453. {$ifc TYPED_FUNCTION_POINTERS}
  454. CFragInitFunction = function(const (*var*) initBlock: CFragInitBlock): OSErr;
  455. {$elsec}
  456. CFragInitFunction = ProcPtr;
  457. {$endc}
  458. {$ifc TYPED_FUNCTION_POINTERS}
  459. CFragTermProcedure = procedure;
  460. {$elsec}
  461. CFragTermProcedure = ProcPtr;
  462. {$endc}
  463. {
  464. For use by init routines. If you get a BundleIntLocator (used to be BundlePreLocator),
  465. convert it to a CFBundleLocator with this. Only call this once per locator.
  466. }
  467. {
  468. * ConvertBundlePreLocator()
  469. *
  470. * Availability:
  471. * Non-Carbon CFM: not available
  472. * CarbonLib: in CarbonLib 1.4 and later
  473. * Mac OS X: in version 10.0 and later
  474. }
  475. function ConvertBundlePreLocator(initBlockLocator: CFragSystem7LocatorPtr): OSErr; external name '_ConvertBundlePreLocator';
  476. {
  477. ¤
  478. ===========================================================================================
  479. Old Name Spellings
  480. ==================
  481. }
  482. {
  483. -------------------------------------------------------------------------------------------
  484. We've tried to reduce the risk of name collisions in the future by introducing the phrase
  485. "CFrag" into constant and type names. The old names are defined below in terms of the new.
  486. }
  487. const
  488. kLoadCFrag = $0001;
  489. {$ifc OLDROUTINENAMES}
  490. type
  491. ConnectionID = CFragConnectionID;
  492. LoadFlags = CFragLoadOptions;
  493. SymClass = CFragSymbolClass;
  494. InitBlock = CFragInitBlock;
  495. InitBlockPtr = ^InitBlock;
  496. MemFragment = CFragSystem7MemoryLocator;
  497. MemFragmentPtr = ^MemFragment;
  498. DiskFragment = CFragSystem7DiskFlatLocator;
  499. DiskFragmentPtr = ^DiskFragment;
  500. SegmentedFragment = CFragSystem7SegmentedLocator;
  501. SegmentedFragmentPtr = ^SegmentedFragment;
  502. FragmentLocator = CFragSystem7Locator;
  503. FragmentLocatorPtr = ^FragmentLocator;
  504. CFragHFSMemoryLocator = CFragSystem7MemoryLocator;
  505. CFragHFSMemoryLocatorPtr = ^CFragHFSMemoryLocator;
  506. CFragHFSDiskFlatLocator = CFragSystem7DiskFlatLocator;
  507. CFragHFSDiskFlatLocatorPtr = ^CFragHFSDiskFlatLocator;
  508. CFragHFSSegmentedLocator = CFragSystem7SegmentedLocator;
  509. CFragHFSSegmentedLocatorPtr = ^CFragHFSSegmentedLocator;
  510. CFragHFSLocator = CFragSystem7Locator;
  511. CFragHFSLocatorPtr = ^CFragHFSLocator;
  512. const
  513. kPowerPCArch = $70777063 (* 'pwpc' *);
  514. kMotorola68KArch = $6D36386B (* 'm68k' *);
  515. kAnyArchType = $3F3F3F3F;
  516. kNoLibName = 0;
  517. kNoConnectionID = 0;
  518. kLoadLib = $0001;
  519. kFindLib = $0002;
  520. kNewCFragCopy = $0005;
  521. kLoadNewCopy = $0005;
  522. kUseInPlace = $80;
  523. kCodeSym = 0;
  524. kDataSym = 1;
  525. kTVectSym = 2;
  526. kTOCSym = 3;
  527. kGlueSym = 4;
  528. kInMem = 0;
  529. kOnDiskFlat = 1;
  530. kOnDiskSegmented = 2;
  531. kIsLib = 0;
  532. kIsApp = 1;
  533. kIsDropIn = 2;
  534. kFullLib = 0;
  535. kUpdateLib = 1;
  536. kWholeFork = 0;
  537. kCFMRsrcType = $63667267 (* 'cfrg' *);
  538. kCFMRsrcID = 0;
  539. kSHLBFileType = $73686C62 (* 'shlb' *);
  540. kUnresolvedSymbolAddress = 0;
  541. kPowerPC = $70777063 (* 'pwpc' *);
  542. kMotorola68K = $6D36386B (* 'm68k' *);
  543. {$endc} {OLDROUTINENAMES}
  544. {$ALIGN MAC68K}
  545. end.