Annotation of researchv10no/cmd/troff/ancient.nroff/tdef.hd, revision 1.1

1.1     ! root        1: /*     tdef.hd  --  Definitions for the C pre-processor.
        !             2:  *
        !             3:  *
        !             4:  *
        !             5:  *
        !             6:  *     The first defines here (copied from the first page of n1.c)
        !             7:  *     control the generation of various permutations of the nroff/
        !             8:  *     troff programs.  This single set of source files generates
        !             9:  *     both nroff and troff, on the PDP-11, VAX, UNIVAC UNIX, TSO
        !            10:  *     (as in IBM), and soon () the 3B-20 Processors without
        !            11:  *     any special compilation procedures, except for the need to define
        !            12:  *     the symbol 'NROFF' when compiling nroff.  By default, compilation
        !            13:  *     will produce troff.
        !            14:  *
        !            15:  *     Some other compilation options are available for building
        !            16:  *     a customized version of nroff or troff.  A list of definable
        !            17:  *     symbols and their effect is given here:
        !            18:  *
        !            19:  *
        !            20:  *  SMALL      Produce a version of nroff or troff that uses a
        !            21:  *             minimum amount of instruction space.  This symbol
        !            22:  *             automatically defines NDIAGS and NOCOMPACT (see below).
        !            23:  *             It also causes the following features to be missing:
        !            24:  *             requests ! and pi, troff paper accounting.
        !            25:  *
        !            26:  *  INCORE     Causes nroff/troff to keep both the suffix table (for
        !            27:  *             hyphenation) and the /tmp file in main memory.
        !            28:  *             This version of nroff/troff has a minimum of inter-
        !            29:  *             action with the operating system, but a maximum of
        !            30:  *             main memory size.  Not recommended on minis, and probably
        !            31:  *             won't work at all on the 11.  It also uses standard
        !            32:  *             I/O, and hence is portable to non-UNIX C environments.
        !            33:  *             Automatically sets NOCOMPACT.
        !            34:  *
        !            35:  *  NDIAGS     Causes the pm request to not be included.
        !            36:  *
        !            37:  *  NOCOMPACT  Produces an nroff/troff without compacted macros.  The
        !            38:  *             -c command line option is synonymous with -m, and
        !            39:  *             the -k option is missing.
        !            40:  *
        !            41:  *  tso                Use TSO-style standard I/O
        !            42:  *
        !            43:  *
        !            44:  *     All these symbols will cause a suitably modified 'what' command
        !            45:  *     response when applied to the object nroff or troff.
        !            46:  *
        !            47:  *     Finally, the symbols expected to be set by the C compiler are:
        !            48:  *
        !            49:  *  unix       If this is the UNIX operating system.  If this symbol
        !            50:  *             is not defined, it causes the automatic definition of
        !            51:  *             INCORE, SMALL, and tso.  The latter is used to control
        !            52:  *             generation of standard I/O calls.
        !            53:  *
        !            54:  *  ebcdic     Produces code to run on a machine with ebcdic as its native
        !            55:  *             character set.  nroff/troff still runs in ASCII internally
        !            56:  *             and expects ASCII input, but does produce ebcdic on the
        !            57:  *             standard output channel.
        !            58:  *
        !            59:  */
        !            60: 
        !            61: 
        !            62: 
        !            63: #ifndef unix
        !            64: #define INCORE
        !            65: #define SMALL
        !            66: #define tso
        !            67: #endif
        !            68: #ifdef SMALL
        !            69: #define NDIAGS
        !            70: #define NOCOMPACT
        !            71: #endif
        !            72: #ifdef INCORE
        !            73: #define NOCOMPACT
        !            74: #endif
        !            75: /* the following define is the version number of nroff/troff */
        !            76: #define NTVER "@(#)roff.src    1.123"
        !            77: #ifdef NROFF   /*NROFF*/
        !            78: #define EM t.Em
        !            79: #define HOR t.Adj
        !            80: #define VERT t.Vert
        !            81: #define INCH 240       /*increments per inch*/
        !            82: #define SPS INCH/10    /*space size*/
        !            83: #define SS INCH/10     /* " */
        !            84: #define TRAILER 0
        !            85: #define UNPAD 0227
        !            86: #define PO 0 /*page offset*/
        !            87: #define ASCII 1
        !            88: #define PTID 1
        !            89: #define LG 0
        !            90: #define DTAB 0 /*set at 8 Ems at init time*/
        !            91: #define ICS 2*SPS
        !            92: #endif
        !            93: #ifndef NROFF  /*TROFF*/
        !            94: #define INCH 432       /*troff resolution*/
        !            95: #define SPS 20 /*space size at 10pt; 1/3 Em*/
        !            96: #define SS 12  /*space size in 36ths of an em*/
        !            97: #define TRAILER 4968   /*144*11.5*3 = 11.5 inches*/
        !            98: #define UNPAD 027
        !            99: #define PO 416 /*page offset 26/27ths inch*/
        !           100: #define HOR 1
        !           101: #define VERT 3
        !           102: #define EM (6*(pts&077))
        !           103: #define ASCII 0
        !           104: #define PTID 0
        !           105: #define LG 1
        !           106: #define DTAB (INCH/2)
        !           107: #define ICS 3*SPS
        !           108: #endif
        !           109: 
        !           110: #ifdef INCORE
        !           111: #define NMACS 100      /* max number of nested macro calls */
        !           112: #define MARGL 512      /* max total length of macro args */
        !           113: #define TSTBUF 1000    /* terminal strings buffer */
        !           114: #endif
        !           115: #ifdef unix
        !           116: #include <signal.h>
        !           117: #endif
        !           118: #ifdef tso
        !           119: #include "stdio.h"
        !           120: #endif
        !           121: #define BSIZE 512      /* size of any IO buffers */
        !           122: #define ARGLEN 50      /* exec request (!) argument length (approx) */
        !           123: #define NARSP 0177     /*narrow space*/
        !           124: #define HNSP 0226      /*half narrow space*/
        !           125: #define PS 10  /*default point size*/
        !           126: #define FT 0   /*default font position*/
        !           127: #define LL 65*INCH/10  /*line length; 39picas=6.5in*/
        !           128: #define VS INCH/6      /*vert space; 12points*/
        !           129: #define NN 300 /*number registers*/
        !           130: #define NNAMES 14 /*predefined reg names*/
        !           131: #define NIF 15 /*if-else nesting*/
        !           132: #define NS 64  /*name buffer*/
        !           133: #define NSN 4  /* number of macro packages per command line */
        !           134:                /* NOTE: must change with definition of nextf in ni.c */
        !           135: #define NTM 256        /*tm buffer*/
        !           136: #define NEV 3  /*environments*/
        !           137: #define EVLSZ 10       /*size of ev stack*/
        !           138: #define NM 350 /*requests + macros*/
        !           139: #define DELTA (256*sizeof(int))        /*delta core bytes*/
        !           140: #define NHYP 10        /*max hyphens per word*/
        !           141: #define NHEX 128       /*byte size of exception word list*/
        !           142: #define NTAB 35        /*tab stops*/
        !           143: #define NSO 5  /*"so" depth*/
        !           144: #define WDSIZE 500     /*word buffer size*/
        !           145: #define LNSIZE 680     /*line buffer size*/
        !           146: #define NDI 5  /*number of diversions*/
        !           147: #define DBL 0100000    /*double size indicator*/
        !           148: #define MOT 0100000    /*motion character indicator*/
        !           149: #define MOTV 0160000   /*clear for motion part*/
        !           150: #define VMOT 0040000   /*vert motion bit*/
        !           151: #define NMOT 0020000   /* negative motion indicator*/
        !           152: #define MMASK 0100000  /*macro mask indicator*/
        !           153: #define CMASK 0100377
        !           154: #define ZBIT 0400      /*zero width char*/
        !           155: #define BMASK 0377
        !           156: #define BYTE 8
        !           157: #define IMP 004        /*impossible char*/
        !           158: #define FILLER 037
        !           159: #define PRESC 026
        !           160: #define HX 0376        /*High-order part of xlss*/
        !           161: #define LX 0375        /*low-order part of xlss*/
        !           162: #define COLON 013              /* lem's character */
        !           163: #define CONT 025
        !           164: #define XPAR 030
        !           165: #define ESC 032
        !           166: #define FLSS 031
        !           167: #define JREG 0374
        !           168: #define NTRAP 20       /*number of traps*/
        !           169: #define NPN 20 /*numbers in "-o"*/
        !           170: #define T_PAD 0101     /*cat padding*/
        !           171: #define T_INIT 0100
        !           172: #define T_IESC 16 /*initial offset*/
        !           173: #define T_STOP 0111
        !           174: #define NPP 10 /*pads per field*/
        !           175: #define FBUFSZ 256     /*field buf size words*/
        !           176: #define OBUFSZ 512     /*bytes*/
        !           177: #define IBUFSZ 512     /*bytes*/
        !           178: #define NC 256 /*cbuf size words*/
        !           179: #define NOV 10 /*number of overstrike chars*/
        !           180: #define ZONE 5 /*5hrs for EST*/
        !           181: #define LEFT 035
        !           182: #define RIGHT 036
        !           183: #define LEADER 001
        !           184: #define TAB 011
        !           185: #define TMASK  037777
        !           186: #define RTAB 0100000
        !           187: #define CTAB 0040000
        !           188: #define OHC 024
        !           189: 
        !           190: #define PAIR(A,B) (A|(B<<BYTE))
        !           191: 
        !           192: #define BLK  128       /*alloc block words*/
        !           193: typedef unsigned filep;
        !           194: #define NBLIST 512     /* /tmp file allocation list */
        !           195: 
        !           196: /*             Compiler Dependent Defines              */
        !           197: 
        !           198: #ifdef tso
        !           199: #define filedes FILE *
        !           200: #define cptmpfaddr(new,old)  new.o = old.o;  new.b = old.b
        !           201: #endif
        !           202: #ifdef unix
        !           203: typedef int filedes;
        !           204: #define cptmpfaddr(new,old)  new = old
        !           205: #endif
        !           206: 
        !           207: 
        !           208: /*     The following block of defines are used for the name table hashing
        !           209:  *     algorithms (see fname and dname).  These definitions are used by the
        !           210:  *     bldtable program for building the initial names table (which contains
        !           211:  *     request and number register names
        !           212:  */
        !           213: 
        !           214: #define TAGSMASK (MMASK)       /* tags on name */
        !           215: #define NAMEMASK (~TAGSMASK)   /* name part */
        !           216: /*     MMASK   0100000         macro (not request)     */
        !           217: #define HBMASK 0177400         /* high order byte mask */
        !           218: 
        !           219: #define HASH(NMPR,SIZE)        (((((unsigned)(NMPR&HBMASK))>>3)- \
        !           220:                                (NMPR&BMASK))%SIZE)
        !           221:                        /* NOTE: this may return a negative, which must
        !           222:                                be made positive        */
        !           223: 
        !           224: 
        !           225: /*     The following defines used to be regular procedures, but are
        !           226:  *     defined here to produce inline code.
        !           227:  */
        !           228: 
        !           229: #define incoff(fp)     {  if (!(fp.o = (fp.o + 1) & (BLK - 1)))\
        !           230:                                if ((fp.b = blist[fp.b]) == (filep)-1) errbsa();  }
        !           231: #define atoi(i)                ((int) atoi0(i))
        !           232: #define boff(i)                ((i-1)*BLK + NEV*sizeof(struct envblock))
        !           233: #define horiz(i)       {       register int jj; \
        !           234:                                vflag = 0; \
        !           235:                                if (jj=i) pchar(makem(jj));     }
        !           236: #define maplow(i)      (((i&CMASK) < 'a') ? ((i&CMASK)+'a'-'A') : (i&CMASK))
        !           237: 
        !           238: #ifndef ebcdic
        !           239: #define aprstr(s)      prstr(s)
        !           240: #define aprstrfl(s)    prstrfl(s)
        !           241: #endif
        !           242: 
        !           243: 
        !           244: /*  The following defines are used for the getch0 character pointer
        !           245:  *      stack.  The set.. defines are used to enter a new pointer into
        !           246:  *      the stack.  The defines following are pointer names and their
        !           247:  *      traditional entry in the stack.  'stack' meaning that is the
        !           248:  *      way characters are removed from the structure - in practice,
        !           249:  *      pointers are entered into fixed positions in the structure, and
        !           250:  *      in any order of insertion.
        !           251:  */
        !           252: 
        !           253: #define setap(i)       { cstk[AP] = i; if (AP > cstkl) cstkl = AP; }
        !           254: #define setcp(i)       { cstk[CP] = i; if (CP > cstkl) cstkl = CP; }
        !           255: #define setrp(i)       { cstk[RP] = i; if (RP > cstkl) cstkl = RP; }
        !           256: #define setch0(i)      { tch[0] = i; cstk[cstkl = CH0] = tch; }
        !           257: 
        !           258: #define CH0    4       /* single character top priority buffer */
        !           259: #define RP     3       /* repeat characters buffer pointer */
        !           260: #define CP     2       /* arbitrary string pointer */
        !           261: #define AP     1       /* pointer to macro call argument */
        !           262: 
        !           263: #define RPTLEN 135     /* max length of repeat string  */
        !           264: 
        !           265: #define NB 5           /* number of macro cache buffers */
        !           266: 
        !           267: 
        !           268: 
        !           269: /*    The names in the next set of defines are the names of all the
        !           270:  *     items in the environment block.  The environment block is a
        !           271:  *     structure, defined in ni.c.  The names below used to be names
        !           272:  *     for the variables themselves, but now are mapped into
        !           273:  *     structure accesses.
        !           274:  */
        !           275: 
        !           276: #ifndef INCORE
        !           277: #define ics eblock.Eics
        !           278: #define ic eblock.Eic
        !           279: #define icf eblock.Eicf
        !           280: #define chbits eblock.Echbits
        !           281: #define nmbits eblock.Enmbits
        !           282: #define apts eblock.Eapts
        !           283: #define apts1 eblock.Eapts1
        !           284: #define pts eblock.Epts
        !           285: #define pts1 eblock.Epts1
        !           286: #define font eblock.Efont
        !           287: #define font1 eblock.Efont1
        !           288: #define sps eblock.Esps
        !           289: #ifndef NROFF
        !           290: #define spacesz eblock.Espacesz
        !           291: #define spbits eblock.Espbits
        !           292: #endif
        !           293: #define lss eblock.Elss
        !           294: #define lss1 eblock.Elss1
        !           295: #define ls eblock.Els
        !           296: #define ls1 eblock.Els1
        !           297: #define ll eblock.Ell
        !           298: #define ll1 eblock.Ell1
        !           299: #define lt eblock.Elt
        !           300: #define lt1 eblock.Elt1
        !           301: #define ad eblock.Ead
        !           302: #define nms eblock.Enms
        !           303: #define ndf eblock.Endf
        !           304: #define fi eblock.Efi
        !           305: #define cc eblock.Ecc
        !           306: #define c2 eblock.Ec2
        !           307: #define ohc eblock.Eohc
        !           308: #define hyf eblock.Ehyf
        !           309: #define hyoff eblock.Ehyoff
        !           310: #define un1 eblock.Eun1
        !           311: #define tabc eblock.Etabc
        !           312: #define dotc eblock.Edotc
        !           313: #define adsp eblock.Eadsp
        !           314: #define adrem eblock.Eadrem
        !           315: #define lastl eblock.Elastl
        !           316: #define nel eblock.Enel
        !           317: #define admod eblock.Eadmod
        !           318: #define wordp eblock.Ewordp
        !           319: #define spflg eblock.Espflg
        !           320: #define linep eblock.Elinep
        !           321: #define wdend eblock.Ewdend
        !           322: #define wdstart eblock.Ewdstart
        !           323: #define wne eblock.Ewne
        !           324: #define ne eblock.Ene
        !           325: #define nc eblock.Enc
        !           326: #define nb eblock.Enb
        !           327: #define lnmod eblock.Elnmod
        !           328: #define nwd eblock.Enwd
        !           329: #define nn eblock.Enn
        !           330: #define ni eblock.Eni
        !           331: #define ul eblock.Eul
        !           332: #define cu eblock.Ecu
        !           333: #define ce eblock.Ece
        !           334: #define in eblock.Ein
        !           335: #define in1 eblock.Ein1
        !           336: #define un eblock.Eun
        !           337: #define wch eblock.Ewch
        !           338: #define pendt eblock.Ependt
        !           339: #define pendw eblock.Ependw
        !           340: #define pendnf eblock.Ependnf
        !           341: #define spread eblock.Espread
        !           342: #define it eblock.Eit
        !           343: #define itmac eblock.Eitmac
        !           344: #define lnsize eblock.Elnsize
        !           345: #define hyptr eblock.Ehyptr
        !           346: #define tabtab eblock.Etabtab
        !           347: #define line eblock.Eline
        !           348: #define word eblock.Eword
        !           349: 
        !           350: #else
        !           351: 
        !           352: #define ics eblock[ev].Eics
        !           353: #define ic eblock[ev].Eic
        !           354: #define icf eblock[ev].Eicf
        !           355: #define chbits eblock[ev].Echbits
        !           356: #define nmbits eblock[ev].Enmbits
        !           357: #define apts eblock[ev].Eapts
        !           358: #define apts1 eblock[ev].Eapts1
        !           359: #define pts eblock[ev].Epts
        !           360: #define pts1 eblock[ev].Epts1
        !           361: #define font eblock[ev].Efont
        !           362: #define font1 eblock[ev].Efont1
        !           363: #define sps eblock[ev].Esps
        !           364: #ifndef NROFF
        !           365: #define spacesz eblock[ev].Espacesz
        !           366: #define spbits eblock[ev].Espbits
        !           367: #endif
        !           368: #define lss eblock[ev].Elss
        !           369: #define lss1 eblock[ev].Elss1
        !           370: #define ls eblock[ev].Els
        !           371: #define ls1 eblock[ev].Els1
        !           372: #define ll eblock[ev].Ell
        !           373: #define ll1 eblock[ev].Ell1
        !           374: #define lt eblock[ev].Elt
        !           375: #define lt1 eblock[ev].Elt1
        !           376: #define ad eblock[ev].Ead
        !           377: #define nms eblock[ev].Enms
        !           378: #define ndf eblock[ev].Endf
        !           379: #define fi eblock[ev].Efi
        !           380: #define cc eblock[ev].Ecc
        !           381: #define c2 eblock[ev].Ec2
        !           382: #define ohc eblock[ev].Eohc
        !           383: #define hyf eblock[ev].Ehyf
        !           384: #define hyoff eblock[ev].Ehyoff
        !           385: #define un1 eblock[ev].Eun1
        !           386: #define tabc eblock[ev].Etabc
        !           387: #define dotc eblock[ev].Edotc
        !           388: #define adsp eblock[ev].Eadsp
        !           389: #define adrem eblock[ev].Eadrem
        !           390: #define lastl eblock[ev].Elastl
        !           391: #define nel eblock[ev].Enel
        !           392: #define admod eblock[ev].Eadmod
        !           393: #define wordp eblock[ev].Ewordp
        !           394: #define spflg eblock[ev].Espflg
        !           395: #define linep eblock[ev].Elinep
        !           396: #define wdend eblock[ev].Ewdend
        !           397: #define wdstart eblock[ev].Ewdstart
        !           398: #define wne eblock[ev].Ewne
        !           399: #define ne eblock[ev].Ene
        !           400: #define nc eblock[ev].Enc
        !           401: #define nb eblock[ev].Enb
        !           402: #define lnmod eblock[ev].Elnmod
        !           403: #define nwd eblock[ev].Enwd
        !           404: #define nn eblock[ev].Enn
        !           405: #define ni eblock[ev].Eni
        !           406: #define ul eblock[ev].Eul
        !           407: #define cu eblock[ev].Ecu
        !           408: #define ce eblock[ev].Ece
        !           409: #define in eblock[ev].Ein
        !           410: #define in1 eblock[ev].Ein1
        !           411: #define un eblock[ev].Eun
        !           412: #define wch eblock[ev].Ewch
        !           413: #define pendt eblock[ev].Ependt
        !           414: #define pendw eblock[ev].Ependw
        !           415: #define pendnf eblock[ev].Ependnf
        !           416: #define spread eblock[ev].Espread
        !           417: #define it eblock[ev].Eit
        !           418: #define itmac eblock[ev].Eitmac
        !           419: #define lnsize eblock[ev].Elnsize
        !           420: #define hyptr eblock[ev].Ehyptr
        !           421: #define tabtab eblock[ev].Etabtab
        !           422: #define line eblock[ev].Eline
        !           423: #define word eblock[ev].Eword
        !           424: #endif
        !           425: 
        !           426: /*     defines for nroff/troff data area (struct datablock dblock)     */
        !           427: 
        !           428: #define r      dblock.Dr
        !           429: #define nametab dblock.Dnametab
        !           430: #define nlist  dblock.Dnlist
        !           431: #define mlist  dblock.Dmlist
        !           432: #define vlist  dblock.Dvlist
        !           433: #define inc    dblock.Dinc
        !           434: #define fmt    dblock.Dfmt
        !           435: #define trtab  dblock.Dtrtab
        !           436: #define blist  dblock.Dblist

unix.superglobalmegacorp.com

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