~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/extra/univint/Math64.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
     File:       Math64.p
3
 
 
4
 
     Contains:   64-bit SInt16 math Interfaces.
5
 
 
6
 
     Version:    Technology: Mac OS 9
7
 
                 Release:    Universal Interfaces 3.4.2
8
 
 
9
 
     Copyright:  � 1994-2002 by Apple Computer, Inc., all rights reserved
10
 
 
11
 
     Bugs?:      For bug reports, consult the following page on
12
 
                 the World Wide Web:
13
 
 
14
 
                     http://www.freepascal.org/bugs.html
15
 
 
16
 
}
17
 
 
18
 
 
19
 
{
20
 
    Modified for use with Free Pascal
21
 
    Version 200
22
 
    Please report any bugs to <gpc@microbizz.nl>
23
 
}
24
 
 
25
 
{$mode macpas}
26
 
{$packenum 1}
27
 
{$macro on}
28
 
{$inline on}
29
 
{$CALLING MWPASCAL}
30
 
 
31
 
unit Math64;
32
 
interface
33
 
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
34
 
{$setc GAP_INTERFACES_VERSION := $0200}
35
 
 
36
 
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
37
 
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
38
 
{$endc}
39
 
 
40
 
{$ifc defined CPUPOWERPC and defined CPUI386}
41
 
        {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
42
 
{$endc}
43
 
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
44
 
        {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
45
 
{$endc}
46
 
 
47
 
{$ifc not defined __ppc__ and defined CPUPOWERPC}
48
 
        {$setc __ppc__ := 1}
49
 
{$elsec}
50
 
        {$setc __ppc__ := 0}
51
 
{$endc}
52
 
{$ifc not defined __i386__ and defined CPUI386}
53
 
        {$setc __i386__ := 1}
54
 
{$elsec}
55
 
        {$setc __i386__ := 0}
56
 
{$endc}
57
 
 
58
 
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
59
 
        {$error Conflicting definitions for __ppc__ and __i386__}
60
 
{$endc}
61
 
 
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}
68
 
{$elsec}
69
 
        {$error Neither __ppc__ nor __i386__ is defined.}
70
 
{$endc}
71
 
{$setc TARGET_CPU_PPC_64 := FALSE}
72
 
 
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}
79
 
{$elsec}
80
 
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
81
 
{$endc}
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;
108
 
 
109
 
 
110
 
{$ALIGN MAC68K}
111
 
 
112
 
 
113
 
{
114
 
 *  S64Max()
115
 
 *  
116
 
 *  Discussion:
117
 
 *    Returns largest possible SInt64 value
118
 
 *  
119
 
 *  Availability:
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
123
 
 }
124
 
function S64Max: SInt64; external name '_S64Max';
125
 
 
126
 
{
127
 
 *  S64Min()
128
 
 *  
129
 
 *  Discussion:
130
 
 *    Returns smallest possible SInt64 value
131
 
 *  
132
 
 *  Availability:
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
136
 
 }
137
 
function S64Min: SInt64; external name '_S64Min';
138
 
 
139
 
 
140
 
{
141
 
 *  S64Add()
142
 
 *  
143
 
 *  Discussion:
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.
147
 
 *  
148
 
 *  Availability:
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
152
 
 }
153
 
function S64Add(left: SInt64; right: SInt64): SInt64; external name '_S64Add';
154
 
 
155
 
 
156
 
{
157
 
 *  S64Subtract()
158
 
 *  
159
 
 *  Discussion:
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.
163
 
 *  
164
 
 *  Availability:
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
168
 
 }
169
 
function S64Subtract(left: SInt64; right: SInt64): SInt64; external name '_S64Subtract';
170
 
 
171
 
 
172
 
{
173
 
 *  S64Negate()
174
 
 *  
175
 
 *  Discussion:
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).
179
 
 *  
180
 
 *  Availability:
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
184
 
 }
185
 
function S64Negate(value: SInt64): SInt64; external name '_S64Negate';
186
 
 
187
 
 
188
 
{$ifc NOT TYPE_LONGLONG}
189
 
{
190
 
 *  S64Absolute()
191
 
 *  
192
 
 *  Discussion:
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
196
 
 *    everywhere.
197
 
 *  
198
 
 *  Availability:
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
202
 
 }
203
 
function S64Absolute(value: SInt64): SInt64; external name '_S64Absolute';
204
 
 
205
 
{$endc}
206
 
 
207
 
{
208
 
 *  S64Multiply()
209
 
 *  
210
 
 *  Discussion:
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.
215
 
 *  
216
 
 *  Availability:
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
220
 
 }
221
 
function S64Multiply(left: SInt64; right: SInt64): SInt64; external name '_S64Multiply';
222
 
 
223
 
 
224
 
{$ifc CALL_NOT_IN_CARBON}
225
 
{
226
 
 *  S64Mod()
227
 
 *  
228
 
 *  Discussion:
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).
233
 
 *  
234
 
 *  Availability:
235
 
 *    Non-Carbon CFM:   available as macro/inline
236
 
 *    CarbonLib:        not available
237
 
 *    Mac OS X:         not available
238
 
 }
239
 
function S64Mod(dividend: SInt64; divisor: SInt64): SInt64; external name '_S64Mod';
240
 
 
241
 
 
242
 
{$endc}  {CALL_NOT_IN_CARBON}
243
 
 
244
 
{
245
 
 *  S64Divide()
246
 
 *  
247
 
 *  Discussion:
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.
256
 
 *  
257
 
 *  Availability:
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
261
 
 }
262
 
function S64Divide(dividend: SInt64; divisor: SInt64; remainder: SInt64Ptr): SInt64; external name '_S64Divide';
263
 
 
264
 
 
265
 
{
266
 
 *  S64Set()
267
 
 *  
268
 
 *  Discussion:
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).
272
 
 *  
273
 
 *  Availability:
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
277
 
 }
278
 
function S64Set(value: SInt32): SInt64; external name '_S64Set';
279
 
 
280
 
 
281
 
{
282
 
 *  S64SetU()
283
 
 *  
284
 
 *  Discussion:
285
 
 *    Given a UInt32, returns a SInt64 with the same value.
286
 
 *  
287
 
 *  Availability:
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
291
 
 }
292
 
function S64SetU(value: UInt32): SInt64; external name '_S64SetU';
293
 
 
294
 
{
295
 
 *  S32Set()
296
 
 *  
297
 
 *  Discussion:
298
 
 *    Given an SInt64, returns an SInt32 by discarding the high-order
299
 
 *    32 bits.
300
 
 *  
301
 
 *  Availability:
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
305
 
 }
306
 
function S32Set(value: SInt64): SInt32; external name '_S32Set';
307
 
 
308
 
 
309
 
{
310
 
 *  S64And()
311
 
 *  
312
 
 *  Discussion:
313
 
 *    Returns one if left and right are non-zero, otherwise returns zero
314
 
 *  
315
 
 *  Availability:
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
319
 
 }
320
 
function S64And(left: SInt64; right: SInt64): boolean; external name '_S64And';
321
 
 
322
 
 
323
 
{
324
 
 *  S64Or()
325
 
 *  
326
 
 *  Discussion:
327
 
 *    Returns one if left or right are non-zero, otherwise returns zero
328
 
 *  
329
 
 *  Availability:
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
333
 
 }
334
 
function S64Or(left: SInt64; right: SInt64): boolean; external name '_S64Or';
335
 
 
336
 
 
337
 
{
338
 
 *  S64Eor()
339
 
 *  
340
 
 *  Discussion:
341
 
 *    Returns one if left xor right are non-zero, otherwise returns zero
342
 
 *  
343
 
 *  Availability:
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
347
 
 }
348
 
function S64Eor(left: SInt64; right: SInt64): boolean; external name '_S64Eor';
349
 
 
350
 
 
351
 
{
352
 
 *  S64Not()
353
 
 *  
354
 
 *  Discussion:
355
 
 *    Returns one if value is non-zero, otherwisze returns zero.
356
 
 *  
357
 
 *  Availability:
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
361
 
 }
362
 
function S64Not(value: SInt64): boolean; external name '_S64Not';
363
 
 
364
 
 
365
 
{
366
 
 *  S64Compare()
367
 
 *  
368
 
 *  Discussion:
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
372
 
 *    form:
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.
379
 
 *  
380
 
 *  Availability:
381
 
 *    Non-Carbon CFM:   not available
382
 
 *    CarbonLib:        in CarbonLib 1.0 and later
383
 
 *    Mac OS X:         in version 10.0 and later
384
 
 }
385
 
function S64Compare(left: SInt64; right: SInt64): SInt32; external name '_S64Compare';
386
 
 
387
 
 
388
 
{
389
 
 *  S64BitwiseAnd()
390
 
 *  
391
 
 *  Discussion:
392
 
 *    bitwise AND
393
 
 *  
394
 
 *  Availability:
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
398
 
 }
399
 
function S64BitwiseAnd(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseAnd';
400
 
 
401
 
 
402
 
{
403
 
 *  S64BitwiseOr()
404
 
 *  
405
 
 *  Discussion:
406
 
 *    bitwise OR
407
 
 *  
408
 
 *  Availability:
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
412
 
 }
413
 
function S64BitwiseOr(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseOr';
414
 
 
415
 
 
416
 
{
417
 
 *  S64BitwiseEor()
418
 
 *  
419
 
 *  Discussion:
420
 
 *    bitwise XOR
421
 
 *  
422
 
 *  Availability:
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
426
 
 }
427
 
function S64BitwiseEor(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseEor';
428
 
 
429
 
 
430
 
{
431
 
 *  S64BitwiseNot()
432
 
 *  
433
 
 *  Discussion:
434
 
 *    bitwise negate
435
 
 *  
436
 
 *  Availability:
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
440
 
 }
441
 
function S64BitwiseNot(value: SInt64): SInt64; external name '_S64BitwiseNot';
442
 
 
443
 
 
444
 
{
445
 
 *  S64ShiftRight()
446
 
 *  
447
 
 *  Discussion:
448
 
 *    Arithmetic shift of value by the lower 7 bits of the shift.
449
 
 *  
450
 
 *  Availability:
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
454
 
 }
455
 
function S64ShiftRight(value: SInt64; shift: UInt32): SInt64; external name '_S64ShiftRight';
456
 
 
457
 
 
458
 
{
459
 
 *  S64ShiftLeft()
460
 
 *  
461
 
 *  Discussion:
462
 
 *    Logical shift of value by the lower 7 bits of the shift.
463
 
 *  
464
 
 *  Availability:
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
468
 
 }
469
 
function S64ShiftLeft(value: SInt64; shift: UInt32): SInt64; external name '_S64ShiftLeft';
470
 
 
471
 
 
472
 
{
473
 
 *  U64Max()
474
 
 *  
475
 
 *  Discussion:
476
 
 *    Returns largest possible UInt64 value
477
 
 *  
478
 
 *  Availability:
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
482
 
 }
483
 
function U64Max: UInt64; external name '_U64Max';
484
 
 
485
 
{
486
 
 *  U64Add()
487
 
 *  
488
 
 *  Discussion:
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.
492
 
 *  
493
 
 *  Availability:
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
497
 
 }
498
 
function U64Add(left: UInt64; right: UInt64): UInt64; external name '_U64Add';
499
 
 
500
 
{
501
 
 *  U64Subtract()
502
 
 *  
503
 
 *  Discussion:
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.
507
 
 *  
508
 
 *  Availability:
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
512
 
 }
513
 
function U64Subtract(left: UInt64; right: UInt64): UInt64; external name '_U64Subtract';
514
 
 
515
 
 
516
 
{
517
 
 *  U64Multiply()
518
 
 *  
519
 
 *  Discussion:
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.
524
 
 *  
525
 
 *  Availability:
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
529
 
 }
530
 
function U64Multiply(left: UInt64; right: UInt64): UInt64; external name '_U64Multiply';
531
 
 
532
 
 
533
 
{$ifc CALL_NOT_IN_CARBON}
534
 
{
535
 
 *  U64Mod()
536
 
 *  
537
 
 *  Discussion:
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).
542
 
 *  
543
 
 *  Availability:
544
 
 *    Non-Carbon CFM:   available as macro/inline
545
 
 *    CarbonLib:        not available
546
 
 *    Mac OS X:         not available
547
 
 }
548
 
function U64Mod(dividend: UInt64; divisor: UInt64): UInt64; external name '_U64Mod';
549
 
 
550
 
 
551
 
{$endc}  {CALL_NOT_IN_CARBON}
552
 
 
553
 
{
554
 
 *  U64Divide()
555
 
 *  
556
 
 *  Discussion:
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.
565
 
 *  
566
 
 *  Availability:
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
570
 
 }
571
 
function U64Divide(dividend: UInt64; divisor: UInt64; remainder: UInt64Ptr): UInt64; external name '_U64Divide';
572
 
 
573
 
 
574
 
{
575
 
 *  U64Set()
576
 
 *  
577
 
 *  Discussion:
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).
581
 
 *  
582
 
 *  Availability:
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
586
 
 }
587
 
function U64Set(value: SInt32): UInt64; external name '_U64Set';
588
 
 
589
 
 
590
 
{
591
 
 *  U64SetU()
592
 
 *  
593
 
 *  Discussion:
594
 
 *    Given a UInt32, returns a UInt64 with the same value.
595
 
 *  
596
 
 *  Availability:
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
600
 
 }
601
 
function U64SetU(value: UInt32): UInt64; external name '_U64SetU';
602
 
 
603
 
{
604
 
 *  U32SetU()
605
 
 *  
606
 
 *  Discussion:
607
 
 *    Given an UInt64, returns an UInt32 by discarding the high-order
608
 
 *    32 bits.
609
 
 *  
610
 
 *  Availability:
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
614
 
 }
615
 
function U32SetU(value: UInt64): UInt32; external name '_U32SetU';
616
 
 
617
 
 
618
 
{
619
 
 *  U64And()
620
 
 *  
621
 
 *  Discussion:
622
 
 *    Returns one if left and right are non-zero, otherwise returns zero
623
 
 *  
624
 
 *  Availability:
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
628
 
 }
629
 
function U64And(left: UInt64; right: UInt64): boolean; external name '_U64And';
630
 
 
631
 
 
632
 
{
633
 
 *  U64Or()
634
 
 *  
635
 
 *  Discussion:
636
 
 *    Returns one if left or right are non-zero, otherwise returns zero
637
 
 *  
638
 
 *  Availability:
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
642
 
 }
643
 
function U64Or(left: UInt64; right: UInt64): boolean; external name '_U64Or';
644
 
 
645
 
 
646
 
{
647
 
 *  U64Eor()
648
 
 *  
649
 
 *  Discussion:
650
 
 *    Returns one if left xor right are non-zero, otherwise returns zero
651
 
 *  
652
 
 *  Availability:
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
656
 
 }
657
 
function U64Eor(left: UInt64; right: UInt64): boolean; external name '_U64Eor';
658
 
 
659
 
 
660
 
{
661
 
 *  U64Not()
662
 
 *  
663
 
 *  Discussion:
664
 
 *    Returns one if value is non-zero, otherwisze returns zero.
665
 
 *  
666
 
 *  Availability:
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
670
 
 }
671
 
function U64Not(value: UInt64): boolean; external name '_U64Not';
672
 
 
673
 
 
674
 
{
675
 
 *  U64Compare()
676
 
 *  
677
 
 *  Discussion:
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
681
 
 *    form:
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.
688
 
 *  
689
 
 *  Availability:
690
 
 *    Non-Carbon CFM:   not available
691
 
 *    CarbonLib:        in CarbonLib 1.0 and later
692
 
 *    Mac OS X:         in version 10.0 and later
693
 
 }
694
 
function U64Compare(left: UInt64; right: UInt64): SInt32; external name '_U64Compare';
695
 
 
696
 
{
697
 
 *  U64BitwiseAnd()
698
 
 *  
699
 
 *  Discussion:
700
 
 *    bitwise AND
701
 
 *  
702
 
 *  Availability:
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
706
 
 }
707
 
function U64BitwiseAnd(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseAnd';
708
 
 
709
 
 
710
 
{
711
 
 *  U64BitwiseOr()
712
 
 *  
713
 
 *  Discussion:
714
 
 *    bitwise OR
715
 
 *  
716
 
 *  Availability:
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
720
 
 }
721
 
function U64BitwiseOr(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseOr';
722
 
 
723
 
 
724
 
{
725
 
 *  U64BitwiseEor()
726
 
 *  
727
 
 *  Discussion:
728
 
 *    bitwise XOR
729
 
 *  
730
 
 *  Availability:
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
734
 
 }
735
 
function U64BitwiseEor(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseEor';
736
 
 
737
 
 
738
 
{
739
 
 *  U64BitwiseNot()
740
 
 *  
741
 
 *  Discussion:
742
 
 *    bitwise negate
743
 
 *  
744
 
 *  Availability:
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
748
 
 }
749
 
function U64BitwiseNot(value: UInt64): UInt64; external name '_U64BitwiseNot';
750
 
 
751
 
 
752
 
{
753
 
 *  U64ShiftRight()
754
 
 *  
755
 
 *  Discussion:
756
 
 *    Arithmetic shift of value by the lower 7 bits of the shift.
757
 
 *  
758
 
 *  Availability:
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
762
 
 }
763
 
function U64ShiftRight(value: UInt64; shift: UInt32): UInt64; external name '_U64ShiftRight';
764
 
 
765
 
 
766
 
{
767
 
 *  U64ShiftLeft()
768
 
 *  
769
 
 *  Discussion:
770
 
 *    Logical shift of value by the lower 7 bits of the shift.
771
 
 *  
772
 
 *  Availability:
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
776
 
 }
777
 
function U64ShiftLeft(value: UInt64; shift: UInt32): UInt64; external name '_U64ShiftLeft';
778
 
 
779
 
 
780
 
{
781
 
 *  UInt64ToSInt64()
782
 
 *  
783
 
 *  Discussion:
784
 
 *    converts UInt64 -> SInt64
785
 
 *  
786
 
 *  Availability:
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
790
 
 }
791
 
function UInt64ToSInt64(value: UInt64): SInt64; external name '_UInt64ToSInt64';
792
 
 
793
 
 
794
 
{
795
 
 *  SInt64ToUInt64()
796
 
 *  
797
 
 *  Discussion:
798
 
 *    converts SInt64 -> UInt64
799
 
 *  
800
 
 *  Availability:
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
804
 
 }
805
 
function SInt64ToUInt64(value: SInt64): UInt64; external name '_SInt64ToUInt64';
806
 
 
807
 
 
808
 
{$ALIGN MAC68K}
809
 
 
810
 
 
811
 
end.