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