Mac OS 9
ToolUtils.h
Go to the documentation of this file.
1 
19 #ifndef __TOOLUTILS__
20 #define __TOOLUTILS__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __FIXMATH__
27 #include <FixMath.h>
28 #endif
29 
30 #ifndef __TEXTUTILS__
31 #include <TextUtils.h>
32 #endif
33 
34 #ifndef __ICONS__
35 #include <Icons.h>
36 #endif
37 
38 #ifndef __QUICKDRAW__
39 #include <Quickdraw.h>
40 #endif
41 
42 #if PRAGMA_ONCE
43 #pragma once
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
51 #if PRAGMA_IMPORT
52 #pragma import on
53 #endif
54 
55 #if PRAGMA_STRUCT_ALIGN
56 #pragma options align = mac68k
57 #elif PRAGMA_STRUCT_PACKPUSH
58 #pragma pack(push, 2)
59 #elif PRAGMA_STRUCT_PACK
60 #pragma pack(2)
61 #endif
62 
109  Boolean
110  BitTst(const void *bytePtr, long bitNum);
111 
120  void
121  BitSet(void *bytePtr, long bitNum);
122 
141  void
142  BitClr(void *bytePtr, long bitNum);
143 
163  x = op1 & op2; /* . . . and this is MUCH faster */
164  </ pre>
165  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
166  * \non_carbon_cfm in InterfaceLib 7.1 and
167  later
168  * \carbon_lib in CarbonLib 1.0 and
169  later
170  * \mac_os_x in version 10.0 and
171  later
172  * /
173  long
174  BitAnd(long value1, long value2);
175 
193  x = op1 | op2; /* . . . and this is MUCH faster */
194  </ pre>
195  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
196  * \non_carbon_cfm in InterfaceLib 7.1 and
197  later
198  * \carbon_lib in CarbonLib 1.0 and
199  later
200  * \mac_os_x in version 10.0 and
201  later
202  * /
203  long
204  BitOr(long value1, long value2);
205 
224  x = op1 ^ op2; /* . . . and this is MUCH faster */
225  </ pre>
226  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
227  * \non_carbon_cfm in InterfaceLib 7.1 and
228  later
229  * \carbon_lib in CarbonLib 1.0 and
230  later
231  * \mac_os_x in version 10.0 and
232  later
233  * /
234  long
235  BitXor(long value1, long value2);
236 
251  x = ~operand; /* . . . and this is MUCH faster */
252  </ pre>
253  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
254  * \non_carbon_cfm in InterfaceLib 7.1 and
255  later
256  * \carbon_lib in CarbonLib 1.0 and
257  later
258  * \mac_os_x in version 10.0 and
259  later
260  * /
261  long
262  BitNot(long value);
263 
289  x = operand << count; /* if count is positive or . . . */
290  x = operand >> (-count); /* if count is negative */
291  </ pre>
292  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
293  * \non_carbon_cfm in InterfaceLib 7.1 and
294  later
295  * \carbon_lib in CarbonLib 1.0 and
296  later
297  * \mac_os_x in version 10.0 and
298  later
299  * /
300  long
301  BitShift(long value, short count);
302 
303 #if TARGET_CPU_68K
304  struct Int64Bit
305  {
306  SInt32 hiLong;
307  UInt32 loLong;
308  };
309  typedef struct Int64Bit Int64Bit;
310 #if CALL_NOT_IN_CARBON
311 
334  void
335  LongMul(long a, long b, Int64Bit *result);
336 
337 #else
338 #define LongMul(a, b, result) ((void)WideMultiply((a), (b), (wide *)(result)))
339 #endif /* CALL_NOT_IN_CARBON */
340 
341 #endif /* TARGET_CPU_68K */
342 
343 #define HiWord(x) ((short)((long)(x) >> 16))
344 #define LoWord(x) ((short)(x))
345 
346 #if PRAGMA_STRUCT_ALIGN
347 #pragma options align = reset
348 #elif PRAGMA_STRUCT_PACKPUSH
349 #pragma pack(pop)
350 #elif PRAGMA_STRUCT_PACK
351 #pragma pack()
352 #endif
353 
354 #ifdef PRAGMA_IMPORT_OFF
355 #pragma import off
356 #elif PRAGMA_IMPORT
357 #pragma import reset
358 #endif
359 
360 #ifdef __cplusplus
361 }
362 #endif
363 
364 #endif /* __TOOLUTILS__ */
365 * /*/*/ * /*/*/ * /*/*/
Fixed Math Interfaces.
Icon Utilities and Icon Services Interfaces.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Interface to Quickdraw Graphics.
Text Utilities Interfaces.
Boolean BitTst(const void *bytePtr, long bitNum)
void BitSet(void *bytePtr, long bitNum)
Set a specified bit in a bit string to a 1.
x
Definition: ToolUtils.h:163
void BitClr(void *bytePtr, long bitNum)