Commit | Line | Data |
---|---|---|
00a89a8a RC |
1 | /* sed.h 4.1 85/04/05 */ |
2 | ||
3 | /* | |
4 | * sed -- stream editor | |
5 | */ | |
6 | ||
7 | #define CBRA 1 | |
8 | #define CCHR 2 | |
9 | #define CDOT 4 | |
10 | #define CCL 6 | |
11 | #define CNL 8 | |
12 | #define CDOL 10 | |
13 | #define CEOF 11 | |
14 | #define CKET 12 | |
15 | #define CNULL 13 | |
16 | #define CLNUM 14 | |
17 | #define CEND 16 | |
18 | #define CDONT 17 | |
19 | #define CBACK 18 | |
20 | ||
21 | #define STAR 01 | |
22 | ||
23 | #define NLINES 256 | |
24 | #define DEPTH 20 | |
25 | #define PTRSIZE 200 | |
26 | #define RESIZE 10000 | |
27 | #define ABUFSIZE 20 | |
28 | #define LBSIZE 4000 | |
29 | #define ESIZE 256 | |
30 | #define LABSIZE 50 | |
31 | #define NBRA 9 | |
32 | ||
33 | FILE *fin; | |
34 | union reptr *abuf[ABUFSIZE]; | |
35 | union reptr **aptr; | |
36 | char *lastre; | |
37 | char ibuf[BUFSIZ]; | |
38 | char *cbp; | |
39 | char *ebp; | |
40 | char genbuf[LBSIZE]; | |
41 | char *loc1; | |
42 | char *loc2; | |
43 | char *locs; | |
44 | char seof; | |
45 | char *reend; | |
46 | char *lbend; | |
47 | char *hend; | |
48 | char *lcomend; | |
49 | union reptr *ptrend; | |
50 | int eflag; | |
51 | int dolflag; | |
52 | int sflag; | |
53 | int jflag; | |
54 | int numbra; | |
55 | int delflag; | |
56 | long lnum; | |
57 | char linebuf[LBSIZE+1]; | |
58 | char holdsp[LBSIZE+1]; | |
59 | char *spend; | |
60 | char *hspend; | |
61 | int nflag; | |
62 | int gflag; | |
63 | char *braelist[NBRA]; | |
64 | char *braslist[NBRA]; | |
65 | long tlno[NLINES]; | |
66 | int nlno; | |
67 | char fname[12][40]; | |
68 | FILE *fcode[12]; | |
69 | int nfiles; | |
70 | ||
71 | #define ACOM 01 | |
72 | #define BCOM 020 | |
73 | #define CCOM 02 | |
74 | #define CDCOM 025 | |
75 | #define CNCOM 022 | |
76 | #define COCOM 017 | |
77 | #define CPCOM 023 | |
78 | #define DCOM 03 | |
79 | #define ECOM 015 | |
80 | #define EQCOM 013 | |
81 | #define FCOM 016 | |
82 | #define GCOM 027 | |
83 | #define CGCOM 030 | |
84 | #define HCOM 031 | |
85 | #define CHCOM 032 | |
86 | #define ICOM 04 | |
87 | #define LCOM 05 | |
88 | #define NCOM 012 | |
89 | #define PCOM 010 | |
90 | #define QCOM 011 | |
91 | #define RCOM 06 | |
92 | #define SCOM 07 | |
93 | #define TCOM 021 | |
94 | #define WCOM 014 | |
95 | #define CWCOM 024 | |
96 | #define YCOM 026 | |
97 | #define XCOM 033 | |
98 | ||
99 | char *cp; | |
100 | char *reend; | |
101 | char *lbend; | |
102 | ||
103 | union reptr { | |
104 | struct reptr1 { | |
105 | char *ad1; | |
106 | char *ad2; | |
107 | char *re1; | |
108 | char *rhs; | |
109 | FILE *fcode; | |
110 | char command; | |
111 | char gfl; | |
112 | char pfl; | |
113 | char inar; | |
114 | char negfl; | |
115 | } A; | |
116 | struct reptr2 { | |
117 | char *ad1; | |
118 | char *ad2; | |
119 | union reptr *lb1; | |
120 | char *rhs; | |
121 | FILE *fcode; | |
122 | char command; | |
123 | char gfl; | |
124 | char pfl; | |
125 | char inar; | |
126 | char negfl; | |
127 | } B; | |
128 | } ptrspace[PTRSIZE], *rep; | |
129 | ||
130 | ||
131 | char respace[RESIZE]; | |
132 | ||
133 | struct label { | |
134 | char asc[9]; | |
135 | union reptr *chain; | |
136 | union reptr *address; | |
137 | } ltab[LABSIZE]; | |
138 | ||
139 | struct label *lab; | |
140 | struct label *labend; | |
141 | ||
142 | int f; | |
143 | int depth; | |
144 | ||
145 | int eargc; | |
146 | char **eargv; | |
147 | ||
148 | extern char bittab[]; | |
149 | ||
150 | union reptr **cmpend[DEPTH]; | |
151 | int depth; | |
152 | union reptr *pending; | |
153 | char *badp; | |
154 | char bad; | |
155 | char *compile(); | |
156 | char *ycomp(); | |
157 | char *address(); | |
158 | char *text(); | |
159 | char *compsub(); | |
160 | struct label *search(); | |
161 | char *gline(); | |
162 | char *place(); | |
163 | char compfl; |