home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / textprocess / armatures / common2 / files / !tex / texsource / commontex / h / tex < prev    next >
Encoding:
Text File  |  1988-04-25  |  5.7 KB  |  204 lines

  1. #define MINIMEM 29000
  2.  
  3. /* doesn't quite fit at 31000 */
  4.  
  5. /* Modified from original to fit into Acorn 310 */
  6. /*
  7.  *    Copyright 1986, 1987 Pat Joseph Monardo. All rights reserved.
  8.  *    Copying of this file is granted according to the provisions 
  9.  *    specified in the file COPYING which must accompany this file.
  10.  */
  11.  
  12.  
  13. /*
  14.  *              tex.h
  15.  */
  16.  
  17. #include        <stdio.h>
  18. #include        <signal.h>
  19. #include        <time.h>
  20.  
  21. /*
  22.  * constants in the outer block
  23.  */
  24.  
  25. #define NUL                                     '\0'
  26. #define EOLN                            '\n'
  27. #define FALSE                           0
  28. #define TRUE                            1
  29. #define EMPTY                           0
  30.  
  31. #define BUF_SIZE                        5000
  32. #define DVI_BUF_SIZE            1024
  33. #define ERROR_LINE                      78
  34. #define FILE_NAME_SIZE          104
  35. #define FONT_BASE                       0
  36. #define FONT_MAX                        100
  37. #define FONT_MEM_SIZE           25000
  38. #define HALF_BUF                        512
  39. #define HALF_ERROR_LINE         39
  40. #define HASH_SIZE                       3000
  41. #define HASH_PRIME                      2551
  42. #define HYPH_SIZE                       307
  43. #define MAX_IN_OPEN                     15
  44. #define MAX_PRINT_LINE          78
  45. #define MAX_STRINGS                     5400
  46. #define NEST_SIZE                       40
  47. #define PARAM_SIZE                      30
  48. #define POOL_SIZE                       25000
  49. #define SAVE_SIZE                       600
  50. #define STACK_SIZE                      200
  51. #define STRING_VACANCIES        1000
  52. #define TRIE_OP_HASH_SIZE       512
  53. #define TRIE_SIZE                       8000
  54.  
  55. #ifdef INIT
  56.  
  57. #ifdef BIG
  58. #define MEM_BOT                         0
  59. #define MEM_TOP                         27000
  60. #define TOK_BOT                         0
  61. #define TOK_TOP                MINIMEM       /*  37000 */
  62. #define MEM_MIN                         MEM_BOT
  63. #define MEM_MAX                         MEM_TOP
  64. #define TOK_MIN                         TOK_BOT
  65. #define TOK_MAX                         TOK_TOP
  66. #define MIN_QUARTERWORD         0
  67. #define MAX_QUARTERWORD         255
  68. #define MIN_HALFWORD            0
  69. #define MAX_HALFWORD            65535 /* 655350 */
  70. /* Surely the half-word must ALWAYS be 65535!  - else a mem_word will be
  71.    two words! */
  72. #endif
  73.  
  74. #ifdef BIGG
  75. #define MEM_BOT                         0
  76. #define MEM_TOP                         37000
  77. #define TOK_BOT                         0
  78. #define TOK_TOP                         47000
  79. #define MEM_MIN                         MEM_BOT
  80. #define MEM_MAX                         MEM_TOP
  81. #define TOK_MIN                         TOK_BOT
  82. #define TOK_MAX                         TOK_TOP
  83. #define MIN_QUARTERWORD         0
  84. #define MAX_QUARTERWORD         255
  85. #define MIN_HALFWORD            0
  86. #define MAX_HALFWORD            65535 /* 6553500 */
  87. #endif
  88.  
  89. #else 
  90.  
  91. #ifdef BIG
  92. #define MEM_BOT                         0
  93. #define MEM_TOP                         27000
  94. #define TOK_BOT                         0
  95. #define TOK_TOP                 MINIMEM  /* 37000 */
  96. #define MEM_MIN                         0
  97. #define MEM_MAX                 MEM_TOP /* 128000 */
  98. #define TOK_MIN                         0
  99. #define TOK_MAX                 TOK_TOP /* 45000 */
  100. #define MIN_QUARTERWORD         0
  101. #define MAX_QUARTERWORD         255
  102. #define MIN_HALFWORD            0
  103. #define MAX_HALFWORD            65535 /* 655350 */
  104. #endif
  105.  
  106. #ifdef BIGG
  107. #define MEM_BOT                         0
  108. #define MEM_TOP                         37000
  109. #define TOK_BOT                         0
  110. #define TOK_TOP                         47000
  111. #define MEM_MIN                         0
  112. #define MEM_MAX                         256000
  113. #define TOK_MIN                         0
  114. #define TOK_MAX                         65000
  115. #define MIN_QUARTERWORD         0
  116. #define MAX_QUARTERWORD         255
  117. #define MIN_HALFWORD            0
  118. #define MAX_HALFWORD            65535 /* 6553500 */
  119. #endif
  120.  
  121. #endif
  122.  
  123. /*
  124.  *      types in the outer block
  125.  */
  126.  
  127. #define global          extern
  128.  
  129. #define ascii           unsigned char
  130. #define bool            int
  131. #define byte            unsigned char
  132. #define fnt                     int
  133. #define gord            unsigned char
  134. #define gratio          float
  135. #define group           int
  136. #define ptr                     hword
  137. #define sc                      i
  138. #define scal            long 
  139. #define str                     hword
  140. #define val                     long
  141.  
  142. typedef FILE    *word_file;
  143. typedef FILE    *alpha_file;                    
  144. typedef FILE    *byte_file;
  145.  
  146. #define qword                   unsigned char
  147.  
  148. #define hword   unsigned short  /* unsigned long */
  149.  
  150. typedef union { 
  151.         struct { 
  152.                 hword   rh; 
  153.                 hword   lh; 
  154.         } hh1; 
  155.         struct { 
  156.                 hword   rh; 
  157.                 qword   b0; 
  158.                 qword   b1; 
  159.         } hh2; 
  160. } twoh;
  161.  
  162. typedef struct { 
  163.         qword   b0;
  164.         qword   b1;
  165.         qword   b2;
  166.         qword   b3;
  167. } fourq;
  168.  
  169. typedef union { 
  170.         long    i;   
  171.         gratio  gr;  
  172.         twoh    hh;  
  173.         fourq   qqqq;
  174. } mword;
  175.  
  176. /*
  177.  *      variables in the outer block
  178.  */
  179.  
  180. global  char            banner[];
  181. global  int                     ready_already;
  182.  
  183. /*
  184.  *      functions in the outer block
  185.  */
  186.  
  187. int             final_cleanup();
  188. int             close_files_and_terminate();
  189. int             initialize();
  190. bool    decode_args();
  191. int             handle_int();
  192.  
  193. /*
  194.  * some common programming idioms
  195.  */
  196.  
  197. #define incr(i)                         ++(i)
  198. #define decr(i)                         --(i)
  199. #define odd(i)                          ((i) & 1)
  200. #define abs(i)                          ((i) >= 0 ? (i) : -(i))
  201. #define round(x)                        (long) ((x) > 0.0 ? ((x) + 0.5) : ((x) - 0.5))
  202. #define negate(x)                       (x) = -(x)
  203. #define loop                            while (1)
  204.