Annotation of coherent/b/bin/troff/roff.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * roff.h
                      3:  * Nroff/Troff.
                      4:  * Header file.
                      5:  */
                      6: 
                      7: #include <stdio.h>
                      8: #include <stdlib.h>
                      9: #include <string.h>
                     10: #include "code.h"
                     11: #include "codebug.h"
                     12: #include "div.h"
                     13: #include "env.h"
                     14: #include "escapes.h"
                     15: #include "fonts.h"
                     16: #include "hyphen.h"
                     17: #include "reg.h"
                     18: #include "request.h"
                     19: #include "str.h"
                     20: 
                     21: #define        VERSION "4.0.8"
                     22: 
                     23: /* Buffer sizes. */
                     24: #define        ABFSIZE 256                     /* Size of argument buffer      */
                     25: #define        ASCSIZE 128                     /* Size of ASCII character set  */
                     26: #define        CBFSIZE 128                     /* Size of char buffer          */
                     27: #ifdef GEMDOS
                     28: #define        DBFSIZE 128                     /* Size of disk buffer          */
                     29: #else
                     30: #define        DBFSIZE 128                     /* Size of disk buffer          */
                     31: #endif
                     32: #define        MSCSIZE 256                     /* Size of miscellaneous buffer */
                     33: 
                     34: /* Types of justification. */
                     35: #define        NJUS    0                       /* None (marks end of table)    */
                     36: #define        LJUS    1                       /* Left justification           */
                     37: #define        CJUS    2                       /* Centre justification         */
                     38: #define        RJUS    3                       /* Right justification          */
                     39: #define        FJUS    4                       /* Filled justification         */
                     40: 
                     41: /*
                     42:  * Unit measures.
                     43:  * These use constants defined as globals in tty.c (nroff) or output.c (troff).
                     44:  * The values are different for nroff and troff,
                     45:  * but the same unlinked object works for both.
                     46:  * Changing these to different manifest constants with a conditional
                     47:  * compilation switch would require different unlinked objects.
                     48:  */
                     49: #define        SMCENT  ((long) 50*sinmul)      /* Centimetre (mul)             */
                     50: #define        SDCENT  ((long) 127*sindiv)     /* Centimetre (div)             */
                     51: #define        SMEMSP  ((long) psz*semmul)     /* Em space (mul)               */
                     52: #define        SDEMSP  ((long) semdiv)         /* Em space (div)               */
                     53: #define        SMENSP  ((long) psz*senmul)     /* En space (mul)               */
                     54: #define        SDENSP  ((long) sendiv)         /* En space (div)               */
                     55: #define        SMHRES  ((long) shrmul)         /* Horizontal resolution (mul)  */
                     56: #define        SDHRES  ((long) shrdiv)         /* Horizontal resolution (div)  */
                     57: #define        SMINCH  ((long) sinmul)         /* Inch (mul)                   */
                     58: #define        SDINCH  ((long) sindiv)         /* Inch (div)                   */
                     59: #define        SMNARS  ((long) psz*snrmul)     /* Narrow space (mul)           */
                     60: #define        SDNARS  ((long) snrdiv)         /* Narrow space (div)           */
                     61: #define        SMPICA  ((long) sinmul)         /* Pica (mul)                   */
                     62: #define        SDPICA  ((long) 6*sindiv)       /* Pica (div)                   */
                     63: #define        SMPOIN  ((long) sinmul)         /* Point (mul)                  */
                     64: #define        SDPOIN  ((long) 72*sindiv)      /* Point (div)                  */
                     65: #define        SMUNIT  ((long) 1)              /* Unit (mul)                   */
                     66: #define        SDUNIT  ((long) 1)              /* Unit (div)                   */
                     67: #define        SMVEMS  ((long) psz)            /* Vertical em space (mul)      */
                     68: #define        SDVEMS  ((long) 1)              /* Vertical em space  (div)     */
                     69: #define        SMVLSP  ((long) vls)            /* Line space (mul)             */
                     70: #define        SDVLSP  ((long) 1)              /* Line space (div)             */
                     71: #define        SMVRES  ((long) svrmul)         /* Vertical resolution (mul)    */
                     72: #define        SDVRES  ((long) svrdiv)         /* Vertical resolution (div)    */
                     73: 
                     74: /* Miscellaneous. */
                     75: #define        NROFF           1               /* Program is nroff             */
                     76: #define        TROFF           2               /* Program is troff             */
                     77: #define        IESTACKSIZE     20              /* .ie stack size               */
                     78: #define        INFINITY        32767
                     79: 
                     80: /* Kludge to avoid hanging PostScript printer on very large files. */
                     81: #define        ZKLUDGE 1                       /* Include Zflag kludge         */
                     82: #if    ZKLUDGE
                     83: #define        ZPAGES  25                      /* Default Zflag value          */
                     84: #endif
                     85: 
                     86: /* System-dependent directory and file names. */
                     87: #ifdef MSDOS
                     88: /* MSDOS */
                     89: #define        LIBDIR  "\\usr\\lib\\roff\\"    /* Configuration directory      */
                     90: #define        NRDIR   "nroff\\"               /* nroff subdirectory           */
                     91: #define        POST_L  "_post_land"            /* Landscape postfix filename   */
                     92: #define        POST_P  "_post"                 /* Portrait postfix filename    */
                     93: #define        PRE_L   "_pre_land"             /* Landscape prefix filename    */
                     94: #define        PRE_P   "_pre"                  /* Portrait prefix filename     */
                     95: #define        TMACDIR "\\usr\\lib\\"          /* Macro library directory      */
                     96: #define        TMACFMT "%s.tmc"                /* Macro filename format        */
                     97: #define        TMPLATE "roffX.tmp"             /* Temp file template           */
                     98: #define        TPCLDIR "troff_pcl\\"           /* PCL troff subdirectory       */
                     99: #define        TPSDIR  "troff_ps\\"            /* PS troff subdirectory        */
                    100: #else
                    101: #ifdef GEMDOS
                    102: /* GEMDOS */
                    103: #define        TMACDIR "\\bin\\"
                    104: #define        TMACFMT "%s.tmc"
                    105: #else
                    106: /* COHERENT */
                    107: #define        LIBDIR  "/usr/lib/roff/"        /* Configuration directory      */
                    108: #define        NRDIR   "nroff/"                /* nroff subdirectory           */
                    109: #define        POST_L  ".post_land"            /* Landscape postfix filename   */
                    110: #define        POST_P  ".post"                 /* Portrait postfix filename    */
                    111: #define        PRE_L   ".pre_land"             /* Landscape prefix filename    */
                    112: #define        PRE_P   ".pre"                  /* Portrait prefix filename     */
                    113: #define        TMACDIR "/usr/lib/"             /* Macro library directory      */
                    114: #define        TMACFMT "tmac.%s"               /* Macro filename format        */
                    115: #define        TMPLATE "/tmp/rofXXXXXX"        /* Temp file template           */
                    116: #define        TPCLDIR "troff_pcl/"            /* PCL troff subdirectory       */
                    117: #define        TPSDIR  "troff_ps/"             /* PS troff subdirectory        */
                    118: #endif
                    119: #endif
                    120: 
                    121: /* Roman numeral table. */
                    122: typedef struct {
                    123:        char    o_digit;                /* Offset for digit             */
                    124:        char    o_state;                /* Next state                   */
                    125: } ROM;
                    126: 
                    127: /* Special characters. */
                    128: typedef struct special {
                    129:        struct special  *spc_link;      /* Link to next                 */
                    130:        char            spc_name[2];    /* Name                         */
                    131:        char            *spc_val;       /* Value                        */
                    132: } SPECIAL;
                    133: 
                    134: /*
                    135:  * Device dependent variables,
                    136:  * defined in tty.c (nroff) or output.c (troff).
                    137:  */
                    138: extern int     ntroff;                 /* Program type                 */
                    139: extern long    semmul;                 /* Multiplier for em space      */
                    140: extern long    semdiv;                 /* Divisor for em space         */
                    141: extern long    senmul;                 /* Multiplier for en space      */
                    142: extern long    sendiv;                 /* Divisor for en space         */
                    143: extern long    shrmul;                 /* Horizontal resolution (mul)  */
                    144: extern long    shrdiv;                 /* Horizontal resolution (div)  */
                    145: extern long    sinmul;                 /* Multiplier for inch          */
                    146: extern long    sindiv;                 /* Divisor for inch             */
                    147: extern long    snrmul;                 /* Narrow space (mul)           */
                    148: extern long    snrdiv;                 /* Narrow space (div)           */
                    149: extern long    svrmul;                 /* Vertical resolution (mul)    */
                    150: extern long    svrdiv;                 /* Vertical resolution (div)    */
                    151: 
                    152: /* Global variables, defined in extern.c. */
                    153: extern int     A_reg;                  /* .A register                  */
                    154: extern int     a_reg;                  /* .a register                  */
                    155: extern char    *argv0;                 /* "nroff" or "troff"           */
                    156: extern int     bracelevel;             /* Level of \{ \} nesting       */
                    157: extern int     byeflag;                /* True when exiting            */
                    158: extern int     dbglvl;                 /* Debug level                  */
                    159: extern int     dflag;                  /* Debug flag                   */
                    160: extern char    diskbuf[DBFSIZE];       /* Disk buffer for temp file    */
                    161: extern char    endtrap[2];             /* End macro name               */
                    162: extern char    esc;                    /* Escape character             */
                    163: extern int     escflag;                /* Last character was escaped   */
                    164: extern int     iestack[IESTACKSIZE];   /* .ie condition stack          */
                    165: extern int     iestackx;               /* .ie condition stack index    */
                    166: extern int     infalse;                /* True in false conditional    */
                    167: extern int     lflag;                  /* Landscape mode               */
                    168: extern char    miscbuf[MSCSIZE];       /* Miscellaneous buffer         */
                    169: extern int     nbrflag;                /* Don't allow command to break */
                    170: extern unsigned        npn;                    /* Next page number             */
                    171: extern int     n_reg;                  /* .n register                  */
                    172: extern int     oldbracelevel;          /* Old level of \{ \} nesting   */
                    173: extern int     oldpof;                 /* Old page offset              */
                    174: extern unsigned        pct;                    /* Page counter                 */
                    175: extern int     pflag;                  /* Generate PostScript output   */
                    176: extern unsigned        pgl;                    /* Page length                  */
                    177: extern int     pof;                    /* Page offset                  */
                    178: extern SPECIAL *spc_list;              /* Special characters           */
                    179: extern int     svs;                    /* Saved space                  */
                    180: extern FILE    *tmp;                   /* Temp file pointer            */
                    181: extern unsigned long tmpseek;          /* Pointer into temp file       */
                    182: extern int     T_reg;                  /* .T register                  */
                    183: extern int     varsp;                  /* Variable spacing             */
                    184: extern int     xflag;                  /* Suppress page eject on exit  */
                    185: #if    ZKLUDGE
                    186: extern int     Zflag;                  /* PS save/restore kludge       */
                    187: #endif
                    188: 
                    189: /* Global tables, defined in tables.c. */
                    190: extern char    esctab[];
                    191: extern char    *mapfont[];
                    192: extern REQ     reqtab[];
                    193: extern ROM     romtab[];
                    194: extern char    trantab[];
                    195: 
                    196: /* Functions. */
                    197: extern STR     *allstr();
                    198: extern char    *duplstr();
                    199: extern REG     *findreg();
                    200: extern void    font_display();
                    201: extern REG     *getnreg();
                    202: extern REG     *makereg();
                    203: extern char    *nalloc();
                    204: extern char    *nextarg();
                    205: extern void    resetdev();
                    206: extern SPECIAL *spc_find();
                    207: 
                    208: /* Library functions. */
                    209: extern long    lseek();
                    210: 
                    211: /* end of roff.h */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.