home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex29 / StTeXsrc.zoo / src / BIGGG_tex.h < prev    next >
C/C++ Source or Header  |  1988-06-04  |  6KB  |  307 lines

  1. /*
  2. This is tex.h in the CommonTeX source. It shows the size of the
  3. buffers uses. The 'bigvirtex' version was built using the 'BIGGGG' #ifdefed
  4. sizes below. These may be bigger than needed.
  5.  
  6. Call bigvirtex with:
  7.  
  8.     bigvirtex '&bigplain' yourfile.texinfo
  9.  
  10. */
  11.  
  12. /*
  13.  *    Copyright 1986, 1987 Pat Joseph Monardo. All rights reserved.
  14.  *    Copying of this file is granted according to the provisions 
  15.  *    specified in the file COPYING which must accompany this file.
  16.  */
  17.  
  18.  
  19. /*
  20.  *        tex.h
  21.  */
  22.  
  23. #include    <stdio.h>
  24. #include    <signal.h>
  25. #include    <sys/time.h>
  26.  
  27. /*
  28.  * constants in the outer block
  29.  */
  30.  
  31. #define    NUL                    '\0'
  32. #define    EOLN                '\n'
  33. #define    FALSE                0
  34. #define    TRUE                1
  35. #define    EMPTY                0
  36.  
  37. #define    BUF_SIZE            5000
  38. #define    DVI_BUF_SIZE        1024
  39. #define    ERROR_LINE            78
  40. #define    FILE_NAME_SIZE        104
  41. #define    FONT_BASE            0
  42. #define    FONT_MAX            250    /* was 100 */
  43. #define    FONT_MEM_SIZE        65000        /* was 25000 */
  44. #define    HALF_BUF            512
  45. #define    HALF_ERROR_LINE        39
  46. #define    HASH_SIZE            5000    /* was 3000 */
  47. #define    HASH_PRIME            2551
  48. #define    HYPH_SIZE            307
  49. #define    MAX_IN_OPEN            15
  50. #define    MAX_PRINT_LINE        78
  51. #define    MAX_STRINGS            5400
  52. #define    NEST_SIZE            400    /* was 40 */
  53. #define    PARAM_SIZE            300    /* was 30 */
  54. #define    POOL_SIZE            75000    /* was 25000 */
  55. #define    SAVE_SIZE            2400    /* was 600 */
  56. #define    STACK_SIZE            800    /* was 200 */
  57. #define    STRING_VACANCIES    1000
  58. #define    TRIE_OP_HASH_SIZE    512
  59. #define    TRIE_SIZE            8000
  60.  
  61. #if !defined(BIGG) && !defined(BIG) && !defined(BIGGG) && !defined(BIGGGG)
  62. #define NORMAL_BIG 1
  63. #endif
  64.  
  65. #ifdef INIT
  66. #if NORMAL_BIG
  67. #define    MEM_BOT                0
  68. #define    MEM_TOP                 17000
  69. #define    TOK_BOT                0
  70. #define    TOK_TOP                27000
  71. #define    MEM_MIN                MEM_BOT
  72. #define    MEM_MAX             MEM_TOP
  73. #define    TOK_MIN                TOK_BOT
  74. #define    TOK_MAX                TOK_TOP
  75. #define    MIN_QUARTERWORD        0
  76. #define    MAX_QUARTERWORD        255
  77. #define    MIN_HALFWORD        0
  78. #define    MAX_HALFWORD        65535
  79. #endif
  80.  
  81. #ifdef BIG
  82. #define    MEM_BOT                0
  83. #define    MEM_TOP                 27000
  84. #define    TOK_BOT                0
  85. #define    TOK_TOP                37000
  86. #define    MEM_MIN                MEM_BOT
  87. #define    MEM_MAX             MEM_TOP
  88. #define    TOK_MIN                TOK_BOT
  89. #define    TOK_MAX                TOK_TOP
  90. #define    MIN_QUARTERWORD        0
  91. #define    MAX_QUARTERWORD        255
  92. #define    MIN_HALFWORD        0
  93. #define    MAX_HALFWORD        655350
  94. #endif
  95.  
  96. #ifdef BIGG
  97. #define    MEM_BOT                0
  98. #define    MEM_TOP                 37000
  99. #define    TOK_BOT                0
  100. #define    TOK_TOP                47000
  101. #define    MEM_MIN                MEM_BOT
  102. #define    MEM_MAX             MEM_TOP
  103. #define    TOK_MIN                TOK_BOT
  104. #define    TOK_MAX                TOK_TOP
  105. #define    MIN_QUARTERWORD        0
  106. #define    MAX_QUARTERWORD        255
  107. #define    MIN_HALFWORD        0
  108. #define    MAX_HALFWORD        6553500
  109. #endif
  110.  
  111.  
  112. #ifdef BIGGG
  113. #define    MEM_BOT                0
  114. #define    MEM_TOP                 87000
  115. #define    TOK_BOT                0
  116. #define    TOK_TOP                47000
  117. #define    MEM_MIN                MEM_BOT
  118. #define    MEM_MAX             MEM_TOP
  119. #define    TOK_MIN                TOK_BOT
  120. #define    TOK_MAX                TOK_TOP
  121. #define    MIN_QUARTERWORD        0
  122. #define    MAX_QUARTERWORD        255
  123. #define    MIN_HALFWORD        0
  124. #define    MAX_HALFWORD        6553500
  125. #endif
  126.  
  127. #ifdef BIGGGG
  128. #define    MEM_BOT                0
  129. #define    MEM_TOP                 87000
  130. #define    TOK_BOT                0
  131. #define    TOK_TOP                47000
  132. #define    MEM_MIN                MEM_BOT
  133. #define    MEM_MAX             MEM_TOP
  134. #define    TOK_MIN                TOK_BOT
  135. #define    TOK_MAX                TOK_TOP
  136. #define    MIN_QUARTERWORD        0
  137. #define    MAX_QUARTERWORD        255
  138. #define    MIN_HALFWORD        0
  139. #define    MAX_HALFWORD        6553500
  140. #endif
  141.  
  142. #else 
  143.  
  144. #if NORMAL_BIG
  145. #define    MEM_BOT                0
  146. #define    MEM_TOP                 17000
  147. #define    TOK_BOT                0
  148. #define    TOK_TOP                27000
  149. #define    MEM_MIN                0
  150. #define    MEM_MAX             32000
  151. #define    TOK_MIN                0
  152. #define    TOK_MAX                35000
  153. #define    MIN_QUARTERWORD        0
  154. #define    MAX_QUARTERWORD        255
  155. #define    MIN_HALFWORD        0
  156. #define    MAX_HALFWORD        65535
  157. #endif
  158.  
  159. #ifdef BIG
  160. #define    MEM_BOT                0
  161. #define    MEM_TOP                 27000
  162. #define    TOK_BOT                0
  163. #define    TOK_TOP                37000
  164. #define    MEM_MIN                0
  165. #define    MEM_MAX             64000
  166. #define    TOK_MIN                0
  167. #define    TOK_MAX                45000
  168. #define    MIN_QUARTERWORD        0
  169. #define    MAX_QUARTERWORD        255
  170. #define    MIN_HALFWORD        0
  171. #define    MAX_HALFWORD        655350
  172. #endif
  173.  
  174. #ifdef BIGG
  175. #define    MEM_BOT                0
  176. #define    MEM_TOP                 37000
  177. #define    TOK_BOT                0
  178. #define    TOK_TOP                47000
  179. #define    MEM_MIN                0
  180. #define    MEM_MAX             128000
  181. #define    TOK_MIN                0
  182. #define    TOK_MAX                65000
  183. #define    MIN_QUARTERWORD        0
  184. #define    MAX_QUARTERWORD        255
  185. #define    MIN_HALFWORD        0
  186. #define    MAX_HALFWORD        6553500
  187. #endif
  188.  
  189. #ifdef BIGGG
  190. #define    MEM_BOT                0
  191. #define    MEM_TOP                 87000
  192. #define    TOK_BOT                0
  193. #define    TOK_TOP                47000
  194. #define    MEM_MIN                0
  195. #define    MEM_MAX             178000
  196. #define    TOK_MIN                0
  197. #define    TOK_MAX                65000
  198. #define    MIN_QUARTERWORD        0
  199. #define    MAX_QUARTERWORD        255
  200. #define    MIN_HALFWORD        0
  201. #define    MAX_HALFWORD        6553500
  202. #endif
  203.  
  204. #ifdef BIGGGG
  205. #define    MEM_BOT                0
  206. #define    MEM_TOP                 87000
  207. #define    TOK_BOT                0
  208. #define    TOK_TOP                47000
  209. #define    MEM_MIN                0
  210. #define    MEM_MAX             250000
  211. #define    TOK_MIN                0
  212. #define    TOK_MAX                65000
  213. #define    MIN_QUARTERWORD        0
  214. #define    MAX_QUARTERWORD        255
  215. #define    MIN_HALFWORD        0
  216. #define    MAX_HALFWORD        6553500
  217. #endif
  218.  
  219. #endif
  220.  
  221. /*
  222.  *    types in the outer block
  223.  */
  224.  
  225. #define    global        extern
  226.  
  227. #define    ascii        unsigned char
  228. #define    bool        int
  229. #define    byte        unsigned char
  230. #define    fnt            int
  231. #define    gord        unsigned char
  232. #define    gratio        float
  233. #define    group        int
  234. #define    ptr            hword
  235. #define    sc            i
  236. #define    scal        long 
  237. #define    str            hword
  238. #define    val            long
  239.  
  240. typedef    FILE    *word_file;
  241. typedef    FILE     *alpha_file;            
  242. typedef    FILE    *byte_file;
  243.  
  244. #define    qword            unsigned char
  245.  
  246. #if NORMAL_BIG
  247. #define    hword    unsigned short
  248. #else
  249. #define    hword    unsigned long
  250. #endif
  251.  
  252. typedef union { 
  253.     struct { 
  254.         hword    rh; 
  255.         hword    lh; 
  256.     } hh1; 
  257.     struct { 
  258.         hword    rh; 
  259.         qword    b0; 
  260.         qword    b1; 
  261.     } hh2; 
  262. } twoh;
  263.  
  264. typedef struct { 
  265.     qword    b0;
  266.     qword    b1;
  267.     qword    b2;
  268.     qword    b3;
  269. } fourq;
  270.  
  271. typedef union { 
  272.     long    i;   
  273.     gratio    gr;  
  274.     twoh    hh;  
  275.     fourq    qqqq;
  276. } mword;
  277.  
  278. /*
  279.  *    variables in the outer block
  280.  */
  281.  
  282. global    char        banner[];
  283. global    int            ready_already;
  284.  
  285. /*
  286.  *    functions in the outer block
  287.  */
  288.  
  289. int        final_cleanup();
  290. int        close_files_and_terminate();
  291. int        initialize();
  292. bool    decode_args();
  293. int        handle_int();
  294.  
  295. /*
  296.  * some common programming idioms
  297.  */
  298.  
  299. #define    incr(i)                ++(i)
  300. #define    decr(i)                 --(i)
  301. #define    odd(i)                ((i) & 1)
  302. #define    abs(i)                ((i) >= 0 ? (i) : -(i))
  303. #define    round(x)            (long) ((x) > 0.0 ? ((x) + 0.5) : ((x) - 0.5))
  304. #define    negate(x)            (x) = -(x)
  305. #define    loop                while (1)
  306.  
  307.