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.

181 lines
10 KiB

  1. #include "hwr_sys.h"
  2. #include "const.h"
  3. #include "def.h"
  4. /************************** Global variables **************************/
  5. ROM_DATA _SHORT sqrtab[LENTH_S] = {0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,
  6. 4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,
  7. 6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
  8. 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
  9. 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
  10. 11,11,11,11,11,11,11 } ;
  11. ROM_DATA _ULONG bit[32] = { 0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,
  12. 0x400,0x800,0x1000,0x2000,0x4000,0x8000,0x10000L,
  13. 0x20000L,0x40000L,0x80000L,0x100000L,0x200000L,0x400000L,
  14. 0x800000L,0x1000000L,0x2000000L,0x4000000L,0x8000000L,
  15. 0x10000000L,0x20000000L,0x40000000L,0x80000000L };
  16. ROM_DATA _SHORT quad[LENTH_Q]={
  17. 0, 1, 4, 9, 16, 25, 36, 49,
  18. 64, 81, 100, 121, 144, 169, 196, 225,
  19. 256, 289, 324, 361, 400, 441, 484, 529,
  20. 576, 625, 676, 729, 784, 841, 900, 961,
  21. 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521,
  22. 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209,
  23. 2304, 2401, 2500, 2601, 2704, 2809, 2916, 3025,
  24. 3136, 3249, 3364, 3481, 3600, 3721, 3844, 3969
  25. } ;
  26. ROM_DATA _SHORT eps0[LENTH_E]={
  27. 0, 0, 0, 0, 0, 0, 0, 0,
  28. 0, 1, 3, 5, 8, 11, 15, 20,
  29. 25, 30, 36, 42, 48, 55, 62, 69,
  30. 77, 85, 92, 101, 109, 117, 126, 135,
  31. 135, 135, 135, 135, 135, 135, 135, 135,
  32. 135, 135, 135, 135, 135, 135, 135, 135,
  33. 135, 135, 135, 135, 135, 135, 135, 135,
  34. 135, 135, 135, 135, 135, 135, 135, 135
  35. } ;
  36. ROM_DATA _SHORT eps1[LENTH_E]={
  37. 0, 0, 0, 0, 0, 0, 9, 30,
  38. 54, 78, 100, 118, 134, 146, 157, 165,
  39. 172, 177, 181, 184, 187, 189, 190, 192,
  40. 193, 193, 194, 194, 195, 195, 195, 195,
  41. 195, 195, 195, 195, 195, 195, 195, 195,
  42. 195, 195, 195, 195, 195, 195, 195, 195,
  43. 195, 195, 195, 195, 195, 195, 195, 195,
  44. 195, 195, 195, 195, 195, 195, 195, 195
  45. } ;
  46. ROM_DATA _SHORT eps2[LENTH_E] = {
  47. 0, 1, 9, 26, 44, 59, 71, 80,
  48. 87, 92, 95, 98, 98, 98, 98, 98,
  49. 98, 98, 98, 98, 98, 98, 98, 98,
  50. 98, 98, 98, 98, 98, 98, 98, 98,
  51. 98, 98, 98, 98, 98, 98, 98, 98,
  52. 98, 98, 98, 98, 98, 98, 98, 98,
  53. 98, 98, 98, 98, 98, 98, 98, 98,
  54. 98, 98, 98, 98, 98, 98, 98, 98
  55. } ;
  56. ROM_DATA _SHORT eps3[LENTH_E]={
  57. 9, 27, 46, 61, 74, 84, 91, 96,
  58. 96, 96, 96, 96, 96, 96, 96, 96,
  59. 96, 96, 96, 96, 96, 96, 96, 96,
  60. 96, 96, 96, 96, 96, 96, 96, 96,
  61. 96, 96, 96, 96, 96, 96, 96, 96,
  62. 96, 96, 96, 96, 96, 96, 96, 96,
  63. 96, 96, 96, 96, 96, 96, 96, 96,
  64. 96, 96, 96, 96, 96, 96, 96, 96
  65. } ;
  66. #if HWR_SYSTEM==HWR_DOS /* || HWR_SYSTEM==HWR_WINDOWS */
  67. SPECL speclGlobal[SPECVAL]={0} ; /* Event describing structures array */
  68. #endif
  69. ROM_DATA _SHORT nbcut0 = 10 ; /* Utmost radius of intersection */
  70. /* search */
  71. ROM_DATA _SHORT nbcut1 = 95 ; /* A square of utmost radius of */
  72. /* intersection search */
  73. ROM_DATA _SHORT nbcut2 = 2 ;
  74. /******************* Low level constants *****************************/
  75. ROM_DATA CONSTS const1 =
  76. {
  77. (_SHORT)HORDA , /* Normalization chord */
  78. (_SHORT)DLT0 , /* */
  79. (_SHORT)NSR , /* */
  80. (_SHORT)J_STEP , /* Initial steps of search for */
  81. (_SHORT)I_STEP , /* intersectons */
  82. (_SHORT)EPS_Y , /* Vicinity of pointing out extremums*/
  83. (_SHORT)EPS_X, /* and preliminary search for */
  84. /* shelves */
  85. (_SHORT)EPS_PY , /* Maximum horizontal and vertical */
  86. (_SHORT)EPS_PX , /* size of "points" . */
  87. (_SHORT)EPS_ST , /* Maximum length of a stroke. */
  88. /* (_SHORT)EPSA_ST , */ /* Maximum slope of a stroke. */
  89. /* (_SHORT)EPSR_ST , */ /* Stroke maximum integral curvature */
  90. /* (_SHORT)EPSX_SH , */ /* Minimum horizontal shelves */
  91. /* */ /* size . */
  92. /* (_SHORT)EPSY_SH , */ /* Half maximum vertical shelf */
  93. /* */ /* size */
  94. /* (_SHORT)EPSL_SH , */ /* Maximum height of shelves gluing */
  95. /* (_SHORT)EPS_SM , */ /* Vicinity of ending extremums */
  96. /* marks */
  97. (_SHORT)A0 , /* */
  98. (_SHORT)B0 , /* */
  99. (_SHORT)LF0 , /* */
  100. (_SHORT)LZ0 , /* */
  101. (_SHORT)A1 , /* */
  102. (_SHORT)B1 , /* */
  103. (_SHORT)LF1 , /* */
  104. (_SHORT)LZ1 , /* */
  105. (_SHORT)A2 , /* */
  106. (_SHORT)B2 , /* */
  107. (_SHORT)LF2 , /* */
  108. (_SHORT)LZ2 , /* */
  109. (_SHORT)A3 , /* */
  110. (_SHORT)B3 , /* */
  111. (_SHORT)LF3 , /* */
  112. (_SHORT)LZ3 /* */
  113. /* (_SHORT)EPS_F */
  114. } ;
  115. #if PG_DEBUG || (defined(FORMULA) && !DEMO)
  116. /****************** Interface variables ******************************/
  117. _SHORT PG_line_s = 1; /* line mumber in DBG window */
  118. _SHORT mpr; /* print mask */
  119. _CHAR *code_name[] = /* codes */
  120. {"_NO_CODE", /* are described */
  121. "_ZZ_", "_UU_", "_IU_", "_GU_", /* here */
  122. " _O_", "_GD_", "_ID_", "_UD_", /* */
  123. "_UUL_","_UUR_","_UDL_","_UDR_",/* */
  124. "_XT_", "_ANl", "_DF_ ", "_ST_",/* */
  125. "_ANr","_ZZZ_","_Z_","_FF_", /* */
  126. "_DUR_","_CUR_","_CUL_","_DUL_",/* */
  127. "_DDR_","_CDR_","_CDL_","_DDL_",/* */
  128. "_GUs_","_GDs_","_Gl_","_Gr_", /* */
  129. "_UUC_","_UDC_", /* */
  130. "_TS_", "_TZ_", "_BR_", "_BL",
  131. "_BSS", "_AN_UR", "_AN_UL",
  132. "NO NAME DEFINED",
  133. "NO NAME DEFINED",
  134. "NO NAME DEFINED",
  135. "NO NAME DEFINED",
  136. "NO NAME DEFINED",
  137. "NO NAME DEFINED",
  138. "NO NAME DEFINED",
  139. "NO NAME DEFINED",
  140. "NO NAME DEFINED"
  141. }; /* */
  142. _CHAR *dist_name[] = /* heights and directions */
  143. {" ", "US1_", "US2_", "UE1_", "UE2_", "UI1_", "UI2_",
  144. "MD_", "DI1_", "DI2_", "DE1_", "DE2_", "DS1_", "DS2_",
  145. " ", " ",
  146. "f_ ","fUS1_","fUS2_","fUE1_","fUE2_","fUI1_","fUI2_",
  147. "fMD_","fDI1_","fDI2_","fDE1_","fDE2_","fDS1_","fDS2_",
  148. " ", " ",
  149. "b_ ","bUS1_","bUS2_","bUE1_","bUE2_","bU1_","bU2_",
  150. "bMD_","bDI1_","bDI2_","bDE1_","bDE2_","bDS1_","bDS2_"
  151. }; /* */
  152. #if 0
  153. p_CHAR links_name[] = /* array of link's names */
  154. {"ARC_UNKNOWN", "ARC_LEFT", "ARC_RIGHT", "ARC_UP", "ARC_DOWN",
  155. "ARC_UP_LEFT", "ARC_DOWN_LEFT", "ARC_UP_RIGHT", "ARC_DOWN_RIGHT",
  156. "ARC_LINE_VERT", "ARC_LINE_HOR", "ARC_LINE_SLASH", "ARC_LINE_BACKSLASH",
  157. "ARC_S_LIKE", "ARC_Z_LIKE", "ARC_SHORT"
  158. };
  159. #else
  160. p_CHAR links_name[] = /* array of link's names */
  161. {"LINK_UNKNOWN",
  162. "LINK_HCR_CCW", "LINK_LCR_CCW", "LINK_MCR_CCW", "LINK_SCR_CCW", "LINK_TCR_CCW",
  163. "LINK_LINE",
  164. "LINK_TCR_CW", "LINK_SCR_CW", "LINK_MCR_CW", "LINK_LCR_CW", "LINK_HCR_CW",
  165. "LINK_HS_LIKE", "LINK_S_LIKE", "LINK_Z_LIKE", "LINK_HZ_LIKE"
  166. };
  167. #endif
  168. #endif /* PG_DEBUG... */
  169. /***************************************************************************/