home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex29 / StTeXsrc.zoo / src / tex.h.conservative < prev    next >
Text File  |  1989-09-29  |  5KB  |  217 lines

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