Source code of Windows XP (NT5)
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.

247 lines
6.4 KiB

  1. /* file: cvt__private.h */
  2. /*
  3. **
  4. ** COPYRIGHT (c) 1989, 1990 BY
  5. ** DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.
  6. ** ALL RIGHTS RESERVED.
  7. **
  8. ** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
  9. ** ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE
  10. ** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
  11. ** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
  12. ** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
  13. ** TRANSFERRED.
  14. **
  15. ** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
  16. ** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
  17. ** CORPORATION.
  18. **
  19. ** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
  20. ** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
  21. **
  22. */
  23. /*
  24. **++
  25. ** Facility:
  26. **
  27. ** CVT Run-Time Library
  28. **
  29. ** Abstract:
  30. **
  31. ** This module contains the private include file for the cvt_* routines.
  32. **
  33. ** Authors:
  34. **
  35. ** Math RTL
  36. **
  37. ** Creation Date: December 5, 1989.
  38. **
  39. ** Modification History:
  40. **
  41. ** 1-001 Original created. MRTL 5-Dec-1989.
  42. ** 1-002 Add GEM FORTRAN stuff. TS 27-Mar-1990.
  43. **
  44. **--
  45. */
  46. #ifndef CVT__PRIVATE
  47. #define CVT__PRIVATE
  48. #define F77_BINDING
  49. #ifndef VMS
  50. #define VMS_BINDING
  51. #endif
  52. #include "descrip.h"
  53. #define C_TAB '\t'
  54. #define C_BLANK ' '
  55. #define C_PLUS '+'
  56. #define C_MINUS '-'
  57. #define C_ASTERISK '*'
  58. #define C_UNDERSCORE '_'
  59. #define C_DECIMAL_POINT '.'
  60. #define C_DOT '.'
  61. #define C_ZERO '0'
  62. #define C_ONE '1'
  63. #define C_TWO '2'
  64. #define C_THREE '3'
  65. #define C_FOUR '4'
  66. #define C_FIVE '5'
  67. #define C_SIX '6'
  68. #define C_SEVEN '7'
  69. #define C_EIGHT '8'
  70. #define C_NINE '9'
  71. #define C_A 'A'
  72. #define C_B 'B'
  73. #define C_C 'C'
  74. #define C_D 'D'
  75. #define C_E 'E'
  76. #define C_F 'F'
  77. #define C_L 'L'
  78. #define C_R 'R'
  79. #define C_S 'S'
  80. #define C_T 'T'
  81. #define C_U 'U'
  82. #define C_W 'W'
  83. #define C_a 'a'
  84. #define C_b 'b'
  85. #define C_c 'c'
  86. #define C_d 'd'
  87. #define C_e 'e'
  88. #define C_f 'f'
  89. #define C_t 't'
  90. #define RAISE(i) \
  91. { \
  92. RpcRaiseException(i); \
  93. }
  94. /*
  95. UNPACKED REAL:
  96. [0]: excess 2147483648 (2 ^ 31) binary exponent
  97. [1]: mantissa: msb ------>
  98. [2]: -------------------->
  99. [3]: -------------------->
  100. [4]: ----------------> lsb
  101. [5]: 28 unused bits, invalid bit, infinity bit, zero bit, negative bit
  102. All fraction bits are explicit and are normalized s.t. 0.5 <= fraction < 1.0
  103. */
  104. typedef struct dsc_descriptor_s DESC_S;
  105. typedef unsigned long UNPACKED_REAL[6];
  106. typedef UNPACKED_REAL *UNPACKED_REAL_PTR;
  107. #define U_R_EXP 0
  108. #define U_R_FLAGS 5
  109. #define U_R_NEGATIVE 1
  110. #define U_R_ZERO 2
  111. #define U_R_INFINITY 4
  112. #define U_R_INVALID 8
  113. #define U_R_UNUSUAL (U_R_ZERO | U_R_INFINITY | U_R_INVALID)
  114. #define U_R_BIAS 2147483648L
  115. extern unsigned long vax_c[];
  116. #define VAX_F_INVALID &vax_c[0]
  117. #define VAX_D_INVALID &vax_c[0]
  118. #define VAX_G_INVALID &vax_c[0]
  119. #define VAX_H_INVALID &vax_c[0]
  120. #define VAX_F_ZERO &vax_c[4]
  121. #define VAX_D_ZERO &vax_c[4]
  122. #define VAX_G_ZERO &vax_c[4]
  123. #define VAX_H_ZERO &vax_c[4]
  124. #define VAX_F_POS_HUGE &vax_c[8]
  125. #define VAX_D_POS_HUGE &vax_c[8]
  126. #define VAX_G_POS_HUGE &vax_c[8]
  127. #define VAX_H_POS_HUGE &vax_c[8]
  128. #define VAX_F_NEG_HUGE &vax_c[12]
  129. #define VAX_D_NEG_HUGE &vax_c[12]
  130. #define VAX_G_NEG_HUGE &vax_c[12]
  131. #define VAX_H_NEG_HUGE &vax_c[12]
  132. extern unsigned long ieee_s[];
  133. #define IEEE_S_INVALID ((options & CVT_C_BIG_ENDIAN) ? \
  134. &ieee_s[1] : &ieee_s[0])
  135. #define IEEE_S_POS_ZERO ((options & CVT_C_BIG_ENDIAN) ? \
  136. &ieee_s[3] : &ieee_s[2])
  137. #define IEEE_S_NEG_ZERO ((options & CVT_C_BIG_ENDIAN) ? \
  138. &ieee_s[5] : &ieee_s[4])
  139. #define IEEE_S_POS_HUGE ((options & CVT_C_BIG_ENDIAN) ? \
  140. &ieee_s[7] : &ieee_s[6])
  141. #define IEEE_S_NEG_HUGE ((options & CVT_C_BIG_ENDIAN) ? \
  142. &ieee_s[9] : &ieee_s[8])
  143. #define IEEE_S_POS_INFINITY ((options & CVT_C_BIG_ENDIAN) ? \
  144. &ieee_s[11] : &ieee_s[10])
  145. #define IEEE_S_NEG_INFINITY ((options & CVT_C_BIG_ENDIAN) ? \
  146. &ieee_s[13] : &ieee_s[12])
  147. extern unsigned long ieee_t[];
  148. #define IEEE_T_INVALID ((options & CVT_C_BIG_ENDIAN) ? \
  149. &ieee_t[2] : &ieee_t[0])
  150. #define IEEE_T_POS_ZERO ((options & CVT_C_BIG_ENDIAN) ? \
  151. &ieee_t[6] : &ieee_t[4])
  152. #define IEEE_T_NEG_ZERO ((options & CVT_C_BIG_ENDIAN) ? \
  153. &ieee_t[10] : &ieee_t[8])
  154. #define IEEE_T_POS_HUGE ((options & CVT_C_BIG_ENDIAN) ? \
  155. &ieee_t[14] : &ieee_t[12])
  156. #define IEEE_T_NEG_HUGE ((options & CVT_C_BIG_ENDIAN) ? \
  157. &ieee_t[18] : &ieee_t[16])
  158. #define IEEE_T_POS_INFINITY ((options & CVT_C_BIG_ENDIAN) ? \
  159. &ieee_t[22] : &ieee_t[20])
  160. #define IEEE_T_NEG_INFINITY ((options & CVT_C_BIG_ENDIAN) ? \
  161. &ieee_t[26] : &ieee_t[24])
  162. extern unsigned long ibm_s[];
  163. #define IBM_S_INVALID &ibm_s[0]
  164. #define IBM_S_POS_ZERO &ibm_s[1]
  165. #define IBM_S_NEG_ZERO &ibm_s[2]
  166. #define IBM_S_POS_HUGE &ibm_s[3]
  167. #define IBM_S_NEG_HUGE &ibm_s[4]
  168. #define IBM_S_POS_INFINITY &ibm_s[5]
  169. #define IBM_S_NEG_INFINITY &ibm_s[6]
  170. extern unsigned long ibm_l[];
  171. #define IBM_L_INVALID &ibm_l[0]
  172. #define IBM_L_POS_ZERO &ibm_l[2]
  173. #define IBM_L_NEG_ZERO &ibm_l[4]
  174. #define IBM_L_POS_HUGE &ibm_l[6]
  175. #define IBM_L_NEG_HUGE &ibm_l[8]
  176. #define IBM_L_POS_INFINITY &ibm_l[10]
  177. #define IBM_L_NEG_INFINITY &ibm_l[12]
  178. extern unsigned long cray[];
  179. #define CRAY_INVALID &cray[0]
  180. #define CRAY_POS_ZERO &cray[2]
  181. #define CRAY_NEG_ZERO &cray[4]
  182. #define CRAY_POS_HUGE &cray[6]
  183. #define CRAY_NEG_HUGE &cray[8]
  184. #define CRAY_POS_INFINITY &cray[10]
  185. #define CRAY_NEG_INFINITY &cray[12]
  186. extern unsigned long int_c[];
  187. #define INT_INVALID ((options & CVT_C_BIG_ENDIAN) ? \
  188. &int_c[1] : &int_c[0])
  189. #define INT_ZERO ((options & CVT_C_BIG_ENDIAN) ? \
  190. &int_c[3] : &int_c[2])
  191. #define INT_POS_HUGE ((options & CVT_C_BIG_ENDIAN) ? \
  192. &int_c[5] : &int_c[4])
  193. #define INT_NEG_HUGE ((options & CVT_C_BIG_ENDIAN) ? \
  194. &int_c[7] : &int_c[6])
  195. #define INT_POS_INFINITY ((options & CVT_C_BIG_ENDIAN) ? \
  196. &int_c[9] : &int_c[8])
  197. #define INT_NEG_INFINITY ((options & CVT_C_BIG_ENDIAN) ? \
  198. &int_c[11] : &int_c[10])
  199. #endif