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