home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / CMTEX330 / SOURCE / TEX.H < prev    next >
C/C++ Source or Header  |  1992-02-19  |  3KB  |  158 lines

  1.  
  2. /*
  3.  * %Y%:%M%:%I%:%Q%
  4.  *
  5.  * Copyright 1987,1988,1991 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    <string.h>
  15. #include    <signal.h>
  16. #include    <time.h>
  17. #include    <malloc.h>
  18.  
  19. /*
  20.  * constants in the outer block
  21.  */
  22.  
  23. #define NUL            '\0'
  24. #define EOLN            '\n'
  25. #define FALSE            0
  26. #define TRUE            1
  27. #define EMPTY            0
  28.  
  29. #define MIN_QUARTERWORD        0
  30. #define MAX_QUARTERWORD        255
  31. #define MIN_HALFWORD        0
  32. #define MAX_HALFWORD        65535
  33.  
  34. /*
  35.  *    types in the outer block
  36.  */
  37.  
  38. #define global        extern
  39.  
  40. typedef int        bool;
  41. typedef unsigned char    byte;
  42. typedef int        tok;
  43. typedef int        fnt;
  44. typedef float        ratio;
  45. typedef int         scal;
  46. typedef char        *str;
  47. typedef FILE        *file;
  48.  
  49. typedef int        ptr;
  50.  
  51. struct qcell {
  52.     short    b0;
  53.     short    b1;
  54.     short    b2;
  55.     short    b3;
  56. };
  57. typedef struct qcell qcell;
  58.  
  59. union hcell { 
  60.     int    i;   
  61.     ptr    p;
  62.     struct {
  63.         short    b0;
  64.         short    b1;
  65.     } qq;
  66. };
  67. typedef union hcell hcell;
  68.  
  69. struct mcell { 
  70.     hcell    h1;
  71.     hcell    h2;
  72. };
  73. typedef struct mcell mcell;
  74.  
  75. #define rinfo(P)    ((mcell *) (P))->h1.i
  76. #define link(P)        ((mcell *) (P))->h1.p
  77. #define info(P)        ((mcell *) (P))->h2.i
  78. #define llink(P)    ((mcell *) (P))->h2.p
  79. #define type(P)        ((mcell *) (P))->h2.qq.b0
  80. #define subtype(P)    ((mcell *) (P))->h2.qq.b1
  81. #define    q0(P)        ((mcell *) (P))->h1.qq.b0
  82. #define    q1(P)        ((mcell *) (P))->h1.qq.b1
  83. #define    q2(P)        ((mcell *) (P))->h2.qq.b0
  84. #define    q3(P)        ((mcell *) (P))->h2.qq.b1
  85.  
  86. #ifdef NOLCASTS
  87. #define mcopy(x,y)    memcpy((void *)x, (void *)y, sizeof(mcell))
  88. #else
  89. #define mcopy(x,y)    *(mcell *)x = *(mcell *)y
  90. #endif
  91. #define mzero(m)    memset(m,0,sizeof(mcell))
  92.  
  93. /*
  94.  *    variables in the outer block
  95.  */
  96.  
  97. global    char    *banner;
  98. global    str    format_ident;
  99. global    int    ready_already;
  100.  
  101. /*
  102.  *    functions in the outer block
  103.  */
  104.  
  105. void    initialize();
  106. void    initialize_once();
  107. bool    decode_args();
  108. void    fix_date_and_time();
  109. void    handle_int();
  110. void    final_cleanup();
  111. void    close_files_and_terminate();
  112. void    call_edit();
  113.  
  114. void    _tex_init ();
  115. void    _tex_init_once ();
  116.  
  117. /*
  118.  * some common programming idioms
  119.  */
  120.  
  121. #define incr(i)        ++(i)
  122. #define decr(i)         --(i)
  123. #define odd(i)        ((i) & 1)
  124. #define abs(i)        ((i) >= 0 ? (i) : -(i))
  125. #define round(x)    (int) ((x) > 0.0 ? ((x) + 0.5) : ((x) - 0.5))
  126. #define negate(x)    (x) = -(x)
  127. #define loop        while (1)
  128.  
  129. #include "align.h"
  130. #include "alloc.h"
  131. #include "arith.h"
  132. #include "box.h"
  133. #include "boxlist.h"
  134. #include "chr.h"
  135. #include "cmd.h"
  136. #include "cond.h"
  137. #include "def.h"
  138. #include "dvi.h"
  139. #include "sym.h"
  140. #include "error.h"
  141. #include "eval.h"
  142. #include "expand.h"
  143. #include "fileio.h"
  144. #include "hyph.h"
  145. #include "math.h"
  146. #include "mathlist.h"
  147. #include "mlst-hlst.h"
  148. #include "pack.h"
  149. #include "page.h"
  150. #include "par.h"
  151. #include "print.h"
  152. #include "scan.h"
  153. #include "str.h"
  154. #include "tfm.h"
  155. #include "tok.h"
  156. #include "toklist.h"
  157. #include "texext.h"
  158.