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