home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex29 / StTeXsrc.zoo / src / texorig.h < prev    next >
C/C++ Source or Header  |  1988-08-31  |  5KB  |  211 lines

  1.  
  2. /*
  3.  * @(#)tex.h 2.6 EPA
  4.  *
  5.  * Copyright 1987,1988 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  * 
  11.  */
  12.  
  13. #include    <stdio.h>
  14. #include    <signal.h>
  15. #include    <time.h>
  16. /*#include     <sys/time.h>*/
  17.  
  18. /*
  19.  * constants in the outer block
  20.  */
  21.  
  22. #define NUL                 '\0'
  23. #define EOLN                '\n'
  24. #define FALSE               0
  25. #define TRUE                1
  26. #define EMPTY               0
  27.  
  28.  
  29. #define BUF_SIZE            500
  30. #define DVI_BUF_SIZE        4096
  31. #define ERROR_LINE          64
  32. #define FILE_NAME_SIZE      104
  33. #define FONT_BASE           0
  34. #define FONT_MAX            150
  35. #define FONT_MEM_SIZE       25000
  36. #define HALF_BUF            2048
  37. #define HALF_ERROR_LINE     32
  38. #define HASH_SIZE           3000
  39. #define HASH_PRIME          2551
  40. #define HYPH_SIZE           307
  41. #define MAX_IN_OPEN         15
  42. #define MAX_PRINT_LINE      72
  43. #define MAX_STRINGS         4400
  44. #define NEST_SIZE           40
  45. #define PARAM_SIZE          30
  46. #define POOL_SIZE           20000
  47. #define SAVE_SIZE           600
  48. #define STACK_SIZE          200
  49. #define STRING_VACANCIES    1000
  50. #define TRIE_OP_HASH_SIZE   512
  51. #define TRIE_SIZE           8000
  52.  
  53. #ifdef BIG
  54. #define MEM_BOT             0
  55. #define MEM_TOP             50000
  56. #define TOK_BOT             0
  57. #define TOK_TOP             30000
  58. #ifdef INIT
  59. #define MEM_MIN             MEM_BOT
  60. #define MEM_MAX             MEM_TOP
  61. #define TOK_MIN             TOK_BOT
  62. #define TOK_MAX             TOK_TOP
  63. #else
  64. #define MEM_MIN             0
  65. #define MEM_MAX             55000
  66. #define TOK_MIN             0
  67. #define TOK_MAX             55000
  68. #endif
  69. #define MIN_QUARTERWORD     0
  70. #define MAX_QUARTERWORD     255
  71. #define MIN_HALFWORD        0
  72. #define MAX_HALFWORD        65535
  73. #endif
  74.  
  75. #ifdef BIGG
  76. #define MEM_BOT             0
  77. #define MEM_TOP             250000
  78. #define TOK_BOT             0
  79. #define TOK_TOP             30000
  80. #ifdef INIT
  81. #define MEM_MIN             MEM_BOT
  82. #define MEM_MAX             MEM_TOP
  83. #define TOK_MIN             TOK_BOT
  84. #define TOK_MAX             TOK_TOP
  85. #else
  86. #define MEM_MIN             0
  87. #define MEM_MAX             524200
  88. #define TOK_MIN             0
  89. #define TOK_MAX             55000
  90. #endif
  91. #define MIN_QUARTERWORD     0
  92. #define MAX_QUARTERWORD     255
  93. #define MIN_HALFWORD        0
  94. #define MAX_HALFWORD        655350
  95. #endif
  96.  
  97. #if !defined(BIGG) && !defined(BIG)
  98. #define MEM_BOT             0
  99. #define MEM_TOP             30000
  100. #define TOK_BOT             0
  101. #define TOK_TOP             30000
  102. #ifdef INIT
  103. #define MEM_MIN             MEM_BOT
  104. #define MEM_MAX             MEM_TOP
  105. #define TOK_MIN             TOK_BOT
  106. #define TOK_MAX             TOK_TOP
  107. #else
  108. #define MEM_MIN             0
  109. #define MEM_MAX             35000
  110. #define TOK_MIN             0
  111. #define TOK_MAX             35000
  112. #endif
  113. #define MIN_QUARTERWORD     0
  114. #define MAX_QUARTERWORD     255
  115. #define MIN_HALFWORD        0
  116. #define MAX_HALFWORD        65535
  117. #endif
  118.  
  119. /*
  120.  *  types in the outer block
  121.  */
  122.  
  123. #define global      extern
  124. #if defined(BIG) || defined(BIGG)
  125. typedef unsigned char   qword;
  126. typedef unsigned long   hword;
  127. #else
  128. typedef unsigned char   qword;
  129. typedef unsigned short  hword;
  130. #endif
  131. typedef unsigned char   ascii;
  132. typedef int             bool;
  133. typedef unsigned char   byte;
  134. typedef char *          chrs;
  135. typedef int             fnt;
  136. typedef unsigned char   gord;
  137. typedef float           gratio;
  138. typedef int             group;
  139. typedef hword           ptr;
  140. typedef long            scal;
  141. typedef hword           str;
  142. typedef hword           tok;
  143. typedef long            val;
  144. typedef FILE            *word_file;
  145. typedef FILE            *alpha_file;            
  146. typedef FILE            *byte_file;
  147. typedef union { 
  148.     struct { 
  149.         hword   rh; 
  150.         hword   lh; 
  151.     } hh1; 
  152.     struct { 
  153.         hword   rh; 
  154.         qword   b0; 
  155.         qword   b1; 
  156.     } hh2; 
  157. } hh;
  158. typedef struct { 
  159.     qword   b0;
  160.     qword   b1;
  161.     qword   b2;
  162.     qword   b3;
  163. } qqqq;
  164. typedef union { 
  165.     hh      hh;  
  166.     qqqq    qqqq;
  167.     long    i;   
  168.     gratio  gr;  
  169. } mword;
  170.  
  171. /*
  172.  *  variables in the outer block
  173.  */
  174.  
  175. global  char        banner[];
  176. global  int         ready_already;
  177.  
  178. /*
  179.  *  functions in the outer block
  180.  */
  181.  
  182. int     final_cleanup();
  183. int     close_files_and_terminate();
  184. int     initialize();
  185. bool    decode_args();
  186. int     handle_int();
  187. int     call_edit();
  188.  
  189. /*
  190.  * some common programming idioms
  191.  */
  192.  
  193. #define sc                  i
  194. #define incr(i)             ++(i)
  195. #define decr(i)             --(i)
  196. #define odd(i)              ((i) & 1)
  197. #define abs(i)              ((i) >= 0 ? (i) : -(i))
  198. #define round(x)            (long) ((x) > 0.0 ? ((x) + 0.5) : ((x) - 0.5))
  199. #define negate(x)           (x) = -(x)
  200. #define loop                while (1)
  201. #include "cmds.h"
  202. #include "char.h"
  203. #include "str.h"
  204. #include "io.h"
  205. #include "print.h"
  206. #include "error.h"
  207. #include "heap.h"
  208. #include "eq.h"
  209. #include "hash.h"
  210. #include "arith.h"
  211.