Annotation of researchv9/cmd/troff/ni.c, revision 1.1

1.1     ! root        1: #include "tdef.h"
        !             2: 
        !             3: /* You may want to change these names */
        !             4: 
        !             5: #ifdef NROFF
        !             6: 
        !             7: char   termtab[NS] = "/usr/lib/term/tab.";     /* term type added in ptinit() */
        !             8: char   fontdir[NS] = "";       /* not used */
        !             9: char   devname[20] = "37";
        !            10: 
        !            11: #else
        !            12: 
        !            13: char   termtab[NS] = "/usr/lib/font";  /* rest added in ptinit() */
        !            14: char   fontdir[NS] = "/usr/lib/font";  /* rest added in casefp() */
        !            15: char   devname[20]      = "202";       /* default typesetter */
        !            16: 
        !            17: #endif
        !            18: 
        !            19: char   obuf[OBUFSZ];   /* characters collected here for typesetter output */
        !            20: char   *obufp = obuf;
        !            21: struct numtab numtab[NN] = {
        !            22:        { PAIR('%', 0) },
        !            23:        { PAIR('n', 'l') },
        !            24:        { PAIR('y', 'r') },
        !            25:        { PAIR('h', 'p') },
        !            26:        { PAIR('c', 't') },
        !            27:        { PAIR('d', 'n') },
        !            28:        { PAIR('m', 'o') },
        !            29:        { PAIR('d', 'y') },
        !            30:        { PAIR('d', 'w') },
        !            31:        { PAIR('l', 'n') },
        !            32:        { PAIR('d', 'l') },
        !            33:        { PAIR('s', 't') },
        !            34:        { PAIR('s', 'b') },
        !            35:        { PAIR('c', '.') },
        !            36:        { PAIR('$', '$') },
        !            37: };
        !            38: 
        !            39: 
        !            40: int    pto = 10000;
        !            41: int    pfrom = 1;
        !            42: int    print = 1;
        !            43: char   nextf[NS] = "/usr/lib/tmac/tmac.";
        !            44: char   mfiles[NMF][NS];
        !            45: int    nmfi = 0;
        !            46: #ifndef NROFF
        !            47: int    oldbits = -1;
        !            48: #endif
        !            49: int    init = 1;
        !            50: int    fc = IMP;       /* field character */
        !            51: int    eschar = '\\';
        !            52: #ifdef NROFF
        !            53: int    pl = 11*INCH;
        !            54: int    po = PO;
        !            55: #else
        !            56: int    pl;
        !            57: int    po;
        !            58: #endif
        !            59: int    dfact = 1;
        !            60: int    dfactd = 1;
        !            61: int    res = 1;
        !            62: int    smnt = 0;       /* beginning of special fonts */
        !            63: int    ascii = ASCII;
        !            64: int    ptid = PTID;
        !            65: int    lg = LG;
        !            66: int    pnlist[NPN] = { -1 };
        !            67: 
        !            68: 
        !            69: int    *pnp = pnlist;
        !            70: int    npn = 1;
        !            71: int    npnflg = 1;
        !            72: int    dpn = -1;
        !            73: int    totout = 1;
        !            74: int    ulfont = ULFONT;
        !            75: int    tabch = TAB;
        !            76: int    ldrch = LEADER;
        !            77: 
        !            78: extern    caseds(), caseas(), casesp(), caseft(), caseps(), casevs(),
        !            79: casenr(), caseif(), casepo(), casetl(), casetm(), casebp(), casech(),
        !            80: casepn(), tbreak(), caseti(), casene(), casenf(), casece(), casefi(),
        !            81: casein(), casell(), casens(), casemk(), casert(), caseam(),
        !            82: casede(), casedi(), caseda(), casewh(), casedt(), caseit(), caserm(),
        !            83: casern(), casead(), casers(), casena(), casepl(), caseta(), casetr(),
        !            84: caseul(), caselt(), casenx(), caseso(), caseig(), casetc(), casefc(),
        !            85: caseec(), caseeo(), caselc(), caseev(), caserd(), caseab(), casefl(),
        !            86: done(),   casess(), casefp(), casecs(), casebd(), caselg(), casehc(),
        !            87: casehy(), casenh(), casenm(), casenn(), casesv(), caseos(), casels(),
        !            88: casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(),
        !            89: casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
        !            90: caseht(), casecf(), casesy(), caself();
        !            91: 
        !            92: #define        C(a,b)  {a, 0, b, 0}
        !            93: struct contab contab[NM] = {
        !            94:        C(PAIR('d', 's'), caseds),
        !            95:        C(PAIR('a', 's'), caseas),
        !            96:        C(PAIR('s', 'p'), casesp),
        !            97:        C(PAIR('f', 't'), caseft),
        !            98:        C(PAIR('p', 's'), caseps),
        !            99:        C(PAIR('v', 's'), casevs),
        !           100:        C(PAIR('n', 'r'), casenr),
        !           101:        C(PAIR('i', 'f'), caseif),
        !           102:        C(PAIR('i', 'e'), caseie),
        !           103:        C(PAIR('e', 'l'), caseel),
        !           104:        C(PAIR('p', 'o'), casepo),
        !           105:        C(PAIR('t', 'l'), casetl),
        !           106:        C(PAIR('t', 'm'), casetm),
        !           107:        C(PAIR('b', 'p'), casebp),
        !           108:        C(PAIR('c', 'h'), casech),
        !           109:        C(PAIR('p', 'n'), casepn),
        !           110:        C(PAIR('b', 'r'), tbreak),
        !           111:        C(PAIR('t', 'i'), caseti),
        !           112:        C(PAIR('n', 'e'), casene),
        !           113:        C(PAIR('n', 'f'), casenf),
        !           114:        C(PAIR('c', 'e'), casece),
        !           115:        C(PAIR('f', 'i'), casefi),
        !           116:        C(PAIR('i', 'n'), casein),
        !           117:        C(PAIR('l', 'l'), casell),
        !           118:        C(PAIR('n', 's'), casens),
        !           119:        C(PAIR('m', 'k'), casemk),
        !           120:        C(PAIR('r', 't'), casert),
        !           121:        C(PAIR('a', 'm'), caseam),
        !           122:        C(PAIR('d', 'e'), casede),
        !           123:        C(PAIR('d', 'i'), casedi),
        !           124:        C(PAIR('d', 'a'), caseda),
        !           125:        C(PAIR('w', 'h'), casewh),
        !           126:        C(PAIR('d', 't'), casedt),
        !           127:        C(PAIR('i', 't'), caseit),
        !           128:        C(PAIR('r', 'm'), caserm),
        !           129:        C(PAIR('r', 'r'), caserr),
        !           130:        C(PAIR('r', 'n'), casern),
        !           131:        C(PAIR('a', 'd'), casead),
        !           132:        C(PAIR('r', 's'), casers),
        !           133:        C(PAIR('n', 'a'), casena),
        !           134:        C(PAIR('p', 'l'), casepl),
        !           135:        C(PAIR('t', 'a'), caseta),
        !           136:        C(PAIR('t', 'r'), casetr),
        !           137:        C(PAIR('u', 'l'), caseul),
        !           138:        C(PAIR('c', 'u'), casecu),
        !           139:        C(PAIR('l', 't'), caselt),
        !           140:        C(PAIR('n', 'x'), casenx),
        !           141:        C(PAIR('s', 'o'), caseso),
        !           142:        C(PAIR('i', 'g'), caseig),
        !           143:        C(PAIR('t', 'c'), casetc),
        !           144:        C(PAIR('f', 'c'), casefc),
        !           145:        C(PAIR('e', 'c'), caseec),
        !           146:        C(PAIR('e', 'o'), caseeo),
        !           147:        C(PAIR('l', 'c'), caselc),
        !           148:        C(PAIR('e', 'v'), caseev),
        !           149:        C(PAIR('r', 'd'), caserd),
        !           150:        C(PAIR('a', 'b'), caseab),
        !           151:        C(PAIR('f', 'l'), casefl),
        !           152:        C(PAIR('e', 'x'), done),
        !           153:        C(PAIR('s', 's'), casess),
        !           154:        C(PAIR('f', 'p'), casefp),
        !           155:        C(PAIR('c', 's'), casecs),
        !           156:        C(PAIR('b', 'd'), casebd),
        !           157:        C(PAIR('l', 'g'), caselg),
        !           158:        C(PAIR('h', 'c'), casehc),
        !           159:        C(PAIR('h', 'y'), casehy),
        !           160:        C(PAIR('n', 'h'), casenh),
        !           161:        C(PAIR('n', 'm'), casenm),
        !           162:        C(PAIR('n', 'n'), casenn),
        !           163:        C(PAIR('s', 'v'), casesv),
        !           164:        C(PAIR('o', 's'), caseos),
        !           165:        C(PAIR('l', 's'), casels),
        !           166:        C(PAIR('c', 'c'), casecc),
        !           167:        C(PAIR('c', '2'), casec2),
        !           168:        C(PAIR('e', 'm'), caseem),
        !           169:        C(PAIR('a', 'f'), caseaf),
        !           170:        C(PAIR('h', 'w'), casehw),
        !           171:        C(PAIR('m', 'c'), casemc),
        !           172:        C(PAIR('p', 'm'), casepm),
        !           173:        C(PAIR('p', 'i'), casepi),
        !           174:        C(PAIR('u', 'f'), caseuf),
        !           175:        C(PAIR('p', 'c'), casepc),
        !           176:        C(PAIR('h', 't'), caseht),
        !           177:        C(PAIR('c', 'f'), casecf),
        !           178:        C(PAIR('s', 'y'), casesy),
        !           179:        C(PAIR('l', 'f'), caself),
        !           180:        C(PAIR('!', 0), casesy),        /* synonym for .sy */
        !           181: };
        !           182: 
        !           183: 
        !           184: tchar oline[OLNSIZE];
        !           185: 
        !           186: /*
        !           187:  * troff environment block
        !           188:  */
        !           189: 
        !           190: struct env env = {
        !           191: /* int ics      */     0,      /* insertion character space, set by .mc */
        !           192: /* int sps      */     0,
        !           193: /* int spacesz  */     0,
        !           194: /* int lss      */     0,
        !           195: /* int lss1     */     0,
        !           196: /* int ll       */     0,
        !           197: /* int ll1      */     0,
        !           198: /* int lt       */     0,
        !           199: /* int lt1      */     0,
        !           200: /* tchar ic     */     0,      /* insertion character (= margin character) */
        !           201: /* int icf      */     0,      /* insertion character flag */
        !           202: /* tchar chbits         */     0,      /* size+font bits for current character */
        !           203: /* tchar spbits         */     0,
        !           204: /* tchar nmbits         */     0,      /* size+font bits for number from .nm */
        !           205: /* int apts     */     PS,     /* actual point size -- as requested by user */
        !           206: /* int apts1    */     PS,     /* need not match an existent size */
        !           207: /* int pts      */     PS,     /* hence, this is the size that really exists */
        !           208: /* int pts1     */     PS,
        !           209: /* int font     */     FT,
        !           210: /* int font1    */     FT,
        !           211: /* int ls       */     1,
        !           212: /* int ls1      */     1,
        !           213: /* int ad       */     1,
        !           214: /* int nms      */     1,      /* .nm multiplier */
        !           215: /* int ndf      */     1,      /* .nm separator */
        !           216: /* int fi       */     1,
        !           217: /* int cc       */     '.',
        !           218: /* int c2       */     '\'',
        !           219: /* int ohc      */     OHC,
        !           220: /* int tdelim   */     IMP,
        !           221: #ifdef NROFF
        !           222: /* int hyf      */     0,
        !           223: #else
        !           224: /* int hyf      */     1,
        !           225: #endif
        !           226: /* int hyoff    */     0,
        !           227: /* int un1      */     -1,
        !           228: /* int tabc     */     0,
        !           229: /* int dotc     */     '.',
        !           230: /* int adsp     */     0,      /* add this much space to each padding point */
        !           231: /* int adrem    */     0,      /* excess space to add until it runs out */
        !           232: /* int lastl    */     0,      /* last text on current output line */
        !           233: /* int nel      */     0,      /* how much space left on current output line */
        !           234: /* int admod    */     0,      /* adjust mode */
        !           235: /* tchar *wordp         */     0,
        !           236: /* int spflg    */     0,      /* probably to indicate space after punctuation needed */
        !           237: /* tchar *linep         */     0,
        !           238: /* tchar *wdend         */     0,
        !           239: /* tchar *wdstart */   0,
        !           240: /* int wne      */     0,
        !           241: /* int ne       */     0,      /* how much space taken on current output line */
        !           242: /* int nc       */     0,      /* #characters (incl blank) on output line */
        !           243: /* int nb       */     0,
        !           244: /* int lnmod    */     0,      /* line number mode, set by .nm */
        !           245: /* int nwd      */     0,      /* number of words on current output line */
        !           246: /* int nn       */     0,      /* from .nn command */
        !           247: /* int ni       */     0,      /* indent of .nm numbers, probably */
        !           248: /* int ul       */     0,
        !           249: /* int cu       */     0,
        !           250: /* int ce       */     0,
        !           251: /* int in       */     0,      /* indent and previous value */
        !           252: /* int in1      */     0,
        !           253: /* int un       */     0,      /* unindent of left margin in some way */
        !           254: /* int wch      */     0,
        !           255: /* int pendt    */     0,
        !           256: /* tchar *pendw         */     (tchar *)0,
        !           257: /* int pendnf   */     0,
        !           258: /* int spread   */     0,
        !           259: /* int it       */     0,      /* input trap count */
        !           260: /* int itmac    */     0,
        !           261: /* int lnsize   */     LNSIZE,
        !           262: };

unix.superglobalmegacorp.com

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