Math64.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. {
  2. File: Math64.p
  3. Contains: 64-bit SInt16 math Interfaces.
  4. Version: Technology: Mac OS 9
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1994-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  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 Math64;
  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 MacTypes,ConditionalMacros;
  92. {$ALIGN MAC68K}
  93. {
  94. * S64Max()
  95. *
  96. * Discussion:
  97. * Returns largest possible SInt64 value
  98. *
  99. * Availability:
  100. * Non-Carbon CFM: available as macro/inline
  101. * CarbonLib: in CarbonLib 1.0 and later
  102. * Mac OS X: in version 10.0 and later
  103. }
  104. function S64Max: SInt64; external name '_S64Max';
  105. {
  106. * S64Min()
  107. *
  108. * Discussion:
  109. * Returns smallest possible SInt64 value
  110. *
  111. * Availability:
  112. * Non-Carbon CFM: available as macro/inline
  113. * CarbonLib: in CarbonLib 1.0 and later
  114. * Mac OS X: in version 10.0 and later
  115. }
  116. function S64Min: SInt64; external name '_S64Min';
  117. {
  118. * S64Add()
  119. *
  120. * Discussion:
  121. * Adds two integers, producing an SInt16 result. If an overflow
  122. * occurs the result is congruent mod (2^64) as if the operands and
  123. * result were unsigned. No overflow is signaled.
  124. *
  125. * Availability:
  126. * Non-Carbon CFM: available as macro/inline
  127. * CarbonLib: in CarbonLib 1.0 and later
  128. * Mac OS X: in version 10.0 and later
  129. }
  130. function S64Add(left: SInt64; right: SInt64): SInt64; external name '_S64Add';
  131. {
  132. * S64Subtract()
  133. *
  134. * Discussion:
  135. * Subtracts two integers, producing an SInt16 result. If an
  136. * overflow occurs the result is congruent mod (2^64) as if the
  137. * operands and result were unsigned. No overflow is signaled.
  138. *
  139. * Availability:
  140. * Non-Carbon CFM: available as macro/inline
  141. * CarbonLib: in CarbonLib 1.0 and later
  142. * Mac OS X: in version 10.0 and later
  143. }
  144. function S64Subtract(left: SInt64; right: SInt64): SInt64; external name '_S64Subtract';
  145. {
  146. * S64Negate()
  147. *
  148. * Discussion:
  149. * Returns the additive inverse of a signed number (i.e. it returns
  150. * 0 - the number). S64Negate (S64Min) is not representable (in
  151. * fact, it returns S64Min).
  152. *
  153. * Availability:
  154. * Non-Carbon CFM: available as macro/inline
  155. * CarbonLib: in CarbonLib 1.0 and later
  156. * Mac OS X: in version 10.0 and later
  157. }
  158. function S64Negate(value: SInt64): SInt64; external name '_S64Negate';
  159. {$ifc NOT TYPE_LONGLONG}
  160. {
  161. * S64Absolute()
  162. *
  163. * Discussion:
  164. * Returns the absolute value of the number (i.e. the number if it
  165. * is positive, or 0 - the number if it is negative). Disabled for
  166. * compilers that support long long until llabs() is available
  167. * everywhere.
  168. *
  169. * Availability:
  170. * Non-Carbon CFM: available as macro/inline
  171. * CarbonLib: in CarbonLib 1.0 and later
  172. * Mac OS X: in version 10.0 and later
  173. }
  174. function S64Absolute(value: SInt64): SInt64; external name '_S64Absolute';
  175. {$endc}
  176. {
  177. * S64Multiply()
  178. *
  179. * Discussion:
  180. * Multiplies two signed numbers, producing a signed result.
  181. * Overflow is ignored and the low-order part of the product is
  182. * returned. The sign of the result is not guaranteed to be correct
  183. * if the magnitude of the product is not representable.
  184. *
  185. * Availability:
  186. * Non-Carbon CFM: available as macro/inline
  187. * CarbonLib: in CarbonLib 1.0 and later
  188. * Mac OS X: in version 10.0 and later
  189. }
  190. function S64Multiply(left: SInt64; right: SInt64): SInt64; external name '_S64Multiply';
  191. {$ifc CALL_NOT_IN_CARBON}
  192. {
  193. * S64Mod()
  194. *
  195. * Discussion:
  196. * Returns the remainder of divide of dividend by divisor. The sign
  197. * of the remainder is the same as the sign of the dividend (i.e.,
  198. * it takes the absolute values of the operands, does the division,
  199. * then fixes the sign of the quotient and remainder).
  200. *
  201. * Availability:
  202. * Non-Carbon CFM: available as macro/inline
  203. * CarbonLib: not available
  204. * Mac OS X: not available
  205. }
  206. function S64Mod(dividend: SInt64; divisor: SInt64): SInt64; external name '_S64Mod';
  207. {$endc} {CALL_NOT_IN_CARBON}
  208. {
  209. * S64Divide()
  210. *
  211. * Discussion:
  212. * Divides dividend by divisor, returning the quotient. The
  213. * remainder is returned in *remainder if remainder (the pointer) is
  214. * non-NULL. The sign of the remainder is the same as the sign of
  215. * the dividend (i.e. it takes the absolute values of the operands,
  216. * does the division, then fixes the sign of the quotient and
  217. * remainder). If the divisor is zero, then S64Max() will be
  218. * returned (or S64Min() if the dividend is negative), and the
  219. * remainder will be the dividend; no error is reported.
  220. *
  221. * Availability:
  222. * Non-Carbon CFM: available as macro/inline
  223. * CarbonLib: in CarbonLib 1.0 and later
  224. * Mac OS X: in version 10.0 and later
  225. }
  226. function S64Divide(dividend: SInt64; divisor: SInt64; remainder: SInt64Ptr): SInt64; external name '_S64Divide';
  227. {
  228. * S64Set()
  229. *
  230. * Discussion:
  231. * Given an SInt32, returns an SInt64 with the same value. Use this
  232. * routine instead of coding 64-bit constants (at least when the
  233. * constant will fit in an SInt32).
  234. *
  235. * Availability:
  236. * Non-Carbon CFM: available as macro/inline
  237. * CarbonLib: in CarbonLib 1.0 and later
  238. * Mac OS X: in version 10.0 and later
  239. }
  240. function S64Set(value: SInt32): SInt64; external name '_S64Set';
  241. {
  242. * S64SetU()
  243. *
  244. * Discussion:
  245. * Given a UInt32, returns a SInt64 with the same value.
  246. *
  247. * Availability:
  248. * Non-Carbon CFM: available as macro/inline
  249. * CarbonLib: in CarbonLib 1.0 and later
  250. * Mac OS X: in version 10.0 and later
  251. }
  252. function S64SetU(value: UInt32): SInt64; external name '_S64SetU';
  253. {
  254. * S32Set()
  255. *
  256. * Discussion:
  257. * Given an SInt64, returns an SInt32 by discarding the high-order
  258. * 32 bits.
  259. *
  260. * Availability:
  261. * Non-Carbon CFM: available as macro/inline
  262. * CarbonLib: in CarbonLib 1.0 and later
  263. * Mac OS X: in version 10.0 and later
  264. }
  265. function S32Set(value: SInt64): SInt32; external name '_S32Set';
  266. {
  267. * S64And()
  268. *
  269. * Discussion:
  270. * Returns one if left and right are non-zero, otherwise returns zero
  271. *
  272. * Availability:
  273. * Non-Carbon CFM: available as macro/inline
  274. * CarbonLib: in CarbonLib 1.0 and later
  275. * Mac OS X: in version 10.0 and later
  276. }
  277. function S64And(left: SInt64; right: SInt64): boolean; external name '_S64And';
  278. {
  279. * S64Or()
  280. *
  281. * Discussion:
  282. * Returns one if left or right are non-zero, otherwise returns zero
  283. *
  284. * Availability:
  285. * Non-Carbon CFM: available as macro/inline
  286. * CarbonLib: in CarbonLib 1.0 and later
  287. * Mac OS X: in version 10.0 and later
  288. }
  289. function S64Or(left: SInt64; right: SInt64): boolean; external name '_S64Or';
  290. {
  291. * S64Eor()
  292. *
  293. * Discussion:
  294. * Returns one if left xor right are non-zero, otherwise returns zero
  295. *
  296. * Availability:
  297. * Non-Carbon CFM: available as macro/inline
  298. * CarbonLib: in CarbonLib 1.0 and later
  299. * Mac OS X: in version 10.0 and later
  300. }
  301. function S64Eor(left: SInt64; right: SInt64): boolean; external name '_S64Eor';
  302. {
  303. * S64Not()
  304. *
  305. * Discussion:
  306. * Returns one if value is non-zero, otherwisze returns zero.
  307. *
  308. * Availability:
  309. * Non-Carbon CFM: available as macro/inline
  310. * CarbonLib: in CarbonLib 1.0 and later
  311. * Mac OS X: in version 10.0 and later
  312. }
  313. function S64Not(value: SInt64): boolean; external name '_S64Not';
  314. {
  315. * S64Compare()
  316. *
  317. * Discussion:
  318. * Given two signed numbers, left and right, returns an SInt32 that
  319. * compares with zero the same way left compares with right. If you
  320. * wanted to perform a comparison on 64-bit integers of the
  321. * form:
  322. * operand_1 <operation> operand_2
  323. * then you could use an expression of the form:
  324. * xxxS64Compare(operand_1,operand_2) <operation> 0
  325. * to test for the same condition. CAUTION: DO NOT depend on the
  326. * exact value returned by this routine. Only the sign (i.e.
  327. * positive, zero, or negative) of the result is guaranteed.
  328. *
  329. * Availability:
  330. * Non-Carbon CFM: not available
  331. * CarbonLib: in CarbonLib 1.0 and later
  332. * Mac OS X: in version 10.0 and later
  333. }
  334. function S64Compare(left: SInt64; right: SInt64): SInt32; external name '_S64Compare';
  335. {
  336. * S64BitwiseAnd()
  337. *
  338. * Discussion:
  339. * bitwise AND
  340. *
  341. * Availability:
  342. * Non-Carbon CFM: available as macro/inline
  343. * CarbonLib: in CarbonLib 1.0 and later
  344. * Mac OS X: in version 10.0 and later
  345. }
  346. function S64BitwiseAnd(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseAnd';
  347. {
  348. * S64BitwiseOr()
  349. *
  350. * Discussion:
  351. * bitwise OR
  352. *
  353. * Availability:
  354. * Non-Carbon CFM: available as macro/inline
  355. * CarbonLib: in CarbonLib 1.0 and later
  356. * Mac OS X: in version 10.0 and later
  357. }
  358. function S64BitwiseOr(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseOr';
  359. {
  360. * S64BitwiseEor()
  361. *
  362. * Discussion:
  363. * bitwise XOR
  364. *
  365. * Availability:
  366. * Non-Carbon CFM: available as macro/inline
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Mac OS X: in version 10.0 and later
  369. }
  370. function S64BitwiseEor(left: SInt64; right: SInt64): SInt64; external name '_S64BitwiseEor';
  371. {
  372. * S64BitwiseNot()
  373. *
  374. * Discussion:
  375. * bitwise negate
  376. *
  377. * Availability:
  378. * Non-Carbon CFM: available as macro/inline
  379. * CarbonLib: in CarbonLib 1.0 and later
  380. * Mac OS X: in version 10.0 and later
  381. }
  382. function S64BitwiseNot(value: SInt64): SInt64; external name '_S64BitwiseNot';
  383. {
  384. * S64ShiftRight()
  385. *
  386. * Discussion:
  387. * Arithmetic shift of value by the lower 7 bits of the shift.
  388. *
  389. * Availability:
  390. * Non-Carbon CFM: available as macro/inline
  391. * CarbonLib: in CarbonLib 1.0 and later
  392. * Mac OS X: in version 10.0 and later
  393. }
  394. function S64ShiftRight(value: SInt64; shift: UInt32): SInt64; external name '_S64ShiftRight';
  395. {
  396. * S64ShiftLeft()
  397. *
  398. * Discussion:
  399. * Logical shift of value by the lower 7 bits of the shift.
  400. *
  401. * Availability:
  402. * Non-Carbon CFM: available as macro/inline
  403. * CarbonLib: in CarbonLib 1.0 and later
  404. * Mac OS X: in version 10.0 and later
  405. }
  406. function S64ShiftLeft(value: SInt64; shift: UInt32): SInt64; external name '_S64ShiftLeft';
  407. {
  408. * U64Max()
  409. *
  410. * Discussion:
  411. * Returns largest possible UInt64 value
  412. *
  413. * Availability:
  414. * Non-Carbon CFM: available as macro/inline
  415. * CarbonLib: in CarbonLib 1.0 and later
  416. * Mac OS X: in version 10.0 and later
  417. }
  418. function U64Max: UInt64; external name '_U64Max';
  419. {
  420. * U64Add()
  421. *
  422. * Discussion:
  423. * Adds two unsigned integers, producing an SInt16 result. If an
  424. * overflow occurs the result is congruent mod (2^64) as if the
  425. * operands and result were unsigned. No overflow is signaled.
  426. *
  427. * Availability:
  428. * Non-Carbon CFM: available as macro/inline
  429. * CarbonLib: in CarbonLib 1.0 and later
  430. * Mac OS X: in version 10.0 and later
  431. }
  432. function U64Add(left: UInt64; right: UInt64): UInt64; external name '_U64Add';
  433. {
  434. * U64Subtract()
  435. *
  436. * Discussion:
  437. * Subtracts two unsigned integers, producing an SInt16 result. If
  438. * an overflow occurs the result is congruent mod (2^64) as if the
  439. * operands and result were unsigned. No overflow is signaled.
  440. *
  441. * Availability:
  442. * Non-Carbon CFM: available as macro/inline
  443. * CarbonLib: in CarbonLib 1.0 and later
  444. * Mac OS X: in version 10.0 and later
  445. }
  446. function U64Subtract(left: UInt64; right: UInt64): UInt64; external name '_U64Subtract';
  447. {
  448. * U64Multiply()
  449. *
  450. * Discussion:
  451. * Multiplies two unsigned numbers, producing a signed result.
  452. * Overflow is ignored and the low-order part of the product is
  453. * returned. The sign of the result is not guaranteed to be correct
  454. * if the magnitude of the product is not representable.
  455. *
  456. * Availability:
  457. * Non-Carbon CFM: available as macro/inline
  458. * CarbonLib: in CarbonLib 1.0 and later
  459. * Mac OS X: in version 10.0 and later
  460. }
  461. function U64Multiply(left: UInt64; right: UInt64): UInt64; external name '_U64Multiply';
  462. {$ifc CALL_NOT_IN_CARBON}
  463. {
  464. * U64Mod()
  465. *
  466. * Discussion:
  467. * Returns the remainder of divide of dividend by divisor. The sign
  468. * of the remainder is the same as the sign of the dividend (i.e.,
  469. * it takes the absolute values of the operands, does the division,
  470. * then fixes the sign of the quotient and remainder).
  471. *
  472. * Availability:
  473. * Non-Carbon CFM: available as macro/inline
  474. * CarbonLib: not available
  475. * Mac OS X: not available
  476. }
  477. function U64Mod(dividend: UInt64; divisor: UInt64): UInt64; external name '_U64Mod';
  478. {$endc} {CALL_NOT_IN_CARBON}
  479. {
  480. * U64Divide()
  481. *
  482. * Discussion:
  483. * Divides dividend by divisor, returning the quotient. The
  484. * remainder is returned in *remainder if remainder (the pointer) is
  485. * non-NULL. The sign of the remainder is the same as the sign of
  486. * the dividend (i.e. it takes the absolute values of the operands,
  487. * does the division, then fixes the sign of the quotient and
  488. * remainder). If the divisor is zero, then U64Max() will be
  489. * returned (or U64Min() if the dividend is negative), and the
  490. * remainder will be the dividend; no error is reported.
  491. *
  492. * Availability:
  493. * Non-Carbon CFM: available as macro/inline
  494. * CarbonLib: in CarbonLib 1.0 and later
  495. * Mac OS X: in version 10.0 and later
  496. }
  497. function U64Divide(dividend: UInt64; divisor: UInt64; remainder: UInt64Ptr): UInt64; external name '_U64Divide';
  498. {
  499. * U64Set()
  500. *
  501. * Discussion:
  502. * Given an SInt32, returns an UInt64 with the same value. Use this
  503. * routine instead of coding 64-bit constants (at least when the
  504. * constant will fit in an SInt32).
  505. *
  506. * Availability:
  507. * Non-Carbon CFM: available as macro/inline
  508. * CarbonLib: in CarbonLib 1.0 and later
  509. * Mac OS X: in version 10.0 and later
  510. }
  511. function U64Set(value: SInt32): UInt64; external name '_U64Set';
  512. {
  513. * U64SetU()
  514. *
  515. * Discussion:
  516. * Given a UInt32, returns a UInt64 with the same value.
  517. *
  518. * Availability:
  519. * Non-Carbon CFM: available as macro/inline
  520. * CarbonLib: in CarbonLib 1.0 and later
  521. * Mac OS X: in version 10.0 and later
  522. }
  523. function U64SetU(value: UInt32): UInt64; external name '_U64SetU';
  524. {
  525. * U32SetU()
  526. *
  527. * Discussion:
  528. * Given an UInt64, returns an UInt32 by discarding the high-order
  529. * 32 bits.
  530. *
  531. * Availability:
  532. * Non-Carbon CFM: available as macro/inline
  533. * CarbonLib: in CarbonLib 1.0 and later
  534. * Mac OS X: in version 10.0 and later
  535. }
  536. function U32SetU(value: UInt64): UInt32; external name '_U32SetU';
  537. {
  538. * U64And()
  539. *
  540. * Discussion:
  541. * Returns one if left and right are non-zero, otherwise returns zero
  542. *
  543. * Availability:
  544. * Non-Carbon CFM: available as macro/inline
  545. * CarbonLib: in CarbonLib 1.0 and later
  546. * Mac OS X: in version 10.0 and later
  547. }
  548. function U64And(left: UInt64; right: UInt64): boolean; external name '_U64And';
  549. {
  550. * U64Or()
  551. *
  552. * Discussion:
  553. * Returns one if left or right are non-zero, otherwise returns zero
  554. *
  555. * Availability:
  556. * Non-Carbon CFM: available as macro/inline
  557. * CarbonLib: in CarbonLib 1.0 and later
  558. * Mac OS X: in version 10.0 and later
  559. }
  560. function U64Or(left: UInt64; right: UInt64): boolean; external name '_U64Or';
  561. {
  562. * U64Eor()
  563. *
  564. * Discussion:
  565. * Returns one if left xor right are non-zero, otherwise returns zero
  566. *
  567. * Availability:
  568. * Non-Carbon CFM: available as macro/inline
  569. * CarbonLib: in CarbonLib 1.0 and later
  570. * Mac OS X: in version 10.0 and later
  571. }
  572. function U64Eor(left: UInt64; right: UInt64): boolean; external name '_U64Eor';
  573. {
  574. * U64Not()
  575. *
  576. * Discussion:
  577. * Returns one if value is non-zero, otherwisze returns zero.
  578. *
  579. * Availability:
  580. * Non-Carbon CFM: available as macro/inline
  581. * CarbonLib: in CarbonLib 1.0 and later
  582. * Mac OS X: in version 10.0 and later
  583. }
  584. function U64Not(value: UInt64): boolean; external name '_U64Not';
  585. {
  586. * U64Compare()
  587. *
  588. * Discussion:
  589. * Given two unsigned numbers, left and right, returns an SInt32
  590. * that compares with zero the same way left compares with right.
  591. * If you wanted to perform a comparison on 64-bit integers of the
  592. * form:
  593. * operand_1 <operation> operand_2
  594. * then you could use an expression of the form:
  595. * xxxU64Compare(operand_1,operand_2) <operation> 0
  596. * to test for the same condition. CAUTION: DO NOT depend on the
  597. * exact value returned by this routine. Only the sign (i.e.
  598. * positive, zero, or negative) of the result is guaranteed.
  599. *
  600. * Availability:
  601. * Non-Carbon CFM: not available
  602. * CarbonLib: in CarbonLib 1.0 and later
  603. * Mac OS X: in version 10.0 and later
  604. }
  605. function U64Compare(left: UInt64; right: UInt64): SInt32; external name '_U64Compare';
  606. {
  607. * U64BitwiseAnd()
  608. *
  609. * Discussion:
  610. * bitwise AND
  611. *
  612. * Availability:
  613. * Non-Carbon CFM: available as macro/inline
  614. * CarbonLib: in CarbonLib 1.0 and later
  615. * Mac OS X: in version 10.0 and later
  616. }
  617. function U64BitwiseAnd(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseAnd';
  618. {
  619. * U64BitwiseOr()
  620. *
  621. * Discussion:
  622. * bitwise OR
  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 U64BitwiseOr(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseOr';
  630. {
  631. * U64BitwiseEor()
  632. *
  633. * Discussion:
  634. * bitwise XOR
  635. *
  636. * Availability:
  637. * Non-Carbon CFM: available as macro/inline
  638. * CarbonLib: in CarbonLib 1.0 and later
  639. * Mac OS X: in version 10.0 and later
  640. }
  641. function U64BitwiseEor(left: UInt64; right: UInt64): UInt64; external name '_U64BitwiseEor';
  642. {
  643. * U64BitwiseNot()
  644. *
  645. * Discussion:
  646. * bitwise negate
  647. *
  648. * Availability:
  649. * Non-Carbon CFM: available as macro/inline
  650. * CarbonLib: in CarbonLib 1.0 and later
  651. * Mac OS X: in version 10.0 and later
  652. }
  653. function U64BitwiseNot(value: UInt64): UInt64; external name '_U64BitwiseNot';
  654. {
  655. * U64ShiftRight()
  656. *
  657. * Discussion:
  658. * Arithmetic shift of value by the lower 7 bits of the shift.
  659. *
  660. * Availability:
  661. * Non-Carbon CFM: available as macro/inline
  662. * CarbonLib: in CarbonLib 1.0 and later
  663. * Mac OS X: in version 10.0 and later
  664. }
  665. function U64ShiftRight(value: UInt64; shift: UInt32): UInt64; external name '_U64ShiftRight';
  666. {
  667. * U64ShiftLeft()
  668. *
  669. * Discussion:
  670. * Logical shift of value by the lower 7 bits of the shift.
  671. *
  672. * Availability:
  673. * Non-Carbon CFM: available as macro/inline
  674. * CarbonLib: in CarbonLib 1.0 and later
  675. * Mac OS X: in version 10.0 and later
  676. }
  677. function U64ShiftLeft(value: UInt64; shift: UInt32): UInt64; external name '_U64ShiftLeft';
  678. {
  679. * UInt64ToSInt64()
  680. *
  681. * Discussion:
  682. * converts UInt64 -> SInt64
  683. *
  684. * Availability:
  685. * Non-Carbon CFM: available as macro/inline
  686. * CarbonLib: in CarbonLib 1.0 and later
  687. * Mac OS X: in version 10.0 and later
  688. }
  689. function UInt64ToSInt64(value: UInt64): SInt64; external name '_UInt64ToSInt64';
  690. {
  691. * SInt64ToUInt64()
  692. *
  693. * Discussion:
  694. * converts SInt64 -> UInt64
  695. *
  696. * Availability:
  697. * Non-Carbon CFM: available as macro/inline
  698. * CarbonLib: in CarbonLib 1.0 and later
  699. * Mac OS X: in version 10.0 and later
  700. }
  701. function SInt64ToUInt64(value: SInt64): UInt64; external name '_SInt64ToUInt64';
  702. {$ALIGN MAC68K}
  703. end.