MacTypes.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. {
  2. File: CarbonCore/MacTypes.h
  3. Contains: Basic Macintosh data types.
  4. Version: CarbonCore-654.0.85~1
  5. Copyright: © 1985-2005 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit MacTypes;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  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 CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses ConditionalMacros;
  92. {$ALIGN MAC68K}
  93. {*******************************************************************************
  94. Base integer types for all target OS's and CPU's
  95. UInt8 8-bit unsigned integer
  96. SInt8 8-bit signed integer
  97. UInt16 16-bit unsigned integer
  98. SInt16 16-bit signed integer
  99. UInt32 32-bit unsigned integer
  100. SInt32 32-bit signed integer
  101. UInt64 64-bit unsigned integer
  102. SInt64 64-bit signed integer
  103. ********************************************************************************}
  104. type
  105. SInt8 = ShortInt;
  106. UInt8 = Byte;
  107. SInt16 = Integer;
  108. UInt16 = Word;
  109. SInt32 = LongInt;
  110. UInt32 = Longword;
  111. SInt64 = Int64;
  112. UInt64 = QWord;
  113. {$ifc TARGET_RT_BIG_ENDIAN}
  114. type
  115. wide = record
  116. case boolean of
  117. false:
  118. ( hi: SInt32;
  119. lo: UInt32);
  120. true:
  121. ( int: SInt64)
  122. end;
  123. UnsignedWide = record
  124. case boolean of
  125. false:
  126. ( hi: UInt32;
  127. lo: UInt32);
  128. true:
  129. ( int: UInt64)
  130. end;
  131. {$elsec}
  132. type
  133. wide = record
  134. case boolean of
  135. false:
  136. ( lo: UInt32;
  137. hi: SInt32);
  138. true:
  139. ( int: SInt64)
  140. end;
  141. UnsignedWide = record
  142. case boolean of
  143. false:
  144. ( lo: UInt32;
  145. hi: UInt32);
  146. true:
  147. ( int: UInt64)
  148. end;
  149. {$endc} {TARGET_RT_BIG_ENDIAN}
  150. type
  151. SInt8Ptr = ^SInt8;
  152. UInt8Ptr = ^UInt8;
  153. SInt16Ptr = ^SInt16;
  154. UInt16Ptr = ^UInt16;
  155. SInt32Ptr = ^SInt32;
  156. UInt32Ptr = ^UInt32;
  157. SInt64Ptr = ^SInt64;
  158. UInt64Ptr = ^UInt64;
  159. widePtr = ^wide;
  160. UnsignedWidePtr = ^UnsignedWide;
  161. { *******************************************************************************
  162. Special types for pascal
  163. ByteParameter UInt8 passed as an 8-bit parameter
  164. Note: The conventions for Pascal on 68K require that a UInt8 when
  165. passed as a parameter occupy 16-bits on the stack, whereas
  166. an SInt8 would only occupy 8-bits. To make C and Pascal
  167. compatable, in pascal all function parameters of type UInt8
  168. or equivalent are changed to ByteParameter.
  169. ******************************************************************************** }
  170. ByteParameter = SInt8;
  171. // For interfaces that use Cs "bool" type, which is a 32 bit number
  172. CBool = SInt32;
  173. {*******************************************************************************
  174. Base fixed point types
  175. Fixed 16-bit signed integer plus 16-bit fraction
  176. UnsignedFixed 16-bit unsigned integer plus 16-bit fraction
  177. Fract 2-bit signed integer plus 30-bit fraction
  178. ShortFixed 8-bit signed integer plus 8-bit fraction
  179. ********************************************************************************}
  180. type
  181. Fixed = SInt32;
  182. FixedPtr = ^Fixed;
  183. Fract = SInt32;
  184. FractPtr = ^Fract;
  185. UnsignedFixed = UInt32;
  186. UnsignedFixedPtr = ^UnsignedFixed;
  187. ShortFixed = SInt16;
  188. ShortFixedPtr = ^ShortFixed;
  189. {*******************************************************************************
  190. Base floating point types
  191. Float32 32 bit IEEE float: 1 sign bit, 8 exponent bits, 23 fraction bits
  192. Float64 64 bit IEEE float: 1 sign bit, 11 exponent bits, 52 fraction bits
  193. Float80 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits
  194. Float96 96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits
  195. Note: These are fixed size floating point types, useful when writing a floating
  196. point value to disk. If your compiler does not support a particular size
  197. float, a struct is used instead.
  198. Use of of the NCEG types (e.g. double_t) or an ANSI C type (e.g. double) if
  199. you want a floating point representation that is natural for any given
  200. compiler, but might be a different size on different compilers.
  201. ********************************************************************************}
  202. type
  203. Float32 = Single;
  204. Float32Ptr = ^Float32;
  205. Float64 = Double;
  206. Float64Ptr = ^Float64;
  207. LongDouble = Double;
  208. Float80 = record
  209. exp: SInt16;
  210. man: array [0..3] of UInt16;
  211. end;
  212. type
  213. Float96 = record
  214. exp: SInt16;
  215. filler: SInt16;
  216. man: array [0..3] of UInt16;
  217. end;
  218. type
  219. Float32Point = record
  220. x: Float32;
  221. y: Float32;
  222. end;
  223. {*******************************************************************************
  224. Unix compatibility types
  225. ********************************************************************************}
  226. type
  227. size_t = UInt32;
  228. size_t_ptr = ^size_t;
  229. ssize_t = SInt32;
  230. ssize_t_ptr = ^ssize_t;
  231. {*******************************************************************************
  232. MacOS Memory Manager types
  233. Ptr Pointer to a non-relocatable block
  234. Handle Pointer to a master pointer to a relocatable block
  235. Size The number of bytes in a block (signed for historical reasons)
  236. ********************************************************************************}
  237. type
  238. Ptr = ^SInt8;
  239. PtrPtr = ^Ptr;
  240. Handle = ^Ptr;
  241. Size = SInt32;
  242. SizePtr = ^Size;
  243. UnivPtr = Pointer;
  244. UnivPtrPtr = ^UnivPtr;
  245. {*******************************************************************************
  246. Higher level basic types
  247. OSErr 16-bit result error code
  248. OSStatus 32-bit result error code
  249. LogicalAddress Address in the clients virtual address space
  250. ConstLogicalAddress Address in the clients virtual address space that will only be read
  251. PhysicalAddress Real address as used on the hardware bus
  252. BytePtr Pointer to an array of bytes
  253. ByteCount The size of an array of bytes
  254. ByteOffset An offset into an array of bytes
  255. ItemCount 32-bit iteration count
  256. OptionBits Standard 32-bit set of bit flags
  257. PBVersion ?
  258. Duration 32-bit millisecond timer for drivers
  259. AbsoluteTime 64-bit clock
  260. ScriptCode A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding
  261. LangCode A particular language (e.g. English), as represented using a particular ScriptCode
  262. RegionCode Designates a language as used in a particular region (e.g. British vs American
  263. English) together with other region-dependent characteristics (e.g. date format)
  264. FourCharCode A 32-bit value made by packing four 1 byte characters together
  265. OSType A FourCharCode used in the OS and file system (e.g. creator)
  266. ResType A FourCharCode used to tag resources (e.g. 'DLOG')
  267. ********************************************************************************}
  268. type
  269. OSErr = SInt16;
  270. OSStatus = SInt32;
  271. LogicalAddress = UnivPtr;
  272. ConstLogicalAddress = UnivPtr;
  273. PhysicalAddress = UnivPtr;
  274. BytePtr = UInt8Ptr;
  275. ByteCount = UInt32;
  276. ByteCountPtr = ^ByteCount;
  277. ByteOffset = UInt32;
  278. ByteOffsetPtr = ^ByteOffset;
  279. Duration = SInt32;
  280. AbsoluteTime = UnsignedWide;
  281. AbsoluteTimePtr = ^AbsoluteTime;
  282. OptionBits = UInt32;
  283. OptionBitsPtr = ^OptionBits;
  284. ItemCount = UInt32;
  285. ItemCountPtr = ^ItemCount;
  286. PBVersion = UInt32;
  287. ScriptCode = SInt16;
  288. ScriptCodePtr = ^ScriptCode;
  289. LangCode = SInt16;
  290. LangCodePtr = ^LangCode;
  291. RegionCode = SInt16;
  292. RegionCodePtr = ^RegionCode;
  293. FourCharCode = UInt32;
  294. OSType = FourCharCode;
  295. ResType = FourCharCode;
  296. OSTypePtr = ^OSType;
  297. ResTypePtr = ^ResType;
  298. {*******************************************************************************
  299. Boolean types and values
  300. Boolean Mac OS historic type, sizeof(Boolean)==1
  301. bool Defined in stdbool.h, ISO C/C++ standard type
  302. false Now defined in stdbool.h
  303. true Now defined in stdbool.h
  304. ********************************************************************************}
  305. type
  306. { "Boolean", "true", and "false" are built into the Pascal language }
  307. BooleanPtr = ^Boolean;
  308. {*******************************************************************************
  309. Function Pointer Types
  310. ProcPtr Generic pointer to a function
  311. Register68kProcPtr Pointer to a 68K function that expects parameters in registers
  312. UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
  313. ProcHandle Pointer to a ProcPtr
  314. UniversalProcHandle Pointer to a UniversalProcPtr
  315. ********************************************************************************}
  316. type
  317. ProcPtr = Ptr;
  318. Register68kProcPtr = ProcPtr;
  319. UniversalProcPtr = ProcPtr;
  320. type
  321. ProcHandle = ^ProcPtr;
  322. UniversalProcHandle = ^UniversalProcPtr;
  323. {*******************************************************************************
  324. Common Constants
  325. noErr OSErr: function performed properly - no error
  326. kNilOptions OptionBits: all flags false
  327. kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's
  328. kVariableLengthArray array bounds: variable length array
  329. Note: kVariableLengthArray is used in array bounds to specify a variable length array.
  330. It is ususally used in variable length structs when the last field is an array
  331. of any size. Before ANSI C, we used zero as the bounds of variable length
  332. array, but zero length array are illegal in ANSI C. Example usage:
  333. struct FooList
  334. (
  335. short listLength;
  336. Foo elements[kVariableLengthArray];
  337. );
  338. ********************************************************************************}
  339. const
  340. noErr = 0;
  341. const
  342. kNilOptions = 0;
  343. const
  344. kInvalidID = 0;
  345. const
  346. kVariableLengthArray = 1;
  347. const
  348. kUnknownType = $3F3F3F3F; { "????" QuickTime 3.0: default unknown ResType or OSType }
  349. {*******************************************************************************
  350. String Types and Unicode Types
  351. UnicodeScalarValue, A complete Unicode character in UTF-32 format, with
  352. UTF32Char values from 0 through 0x10FFFF (excluding the surrogate
  353. range 0xD800-0xDFFF and certain disallowed values).
  354. UniChar, A 16-bit Unicode code value in the default UTF-16 format.
  355. UTF16Char UnicodeScalarValues 0-0xFFFF are expressed in UTF-16
  356. format using a single UTF16Char with the same value.
  357. UnicodeScalarValues 0x10000-0x10FFFF are expressed in
  358. UTF-16 format using a pair of UTF16Chars - one in the
  359. high surrogate range (0xD800-0xDBFF) followed by one in
  360. the low surrogate range (0xDC00-0xDFFF). All of the
  361. characters defined in Unicode versions through 3.0 are
  362. in the range 0-0xFFFF and can be expressed using a single
  363. UTF16Char, thus the term "Unicode character" generally
  364. refers to a UniChar = UTF16Char.
  365. UTF8Char An 8-bit code value in UTF-8 format. UnicodeScalarValues
  366. 0-0x7F are expressed in UTF-8 format using one UTF8Char
  367. with the same value. UnicodeScalarValues above 0x7F are
  368. expressed in UTF-8 format using 2-4 UTF8Chars, all with
  369. values in the range 0x80-0xF4 (UnicodeScalarValues
  370. 0x100-0xFFFF use two or three UTF8Chars,
  371. UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars).
  372. UniCharCount A count of UTF-16 code values in an array or buffer.
  373. StrNNN Pascal string holding up to NNN bytes
  374. StringPtr Pointer to a pascal string
  375. StringHandle Pointer to a StringPtr
  376. ConstStringPtr Pointer to a read-only pascal string
  377. ConstStrNNNParam For function parameters only - means string is const
  378. CStringPtr Pointer to a C string (in C: char*)
  379. ConstCStringPtr Pointer to a read-only C string (in C: const char*)
  380. Note: The length of a pascal string is stored as the first byte.
  381. A pascal string does not have a termination byte.
  382. A pascal string can hold at most 255 bytes of data.
  383. The first character in a pascal string is offset one byte from the start of the string.
  384. A C string is terminated with a byte of value zero.
  385. A C string has no length limitation.
  386. The first character in a C string is the zeroth byte of the string.
  387. ********************************************************************************}
  388. type
  389. UnicodeScalarValue = UInt32;
  390. UTF32Char = UInt32;
  391. UniChar = UInt16;
  392. UTF16Char = UInt16;
  393. UTF8Char = UInt8;
  394. UniCharPtr = ^UniChar;
  395. ConstUniCharPtr = UniCharPtr;
  396. UniCharCount = UInt32;
  397. UniCharCountPtr = ^UniCharCount;
  398. Str15 = STRING[15];
  399. Str27 = STRING[27];
  400. Str31 = STRING[31];
  401. Str32 = STRING[32];
  402. Str36 = STRING[36];
  403. Str63 = STRING[63];
  404. Str255 = STRING[255];
  405. {
  406. The type Str32 is used in many AppleTalk based data structures.
  407. It holds up to 32 one byte chars. The problem is that with the
  408. length byte it is 33 bytes long. This can cause weird alignment
  409. problems in structures. To fix this the type "Str32Field" has
  410. been created. It should only be used to hold 32 chars, but
  411. it is 34 bytes long so that there are no alignment problems.
  412. }
  413. Str32Field = Str32;
  414. {
  415. QuickTime 3.0:
  416. The type StrFileName is used to make MacOS structs work
  417. cross-platform. For example FSSpec or SFReply previously
  418. contained a Str63 field. They now contain a StrFileName
  419. field which is the same when targeting the MacOS but is
  420. a 256 char buffer for Win32 and unix, allowing them to
  421. contain long file names.
  422. }
  423. type
  424. StrFileName = Str63;
  425. StringPtr = ^Str255;
  426. StringHandle = ^StringPtr;
  427. ConstStringPtr = StringPtr;
  428. CStringPtr = PChar;
  429. ConstCStringPtr = CStringPtr;
  430. CStringPtrPtr = ^CStringPtr;
  431. ConstCStringPtrPtr = ^ConstCStringPtr;
  432. ConstStr255Param = Str255;
  433. ConstStr63Param = Str63;
  434. ConstStr36Param = Str36;
  435. ConstStr32Param = Str32;
  436. ConstStr31Param = Str31;
  437. ConstStr27Param = Str27;
  438. ConstStr15Param = Str15;
  439. ConstStrFileNameParam = ConstStr63Param;
  440. {*******************************************************************************
  441. Process Manager type ProcessSerialNumber (previously in Processes.h)
  442. ********************************************************************************}
  443. { type for unique process identifier }
  444. type
  445. ProcessSerialNumber = record
  446. highLongOfPSN: UInt32;
  447. lowLongOfPSN: UInt32;
  448. end;
  449. ProcessSerialNumberPtr = ^ProcessSerialNumber;
  450. {*******************************************************************************
  451. Quickdraw Types
  452. Point 2D Quickdraw coordinate, range: -32K to +32K
  453. Rect Rectangular Quickdraw area
  454. Style Quickdraw font rendering styles
  455. StyleParameter Style when used as a parameter (historical 68K convention)
  456. StyleField Style when used as a field (historical 68K convention)
  457. CharParameter Char when used as a parameter (historical 68K convention)
  458. Note: The original Macintosh toolbox in 68K Pascal defined Style as a SET.
  459. Both Style and CHAR occupy 8-bits in packed records or 16-bits when
  460. used as fields in non-packed records or as parameters.
  461. ********************************************************************************}
  462. type
  463. Point = record
  464. case SInt16 of
  465. 0: (
  466. v: SInt16;
  467. h: SInt16;
  468. );
  469. 1: (
  470. vh: array [0..1] of SInt16;
  471. );
  472. end;
  473. PointPtr = ^Point;
  474. type
  475. Rect = record
  476. case SInt16 of
  477. 0: (
  478. top: SInt16;
  479. left: SInt16;
  480. bottom: SInt16;
  481. right: SInt16;
  482. );
  483. 1: (
  484. topLeft: Point;
  485. botRight: Point;
  486. );
  487. end;
  488. RectPtr = ^Rect;
  489. type
  490. FixedPoint = record
  491. x: Fixed;
  492. y: Fixed;
  493. end;
  494. FixedPointPtr = ^FixedPoint;
  495. type
  496. FixedRect = record
  497. left: Fixed;
  498. top: Fixed;
  499. right: Fixed;
  500. bottom: Fixed;
  501. end;
  502. FixedRectPtr = ^FixedRect;
  503. type
  504. CharParameter = Char;
  505. const
  506. normal = 0;
  507. bold = 1;
  508. italic = 2;
  509. underline = 4;
  510. outline = 8;
  511. shadow = $10;
  512. condense = $20;
  513. extend = $40;
  514. type
  515. Style = SInt8;
  516. StyleParameter = SInt16;
  517. StyleField = Style;
  518. {*******************************************************************************
  519. QuickTime TimeBase types (previously in Movies.h)
  520. TimeValue Count of units
  521. TimeScale Units per second
  522. CompTimeValue 64-bit count of units (always a struct)
  523. TimeValue64 64-bit count of units (long long or struct)
  524. TimeBase An opaque reference to a time base
  525. TimeRecord Package of TimeBase, duration, and scale
  526. ********************************************************************************}
  527. type
  528. TimeValue = SInt32;
  529. TimeScale = SInt32;
  530. CompTimeValue = wide;
  531. CompTimeValuePtr = ^CompTimeValue;
  532. TimeValue64 = SInt64;
  533. TimeValue64Ptr = ^TimeValue64;
  534. TimeBase = ^SInt32; { an opaque 32-bit type }
  535. TimeBasePtr = ^TimeBase;
  536. TimeRecord = record
  537. value: CompTimeValue; { units (duration or absolute) }
  538. scale: TimeScale; { units per second }
  539. base: TimeBase; { refernce to the time base }
  540. end;
  541. TimeRecordPtr = ^TimeRecord;
  542. {*******************************************************************************
  543. MacOS versioning structures
  544. VersRec Contents of a 'vers' resource
  545. VersRecPtr Pointer to a VersRecPtr
  546. VersRecHndl Resource Handle containing a VersRec
  547. NumVersion Packed BCD version representation (e.g. "4.2.1a3" is 0x04214003)
  548. UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
  549. ProcHandle Pointer to a ProcPtr
  550. UniversalProcHandle Pointer to a UniversalProcPtr
  551. ********************************************************************************}
  552. {$ifc TARGET_RT_BIG_ENDIAN}
  553. type
  554. NumVersion = packed record
  555. { Numeric version part of 'vers' resource }
  556. majorRev: UInt8; {1st part of version number in BCD}
  557. minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
  558. stage: UInt8; {stage code: dev, alpha, beta, final}
  559. nonRelRev: UInt8; {revision level of non-released version}
  560. end;
  561. {$elsec}
  562. type
  563. NumVersion = packed record
  564. { Numeric version part of 'vers' resource accessable in little endian format }
  565. nonRelRev: UInt8; {revision level of non-released version}
  566. stage: UInt8; {stage code: dev, alpha, beta, final}
  567. minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
  568. majorRev: UInt8; {1st part of version number in BCD}
  569. end;
  570. {$endc} {TARGET_RT_BIG_ENDIAN}
  571. NumVersionPtr = ^NumVersion;
  572. const
  573. { Version Release Stage Codes }
  574. developStage = $20;
  575. alphaStage = $40;
  576. betaStage = $60;
  577. finalStage = $80;
  578. type
  579. NumVersionVariant = record
  580. case SInt16 of
  581. { NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value }
  582. 0: (
  583. parts: NumVersion;
  584. );
  585. 1: (
  586. whole: UInt32;
  587. );
  588. end;
  589. NumVersionVariantPtr = ^NumVersionVariant;
  590. NumVersionVariantHandle = ^NumVersionVariantPtr;
  591. VersRec = record
  592. { 'vers' resource format }
  593. numericVersion: NumVersion; {encoded version number}
  594. countryCode: SInt16; {country code from intl utilities}
  595. shortVersion: Str255; {version number string - worst case}
  596. reserved: Str255; {longMessage string packed after shortVersion}
  597. end;
  598. VersRecPtr = ^VersRec;
  599. type
  600. VersRecHndl = ^VersRecPtr;
  601. {********************************************************************************
  602. Old names for types
  603. ********************************************************************************}
  604. type
  605. Byte = UInt8;
  606. SignedByte = SInt8;
  607. extended80 = Float80;
  608. extended80Ptr = ^extended80;
  609. extended96 = Float96;
  610. extended96Ptr = ^extended96;
  611. VHSelect = SInt8;
  612. {********************************************************************************
  613. Debugger functions
  614. ********************************************************************************}
  615. {
  616. * Debugger()
  617. *
  618. * Availability:
  619. * Mac OS X: in version 10.0 and later in CoreServices.framework
  620. * CarbonLib: in CarbonLib 1.0 and later
  621. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  622. }
  623. procedure Debugger; external name '_Debugger';
  624. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  625. {
  626. * DebugStr()
  627. *
  628. * Availability:
  629. * Mac OS X: in version 10.0 and later in CoreServices.framework
  630. * CarbonLib: in CarbonLib 1.0 and later
  631. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  632. }
  633. procedure DebugStr( const (*var*) debuggerMsg: Str255 ); external name '_DebugStr';
  634. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  635. {
  636. * debugstr()
  637. *
  638. * Availability:
  639. * Mac OS X: not available
  640. * CarbonLib: not available
  641. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  642. }
  643. { Only for Mac OS native drivers }
  644. {
  645. * SysDebug()
  646. *
  647. * Availability:
  648. * Mac OS X: not available
  649. * CarbonLib: not available
  650. * Non-Carbon CFM: in DriverServicesLib 1.0 and later
  651. }
  652. {
  653. * SysDebugStr()
  654. *
  655. * Availability:
  656. * Mac OS X: not available
  657. * CarbonLib: not available
  658. * Non-Carbon CFM: in DriverServicesLib 1.0 and later
  659. }
  660. { SADE break points }
  661. {
  662. * SysBreak()
  663. *
  664. * Availability:
  665. * Mac OS X: in version 10.0 and later in CoreServices.framework
  666. * CarbonLib: in CarbonLib 1.0 and later
  667. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  668. }
  669. procedure SysBreak; external name '_SysBreak';
  670. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  671. {
  672. * SysBreakStr()
  673. *
  674. * Availability:
  675. * Mac OS X: in version 10.0 and later in CoreServices.framework
  676. * CarbonLib: in CarbonLib 1.0 and later
  677. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  678. }
  679. procedure SysBreakStr( const (*var*) debuggerMsg: Str255 ); external name '_SysBreakStr';
  680. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  681. {
  682. * SysBreakFunc()
  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. }
  689. procedure SysBreakFunc( const (*var*) debuggerMsg: Str255 ); external name '_SysBreakFunc';
  690. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  691. end.