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