4
Contains: 64-bit SInt16 math Interfaces.
6
Version: Technology: Mac OS 9
7
Release: Universal Interfaces 3.4.2
9
Copyright: � 1994-2002 by Apple Computer, Inc., all rights reserved
11
Bugs?: For bug reports, consult the following page on
14
http://www.freepascal.org/bugs.html
20
Modified for use with Free Pascal
22
Please report any bugs to <gpc@microbizz.nl>
33
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
34
{$setc GAP_INTERFACES_VERSION := $0200}
36
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
37
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
40
{$ifc defined CPUPOWERPC and defined CPUI386}
41
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
43
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
44
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
47
{$ifc not defined __ppc__ and defined CPUPOWERPC}
52
{$ifc not defined __i386__ and defined CPUI386}
58
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
59
{$error Conflicting definitions for __ppc__ and __i386__}
62
{$ifc defined __ppc__ and __ppc__}
63
{$setc TARGET_CPU_PPC := TRUE}
64
{$setc TARGET_CPU_X86 := FALSE}
65
{$elifc defined __i386__ and __i386__}
66
{$setc TARGET_CPU_PPC := FALSE}
67
{$setc TARGET_CPU_X86 := TRUE}
69
{$error Neither __ppc__ nor __i386__ is defined.}
71
{$setc TARGET_CPU_PPC_64 := FALSE}
73
{$ifc defined FPC_BIG_ENDIAN}
74
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
75
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
76
{$elifc defined FPC_LITTLE_ENDIAN}
77
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
78
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
80
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
82
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
83
{$setc CALL_NOT_IN_CARBON := FALSE}
84
{$setc OLDROUTINENAMES := FALSE}
85
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
86
{$setc OPAQUE_UPP_TYPES := TRUE}
87
{$setc OTCARBONAPPLICATION := TRUE}
88
{$setc OTKERNEL := FALSE}
89
{$setc PM_USE_SESSION_APIS := TRUE}
90
{$setc TARGET_API_MAC_CARBON := TRUE}
91
{$setc TARGET_API_MAC_OS8 := FALSE}
92
{$setc TARGET_API_MAC_OSX := TRUE}
93
{$setc TARGET_CARBON := TRUE}
94
{$setc TARGET_CPU_68K := FALSE}
95
{$setc TARGET_CPU_MIPS := FALSE}
96
{$setc TARGET_CPU_SPARC := FALSE}
97
{$setc TARGET_OS_MAC := TRUE}
98
{$setc TARGET_OS_UNIX := FALSE}
99
{$setc TARGET_OS_WIN32 := FALSE}
100
{$setc TARGET_RT_MAC_68881 := FALSE}
101
{$setc TARGET_RT_MAC_CFM := FALSE}
102
{$setc TARGET_RT_MAC_MACHO := TRUE}
103
{$setc TYPED_FUNCTION_POINTERS := TRUE}
104
{$setc TYPE_BOOL := FALSE}
105
{$setc TYPE_EXTENDED := FALSE}
106
{$setc TYPE_LONGLONG := TRUE}
107
uses MacTypes,ConditionalMacros;
117
* Returns largest possible SInt64 value
120
* Non-Carbon CFM: available as macro/inline
121
* CarbonLib: in CarbonLib 1.0 and later
122
* Mac OS X: in version 10.0 and later
124
function S64Max: SInt64; external name '_S64Max';
130
* Returns smallest possible SInt64 value
133
* Non-Carbon CFM: available as macro/inline
134
* CarbonLib: in CarbonLib 1.0 and later
135
* Mac OS X: in version 10.0 and later
137
function S64Min: SInt64; external name '_S64Min';
144
* Adds two integers, producing an SInt16 result. If an overflow
145
* occurs the result is congruent mod (2^64) as if the operands and
146
* result were unsigned. No overflow is signaled.
149
* Non-Carbon CFM: available as macro/inline
150
* CarbonLib: in CarbonLib 1.0 and later
151
* Mac OS X: in version 10.0 and later
153
function S64Add(left: SInt64; right: SInt64): SInt64; external name '_S64Add';
160
* Subtracts two integers, producing an SInt16 result. If an
161
* overflow occurs the result is congruent mod (2^64) as if the
162
* operands and result were unsigned. No overflow is signaled.
165
* Non-Carbon CFM: available as macro/inline
166
* CarbonLib: in CarbonLib 1.0 and later
167
* Mac OS X: in version 10.0 and later
169
function S64Subtract(left: SInt64; right: SInt64): SInt64; external name '_S64Subtract';
176
* Returns the additive inverse of a signed number (i.e. it returns
177
* 0 - the number). S64Negate (S64Min) is not representable (in
178
* fact, it returns S64Min).
181
* Non-Carbon CFM: available as macro/inline
182
* CarbonLib: in CarbonLib 1.0 and later
183
* Mac OS X: in version 10.0 and later
185
function S64Negate(value: SInt64): SInt64; external name '_S64Negate';
188
{$ifc NOT TYPE_LONGLONG}
193
* Returns the absolute value of the number (i.e. the number if it
194
* is positive, or 0 - the number if it is negative). Disabled for
195
* compilers that support long long until llabs() is available
199
* Non-Carbon CFM: available as macro/inline
200
* CarbonLib: in CarbonLib 1.0 and later
201
* Mac OS X: in version 10.0 and later
203
function S64Absolute(value: SInt64): SInt64; external name '_S64Absolute';
211
* Multiplies two signed numbers, producing a signed result.
212
* Overflow is ignored and the low-order part of the product is
213
* returned. The sign of the result is not guaranteed to be correct
214
* if the magnitude of the product is not representable.
217
* Non-Carbon CFM: available as macro/inline
218
* CarbonLib: in CarbonLib 1.0 and later
219
* Mac OS X: in version 10.0 and later
221
function S64Multiply(left: SInt64; right: SInt64): SInt64; external name '_S64Multiply';
224
{$ifc CALL_NOT_IN_CARBON}
229
* Returns the remainder of divide of dividend by divisor. The sign
230
* of the remainder is the same as the sign of the dividend (i.e.,
231
* it takes the absolute values of the operands, does the division,
232
* then fixes the sign of the quotient and remainder).
235
* Non-Carbon CFM: available as macro/inline
236
* CarbonLib: not available
237
* Mac OS X: not available
239
function S64Mod(dividend: SInt64; divisor: SInt64): SInt64; external name '_S64Mod';
242
{$endc} {CALL_NOT_IN_CARBON}
248
* Divides dividend by divisor, returning the quotient. The
249
* remainder is returned in *remainder if remainder (the pointer) is
250
* non-NULL. The sign of the remainder is the same as the sign of
251
* the dividend (i.e. it takes the absolute values of the operands,
252
* does the division, then fixes the sign of the quotient and
253
* remainder). If the divisor is zero, then S64Max() will be
254
* returned (or S64Min() if the dividend is negative), and the
255
* remainder will be the dividend; no error is reported.
258
* Non-Carbon CFM: available as macro/inline
259
* CarbonLib: in CarbonLib 1.0 and later
260
* Mac OS X: in version 10.0 and later
262
function S64Divide(dividend: SInt64; divisor: SInt64; remainder: SInt64Ptr): SInt64; external name '_S64Divide';
269
* Given an SInt32, returns an SInt64 with the same value. Use this
270
* routine instead of coding 64-bit constants (at least when the
271
* constant will fit in an SInt32).
274
* Non-Carbon CFM: available as macro/inline
275
* CarbonLib: in CarbonLib 1.0 and later
276
* Mac OS X: in version 10.0 and later
278
function S64Set(value: SInt32): SInt64; external name '_S64Set';
285
* Given a UInt32, returns a SInt64 with the same value.
288
* Non-Carbon CFM: available as macro/inline
289
* CarbonLib: in CarbonLib 1.0 and later
290
* Mac OS X: in version 10.0 and later
292
function S64SetU(value: UInt32): SInt64; external name '_S64SetU';
298
* Given an SInt64, returns an SInt32 by discarding the high-order
302
* Non-Carbon CFM: available as macro/inline
303
* CarbonLib: in CarbonLib 1.0 and later
304
* Mac OS X: in version 10.0 and later
306
function S32Set(value: SInt64): SInt32; external name '_S32Set';
313
* Returns one if left and right are non-zero, otherwise returns zero
316
* Non-Carbon CFM: available as macro/inline
317
* CarbonLib: in CarbonLib 1.0 and later
318
* Mac OS X: in version 10.0 and later
320
function S64And(left: SInt64; right: SInt64): boolean; external name '_S64And';
327
* Returns one if left or right are non-zero, otherwise returns zero
330
* Non-Carbon CFM: available as macro/inline
331
* CarbonLib: in CarbonLib 1.0 and later
332
* Mac OS X: in version 10.0 and later
334
function S64Or(left: SInt64; right: SInt64): boolean; external name '_S64Or';
341
* Returns one if left xor right are non-zero, otherwise returns zero
344
* Non-Carbon CFM: available as macro/inline
345
* CarbonLib: in CarbonLib 1.0 and later
346
* Mac OS X: in version 10.0 and later
348
function S64Eor(left: SInt64; right: SInt64): boolean; external name '_S64Eor';
355
* Returns one if value is non-zero, otherwisze returns zero.
358
* Non-Carbon CFM: available as macro/inline
359
* CarbonLib: in CarbonLib 1.0 and later
360
* Mac OS X: in version 10.0 and later
362
function S64Not(value: SInt64): boolean; external name '_S64Not';
369
* Given two signed numbers, left and right, returns an SInt32 that
370
* compares with zero the same way left compares with right. If you
371
* wanted to perform a comparison on 64-bit integers of the
373
* operand_1 <operation> operand_2
374
* then you could use an expression of the form:
375
* xxxS64Compare(operand_1,operand_2) <operation> 0
376
* to test for the same condition. CAUTION: DO NOT depend on the
377
* exact value returned by this routine. Only the sign (i.e.
378
* positive, zero, or negative) of the result is guaranteed.
381
* Non-Carbon CFM: not available
382
* CarbonLib: in CarbonLib 1.0 and later
383
* Mac OS X: in version 10.0 and later
385
function S64Compare(left: SInt64; right: SInt64): SInt32; external name '_S64Compare';
395
* Non-Carbon CFM: available as macro/inline
396
* CarbonLib: in CarbonLib 1.0 and later
397
* Mac OS X: in version 10.0 and later
399
function S64BitwiseAnd(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseAnd';
409
* Non-Carbon CFM: available as macro/inline
410
* CarbonLib: in CarbonLib 1.0 and later
411
* Mac OS X: in version 10.0 and later
413
function S64BitwiseOr(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseOr';
423
* Non-Carbon CFM: available as macro/inline
424
* CarbonLib: in CarbonLib 1.0 and later
425
* Mac OS X: in version 10.0 and later
427
function S64BitwiseEor(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseEor';
437
* Non-Carbon CFM: available as macro/inline
438
* CarbonLib: in CarbonLib 1.0 and later
439
* Mac OS X: in version 10.0 and later
441
function S64BitwiseNot(value: SInt64): SInt64; external name '_S64BitwiseNot';
448
* Arithmetic shift of value by the lower 7 bits of the shift.
451
* Non-Carbon CFM: available as macro/inline
452
* CarbonLib: in CarbonLib 1.0 and later
453
* Mac OS X: in version 10.0 and later
455
function S64ShiftRight(value: SInt64; shift: UInt32): SInt64; external name '_S64ShiftRight';
462
* Logical shift of value by the lower 7 bits of the shift.
465
* Non-Carbon CFM: available as macro/inline
466
* CarbonLib: in CarbonLib 1.0 and later
467
* Mac OS X: in version 10.0 and later
469
function S64ShiftLeft(value: SInt64; shift: UInt32): SInt64; external name '_S64ShiftLeft';
476
* Returns largest possible UInt64 value
479
* Non-Carbon CFM: available as macro/inline
480
* CarbonLib: in CarbonLib 1.0 and later
481
* Mac OS X: in version 10.0 and later
483
function U64Max: UInt64; external name '_U64Max';
489
* Adds two unsigned integers, producing an SInt16 result. If an
490
* overflow occurs the result is congruent mod (2^64) as if the
491
* operands and result were unsigned. No overflow is signaled.
494
* Non-Carbon CFM: available as macro/inline
495
* CarbonLib: in CarbonLib 1.0 and later
496
* Mac OS X: in version 10.0 and later
498
function U64Add(left: UInt64; right: UInt64): UInt64; external name '_U64Add';
504
* Subtracts two unsigned integers, producing an SInt16 result. If
505
* an overflow occurs the result is congruent mod (2^64) as if the
506
* operands and result were unsigned. No overflow is signaled.
509
* Non-Carbon CFM: available as macro/inline
510
* CarbonLib: in CarbonLib 1.0 and later
511
* Mac OS X: in version 10.0 and later
513
function U64Subtract(left: UInt64; right: UInt64): UInt64; external name '_U64Subtract';
520
* Multiplies two unsigned numbers, producing a signed result.
521
* Overflow is ignored and the low-order part of the product is
522
* returned. The sign of the result is not guaranteed to be correct
523
* if the magnitude of the product is not representable.
526
* Non-Carbon CFM: available as macro/inline
527
* CarbonLib: in CarbonLib 1.0 and later
528
* Mac OS X: in version 10.0 and later
530
function U64Multiply(left: UInt64; right: UInt64): UInt64; external name '_U64Multiply';
533
{$ifc CALL_NOT_IN_CARBON}
538
* Returns the remainder of divide of dividend by divisor. The sign
539
* of the remainder is the same as the sign of the dividend (i.e.,
540
* it takes the absolute values of the operands, does the division,
541
* then fixes the sign of the quotient and remainder).
544
* Non-Carbon CFM: available as macro/inline
545
* CarbonLib: not available
546
* Mac OS X: not available
548
function U64Mod(dividend: UInt64; divisor: UInt64): UInt64; external name '_U64Mod';
551
{$endc} {CALL_NOT_IN_CARBON}
557
* Divides dividend by divisor, returning the quotient. The
558
* remainder is returned in *remainder if remainder (the pointer) is
559
* non-NULL. The sign of the remainder is the same as the sign of
560
* the dividend (i.e. it takes the absolute values of the operands,
561
* does the division, then fixes the sign of the quotient and
562
* remainder). If the divisor is zero, then U64Max() will be
563
* returned (or U64Min() if the dividend is negative), and the
564
* remainder will be the dividend; no error is reported.
567
* Non-Carbon CFM: available as macro/inline
568
* CarbonLib: in CarbonLib 1.0 and later
569
* Mac OS X: in version 10.0 and later
571
function U64Divide(dividend: UInt64; divisor: UInt64; remainder: UInt64Ptr): UInt64; external name '_U64Divide';
578
* Given an SInt32, returns an UInt64 with the same value. Use this
579
* routine instead of coding 64-bit constants (at least when the
580
* constant will fit in an SInt32).
583
* Non-Carbon CFM: available as macro/inline
584
* CarbonLib: in CarbonLib 1.0 and later
585
* Mac OS X: in version 10.0 and later
587
function U64Set(value: SInt32): UInt64; external name '_U64Set';
594
* Given a UInt32, returns a UInt64 with the same value.
597
* Non-Carbon CFM: available as macro/inline
598
* CarbonLib: in CarbonLib 1.0 and later
599
* Mac OS X: in version 10.0 and later
601
function U64SetU(value: UInt32): UInt64; external name '_U64SetU';
607
* Given an UInt64, returns an UInt32 by discarding the high-order
611
* Non-Carbon CFM: available as macro/inline
612
* CarbonLib: in CarbonLib 1.0 and later
613
* Mac OS X: in version 10.0 and later
615
function U32SetU(value: UInt64): UInt32; external name '_U32SetU';
622
* Returns one if left and right are non-zero, otherwise returns zero
625
* Non-Carbon CFM: available as macro/inline
626
* CarbonLib: in CarbonLib 1.0 and later
627
* Mac OS X: in version 10.0 and later
629
function U64And(left: UInt64; right: UInt64): boolean; external name '_U64And';
636
* Returns one if left or right are non-zero, otherwise returns zero
639
* Non-Carbon CFM: available as macro/inline
640
* CarbonLib: in CarbonLib 1.0 and later
641
* Mac OS X: in version 10.0 and later
643
function U64Or(left: UInt64; right: UInt64): boolean; external name '_U64Or';
650
* Returns one if left xor right are non-zero, otherwise returns zero
653
* Non-Carbon CFM: available as macro/inline
654
* CarbonLib: in CarbonLib 1.0 and later
655
* Mac OS X: in version 10.0 and later
657
function U64Eor(left: UInt64; right: UInt64): boolean; external name '_U64Eor';
664
* Returns one if value is non-zero, otherwisze returns zero.
667
* Non-Carbon CFM: available as macro/inline
668
* CarbonLib: in CarbonLib 1.0 and later
669
* Mac OS X: in version 10.0 and later
671
function U64Not(value: UInt64): boolean; external name '_U64Not';
678
* Given two unsigned numbers, left and right, returns an SInt32
679
* that compares with zero the same way left compares with right.
680
* If you wanted to perform a comparison on 64-bit integers of the
682
* operand_1 <operation> operand_2
683
* then you could use an expression of the form:
684
* xxxU64Compare(operand_1,operand_2) <operation> 0
685
* to test for the same condition. CAUTION: DO NOT depend on the
686
* exact value returned by this routine. Only the sign (i.e.
687
* positive, zero, or negative) of the result is guaranteed.
690
* Non-Carbon CFM: not available
691
* CarbonLib: in CarbonLib 1.0 and later
692
* Mac OS X: in version 10.0 and later
694
function U64Compare(left: UInt64; right: UInt64): SInt32; external name '_U64Compare';
703
* Non-Carbon CFM: available as macro/inline
704
* CarbonLib: in CarbonLib 1.0 and later
705
* Mac OS X: in version 10.0 and later
707
function U64BitwiseAnd(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseAnd';
717
* Non-Carbon CFM: available as macro/inline
718
* CarbonLib: in CarbonLib 1.0 and later
719
* Mac OS X: in version 10.0 and later
721
function U64BitwiseOr(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseOr';
731
* Non-Carbon CFM: available as macro/inline
732
* CarbonLib: in CarbonLib 1.0 and later
733
* Mac OS X: in version 10.0 and later
735
function U64BitwiseEor(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseEor';
745
* Non-Carbon CFM: available as macro/inline
746
* CarbonLib: in CarbonLib 1.0 and later
747
* Mac OS X: in version 10.0 and later
749
function U64BitwiseNot(value: UInt64): UInt64; external name '_U64BitwiseNot';
756
* Arithmetic shift of value by the lower 7 bits of the shift.
759
* Non-Carbon CFM: available as macro/inline
760
* CarbonLib: in CarbonLib 1.0 and later
761
* Mac OS X: in version 10.0 and later
763
function U64ShiftRight(value: UInt64; shift: UInt32): UInt64; external name '_U64ShiftRight';
770
* Logical shift of value by the lower 7 bits of the shift.
773
* Non-Carbon CFM: available as macro/inline
774
* CarbonLib: in CarbonLib 1.0 and later
775
* Mac OS X: in version 10.0 and later
777
function U64ShiftLeft(value: UInt64; shift: UInt32): UInt64; external name '_U64ShiftLeft';
784
* converts UInt64 -> SInt64
787
* Non-Carbon CFM: available as macro/inline
788
* CarbonLib: in CarbonLib 1.0 and later
789
* Mac OS X: in version 10.0 and later
791
function UInt64ToSInt64(value: UInt64): SInt64; external name '_UInt64ToSInt64';
798
* converts SInt64 -> UInt64
801
* Non-Carbon CFM: available as macro/inline
802
* CarbonLib: in CarbonLib 1.0 and later
803
* Mac OS X: in version 10.0 and later
805
function SInt64ToUInt64(value: SInt64): UInt64; external name '_SInt64ToUInt64';