MacTypes.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  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. Handle_fix = Handle; { used as field type when a record declaration contains a Handle field identifier }
  242. Size = SInt32;
  243. Size_fix = Size; { used as field type when a record declaration contains a Size field identifier }
  244. SizePtr = ^Size;
  245. UnivPtr = Pointer;
  246. UnivPtrPtr = ^UnivPtr;
  247. {*******************************************************************************
  248. Higher level basic types
  249. OSErr 16-bit result error code
  250. OSStatus 32-bit result error code
  251. LogicalAddress Address in the clients virtual address space
  252. ConstLogicalAddress Address in the clients virtual address space that will only be read
  253. PhysicalAddress Real address as used on the hardware bus
  254. BytePtr Pointer to an array of bytes
  255. ByteCount The size of an array of bytes
  256. ByteOffset An offset into an array of bytes
  257. ItemCount 32-bit iteration count
  258. OptionBits Standard 32-bit set of bit flags
  259. PBVersion ?
  260. Duration 32-bit millisecond timer for drivers
  261. AbsoluteTime 64-bit clock
  262. ScriptCode A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding
  263. LangCode A particular language (e.g. English), as represented using a particular ScriptCode
  264. RegionCode Designates a language as used in a particular region (e.g. British vs American
  265. English) together with other region-dependent characteristics (e.g. date format)
  266. FourCharCode A 32-bit value made by packing four 1 byte characters together
  267. OSType A FourCharCode used in the OS and file system (e.g. creator)
  268. ResType A FourCharCode used to tag resources (e.g. 'DLOG')
  269. ********************************************************************************}
  270. type
  271. OSErr = SInt16;
  272. OSStatus = SInt32;
  273. LogicalAddress = UnivPtr;
  274. ConstLogicalAddress = UnivPtr;
  275. PhysicalAddress = UnivPtr;
  276. BytePtr = UInt8Ptr;
  277. ByteCount = UInt32;
  278. ByteCountPtr = ^ByteCount;
  279. ByteOffset = UInt32;
  280. ByteOffsetPtr = ^ByteOffset;
  281. Duration = SInt32;
  282. AbsoluteTime = UnsignedWide;
  283. AbsoluteTimePtr = ^AbsoluteTime;
  284. OptionBits = UInt32;
  285. OptionBitsPtr = ^OptionBits;
  286. ItemCount = UInt32;
  287. ItemCountPtr = ^ItemCount;
  288. PBVersion = UInt32;
  289. ScriptCode = SInt16;
  290. ScriptCodePtr = ^ScriptCode;
  291. LangCode = SInt16;
  292. LangCodePtr = ^LangCode;
  293. RegionCode = SInt16;
  294. RegionCodePtr = ^RegionCode;
  295. FourCharCode = UInt32;
  296. OSType = FourCharCode;
  297. OSType_fix = OSType; { used as field type when a record declaration contains a OSType field identifier }
  298. ResType = FourCharCode;
  299. OSTypePtr = ^OSType;
  300. ResTypePtr = ^ResType;
  301. {*******************************************************************************
  302. Boolean types and values
  303. Boolean Mac OS historic type, sizeof(Boolean)==1
  304. bool Defined in stdbool.h, ISO C/C++ standard type
  305. false Now defined in stdbool.h
  306. true Now defined in stdbool.h
  307. ********************************************************************************}
  308. type
  309. { "Boolean", "true", and "false" are built into the Pascal language }
  310. BooleanPtr = ^Boolean;
  311. boolean_fix = boolean; { used as field type when a record declaration contains a boolean field identifier }
  312. {*******************************************************************************
  313. Function Pointer Types
  314. ProcPtr Generic pointer to a function
  315. Register68kProcPtr Pointer to a 68K function that expects parameters in registers
  316. UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
  317. ProcHandle Pointer to a ProcPtr
  318. UniversalProcHandle Pointer to a UniversalProcPtr
  319. ********************************************************************************}
  320. type
  321. ProcPtr = Ptr;
  322. Register68kProcPtr = ProcPtr;
  323. UniversalProcPtr = ProcPtr;
  324. type
  325. ProcHandle = ^ProcPtr;
  326. UniversalProcHandle = ^UniversalProcPtr;
  327. {*******************************************************************************
  328. Common Constants
  329. noErr OSErr: function performed properly - no error
  330. kNilOptions OptionBits: all flags false
  331. kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's
  332. kVariableLengthArray array bounds: variable length array
  333. Note: kVariableLengthArray is used in array bounds to specify a variable length array.
  334. It is ususally used in variable length structs when the last field is an array
  335. of any size. Before ANSI C, we used zero as the bounds of variable length
  336. array, but zero length array are illegal in ANSI C. Example usage:
  337. struct FooList
  338. (
  339. short listLength;
  340. Foo elements[kVariableLengthArray];
  341. );
  342. ********************************************************************************}
  343. const
  344. noErr = 0;
  345. const
  346. kNilOptions = 0;
  347. const
  348. kInvalidID = 0;
  349. const
  350. kVariableLengthArray = 1;
  351. const
  352. kUnknownType = $3F3F3F3F; { "????" QuickTime 3.0: default unknown ResType or OSType }
  353. {*******************************************************************************
  354. String Types and Unicode Types
  355. UnicodeScalarValue, A complete Unicode character in UTF-32 format, with
  356. UTF32Char values from 0 through 0x10FFFF (excluding the surrogate
  357. range 0xD800-0xDFFF and certain disallowed values).
  358. UniChar, A 16-bit Unicode code value in the default UTF-16 format.
  359. UTF16Char UnicodeScalarValues 0-0xFFFF are expressed in UTF-16
  360. format using a single UTF16Char with the same value.
  361. UnicodeScalarValues 0x10000-0x10FFFF are expressed in
  362. UTF-16 format using a pair of UTF16Chars - one in the
  363. high surrogate range (0xD800-0xDBFF) followed by one in
  364. the low surrogate range (0xDC00-0xDFFF). All of the
  365. characters defined in Unicode versions through 3.0 are
  366. in the range 0-0xFFFF and can be expressed using a single
  367. UTF16Char, thus the term "Unicode character" generally
  368. refers to a UniChar = UTF16Char.
  369. UTF8Char An 8-bit code value in UTF-8 format. UnicodeScalarValues
  370. 0-0x7F are expressed in UTF-8 format using one UTF8Char
  371. with the same value. UnicodeScalarValues above 0x7F are
  372. expressed in UTF-8 format using 2-4 UTF8Chars, all with
  373. values in the range 0x80-0xF4 (UnicodeScalarValues
  374. 0x100-0xFFFF use two or three UTF8Chars,
  375. UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars).
  376. UniCharCount A count of UTF-16 code values in an array or buffer.
  377. StrNNN Pascal string holding up to NNN bytes
  378. StringPtr Pointer to a pascal string
  379. StringHandle Pointer to a StringPtr
  380. ConstStringPtr Pointer to a read-only pascal string
  381. ConstStrNNNParam For function parameters only - means string is const
  382. CStringPtr Pointer to a C string (in C: char*)
  383. ConstCStringPtr Pointer to a read-only C string (in C: const char*)
  384. Note: The length of a pascal string is stored as the first byte.
  385. A pascal string does not have a termination byte.
  386. A pascal string can hold at most 255 bytes of data.
  387. The first character in a pascal string is offset one byte from the start of the string.
  388. A C string is terminated with a byte of value zero.
  389. A C string has no length limitation.
  390. The first character in a C string is the zeroth byte of the string.
  391. ********************************************************************************}
  392. type
  393. UnicodeScalarValue = UInt32;
  394. UTF32Char = UInt32;
  395. UniChar = UInt16;
  396. UTF16Char = UInt16;
  397. UTF8Char = UInt8;
  398. UniCharPtr = ^UniChar;
  399. ConstUniCharPtr = UniCharPtr;
  400. UniCharCount = UInt32;
  401. UniCharCountPtr = ^UniCharCount;
  402. Str15 = STRING[15];
  403. Str27 = STRING[27];
  404. Str31 = STRING[31];
  405. Str32 = STRING[32];
  406. Str36 = STRING[36];
  407. Str63 = STRING[63];
  408. Str255 = STRING[255];
  409. {
  410. The type Str32 is used in many AppleTalk based data structures.
  411. It holds up to 32 one byte chars. The problem is that with the
  412. length byte it is 33 bytes long. This can cause weird alignment
  413. problems in structures. To fix this the type "Str32Field" has
  414. been created. It should only be used to hold 32 chars, but
  415. it is 34 bytes long so that there are no alignment problems.
  416. }
  417. Str32Field = Str32;
  418. {
  419. QuickTime 3.0:
  420. The type StrFileName is used to make MacOS structs work
  421. cross-platform. For example FSSpec or SFReply previously
  422. contained a Str63 field. They now contain a StrFileName
  423. field which is the same when targeting the MacOS but is
  424. a 256 char buffer for Win32 and unix, allowing them to
  425. contain long file names.
  426. }
  427. type
  428. StrFileName = Str63;
  429. StringPtr = ^Str255;
  430. StringHandle = ^StringPtr;
  431. ConstStringPtr = StringPtr;
  432. CStringPtr = PChar;
  433. ConstCStringPtr = CStringPtr;
  434. CStringPtrPtr = ^CStringPtr;
  435. ConstCStringPtrPtr = ^ConstCStringPtr;
  436. ConstStr255Param = Str255;
  437. ConstStr63Param = Str63;
  438. ConstStr36Param = Str36;
  439. ConstStr32Param = Str32;
  440. ConstStr31Param = Str31;
  441. ConstStr27Param = Str27;
  442. ConstStr15Param = Str15;
  443. ConstStrFileNameParam = ConstStr63Param;
  444. {*******************************************************************************
  445. Process Manager type ProcessSerialNumber (previously in Processes.h)
  446. ********************************************************************************}
  447. { type for unique process identifier }
  448. type
  449. ProcessSerialNumber = record
  450. highLongOfPSN: UInt32;
  451. lowLongOfPSN: UInt32;
  452. end;
  453. ProcessSerialNumberPtr = ^ProcessSerialNumber;
  454. {*******************************************************************************
  455. Quickdraw Types
  456. Point 2D Quickdraw coordinate, range: -32K to +32K
  457. Rect Rectangular Quickdraw area
  458. Style Quickdraw font rendering styles
  459. StyleParameter Style when used as a parameter (historical 68K convention)
  460. StyleField Style when used as a field (historical 68K convention)
  461. CharParameter Char when used as a parameter (historical 68K convention)
  462. Note: The original Macintosh toolbox in 68K Pascal defined Style as a SET.
  463. Both Style and CHAR occupy 8-bits in packed records or 16-bits when
  464. used as fields in non-packed records or as parameters.
  465. ********************************************************************************}
  466. type
  467. Point = record
  468. case SInt16 of
  469. 0: (
  470. v: SInt16;
  471. h: SInt16;
  472. );
  473. 1: (
  474. vh: array [0..1] of SInt16;
  475. );
  476. end;
  477. PointPtr = ^Point;
  478. type
  479. Rect = record
  480. case SInt16 of
  481. 0: (
  482. top: SInt16;
  483. left: SInt16;
  484. bottom: SInt16;
  485. right: SInt16;
  486. );
  487. 1: (
  488. topLeft: Point;
  489. botRight: Point;
  490. );
  491. end;
  492. RectPtr = ^Rect;
  493. type
  494. FixedPoint = record
  495. x: Fixed;
  496. y: Fixed;
  497. end;
  498. FixedPointPtr = ^FixedPoint;
  499. type
  500. FixedRect = record
  501. left: Fixed;
  502. top: Fixed;
  503. right: Fixed;
  504. bottom: Fixed;
  505. end;
  506. FixedRectPtr = ^FixedRect;
  507. type
  508. CharParameter = Char;
  509. const
  510. normal = 0;
  511. bold = 1;
  512. italic = 2;
  513. underline = 4;
  514. outline = 8;
  515. shadow = $10;
  516. condense = $20;
  517. extend = $40;
  518. type
  519. Style = SInt8;
  520. Style_fix = Style; { used as field type when a record declaration contains a Style field identifier }
  521. StyleParameter = SInt16;
  522. StyleField = Style;
  523. {*******************************************************************************
  524. QuickTime TimeBase types (previously in Movies.h)
  525. TimeValue Count of units
  526. TimeScale Units per second
  527. CompTimeValue 64-bit count of units (always a struct)
  528. TimeValue64 64-bit count of units (long long or struct)
  529. TimeBase An opaque reference to a time base
  530. TimeRecord Package of TimeBase, duration, and scale
  531. ********************************************************************************}
  532. type
  533. TimeValue = SInt32;
  534. TimeScale = SInt32;
  535. TimeScale_fix = TimeScale; { used as field type when a record declaration contains a TimeScale field identifier }
  536. CompTimeValue = wide;
  537. CompTimeValuePtr = ^CompTimeValue;
  538. TimeValue64 = SInt64;
  539. TimeValue64Ptr = ^TimeValue64;
  540. TimeBase = ^SInt32; { an opaque 32-bit type }
  541. TimeBase_fix = TimeBase; { used as field type when a record declaration contains a TimeBase field identifier }
  542. TimeBasePtr = ^TimeBase;
  543. TimeRecord = record
  544. value: CompTimeValue; { units (duration or absolute) }
  545. scale: TimeScale; { units per second }
  546. base: TimeBase; { refernce to the time base }
  547. end;
  548. TimeRecordPtr = ^TimeRecord;
  549. {*******************************************************************************
  550. MacOS versioning structures
  551. VersRec Contents of a 'vers' resource
  552. VersRecPtr Pointer to a VersRecPtr
  553. VersRecHndl Resource Handle containing a VersRec
  554. NumVersion Packed BCD version representation (e.g. "4.2.1a3" is 0x04214003)
  555. UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
  556. ProcHandle Pointer to a ProcPtr
  557. UniversalProcHandle Pointer to a UniversalProcPtr
  558. ********************************************************************************}
  559. {$ifc TARGET_RT_BIG_ENDIAN}
  560. type
  561. NumVersion = packed record
  562. { Numeric version part of 'vers' resource }
  563. majorRev: UInt8; {1st part of version number in BCD}
  564. minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
  565. stage: UInt8; {stage code: dev, alpha, beta, final}
  566. nonRelRev: UInt8; {revision level of non-released version}
  567. end;
  568. {$elsec}
  569. type
  570. NumVersion = packed record
  571. { Numeric version part of 'vers' resource accessable in little endian format }
  572. nonRelRev: UInt8; {revision level of non-released version}
  573. stage: UInt8; {stage code: dev, alpha, beta, final}
  574. minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
  575. majorRev: UInt8; {1st part of version number in BCD}
  576. end;
  577. {$endc} {TARGET_RT_BIG_ENDIAN}
  578. NumVersionPtr = ^NumVersion;
  579. const
  580. { Version Release Stage Codes }
  581. developStage = $20;
  582. alphaStage = $40;
  583. betaStage = $60;
  584. finalStage = $80;
  585. type
  586. NumVersionVariant = record
  587. case SInt16 of
  588. { NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value }
  589. 0: (
  590. parts: NumVersion;
  591. );
  592. 1: (
  593. whole: UInt32;
  594. );
  595. end;
  596. NumVersionVariantPtr = ^NumVersionVariant;
  597. NumVersionVariantHandle = ^NumVersionVariantPtr;
  598. VersRec = record
  599. { 'vers' resource format }
  600. numericVersion: NumVersion; {encoded version number}
  601. countryCode: SInt16; {country code from intl utilities}
  602. shortVersion: Str255; {version number string - worst case}
  603. reserved: Str255; {longMessage string packed after shortVersion}
  604. end;
  605. VersRecPtr = ^VersRec;
  606. type
  607. VersRecHndl = ^VersRecPtr;
  608. {********************************************************************************
  609. Old names for types
  610. ********************************************************************************}
  611. type
  612. Byte = UInt8;
  613. SignedByte = SInt8;
  614. extended80 = Float80;
  615. extended80Ptr = ^extended80;
  616. extended96 = Float96;
  617. extended96Ptr = ^extended96;
  618. VHSelect = SInt8;
  619. {********************************************************************************
  620. Debugger functions
  621. ********************************************************************************}
  622. {
  623. * Debugger()
  624. *
  625. * Availability:
  626. * Mac OS X: in version 10.0 and later in CoreServices.framework
  627. * CarbonLib: in CarbonLib 1.0 and later
  628. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  629. }
  630. procedure Debugger; external name '_Debugger';
  631. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  632. {
  633. * DebugStr()
  634. *
  635. * Availability:
  636. * Mac OS X: in version 10.0 and later in CoreServices.framework
  637. * CarbonLib: in CarbonLib 1.0 and later
  638. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  639. }
  640. procedure DebugStr( const (*var*) debuggerMsg: Str255 ); external name '_DebugStr';
  641. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  642. {
  643. * debugstr()
  644. *
  645. * Availability:
  646. * Mac OS X: not available
  647. * CarbonLib: not available
  648. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  649. }
  650. { Only for Mac OS native drivers }
  651. {
  652. * SysDebug()
  653. *
  654. * Availability:
  655. * Mac OS X: not available
  656. * CarbonLib: not available
  657. * Non-Carbon CFM: in DriverServicesLib 1.0 and later
  658. }
  659. {
  660. * SysDebugStr()
  661. *
  662. * Availability:
  663. * Mac OS X: not available
  664. * CarbonLib: not available
  665. * Non-Carbon CFM: in DriverServicesLib 1.0 and later
  666. }
  667. { SADE break points }
  668. {
  669. * SysBreak()
  670. *
  671. * Availability:
  672. * Mac OS X: in version 10.0 and later in CoreServices.framework
  673. * CarbonLib: in CarbonLib 1.0 and later
  674. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  675. }
  676. procedure SysBreak; external name '_SysBreak';
  677. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  678. {
  679. * SysBreakStr()
  680. *
  681. * Availability:
  682. * Mac OS X: in version 10.0 and later in CoreServices.framework
  683. * CarbonLib: in CarbonLib 1.0 and later
  684. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  685. }
  686. procedure SysBreakStr( const (*var*) debuggerMsg: Str255 ); external name '_SysBreakStr';
  687. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  688. {
  689. * SysBreakFunc()
  690. *
  691. * Availability:
  692. * Mac OS X: in version 10.0 and later in CoreServices.framework
  693. * CarbonLib: in CarbonLib 1.0 and later
  694. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  695. }
  696. procedure SysBreakFunc( const (*var*) debuggerMsg: Str255 ); external name '_SysBreakFunc';
  697. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  698. end.