Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
5.5 KiB

  1. /*
  2. File: ToolUtils.h
  3. Contains: Toolbox Utilities Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1990-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __TOOLUTILS__
  11. #define __TOOLUTILS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __FIXMATH__
  16. #include <FixMath.h>
  17. #endif
  18. #ifndef __TEXTUTILS__
  19. #include <TextUtils.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. /*
  38. ------------------------------------------------------------------------------------
  39. Note:
  40. The following routines that used to be in this header file, have moved to
  41. more appropriate headers.
  42. FixMath.h: FixMul
  43. FixRatio
  44. FixRound
  45. Icons.h: GetIcon
  46. PlotIcon
  47. Quickdraw.h: AngleFromSlope
  48. DeltaPoint
  49. GetCursor
  50. GetIndPattern
  51. GetPattern
  52. GetPicture
  53. PackBits
  54. ScreenRes
  55. ShieldCursor
  56. SlopeFromAngle
  57. UnpackBits
  58. TextUtils.h: Munger
  59. GetIndString
  60. GetString
  61. NewString
  62. SetString
  63. ------------------------------------------------------------------------------------
  64. */
  65. /*
  66. * BitTst()
  67. *
  68. * Availability:
  69. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  70. * CarbonLib: in CarbonLib 1.0 and later
  71. * Mac OS X: in version 10.0 and later
  72. */
  73. EXTERN_API( Boolean )
  74. BitTst(
  75. const void * bytePtr,
  76. long bitNum) ONEWORDINLINE(0xA85D);
  77. /*
  78. * BitSet()
  79. *
  80. * Availability:
  81. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  82. * CarbonLib: in CarbonLib 1.0 and later
  83. * Mac OS X: in version 10.0 and later
  84. */
  85. EXTERN_API( void )
  86. BitSet(
  87. void * bytePtr,
  88. long bitNum) ONEWORDINLINE(0xA85E);
  89. /*
  90. * BitClr()
  91. *
  92. * Availability:
  93. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  94. * CarbonLib: in CarbonLib 1.0 and later
  95. * Mac OS X: in version 10.0 and later
  96. */
  97. EXTERN_API( void )
  98. BitClr(
  99. void * bytePtr,
  100. long bitNum) ONEWORDINLINE(0xA85F);
  101. /*
  102. * BitAnd()
  103. *
  104. * Availability:
  105. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  106. * CarbonLib: in CarbonLib 1.0 and later
  107. * Mac OS X: in version 10.0 and later
  108. */
  109. EXTERN_API( long )
  110. BitAnd(
  111. long value1,
  112. long value2) ONEWORDINLINE(0xA858);
  113. /*
  114. * BitOr()
  115. *
  116. * Availability:
  117. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  118. * CarbonLib: in CarbonLib 1.0 and later
  119. * Mac OS X: in version 10.0 and later
  120. */
  121. EXTERN_API( long )
  122. BitOr(
  123. long value1,
  124. long value2) ONEWORDINLINE(0xA85B);
  125. /*
  126. * BitXor()
  127. *
  128. * Availability:
  129. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  130. * CarbonLib: in CarbonLib 1.0 and later
  131. * Mac OS X: in version 10.0 and later
  132. */
  133. EXTERN_API( long )
  134. BitXor(
  135. long value1,
  136. long value2) ONEWORDINLINE(0xA859);
  137. /*
  138. * BitNot()
  139. *
  140. * Availability:
  141. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  142. * CarbonLib: in CarbonLib 1.0 and later
  143. * Mac OS X: in version 10.0 and later
  144. */
  145. EXTERN_API( long )
  146. BitNot(long value) ONEWORDINLINE(0xA85A);
  147. /*
  148. * BitShift()
  149. *
  150. * Availability:
  151. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  152. * CarbonLib: in CarbonLib 1.0 and later
  153. * Mac OS X: in version 10.0 and later
  154. */
  155. EXTERN_API( long )
  156. BitShift(
  157. long value,
  158. short count) ONEWORDINLINE(0xA85C);
  159. #if TARGET_CPU_68K
  160. struct Int64Bit {
  161. SInt32 hiLong;
  162. UInt32 loLong;
  163. };
  164. typedef struct Int64Bit Int64Bit;
  165. #if CALL_NOT_IN_CARBON
  166. /*
  167. * LongMul()
  168. *
  169. * Availability:
  170. * Non-Carbon CFM: not available
  171. * CarbonLib: not available
  172. * Mac OS X: not available
  173. */
  174. EXTERN_API( void )
  175. LongMul(
  176. long a,
  177. long b,
  178. Int64Bit * result) ONEWORDINLINE(0xA867);
  179. #else
  180. #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  181. #endif /* CALL_NOT_IN_CARBON */
  182. #endif /* TARGET_CPU_68K */
  183. #define HiWord(x) ((short)((long)(x) >> 16))
  184. #define LoWord(x) ((short)(x))
  185. #if PRAGMA_STRUCT_ALIGN
  186. #pragma options align=reset
  187. #elif PRAGMA_STRUCT_PACKPUSH
  188. #pragma pack(pop)
  189. #elif PRAGMA_STRUCT_PACK
  190. #pragma pack()
  191. #endif
  192. #ifdef PRAGMA_IMPORT_OFF
  193. #pragma import off
  194. #elif PRAGMA_IMPORT
  195. #pragma import reset
  196. #endif
  197. #ifdef __cplusplus
  198. }
  199. #endif
  200. #endif /* __TOOLUTILS__ */