1: #include <signal.h>
2: #include <sgtty.h>
3:
4: /* printer parameters */
5: #define BSPEED B2400
6: #define HOR 1 /* 1 mil */
7: #define VERT 3 /* actually 3.5 mil */
8: #define PTID 0
9: #define FT 0 /*default font position*/
10: #define PFONT 3 /* maximum number of proportional fonts in -F option */
11: /*
12: * default spacings
13: */
14: #define INCH 1000 /*increments per inch*/
15: #define stou(x) (int)((long)(x)*7/2) /* internal vertical steps to units */
16: #ifdef PGOFF
17: #define PO INCH /*page offset*/
18: #else
19: #define PO 0
20: #endif
21: #define DTAB INCH/2 /* tab stops */
22: #define NDTAB INCH/10*8 /* tabs for -nroff */
23: #define LL (6*INCH+INCH/2) /*line length; 39picas=6.5in*/
24: #define SD_LL (7*INCH) /* printer default line length */
25: #define TOP_MARG INCH/2 /* printer (hard) top margin */
26: #define VS INCH/6 /*vert space; 12points*/
27:
28: #define LG 0
29:
30: /*
31: * internal characters
32: */
33: #define LEADER 001
34: #define IMP 004 /*impossible char*/
35: #define TAB 011
36: #define COLON 013
37: #define RPT 014
38: #define OHC 024
39: #define CONT 025
40: #define PRESC 026
41: #define UNPAD 027
42: #define XPAR 030
43: #define FLSS 031
44: #define TDELIM 032
45: #define ESC 033
46: #define LEFT 035
47: #define RIGHT 036
48: #define FILLER 037
49: #define JREG 0374
50: #define LX 0375 /*low-order part of xlss*/
51: #define HX 0376 /*High-order part of xlss*/
52:
53:
54: /*
55: * output characters
56: */
57:
58: /* ascii control characters */
59: #define C_DEL 0177 /* DEL, 0177 */
60: #define C_NUL 0200 /* NULL */
61: #define C_BS 0201 /* backspace */
62: #define C_TAB 0202 /* horizontal tab */
63: #define C_LF 0203 /* linefeed */
64: #define C_FF 0204 /* formfeed */
65: #define C_CR 0205 /* carriage return */
66: #define C_ESC 0206 /* ESC, 033 */
67: /* sanders escape sequences */
68: #define S_FT 0212 /* select font */
69: #define S_AD 0221 /* select format (adjust) */
70: #define S_LL 0222 /* set line length */
71: #define S_TI 0223 /* set temporary indent */
72: #define S_IN 0224 /* set indent */
73: #define S_WS 0225 /* set word spacing */
74: #define S_PL 0226 /* set page length */
75: /* characters receiving special handling */
76: #define C_HY 055 /* hyphen */
77: #define C_RN 0311 /* root en */
78: #define C_BR 0341 /* vertical box rule */
79: #define C_VB 0372 /* single vertical bar */
80: #define C_UR 0347 /* underrule */
81: #define C_EM 0350 /* 3/4 em dash */
82: #define MAXCHAR 0373 /* 1 greater than max printing character */
83:
84: /*
85: * Sanders escape sequences used internally (sent directly)
86: */
87: #define SE_CHFONT "\033a" /* change font */
88: #define SE_MOUNT "\033d" /* mount font */
89: #define SE_DRAFT "\033t" /* mount font */
90: #define SE_LMARGIN "\033f" /* set page offset */
91:
92: #define SE_VMOT "\033o" /* vertical motion */
93: #define SE_VBLOCK 2047 /* chunks for vertical motion */
94: #define SE_UPBL "\033o`A" /* up VBLOCK */
95: #define SE_DOWNBL "\033o_\177" /* down VBLOCK */
96: #define SE_UP1 "\033o\177\177" /* up 1 step */
97: #define SE_DOWN1 "\033o@A" /* down 1 step */
98:
99: #define SE_HMOT "\033l" /* horizontal motion */
100: #define SE_HBLOCK 2047 /* chunks for horizontal motion */
101: #define SE_LEFTBL "\033l`A" /* left HBLOCK */
102: #define SE_RIGHTBL "\033l_\177" /* right HBLOCK */
103:
104:
105: #define ZONE 8 /*8hrs for PST*/
106: /*
107: * fonts; bits in chbits
108: */
109: #define ZBIT 010000 /*zero width char*/
110: #define ULMODE 020000 /* underline this character */
111: #define EBIT 040000 /* stan, character in escape sequence for sanders */
112: #define NFONTS 8 /* power of 2, maximum 16 */
113: #define FONTSHFT 8 /* position of font bits in chbits */
114: #define FONTMSK (NFONTS-1) /* physical font in fonts[] */
115: #define PROPOR 0100 /* physical font is proportional */
116: #define getfont(i) ((i>>FONTSHFT)&FONTMSK) /* font of char i */
117:
118: /* more bit masks */
119: #define DBL 0100000 /*double size indicator*/
120: #define MOT 0100000 /*motion character indicator*/
121: #define MOTV 0160000 /*clear for motion part*/
122: #define VMOT 0040000 /*vert motion bit*/
123: #define NMOT 0020000 /* negative motion indicator*/
124: #define MMASK 0100000 /*macro mask indicator*/
125: #define CMASK 0100377
126: #define WDMASK 01777 /* width part of *fontab */
127: #define BMASK 0377
128: #define BYTE 8
129: #define TMASK 037777
130: #define RTAB 0100000
131: #define CTAB 0040000
132:
133:
134: #define PAIR(A,B) (A|(B<<BYTE))
135:
136: /* array sizes and limits */
137: #define NN 200 /*number registers*/
138: /* NN changed Jan 31 from 132 */
139: #define NNAMES 14 /*predefined reg names*/
140: #define NIF 15 /*if-else nesting*/
141: #define NEV 3 /*environments*/
142: #define EVLSZ 10 /*size of ev stack*/
143: #define EVS 4*256 /*environment size in words*/
144: /* BWK - trying 4*256 instead of 3*256 */
145: #ifdef VMUNIX
146: #define NM 500 /*requests + macros */
147: #else
148: #define NM 300 /*requests + macros*/
149: #endif
150: #define NHYP 10 /*max hyphens per word*/
151: #define NHEX 128 /*byte size of exception word list*/
152: #define NTAB 35 /*tab stops*/
153: #define NSO 5 /*"so" depth*/
154: #define NDI 5 /*number of diversions*/
155: #define NPN 20 /*numbers in "-o"*/
156: #define NPP 10 /*pads per field*/
157: #define NOV 10 /*number of overstrike chars*/
158: #define NTRAP 20 /*number of traps*/
159:
160: /* buffer sizes */
161: #define NS 64 /*name buffer*/
162: #define NTM 256 /*tm buffer*/
163: #define DELTA 512 /*delta core bytes*/
164: #define WDSIZE 200 /*stan, changed from 170, word buffer size*/
165: #define LNSIZE 680 /*line buffer size*/
166: /* BWK - changed from 480 after EVS changed */
167: #define FBUFSZ 256 /*field buf size words*/
168: #define OBUFSZ 512 /*bytes*/
169: #define IBUFSZ 512 /*bytes*/
170: #define NC 256 /*cbuf size words*/
171: #ifdef VMUNIX
172: #define MAXPTR (char *)0x7fffffff /* max value of any pointer variable */
173: #else
174: #define MAXPTR (char *)(-1) /* max value of any pointer variable */
175: #endif
176:
177: /* temp file management */
178: #define BLK 128 /*alloc block words*/
179: #define TEMP 512 /*65Kw*/
180: #ifdef BIG
181: typedef long filep;
182: #define NBLIST BIG /*allocation , BIG = 256 per 65k*/
183: #define BLKBITS 7 /*for BLK=128*/
184: #endif
185: #ifndef BIG
186: typedef unsigned filep;
187: #define NBLIST TEMP /*allocation list, TEMP<=512*/
188: /* BLK*NBLIST<=65536 words, if filep=unsigned */
189: #define BLKBITS 0
190: #endif
Defined typedef's
filep
defined in line
181; used 69 times
- in line 186
- in /usr/src/local/sroff/s1.c line
27-29(3),
123,
391,
399
- in /usr/src/local/sroff/s2.c line
16-17(2),
35
- in /usr/src/local/sroff/s3.c line
15-17(3),
42-45(3),
98-99(2),
138-159(9),
201,
262-266(3),
280-293(4),
321,
338,
344,
354-356(2),
365-369(3),
375,
397,
455,
567,
586-587(2),
594-597(2),
609-612(2),
631,
640
- in /usr/src/local/sroff/s5.c line
15-16(2),
644-647(4),
654,
709
- in /usr/src/local/sroff/sii.c line
45,
67-75(3),
82-84(2)
Defined macros
BLK
defined in line
178; used 12 times
BMASK
defined in line
127; used 12 times
BSPEED
defined in line
5; used 1 times
BYTE
defined in line
128; used 7 times
CMASK
defined in line
125; used 109 times
- in /usr/src/local/sroff/s1.c line
249-252(2),
260,
421,
432,
460,
492,
545,
617,
672-677(4),
742,
757-758(2),
784,
853,
888
- in /usr/src/local/sroff/s10.c line
128,
189
- in /usr/src/local/sroff/s2.c line
67,
90,
100
- in /usr/src/local/sroff/s3.c line
193,
212,
256-257(2),
485-492(4),
516,
577-580(3),
620-621(2)
- in /usr/src/local/sroff/s4.c line
59,
254,
297,
305,
312,
330,
347,
362-367(2),
374,
465,
491
- in /usr/src/local/sroff/s5.c line
107,
198-199(2),
571,
582,
613-614(2),
631,
652,
659,
671,
748,
781-783(2)
- in /usr/src/local/sroff/s6.c line
59,
71,
84,
132-133(2),
142,
174,
181,
251
- in /usr/src/local/sroff/s7.c line
150-155(2),
235,
292,
332,
516,
570-573(2),
635,
682-685(2),
724
- in /usr/src/local/sroff/s8.c line
74,
103,
140-143(2),
166,
211,
234
- in /usr/src/local/sroff/s9.c line
38,
48-51(2),
65,
90,
99-100(2),
138-140(2),
151-155(2),
176,
187,
237-239(2),
268,
316
COLON
defined in line
36; used 1 times
CONT
defined in line
39; used 3 times
CTAB
defined in line
131; used 1 times
C_BR
defined in line
78;
never used
C_BS
defined in line
61;
never used
C_CR
defined in line
65;
never used
C_DEL
defined in line
59;
never used
C_EM
defined in line
81; used 2 times
C_ESC
defined in line
66;
never used
C_FF
defined in line
64;
never used
C_HY
defined in line
76; used 2 times
C_LF
defined in line
63;
never used
C_NUL
defined in line
60;
never used
C_RN
defined in line
77;
never used
C_TAB
defined in line
62;
never used
C_UR
defined in line
80;
never used
C_VB
defined in line
79; used 1 times
DBL
defined in line
119;
never used
DTAB
defined in line
21; used 16 times
EBIT
defined in line
111; used 10 times
ESC
defined in line
45; used 2 times
EVS
defined in line
143; used 9 times
FLSS
defined in line
43; used 3 times
FT
defined in line
9; used 2 times
HOR
defined in line
6; used 3 times
HX
defined in line
51; used 1 times
IMP
defined in line
34; used 13 times
INCH
defined in line
14; used 18 times
JREG
defined in line
49; used 2 times
LEFT
defined in line
46; used 5 times
LG
defined in line
28; used 1 times
LL
defined in line
23; used 4 times
LX
defined in line
50; used 1 times
MOT
defined in line
120; used 32 times
- in /usr/src/local/sroff/s1.c line
433,
461,
756,
858
- in /usr/src/local/sroff/s10.c line
172,
183
- in /usr/src/local/sroff/s2.c line
66
- in /usr/src/local/sroff/s3.c line
574
- in /usr/src/local/sroff/s5.c line
197,
651,
782(2)
- in /usr/src/local/sroff/s6.c line
53,
174,
183,
242
- in /usr/src/local/sroff/s7.c line
453-459(3),
723
- in /usr/src/local/sroff/s8.c line
101
- in /usr/src/local/sroff/s9.c line
31,
37,
98,
137,
150-154(2),
167,
175,
236-239(2),
311
MOTV
defined in line
121; used 5 times
NC
defined in line
170; used 6 times
NDI
defined in line
154; used 1 times
NDTAB
defined in line
22; used 1 times
NEV
defined in line
141; used 5 times
NHEX
defined in line
151; used 3 times
NHYP
defined in line
150; used 9 times
NIF
defined in line
140; used 2 times
NM
defined in line
148; used 8 times
NMOT
defined in line
123; used 7 times
NN
defined in line
137; used 13 times
NOV
defined in line
157; used 3 times
NPN
defined in line
155; used 2 times
NPP
defined in line
156; used 2 times
NS
defined in line
161; used 3 times
NSO
defined in line
153; used 6 times
NTAB
defined in line
152; used 4 times
NTM
defined in line
162; used 3 times
NTRAP
defined in line
158; used 16 times
OHC
defined in line
38; used 3 times
PAIR
defined in line
134; used 100 times
PFONT
defined in line
10; used 7 times
PO
defined in line
19; used 1 times
PRESC
defined in line
40; used 2 times
PTID
defined in line
8; used 1 times
RIGHT
defined in line
47; used 3 times
RPT
defined in line
37; used 3 times
RTAB
defined in line
130; used 2 times
SD_LL
defined in line
24; used 1 times
S_AD
defined in line
69; used 1 times
S_FT
defined in line
68;
never used
S_IN
defined in line
72; used 1 times
S_LL
defined in line
70; used 1 times
S_PL
defined in line
74; used 1 times
S_TI
defined in line
71; used 1 times
S_WS
defined in line
73; used 1 times
TAB
defined in line
35; used 1 times
TEMP
defined in line
179; used 1 times
UNPAD
defined in line
41; used 2 times
VERT
defined in line
7; used 3 times
VMOT
defined in line
122; used 6 times
VS
defined in line
26; used 2 times
XPAR
defined in line
42; used 2 times
ZBIT
defined in line
109; used 9 times
ZONE
defined in line
105; used 1 times
stou
defined in line
15; used 1 times
Usage of this include