1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
|
{
File: CarbonCore/MacTypes.h
Contains: Basic Macintosh data types.
Version: CarbonCore-769~1
Copyright: © 1985-2008 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://www.freepascal.org/bugs.html
}
{ Pascal Translation Updated: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
{ Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
{ Pascal Translation Updated: Gorazd Krosl <gorazd_1957@yahoo.ca>, October 2009 }
{
Modified for use with Free Pascal
Version 308
Please report any bugs to <gpc@microbizz.nl>
}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
{$mode macpas}
{$packenum 1}
{$macro on}
{$inline on}
{$calling mwpascal}
unit MacTypes;
interface
{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
{$setc GAP_INTERFACES_VERSION := $0308}
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
{$endc}
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
{$endc}
{$ifc not defined __ppc__ and defined CPUPOWERPC32}
{$setc __ppc__ := 1}
{$elsec}
{$setc __ppc__ := 0}
{$endc}
{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
{$setc __ppc64__ := 1}
{$elsec}
{$setc __ppc64__ := 0}
{$endc}
{$ifc not defined __i386__ and defined CPUI386}
{$setc __i386__ := 1}
{$elsec}
{$setc __i386__ := 0}
{$endc}
{$ifc not defined __x86_64__ and defined CPUX86_64}
{$setc __x86_64__ := 1}
{$elsec}
{$setc __x86_64__ := 0}
{$endc}
{$ifc not defined __arm__ and defined CPUARM}
{$setc __arm__ := 1}
{$elsec}
{$setc __arm__ := 0}
{$endc}
{$ifc defined cpu64}
{$setc __LP64__ := 1}
{$elsec}
{$setc __LP64__ := 0}
{$endc}
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
{$error Conflicting definitions for __ppc__ and __i386__}
{$endc}
{$ifc defined __ppc__ and __ppc__}
{$setc TARGET_CPU_PPC := TRUE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __ppc64__ and __ppc64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := TRUE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __i386__ and __i386__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := TRUE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$ifc defined(iphonesim)}
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := TRUE}
{$elsec}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$endc}
{$elifc defined __x86_64__ and __x86_64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := TRUE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __arm__ and __arm__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := TRUE}
{ will require compiler define when/if other Apple devices with ARM cpus ship }
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elsec}
{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
{$endc}
{$ifc defined __LP64__ and __LP64__ }
{$setc TARGET_CPU_64 := TRUE}
{$elsec}
{$setc TARGET_CPU_64 := FALSE}
{$endc}
{$ifc defined FPC_BIG_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
{$elifc defined FPC_LITTLE_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
{$elsec}
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
{$endc}
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
{$setc CALL_NOT_IN_CARBON := FALSE}
{$setc OLDROUTINENAMES := FALSE}
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
{$setc OPAQUE_UPP_TYPES := TRUE}
{$setc OTCARBONAPPLICATION := TRUE}
{$setc OTKERNEL := FALSE}
{$setc PM_USE_SESSION_APIS := TRUE}
{$setc TARGET_API_MAC_CARBON := TRUE}
{$setc TARGET_API_MAC_OS8 := FALSE}
{$setc TARGET_API_MAC_OSX := TRUE}
{$setc TARGET_CARBON := TRUE}
{$setc TARGET_CPU_68K := FALSE}
{$setc TARGET_CPU_MIPS := FALSE}
{$setc TARGET_CPU_SPARC := FALSE}
{$setc TARGET_OS_UNIX := FALSE}
{$setc TARGET_OS_WIN32 := FALSE}
{$setc TARGET_RT_MAC_68881 := FALSE}
{$setc TARGET_RT_MAC_CFM := FALSE}
{$setc TARGET_RT_MAC_MACHO := TRUE}
{$setc TYPED_FUNCTION_POINTERS := TRUE}
{$setc TYPE_BOOL := FALSE}
{$setc TYPE_EXTENDED := FALSE}
{$setc TYPE_LONGLONG := TRUE}
uses ConditionalMacros;
{$endc} {not MACOSALLINCLUDE}
{$ALIGN MAC68K}
{*******************************************************************************
Base integer types for all target OS's and CPU's
UInt8 8-bit unsigned integer
SInt8 8-bit signed integer
UInt16 16-bit unsigned integer
SInt16 16-bit signed integer
UInt32 32-bit unsigned integer
SInt32 32-bit signed integer
UInt64 64-bit unsigned integer
SInt64 64-bit signed integer
********************************************************************************}
type
SInt8 = ShortInt;
UInt8 = Byte;
SInt16 = Integer;
UInt16 = Word;
SInt32 = LongInt;
UInt32 = Longword;
SInt64 = Int64;
UInt64 = QWord;
type
UNSIGNEDBYTE = UInt8;
SIGNEDBYTE = SInt8;
UNSIGNEDWORD = UInt16;
SIGNEDWORD = SInt16;
UInt32_fix = UInt32;
type
{$ifc TARGET_CPU_64}
UNSIGNEDLONG = UInt64;
SIGNEDLONG = SInt64;
{$elsec}
UNSIGNEDLONG = UInt32;
SIGNEDLONG = SInt32;
{$endc}
MacPtrUInt = UNSIGNEDLONG;
MacPtrSInt = SIGNEDLONG;
{$ifc TARGET_RT_BIG_ENDIAN}
type
wide = record
case boolean of
false:
( hi: SInt32;
lo: UInt32);
true:
( int: SInt64)
end;
UnsignedWide = record
case boolean of
false:
( hi: UInt32;
lo: UInt32);
true:
( int: UInt64)
end;
{$elsec}
type
wide = record
case boolean of
false:
( lo: UInt32;
hi: SInt32);
true:
( int: SInt64)
end;
UnsignedWide = record
case boolean of
false:
( lo: UInt32;
hi: UInt32);
true:
( int: UInt64)
end;
{$endc} {TARGET_RT_BIG_ENDIAN}
type
SInt8Ptr = ^SInt8;
UInt8Ptr = ^UInt8;
SInt16Ptr = ^SInt16;
UInt16Ptr = ^UInt16;
SInt32Ptr = ^SInt32;
UInt32Ptr = ^UInt32;
SInt64Ptr = ^SInt64;
UInt64Ptr = ^UInt64;
widePtr = ^wide;
UnsignedWidePtr = ^UnsignedWide;
SIGNEDLONGPtr = ^SIGNEDLONG;
UNSIGNEDLONGPtr = ^UNSIGNEDLONG;
{ *******************************************************************************
Special types for pascal
ByteParameter UInt8 passed as an 8-bit parameter
Note: The conventions for Pascal on 68K require that a UInt8 when
passed as a parameter occupy 16-bits on the stack, whereas
an SInt8 would only occupy 8-bits. To make C and Pascal
compatable, in pascal all function parameters of type UInt8
or equivalent are changed to ByteParameter.
******************************************************************************** }
ByteParameter = SInt8;
// For interfaces that use Cs "bool" type
{$ifc TARGET_CPU_PPC}
CBool = SInt32;
{$elsec}
CBool = SInt8;
{$endc}
{*******************************************************************************
Base fixed point types
Fixed 16-bit signed integer plus 16-bit fraction
UnsignedFixed 16-bit unsigned integer plus 16-bit fraction
Fract 2-bit signed integer plus 30-bit fraction
ShortFixed 8-bit signed integer plus 8-bit fraction
********************************************************************************}
type
Fixed = SInt32;
FixedPtr = ^Fixed;
Fract = SInt32;
FractPtr = ^Fract;
UnsignedFixed = UInt32;
UnsignedFixedPtr = ^UnsignedFixed;
ShortFixed = SInt16;
ShortFixedPtr = ^ShortFixed;
{*******************************************************************************
Base floating point types
Float32 32 bit IEEE float: 1 sign bit, 8 exponent bits, 23 fraction bits
Float64 64 bit IEEE float: 1 sign bit, 11 exponent bits, 52 fraction bits
Float80 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits
Float96 96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits
Note: These are fixed size floating point types, useful when writing a floating
point value to disk. If your compiler does not support a particular size
float, a struct is used instead.
Use of of the NCEG types (e.g. double_t) or an ANSI C type (e.g. double) if
you want a floating point representation that is natural for any given
compiler, but might be a different size on different compilers.
********************************************************************************}
type
Float32 = Single;
Float32Ptr = ^Float32;
Float64 = Double;
Float64Ptr = ^Float64;
LongDouble = Double;
Float80 = record
exp: SInt16;
man: array [0..3] of UInt16;
end;
const
Float32_Min = 1.5e-45;
Float32_Max = 3.4e+38;
Float64_Min = 5.0e-324;
Float64_Max = 1.7e+308;
type
Float96 = record
exp: SInt16;
filler: SInt16;
man: array [0..3] of UInt16;
end;
type
Float32Point = record
x: Float32;
y: Float32;
end;
{GK: Need in AudioUnitCarbonViews.pas }
Float32PointPtr = ^Float32Point;
{*******************************************************************************
Unix compatibility types
********************************************************************************}
type
size_t = UNSIGNEDLONG;
size_t_ptr = ^size_t;
ssize_t = SIGNEDLONG;
ssize_t_ptr = ^ssize_t;
{*******************************************************************************
MacOS Memory Manager types
Ptr Pointer to a non-relocatable block
Handle Pointer to a master pointer to a relocatable block
Size The number of bytes in a block (signed for historical reasons)
********************************************************************************}
type
Ptr = ^SInt8;
PtrPtr = ^Ptr;
Handle = ^Ptr;
Handle_fix = Handle; { used as field type when a record declaration contains a Handle field identifier }
Size = SIGNEDLONG;
Size_fix = Size; { used as field type when a record declaration contains a Size field identifier }
SizePtr = ^Size;
UnivPtr = Pointer;
UnivPtrPtr = ^UnivPtr;
{*******************************************************************************
Higher level basic types
OSErr 16-bit result error code
OSStatus 32-bit result error code
LogicalAddress Address in the clients virtual address space
ConstLogicalAddress Address in the clients virtual address space that will only be read
PhysicalAddress Real address as used on the hardware bus
BytePtr Pointer to an array of bytes
ByteCount The size of an array of bytes
ByteOffset An offset into an array of bytes
ItemCount 32-bit iteration count
OptionBits Standard 32-bit set of bit flags
PBVersion ?
Duration 32-bit millisecond timer for drivers
AbsoluteTime 64-bit clock
ScriptCode A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding
LangCode A particular language (e.g. English), as represented using a particular ScriptCode
RegionCode Designates a language as used in a particular region (e.g. British vs American
English) together with other region-dependent characteristics (e.g. date format)
FourCharCode A 32-bit value made by packing four 1 byte characters together
OSType A FourCharCode used in the OS and file system (e.g. creator)
ResType A FourCharCode used to tag resources (e.g. 'DLOG')
********************************************************************************}
type
OSErr = SInt16;
OSStatus = SInt32;
LogicalAddress = UnivPtr;
ConstLogicalAddress = UnivPtr;
PhysicalAddress = UnivPtr;
BytePtr = UInt8Ptr;
ByteCount = UNSIGNEDLONG;
ByteCountPtr = ^ByteCount;
ByteOffset = UNSIGNEDLONG;
ByteOffsetPtr = ^ByteOffset;
Duration = SInt32;
AbsoluteTime = UnsignedWide;
AbsoluteTimePtr = ^AbsoluteTime;
OptionBits = UInt32;
OptionBitsPtr = ^OptionBits;
ItemCount = UNSIGNEDLONG;
ItemCountPtr = ^ItemCount;
PBVersion = UInt32;
ScriptCode = SInt16;
ScriptCodePtr = ^ScriptCode;
LangCode = SInt16;
LangCodePtr = ^LangCode;
RegionCode = SInt16;
RegionCodePtr = ^RegionCode;
FourCharCode = UInt32;
OSType = FourCharCode;
OSType_fix = OSType; { used as field type when a record declaration contains a OSType field identifier }
ResType = FourCharCode;
OSTypePtr = ^OSType;
OSTypeHandle = ^OSTypePtr;
ResTypePtr = ^ResType;
{*******************************************************************************
Boolean types and values
Boolean Mac OS historic type, sizeof(Boolean)==1
bool Defined in stdbool.h, ISO C/C++ standard type
false Now defined in stdbool.h
true Now defined in stdbool.h
********************************************************************************}
type
{ "Boolean", "true", and "false" are built into the Pascal language }
BooleanPtr = ^Boolean;
boolean_fix = boolean; { used as field type when a record declaration contains a boolean field identifier }
{*******************************************************************************
Function Pointer Types
ProcPtr Generic pointer to a function
Register68kProcPtr Pointer to a 68K function that expects parameters in registers
UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
ProcHandle Pointer to a ProcPtr
UniversalProcHandle Pointer to a UniversalProcPtr
********************************************************************************}
type
ProcPtr = Ptr;
Register68kProcPtr = ProcPtr;
UniversalProcPtr = ProcPtr;
type
ProcHandle = ^ProcPtr;
UniversalProcHandle = ^UniversalProcPtr;
{*******************************************************************************
RefCon Types
For access to private data in callbacks, etc.; refcons are generally
used as a pointer to something, but in the 32-bit world refcons in
different APIs have had various types: pointer, unsigned scalar, and
signed scalar. The RefCon types defined here support the current 32-bit
usage but provide normalization to pointer types for 64-bit.
PRefCon is preferred for new APIs; URefCon and SRefCon are primarily
for compatibility with existing APIs.
********************************************************************************}
type
PRefCon = UnivPtr;
{$ifc TARGET_CPU_64}
type
URefCon = UnivPtr;
SRefCon = UnivPtr;
{$elsec}
type
URefCon = UInt32;
SRefCon = SInt32;
{$endc}
{*******************************************************************************
Common Constants
noErr OSErr: function performed properly - no error
kNilOptions OptionBits: all flags false
kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's
kVariableLengthArray array bounds: variable length array
Note: kVariableLengthArray is used in array bounds to specify a variable length array.
It is ususally used in variable length structs when the last field is an array
of any size. Before ANSI C, we used zero as the bounds of variable length
array, but zero length array are illegal in ANSI C. Example usage:
struct FooList
(
short listLength;
Foo elements[kVariableLengthArray];
);
********************************************************************************}
const
noErr = 0;
const
kNilOptions = 0;
const
kInvalidID = 0;
const
kVariableLengthArray = 1;
const
kUnknownType = $3F3F3F3F; { "????" QuickTime 3.0: default unknown ResType or OSType }
{*******************************************************************************
String Types and Unicode Types
UnicodeScalarValue, A complete Unicode character in UTF-32 format, with
UTF32Char values from 0 through 0x10FFFF (excluding the surrogate
range 0xD800-0xDFFF and certain disallowed values).
UniChar, A 16-bit Unicode code value in the default UTF-16 format.
UTF16Char UnicodeScalarValues 0-0xFFFF are expressed in UTF-16
format using a single UTF16Char with the same value.
UnicodeScalarValues 0x10000-0x10FFFF are expressed in
UTF-16 format using a pair of UTF16Chars - one in the
high surrogate range (0xD800-0xDBFF) followed by one in
the low surrogate range (0xDC00-0xDFFF). All of the
characters defined in Unicode versions through 3.0 are
in the range 0-0xFFFF and can be expressed using a single
UTF16Char, thus the term "Unicode character" generally
refers to a UniChar = UTF16Char.
UTF8Char An 8-bit code value in UTF-8 format. UnicodeScalarValues
0-0x7F are expressed in UTF-8 format using one UTF8Char
with the same value. UnicodeScalarValues above 0x7F are
expressed in UTF-8 format using 2-4 UTF8Chars, all with
values in the range 0x80-0xF4 (UnicodeScalarValues
0x100-0xFFFF use two or three UTF8Chars,
UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars).
UniCharCount A count of UTF-16 code values in an array or buffer.
StrNNN Pascal string holding up to NNN bytes
StringPtr Pointer to a pascal string
StringHandle Pointer to a StringPtr
ConstStringPtr Pointer to a read-only pascal string
ConstStrNNNParam For function parameters only - means string is const
CStringPtr Pointer to a C string (in C: char*)
ConstCStringPtr Pointer to a read-only C string (in C: const char*)
Note: The length of a pascal string is stored as the first byte.
A pascal string does not have a termination byte.
A pascal string can hold at most 255 bytes of data.
The first character in a pascal string is offset one byte from the start of the string.
A C string is terminated with a byte of value zero.
A C string has no length limitation.
The first character in a C string is the zeroth byte of the string.
********************************************************************************}
type
UnicodeScalarValue = UInt32;
UTF32Char = UInt32;
UniChar = UInt16;
UTF16Char = UInt16;
UTF8Char = UInt8;
UniCharPtr = ^UniChar;
ConstUniCharPtr = UniCharPtr;
UniCharCount = UNSIGNEDLONG;
UniCharCountPtr = ^UniCharCount;
Str15 = STRING[15];
Str27 = STRING[27];
Str31 = STRING[31];
Str32 = STRING[32];
Str36 = STRING[36];
Str63 = STRING[63];
Str255 = STRING[255];
{
The type Str32 is used in many AppleTalk based data structures.
It holds up to 32 one byte chars. The problem is that with the
length byte it is 33 bytes long. This can cause weird alignment
problems in structures. To fix this the type "Str32Field" has
been created. It should only be used to hold 32 chars, but
it is 34 bytes long so that there are no alignment problems.
}
Str32Field = Str32;
{
QuickTime 3.0:
The type StrFileName is used to make MacOS structs work
cross-platform. For example FSSpec or SFReply previously
contained a Str63 field. They now contain a StrFileName
field which is the same when targeting the MacOS but is
a 256 char buffer for Win32 and unix, allowing them to
contain long file names.
}
type
StrFileName = Str63;
StringPtr = ^Str255;
StringHandle = ^StringPtr;
ConstStringPtr = StringPtr;
CStringPtr = PChar;
ConstCStringPtr = CStringPtr;
CStringPtrPtr = ^CStringPtr;
ConstCStringPtrPtr = ^ConstCStringPtr;
ConstStr255Param = Str255;
ConstStr63Param = Str63;
ConstStr36Param = Str36;
ConstStr32Param = Str32;
ConstStr31Param = Str31;
ConstStr27Param = Str27;
ConstStr15Param = Str15;
ConstStrFileNameParam = ConstStr63Param;
{*******************************************************************************
Process Manager type ProcessSerialNumber (previously in Processes.h)
********************************************************************************}
{ type for unique process identifier }
type
ProcessSerialNumber = record
highLongOfPSN: UInt32;
lowLongOfPSN: UInt32;
end;
ProcessSerialNumberPtr = ^ProcessSerialNumber;
{*******************************************************************************
Quickdraw Types
Point 2D Quickdraw coordinate, range: -32K to +32K
Rect Rectangular Quickdraw area
Style Quickdraw font rendering styles
StyleParameter Style when used as a parameter (historical 68K convention)
StyleField Style when used as a field (historical 68K convention)
CharParameter Char when used as a parameter (historical 68K convention)
Note: The original Macintosh toolbox in 68K Pascal defined Style as a SET.
Both Style and CHAR occupy 8-bits in packed records or 16-bits when
used as fields in non-packed records or as parameters.
********************************************************************************}
type
Point = record
case SInt16 of
0: (
v: SInt16;
h: SInt16;
);
1: (
vh: array [0..1] of SInt16;
);
end;
PointPtr = ^Point;
type
Rect = record
case SInt16 of
0: (
top: SInt16;
left: SInt16;
bottom: SInt16;
right: SInt16;
);
1: (
topLeft: Point;
botRight: Point;
);
end;
RectPtr = ^Rect;
type
FixedPoint = record
x: Fixed;
y: Fixed;
end;
FixedPointPtr = ^FixedPoint;
type
FixedRect = record
left: Fixed;
top: Fixed;
right: Fixed;
bottom: Fixed;
end;
FixedRectPtr = ^FixedRect;
type
CharParameter = Char;
const
normal = 0;
bold = 1;
italic = 2;
underline = 4;
outline = 8;
shadow = $10;
condense = $20;
extend = $40;
type
Style = SInt8;
Style_fix = Style; { used as field type when a record declaration contains a Style field identifier }
StyleParameter = SInt16;
StyleField = Style;
{*******************************************************************************
QuickTime TimeBase types (previously in Movies.h)
TimeValue Count of units
TimeScale Units per second
CompTimeValue 64-bit count of units (always a struct)
TimeValue64 64-bit count of units (long long or struct)
TimeBase An opaque reference to a time base
TimeRecord Package of TimeBase, duration, and scale
********************************************************************************}
type
TimeValue = SInt32;
TimeScale = SInt32;
TimeScalePtr = ^TimeScale;
TimeScale_fix = TimeScale; { used as field type when a record declaration contains a TimeScale field identifier }
CompTimeValue = wide;
CompTimeValuePtr = ^CompTimeValue;
TimeValue64 = SInt64;
TimeValue64Ptr = ^TimeValue64;
TimeBase = ^SInt32; { an opaque 32-bit type }
TimeBase_fix = TimeBase; { used as field type when a record declaration contains a TimeBase field identifier }
TimeBasePtr = ^TimeBase;
TimeRecord = record
value: CompTimeValue; { units (duration or absolute) }
scale: TimeScale; { units per second }
base: TimeBase; { refernce to the time base }
end;
TimeRecordPtr = ^TimeRecord;
{*******************************************************************************
MacOS versioning structures
VersRec Contents of a 'vers' resource
VersRecPtr Pointer to a VersRecPtr
VersRecHndl Resource Handle containing a VersRec
NumVersion Packed BCD version representation (e.g. "4.2.1a3" is 0x04214003)
UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
ProcHandle Pointer to a ProcPtr
UniversalProcHandle Pointer to a UniversalProcPtr
********************************************************************************}
{$ifc TARGET_RT_BIG_ENDIAN}
type
NumVersion = packed record
{ Numeric version part of 'vers' resource }
majorRev: UInt8; {1st part of version number in BCD}
minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
stage: UInt8; {stage code: dev, alpha, beta, final}
nonRelRev: UInt8; {revision level of non-released version}
end;
{$elsec}
type
NumVersion = packed record
{ Numeric version part of 'vers' resource accessable in little endian format }
nonRelRev: UInt8; {revision level of non-released version}
stage: UInt8; {stage code: dev, alpha, beta, final}
minorAndBugRev: UInt8; {2nd & 3rd part of version number share a byte}
majorRev: UInt8; {1st part of version number in BCD}
end;
{$endc} {TARGET_RT_BIG_ENDIAN}
NumVersionPtr = ^NumVersion;
const
{ Version Release Stage Codes }
developStage = $20;
alphaStage = $40;
betaStage = $60;
finalStage = $80;
type
NumVersionVariant = record
case SInt16 of
{ NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value }
0: (
parts: NumVersion;
);
1: (
whole: UInt32;
);
end;
NumVersionVariantPtr = ^NumVersionVariant;
NumVersionVariantHandle = ^NumVersionVariantPtr;
VersRec = record
{ 'vers' resource format }
numericVersion: NumVersion; {encoded version number}
countryCode: SInt16; {country code from intl utilities}
shortVersion: Str255; {version number string - worst case}
reserved: Str255; {longMessage string packed after shortVersion}
end;
VersRecPtr = ^VersRec;
type
VersRecHndl = ^VersRecPtr;
{********************************************************************************
Old names for types
********************************************************************************}
type
extended80 = Float80;
extended80Ptr = ^extended80;
extended96 = Float96;
extended96Ptr = ^extended96;
VHSelect = SInt8;
{********************************************************************************
Debugger functions
********************************************************************************}
{
* Debugger()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure Debugger; external name '_Debugger';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* DebugStr()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure DebugStr( const (*var*) debuggerMsg: Str255 ); external name '_DebugStr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* debugstr()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
{ Only for Mac OS native drivers }
{
* SysDebug()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in DriverServicesLib 1.0 and later
}
{
* SysDebugStr()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in DriverServicesLib 1.0 and later
}
{ SADE break points }
{
* SysBreak()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure SysBreak; external name '_SysBreak';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* SysBreakStr()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure SysBreakStr( const (*var*) debuggerMsg: Str255 ); external name '_SysBreakStr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* SysBreakFunc()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure SysBreakFunc( const (*var*) debuggerMsg: Str255 ); external name '_SysBreakFunc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
end.
{$endc} {not MACOSALLINCLUDE}
|