home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s076 / 4.img / DEMO / FSCDEFS.H next >
Encoding:
C/C++ Source or Header  |  1992-04-30  |  3.0 KB  |  148 lines

  1. /*
  2.     File:       fscdefs.h
  3.  
  4.     Copyright:  c 1988-1990 by Apple Computer, Inc., all rights reserved.
  5.  
  6. */
  7.  
  8.  
  9. #define true 1
  10. #define false 0
  11.  
  12. #define ONEFIX      ( 1L << 16 )
  13. #define ONEFRAC     ( 1L << 30 )
  14. #define ONEHALFFIX  0x8000L
  15. #define ONEVECSHIFT 16
  16. #define HALFVECDIV  (1L << (ONEVECSHIFT-1))
  17.  
  18. typedef char int8;
  19. typedef unsigned char uint8;
  20. typedef short int16;
  21. typedef unsigned short uint16;
  22. typedef long int32;
  23. typedef unsigned long uint32;
  24.  
  25. typedef short FUnit;
  26. typedef unsigned short uFUnit;
  27.  
  28. typedef long Fixed;
  29. typedef long Fract;
  30.  
  31. #ifndef F26Dot6
  32. #define F26Dot6 long
  33. #endif
  34.  
  35. #ifndef boolean
  36. #define boolean int
  37. #endif
  38.  
  39. #ifndef CONST
  40. #define CONST const
  41. #endif
  42.  
  43. #ifndef FAR
  44. #define FAR
  45. #endif
  46.  
  47. #ifndef NEAR 
  48. #define NEAR 
  49. #endif 
  50.  
  51. #ifndef TMP_CONV
  52. #define TMP_CONV
  53. #endif 
  54.  
  55. #ifndef FS_MAC_PASCAL
  56. #define FS_MAC_PASCAL
  57. #endif 
  58.  
  59. #ifndef FS_PC_PASCAL
  60. #define FS_PC_PASCAL
  61. #endif 
  62.  
  63. #ifndef FS_MAC_TRAP
  64. #define FS_MAC_TRAP(a)
  65. #endif 
  66.  
  67. typedef struct {
  68.     Fixed       transform[3][3];
  69. } transMatrix;
  70.  
  71. typedef struct {
  72.     Fixed       x, y;
  73. } vectorType;
  74.  
  75. /* Private Data Types */
  76. typedef struct {
  77.     int16 xMin;
  78.     int16 yMin;
  79.     int16 xMax;
  80.     int16 yMax;
  81. } BBOX;
  82.  
  83. #ifndef SHORTMUL
  84. #define SHORTMUL(a,b)   (int32)((int32)(a) * (b))
  85. #endif
  86.  
  87. #ifndef SHORTDIV
  88. #define SHORTDIV(a,b)   (int32)((int32)(a) / (b))
  89. #endif
  90.  
  91. #ifdef FSCFG_BIG_ENDIAN    /* target byte order matches Motorola 68000 */
  92.  #define SWAPL(a)        (a)
  93.  #define SWAPW(a)        (a)
  94.  #define SWAPWINC(a)     (*(a)++)
  95. #else
  96.  /* Portable code to extract a short or a long from a 2- or 4-byte buffer */
  97.  /* which was encoded using Motorola 68000 (TrueType "native") byte order. */
  98.  #define FS_2BYTE(p)  ( ((unsigned short)((p)[0]) << 8) |  (p)[1])
  99.  #define FS_4BYTE(p)  ( FS_2BYTE((p)+2) | ( (FS_2BYTE(p)+0L) << 16) )
  100. #endif
  101.  
  102. #ifndef SWAPW
  103. #define SWAPW(a)        ((short) FS_2BYTE( (unsigned char FAR*)(&a) ))
  104. #endif
  105.  
  106. #ifndef SWAPL
  107. #define SWAPL(a)        ((long) FS_4BYTE( (unsigned char FAR*)(&a) ))
  108. #endif
  109.  
  110. #ifndef SWAPWINC
  111. #define SWAPWINC(a)     SWAPW(*(a)); a++    /* Do NOT parenthesize! */
  112. #endif
  113.  
  114. #ifndef LoopCount
  115. #define LoopCount int16      /* short gives us a Motorola DBF */
  116. #endif
  117.  
  118. #ifndef ArrayIndex
  119. #define ArrayIndex int32     /* avoids EXT.L on Motorola */
  120. #endif
  121.  
  122. typedef void (*voidFunc) ();
  123. typedef void FAR * voidPtr;
  124. typedef void (*ReleaseSFNTFunc) (voidPtr);
  125. typedef void FAR * (*GetSFNTFunc) (long, long, long);
  126.  
  127.  
  128. #ifndef MEMSET
  129. #define MEMSET(dst, value, size)    memset(dst, value, (size_t)(size))
  130. #define FS_NEED_STRING_DOT_H
  131. #endif
  132.  
  133. #ifndef MEMCPY
  134. #define MEMCPY(dst, src, size)      memcpy(dst, src, (size_t)(size))
  135. #ifndef FS_NEED_STRING_DOT_H
  136. #define FS_NEED_STRING_DOT_H
  137. #endif
  138. #endif
  139.  
  140. #ifdef FS_NEED_STRING_DOT_H
  141. #undef FS_NEED_STRING_DOT_H
  142. #include <string.h>
  143. #endif
  144.  
  145. #ifndef FS_UNUSED_PARAMETER
  146. #define FS_UNUSED_PARAMETER(a)        (a)    /* Silence some warnings */
  147. #endif
  148.