xref: /titanic_50/usr/src/lib/libcurses/screen/maketerm.ed (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate!#ident	"%Z%%M%	%I%	%E% SMI"
2*7c478bd9Sstevel@tonic-gateH
3*7c478bd9Sstevel@tonic-gate!rm -f bool num str boolnames numnames strnames boolvals numvals strvals tnames.c tinames.c tifnames.c term.h ./tmp/term.h.new ./tmp/tmp.awk ./tmp/term.h
4*7c478bd9Sstevel@tonic-gatee caps
5*7c478bd9Sstevel@tonic-gateg/^#/d
6*7c478bd9Sstevel@tonic-gate/--- begin bool/+1,/--- end bool/-1 w bool
7*7c478bd9Sstevel@tonic-gate/--- begin num/+1,/--- end num/-1 w num
8*7c478bd9Sstevel@tonic-gate/--- begin str/+1,/--- end str/-1 w str
9*7c478bd9Sstevel@tonic-gateE bool
10*7c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
11*7c478bd9Sstevel@tonic-gate1,$s/.*	"/"/
12*7c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
13*7c478bd9Sstevel@tonic-gate+,$j
14*7c478bd9Sstevel@tonic-gate1i
15*7c478bd9Sstevel@tonic-gatechar	*boolnames[] =
16*7c478bd9Sstevel@tonic-gate	{
17*7c478bd9Sstevel@tonic-gate.
18*7c478bd9Sstevel@tonic-gate$a
19*7c478bd9Sstevel@tonic-gate0
20*7c478bd9Sstevel@tonic-gate	};
21*7c478bd9Sstevel@tonic-gate
22*7c478bd9Sstevel@tonic-gate.
23*7c478bd9Sstevel@tonic-gatew tinames.c
24*7c478bd9Sstevel@tonic-gatee bool
25*7c478bd9Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
26*7c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
27*7c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
28*7c478bd9Sstevel@tonic-gate+,$j
29*7c478bd9Sstevel@tonic-gate1i
30*7c478bd9Sstevel@tonic-gatechar	*boolcodes[] =
31*7c478bd9Sstevel@tonic-gate	{
32*7c478bd9Sstevel@tonic-gate.
33*7c478bd9Sstevel@tonic-gate$a
34*7c478bd9Sstevel@tonic-gate0
35*7c478bd9Sstevel@tonic-gate	};
36*7c478bd9Sstevel@tonic-gate
37*7c478bd9Sstevel@tonic-gate.
38*7c478bd9Sstevel@tonic-gatew tnames.c
39*7c478bd9Sstevel@tonic-gatee bool
40*7c478bd9Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
41*7c478bd9Sstevel@tonic-gate1,$-4g/^/.,+3j
42*7c478bd9Sstevel@tonic-gate+,$j
43*7c478bd9Sstevel@tonic-gate1i
44*7c478bd9Sstevel@tonic-gatechar	*boolfnames[] =
45*7c478bd9Sstevel@tonic-gate	{
46*7c478bd9Sstevel@tonic-gate.
47*7c478bd9Sstevel@tonic-gate$a
48*7c478bd9Sstevel@tonic-gate0
49*7c478bd9Sstevel@tonic-gate	};
50*7c478bd9Sstevel@tonic-gate
51*7c478bd9Sstevel@tonic-gate.
52*7c478bd9Sstevel@tonic-gatew tifnames.c
53*7c478bd9Sstevel@tonic-gatee bool
54*7c478bd9Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
55*7c478bd9Sstevel@tonic-gate1,$s;$; */;
56*7c478bd9Sstevel@tonic-gate1,$s;^;	;
57*7c478bd9Sstevel@tonic-gate1i
58*7c478bd9Sstevel@tonic-gate    char
59*7c478bd9Sstevel@tonic-gate.
60*7c478bd9Sstevel@tonic-gate$a
61*7c478bd9Sstevel@tonic-gate	Sentinel;		/* End of bools. DO NOT MOVE! */
62*7c478bd9Sstevel@tonic-gate.
63*7c478bd9Sstevel@tonic-gatew boolvals
64*7c478bd9Sstevel@tonic-gatee num
65*7c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
66*7c478bd9Sstevel@tonic-gate1,$s/.*	"/"/
67*7c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
68*7c478bd9Sstevel@tonic-gate+,$j
69*7c478bd9Sstevel@tonic-gate1i
70*7c478bd9Sstevel@tonic-gatechar	*numnames[] =
71*7c478bd9Sstevel@tonic-gate	{
72*7c478bd9Sstevel@tonic-gate.
73*7c478bd9Sstevel@tonic-gate$a
74*7c478bd9Sstevel@tonic-gate0
75*7c478bd9Sstevel@tonic-gate	};
76*7c478bd9Sstevel@tonic-gate
77*7c478bd9Sstevel@tonic-gate.
78*7c478bd9Sstevel@tonic-gate0r tinames.c
79*7c478bd9Sstevel@tonic-gatew tinames.c
80*7c478bd9Sstevel@tonic-gatee num
81*7c478bd9Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
82*7c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
83*7c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
84*7c478bd9Sstevel@tonic-gate+,$j
85*7c478bd9Sstevel@tonic-gate1i
86*7c478bd9Sstevel@tonic-gatechar	*numcodes[] =
87*7c478bd9Sstevel@tonic-gate	{
88*7c478bd9Sstevel@tonic-gate.
89*7c478bd9Sstevel@tonic-gate$a
90*7c478bd9Sstevel@tonic-gate0
91*7c478bd9Sstevel@tonic-gate	};
92*7c478bd9Sstevel@tonic-gate
93*7c478bd9Sstevel@tonic-gate.
94*7c478bd9Sstevel@tonic-gate0r tnames.c
95*7c478bd9Sstevel@tonic-gatew tnames.c
96*7c478bd9Sstevel@tonic-gatee num
97*7c478bd9Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
98*7c478bd9Sstevel@tonic-gate1,$-4g/^/.,+3j
99*7c478bd9Sstevel@tonic-gate+,$j
100*7c478bd9Sstevel@tonic-gate1i
101*7c478bd9Sstevel@tonic-gatechar	*numfnames[] =
102*7c478bd9Sstevel@tonic-gate	{
103*7c478bd9Sstevel@tonic-gate.
104*7c478bd9Sstevel@tonic-gate$a
105*7c478bd9Sstevel@tonic-gate0
106*7c478bd9Sstevel@tonic-gate	};
107*7c478bd9Sstevel@tonic-gate
108*7c478bd9Sstevel@tonic-gate.
109*7c478bd9Sstevel@tonic-gate0r tifnames.c
110*7c478bd9Sstevel@tonic-gatew tifnames.c
111*7c478bd9Sstevel@tonic-gatee num
112*7c478bd9Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
113*7c478bd9Sstevel@tonic-gate1,$s;$; */;
114*7c478bd9Sstevel@tonic-gate1,$s;^;	;
115*7c478bd9Sstevel@tonic-gate1i
116*7c478bd9Sstevel@tonic-gate    short
117*7c478bd9Sstevel@tonic-gate.
118*7c478bd9Sstevel@tonic-gate$a
119*7c478bd9Sstevel@tonic-gate	Sentinel;		/* End of nums. DO NOT MOVE! */
120*7c478bd9Sstevel@tonic-gate.
121*7c478bd9Sstevel@tonic-gatew numvals
122*7c478bd9Sstevel@tonic-gatee str
123*7c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
124*7c478bd9Sstevel@tonic-gate1,$s/.*	"/"/
125*7c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
126*7c478bd9Sstevel@tonic-gate+,$j
127*7c478bd9Sstevel@tonic-gate1i
128*7c478bd9Sstevel@tonic-gatechar	*strnames[] =
129*7c478bd9Sstevel@tonic-gate	{
130*7c478bd9Sstevel@tonic-gate.
131*7c478bd9Sstevel@tonic-gate$a
132*7c478bd9Sstevel@tonic-gate0
133*7c478bd9Sstevel@tonic-gate	};
134*7c478bd9Sstevel@tonic-gate
135*7c478bd9Sstevel@tonic-gate.
136*7c478bd9Sstevel@tonic-gate0r tinames.c
137*7c478bd9Sstevel@tonic-gatew tinames.c
138*7c478bd9Sstevel@tonic-gatee str
139*7c478bd9Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
140*7c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
141*7c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
142*7c478bd9Sstevel@tonic-gate+,$j
143*7c478bd9Sstevel@tonic-gate1i
144*7c478bd9Sstevel@tonic-gatechar	*strcodes[] =
145*7c478bd9Sstevel@tonic-gate	{
146*7c478bd9Sstevel@tonic-gate.
147*7c478bd9Sstevel@tonic-gate$a
148*7c478bd9Sstevel@tonic-gate0
149*7c478bd9Sstevel@tonic-gate	};
150*7c478bd9Sstevel@tonic-gate
151*7c478bd9Sstevel@tonic-gate.
152*7c478bd9Sstevel@tonic-gate0r tnames.c
153*7c478bd9Sstevel@tonic-gatew tnames.c
154*7c478bd9Sstevel@tonic-gatee str
155*7c478bd9Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
156*7c478bd9Sstevel@tonic-gate1,$-4g/^/.,+3j
157*7c478bd9Sstevel@tonic-gate+,$j
158*7c478bd9Sstevel@tonic-gate1i
159*7c478bd9Sstevel@tonic-gatechar	*strfnames[] =
160*7c478bd9Sstevel@tonic-gate	{
161*7c478bd9Sstevel@tonic-gate.
162*7c478bd9Sstevel@tonic-gate$a
163*7c478bd9Sstevel@tonic-gate0
164*7c478bd9Sstevel@tonic-gate	};
165*7c478bd9Sstevel@tonic-gate
166*7c478bd9Sstevel@tonic-gate.
167*7c478bd9Sstevel@tonic-gate0r tifnames.c
168*7c478bd9Sstevel@tonic-gatew tifnames.c
169*7c478bd9Sstevel@tonic-gatee str
170*7c478bd9Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
171*7c478bd9Sstevel@tonic-gate1,$s;$; */;
172*7c478bd9Sstevel@tonic-gate1,$s;^;	strs.;
173*7c478bd9Sstevel@tonic-gate$a
174*7c478bd9Sstevel@tonic-gate	Sentinel;		/* End of strings. DO NOT MOVE! */
175*7c478bd9Sstevel@tonic-gate.
176*7c478bd9Sstevel@tonic-gatew strvals
177*7c478bd9Sstevel@tonic-gate1,$d
178*7c478bd9Sstevel@tonic-gater tnames.c
179*7c478bd9Sstevel@tonic-gate1i
180*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
181*7c478bd9Sstevel@tonic-gate
182*7c478bd9Sstevel@tonic-gate/* tnames.c: Made automatically from caps and maketerm.ed - don't edit me! */
183*7c478bd9Sstevel@tonic-gate.
184*7c478bd9Sstevel@tonic-gate1,$s/ $//
185*7c478bd9Sstevel@tonic-gate0r copyright.h
186*7c478bd9Sstevel@tonic-gate/copyright\.h/d
187*7c478bd9Sstevel@tonic-gatew tnames.c
188*7c478bd9Sstevel@tonic-gate1,$d
189*7c478bd9Sstevel@tonic-gater tinames.c
190*7c478bd9Sstevel@tonic-gate1i
191*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
192*7c478bd9Sstevel@tonic-gate
193*7c478bd9Sstevel@tonic-gate/* tinames.c: Made automatically from caps and maketerm.ed - don't edit me! */
194*7c478bd9Sstevel@tonic-gate.
195*7c478bd9Sstevel@tonic-gate1,$s/ $//
196*7c478bd9Sstevel@tonic-gate0r copyright.h
197*7c478bd9Sstevel@tonic-gate/copyright\.h/d
198*7c478bd9Sstevel@tonic-gatew tinames.c
199*7c478bd9Sstevel@tonic-gate1,$d
200*7c478bd9Sstevel@tonic-gater tifnames.c
201*7c478bd9Sstevel@tonic-gate1i
202*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
203*7c478bd9Sstevel@tonic-gate
204*7c478bd9Sstevel@tonic-gate/* tifnames.c: Made automatically from caps and maketerm.ed - don't edit me! */
205*7c478bd9Sstevel@tonic-gate.
206*7c478bd9Sstevel@tonic-gate1,$s/ $//
207*7c478bd9Sstevel@tonic-gate0r copyright.h
208*7c478bd9Sstevel@tonic-gate/copyright\.h/d
209*7c478bd9Sstevel@tonic-gatew tifnames.c
210*7c478bd9Sstevel@tonic-gatee bool
211*7c478bd9Sstevel@tonic-gate1,$d
212*7c478bd9Sstevel@tonic-gatea
213*7c478bd9Sstevel@tonic-gate
214*7c478bd9Sstevel@tonic-gatetypedef char *charptr;
215*7c478bd9Sstevel@tonic-gatestruct strs {
216*7c478bd9Sstevel@tonic-gate    charptr
217*7c478bd9Sstevel@tonic-gate.
218*7c478bd9Sstevel@tonic-gater strvals
219*7c478bd9Sstevel@tonic-gate1,.s/strs\.//
220*7c478bd9Sstevel@tonic-gate$a
221*7c478bd9Sstevel@tonic-gate};
222*7c478bd9Sstevel@tonic-gate
223*7c478bd9Sstevel@tonic-gatestruct _bool_struct {
224*7c478bd9Sstevel@tonic-gate.
225*7c478bd9Sstevel@tonic-gater boolvals
226*7c478bd9Sstevel@tonic-gatea
227*7c478bd9Sstevel@tonic-gate};
228*7c478bd9Sstevel@tonic-gate
229*7c478bd9Sstevel@tonic-gatestruct _num_struct {
230*7c478bd9Sstevel@tonic-gate.
231*7c478bd9Sstevel@tonic-gater numvals
232*7c478bd9Sstevel@tonic-gatea
233*7c478bd9Sstevel@tonic-gate};
234*7c478bd9Sstevel@tonic-gate.
235*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
236*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
237*7c478bd9Sstevel@tonic-gateg/^	./s/^	/	_/
238*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
239*7c478bd9Sstevel@tonic-gatee boolvals
240*7c478bd9Sstevel@tonic-gate.kb
241*7c478bd9Sstevel@tonic-gate.r numvals
242*7c478bd9Sstevel@tonic-gate.kn
243*7c478bd9Sstevel@tonic-gate1,$v/^	/d
244*7c478bd9Sstevel@tonic-gate1,$s/^	//
245*7c478bd9Sstevel@tonic-gate1,$s/	[^	].*/	/
246*7c478bd9Sstevel@tonic-gate1,$s/,/ /
247*7c478bd9Sstevel@tonic-gate1,'bs/.*/#define	&	CURB _&/
248*7c478bd9Sstevel@tonic-gate'b+1,'ns/.*/#define	&	CURN _&/
249*7c478bd9Sstevel@tonic-gate1,$g/;/d
250*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new2
251*7c478bd9Sstevel@tonic-gatee strvals
252*7c478bd9Sstevel@tonic-gate1,$v/^	/d
253*7c478bd9Sstevel@tonic-gate1,$s/^	//
254*7c478bd9Sstevel@tonic-gate1,$s/	[^	].*/	/
255*7c478bd9Sstevel@tonic-gate1,$s/,/ /
256*7c478bd9Sstevel@tonic-gate1,$s/.*/#define	&	CURS _&/
257*7c478bd9Sstevel@tonic-gate1,$s/strs\.//
258*7c478bd9Sstevel@tonic-gate1,$s/strs.\(.\)/strs._\1/
259*7c478bd9Sstevel@tonic-gate1,$g/;/d
260*7c478bd9Sstevel@tonic-gatew
261*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new2
262*7c478bd9Sstevel@tonic-gate$r strvals
263*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new1
264*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new1
265*7c478bd9Sstevel@tonic-gate$r ./tmp/term.h.new
266*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
267*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
268*7c478bd9Sstevel@tonic-gate1,$s/[ 	]*$//
269*7c478bd9Sstevel@tonic-gate1,$s/CURS _strs/CURS strs/
270*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
271*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
272*7c478bd9Sstevel@tonic-gate1;/CURS strs/+100;.,+99s/CURS strs/CURS strs2/
273*7c478bd9Sstevel@tonic-gate.+1,+100s/CURS strs/CURS strs3/
274*7c478bd9Sstevel@tonic-gate.+1,$s/CURS strs/CURS strs4/
275*7c478bd9Sstevel@tonic-gate/^struct strs/+101s/,/;/
276*7c478bd9Sstevel@tonic-gatea
277*7c478bd9Sstevel@tonic-gate};
278*7c478bd9Sstevel@tonic-gate
279*7c478bd9Sstevel@tonic-gatestruct strs2 {
280*7c478bd9Sstevel@tonic-gate    charptr
281*7c478bd9Sstevel@tonic-gate.
282*7c478bd9Sstevel@tonic-gate+100s/,/;/
283*7c478bd9Sstevel@tonic-gatea
284*7c478bd9Sstevel@tonic-gate};
285*7c478bd9Sstevel@tonic-gate
286*7c478bd9Sstevel@tonic-gatestruct strs3 {
287*7c478bd9Sstevel@tonic-gate    charptr
288*7c478bd9Sstevel@tonic-gate.
289*7c478bd9Sstevel@tonic-gate+100s/,/;/
290*7c478bd9Sstevel@tonic-gatea
291*7c478bd9Sstevel@tonic-gate};
292*7c478bd9Sstevel@tonic-gate
293*7c478bd9Sstevel@tonic-gatestruct strs4 {
294*7c478bd9Sstevel@tonic-gate    charptr
295*7c478bd9Sstevel@tonic-gate.
296*7c478bd9Sstevel@tonic-gate1,$s/_Sentinel/Sentinel/
297*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
298*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
299*7c478bd9Sstevel@tonic-gateg/[ 	.]_cursor_/s/_cursor_/_crsr_/
300*7c478bd9Sstevel@tonic-gateg/[ 	.]_delete_/s/_delete_/_dlt_/
301*7c478bd9Sstevel@tonic-gateg/[ 	.]_enter_/s/_enter_/_entr_/
302*7c478bd9Sstevel@tonic-gateg/[ 	.]_insert_/s/_insert_/_ins_/
303*7c478bd9Sstevel@tonic-gateg/[ 	.]_key_/s/_key_/_ky_/
304*7c478bd9Sstevel@tonic-gateg/[ 	.]_keypad_/s/_keypad_/_kpad_/
305*7c478bd9Sstevel@tonic-gateg/[ 	.]_label_/s/_label_/_labl_/
306*7c478bd9Sstevel@tonic-gateg/[ 	.]_memory_/s/_memory_/_mem_/
307*7c478bd9Sstevel@tonic-gateg/[ 	.]_parm_/s/_parm_/_prm_/
308*7c478bd9Sstevel@tonic-gateg/[ 	.]_scroll_/s/_scroll_/_scrll_/
309*7c478bd9Sstevel@tonic-gateg/^	_......[,;]			\//s/,	/,/
310*7c478bd9Sstevel@tonic-gateg/^	_..............[,;]		\//s/,	/,/
311*7c478bd9Sstevel@tonic-gateg/^	_......................[,;]	\//s/,	/,/
312*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
313*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
314*7c478bd9Sstevel@tonic-gate!# the following lines GO away when Vr2 compat code goes away
315*7c478bd9Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/s/CURB.*/CUR _b/
316*7c478bd9Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/w ./tmp/tmp.term.h
317*7c478bd9Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/d
318*7c478bd9Sstevel@tonic-gate!/usr/bin/echo '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
319*7c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
320*7c478bd9Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/s/CURN.*/CUR _c/
321*7c478bd9Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/w ./tmp/tmp.term.h
322*7c478bd9Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/d
323*7c478bd9Sstevel@tonic-gate!/usr/bin/echo '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
324*7c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
325*7c478bd9Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/s/CURS.*/CUR _Vr2_Astrs._s/
326*7c478bd9Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/w ./tmp/tmp.term.h
327*7c478bd9Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/d
328*7c478bd9Sstevel@tonic-gate!/usr/bin/echo '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
329*7c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
330*7c478bd9Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/s/CURS.*/CUR _Vr2_Bstrs._s/
331*7c478bd9Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/w ./tmp/tmp.term.h
332*7c478bd9Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/d
333*7c478bd9Sstevel@tonic-gate!/usr/bin/echo 'BEGIN{i=100}\n{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
334*7c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
335*7c478bd9Sstevel@tonic-gate!rm -f ./tmp/tmp.term.h ./tmp/tmp.awk
336*7c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
337*7c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
338*7c478bd9Sstevel@tonic-gate!# Vr2 compat code ends here
339*7c478bd9Sstevel@tonic-gate1i
340*7c478bd9Sstevel@tonic-gate#ifndef	_TERM_H
341*7c478bd9Sstevel@tonic-gate#define	_TERM_H
342*7c478bd9Sstevel@tonic-gate
343*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
344*7c478bd9Sstevel@tonic-gate
345*7c478bd9Sstevel@tonic-gate/*
346*7c478bd9Sstevel@tonic-gate * term.h - this file is automatically made from caps and maketerm.ed.
347*7c478bd9Sstevel@tonic-gate * Don't make changes directly to term.h.
348*7c478bd9Sstevel@tonic-gate */
349*7c478bd9Sstevel@tonic-gate
350*7c478bd9Sstevel@tonic-gate#ifdef	__cplusplus
351*7c478bd9Sstevel@tonic-gateextern "C" {
352*7c478bd9Sstevel@tonic-gate#endif
353*7c478bd9Sstevel@tonic-gate
354*7c478bd9Sstevel@tonic-gate.
355*7c478bd9Sstevel@tonic-gate$a
356*7c478bd9Sstevel@tonic-gate
357*7c478bd9Sstevel@tonic-gatestruct _str_struct {
358*7c478bd9Sstevel@tonic-gate	struct strs strs;
359*7c478bd9Sstevel@tonic-gate	struct strs2 strs2;
360*7c478bd9Sstevel@tonic-gate	struct strs3 strs3;
361*7c478bd9Sstevel@tonic-gate	struct strs4 strs4;
362*7c478bd9Sstevel@tonic-gate};
363*7c478bd9Sstevel@tonic-gate
364*7c478bd9Sstevel@tonic-gate#define	NUM_ATTRIBUTES	9
365*7c478bd9Sstevel@tonic-gate#define	UNACCESSIBLE		1
366*7c478bd9Sstevel@tonic-gate#define	NO_TERMINAL		2
367*7c478bd9Sstevel@tonic-gate#define	CORRUPTED		3
368*7c478bd9Sstevel@tonic-gate#define	ENTRY_TOO_LONG		4
369*7c478bd9Sstevel@tonic-gate#define	TERMINFO_TOO_LONG	5
370*7c478bd9Sstevel@tonic-gate#define	TERM_BAD_MALLOC		6
371*7c478bd9Sstevel@tonic-gate#define	NOT_READABLE		7
372*7c478bd9Sstevel@tonic-gate#define	_VR2_COMPAT_CODE
373*7c478bd9Sstevel@tonic-gate#ifdef _VR2_COMPAT_CODE
374*7c478bd9Sstevel@tonic-gatestruct _Vr2_Astrs {
375*7c478bd9Sstevel@tonic-gate    charptr
376*7c478bd9Sstevel@tonic-gate	_s1,  _s2,  _s3,  _s4,  _s5,  _s6,  _s7,  _s8,  _s9,  _s10,
377*7c478bd9Sstevel@tonic-gate	_s11, _s12, _s13, _s14, _s15, _s16, _s17, _s18, _s19, _s20,
378*7c478bd9Sstevel@tonic-gate	_s21, _s22, _s23, _s24, _s25, _s26, _s27, _s28, _s29, _s30,
379*7c478bd9Sstevel@tonic-gate	_s31, _s32, _s33, _s34, _s35, _s36, _s37, _s38, _s39, _s40,
380*7c478bd9Sstevel@tonic-gate	_s41, _s42, _s43, _s44, _s45, _s46, _s47, _s48, _s49, _s50,
381*7c478bd9Sstevel@tonic-gate	_s51, _s52, _s53, _s54, _s55, _s56, _s57, _s58, _s59, _s60,
382*7c478bd9Sstevel@tonic-gate	_s61, _s62, _s63, _s64, _s65, _s66, _s67, _s68, _s69, _s70,
383*7c478bd9Sstevel@tonic-gate	_s71, _s72, _s73, _s74, _s75, _s76, _s77, _s78, _s79, _s80,
384*7c478bd9Sstevel@tonic-gate	_s81, _s82, _s83, _s84, _s85, _s86, _s87, _s88, _s89, _s90,
385*7c478bd9Sstevel@tonic-gate	_s91, _s92, _s93, _s94, _s95, _s96, _s97, _s98, _s99, _s100;
386*7c478bd9Sstevel@tonic-gate};
387*7c478bd9Sstevel@tonic-gate
388*7c478bd9Sstevel@tonic-gatestruct _Vr2_Bstrs {
389*7c478bd9Sstevel@tonic-gate    charptr
390*7c478bd9Sstevel@tonic-gate	_s101, _s102, _s103, _s104, _s105, _s106, _s107, _s108, _s109, _s110,
391*7c478bd9Sstevel@tonic-gate	_s111, _s112, _s113, _s114, _s115, _s116, _s117, _s118, _s119, _s120,
392*7c478bd9Sstevel@tonic-gate	_s121, _s122, _s123, _s124, _s125, _s126, _s127, _s128, _s129, _s130,
393*7c478bd9Sstevel@tonic-gate	_s131, _s132, _s133, _s134, _s135, _s136, _s137, _s138, _s139, _s140,
394*7c478bd9Sstevel@tonic-gate	_s141, _s142, _s143, _s144, _s145;
395*7c478bd9Sstevel@tonic-gate};
396*7c478bd9Sstevel@tonic-gate#endif /* _VR2_COMPAT_CODE */
397*7c478bd9Sstevel@tonic-gate
398*7c478bd9Sstevel@tonic-gatetypedef struct {
399*7c478bd9Sstevel@tonic-gate	char	*_sends;	/* Characters sent when key is pressed */
400*7c478bd9Sstevel@tonic-gate	short	_keyval;	/* "char" we pass back to program */
401*7c478bd9Sstevel@tonic-gate} _KEY_MAP;
402*7c478bd9Sstevel@tonic-gate
403*7c478bd9Sstevel@tonic-gatetypedef struct {
404*7c478bd9Sstevel@tonic-gate	short	foreground;	/* foreground color */
405*7c478bd9Sstevel@tonic-gate	short	background;	/* background color */
406*7c478bd9Sstevel@tonic-gate	bool	init;		/* TRUE if pair was initialized */
407*7c478bd9Sstevel@tonic-gate} _Color_pair;
408*7c478bd9Sstevel@tonic-gate
409*7c478bd9Sstevel@tonic-gate
410*7c478bd9Sstevel@tonic-gatetypedef struct {
411*7c478bd9Sstevel@tonic-gate	short	r, g, b;
412*7c478bd9Sstevel@tonic-gate} _Color;
413*7c478bd9Sstevel@tonic-gate
414*7c478bd9Sstevel@tonic-gate
415*7c478bd9Sstevel@tonic-gate/*
416*7c478bd9Sstevel@tonic-gate * This definition for the term struct allows the boolean, number
417*7c478bd9Sstevel@tonic-gate * and string information to grow in the future and still allow .o
418*7c478bd9Sstevel@tonic-gate * compatibility.
419*7c478bd9Sstevel@tonic-gate */
420*7c478bd9Sstevel@tonic-gate
421*7c478bd9Sstevel@tonic-gatestruct term {
422*7c478bd9Sstevel@tonic-gate#ifdef _VR2_COMPAT_CODE
423*7c478bd9Sstevel@tonic-gate    char
424*7c478bd9Sstevel@tonic-gate	_b1,  _b2,  _b3,  _b4,  _b5,  _b6,  _b7,  _b8,  _b9,  _b10,
425*7c478bd9Sstevel@tonic-gate	_b11, _b12, _b13, _b14, _b15, _b16, _b17, _b18, _b19, _b20, _b21;
426*7c478bd9Sstevel@tonic-gate    short
427*7c478bd9Sstevel@tonic-gate	_c1, _c2, _c3, _c4, _c5, _c6, _c7, _c8;
428*7c478bd9Sstevel@tonic-gate	struct _Vr2_Astrs _Vr2_Astrs;
429*7c478bd9Sstevel@tonic-gate	struct _Vr2_Bstrs _Vr2_Bstrs;
430*7c478bd9Sstevel@tonic-gate#endif /* _VR2_COMPAT_CODE */
431*7c478bd9Sstevel@tonic-gate	short	Filedes;	/* file descriptor being written to */
432*7c478bd9Sstevel@tonic-gate	SGTTY	Ottyb,		/* original state of the terminal */
433*7c478bd9Sstevel@tonic-gate		Nttyb;		/* current state of the terminal */
434*7c478bd9Sstevel@tonic-gate#ifdef SYSV
435*7c478bd9Sstevel@tonic-gate	SGTTYS	Ottybs,		/* original state of the terminal */
436*7c478bd9Sstevel@tonic-gate		Nttybs;		/* current state of the terminal */
437*7c478bd9Sstevel@tonic-gate#endif
438*7c478bd9Sstevel@tonic-gate#ifdef DIOCSETT
439*7c478bd9Sstevel@tonic-gate	struct termcb new, old;	/* CB/UNIX virtual terminals */
440*7c478bd9Sstevel@tonic-gate#endif
441*7c478bd9Sstevel@tonic-gate#ifdef LTILDE
442*7c478bd9Sstevel@tonic-gate	int newlmode, oldlmode;	/* BSD tty driver */
443*7c478bd9Sstevel@tonic-gate#endif
444*7c478bd9Sstevel@tonic-gate	/* end of Vr2 structure */
445*7c478bd9Sstevel@tonic-gate	struct _bool_struct *_bools;
446*7c478bd9Sstevel@tonic-gate	struct _num_struct *_nums;
447*7c478bd9Sstevel@tonic-gate	struct _str_struct *_strs;
448*7c478bd9Sstevel@tonic-gate	char	*_strtab;
449*7c478bd9Sstevel@tonic-gate#ifdef FIONREAD
450*7c478bd9Sstevel@tonic-gate	long	timeout;		/* for BSD halfdelay mode */
451*7c478bd9Sstevel@tonic-gate#endif
452*7c478bd9Sstevel@tonic-gate	/* end of Vr3 structure */
453*7c478bd9Sstevel@tonic-gate	chtype	sgr_mode;		/* current phys. graphic rendition */
454*7c478bd9Sstevel@tonic-gate	chtype	sgr_faked;		/* attributes faked by vidputs */
455*7c478bd9Sstevel@tonic-gate	int	_delay;			/* timeout for inputs */
456*7c478bd9Sstevel@tonic-gate	int	_inputfd;		/* input file descriptor */
457*7c478bd9Sstevel@tonic-gate	int	_check_fd;		/* typeahead file descriptor */
458*7c478bd9Sstevel@tonic-gate	_KEY_MAP	**_keys,	/* key map */
459*7c478bd9Sstevel@tonic-gate			*internal_keys;	/* pointer to free key structures */
460*7c478bd9Sstevel@tonic-gate	short		_ksz,		/* size of keymap */
461*7c478bd9Sstevel@tonic-gate			_lastkey_ordered, /* where the last ordered key is */
462*7c478bd9Sstevel@tonic-gate			_lastmacro_ordered, /* where last ordered macro is */
463*7c478bd9Sstevel@tonic-gate			_first_macro;
464*7c478bd9Sstevel@tonic-gate	bool		funckeystarter[0400];
465*7c478bd9Sstevel@tonic-gate					/* map of which chars start fn keys */
466*7c478bd9Sstevel@tonic-gate	bool		_fl_rawmode,	/* in cbreak(=1) or raw(=2) mode */
467*7c478bd9Sstevel@tonic-gate			fl_typeahdok,	/* ok to use typeahead */
468*7c478bd9Sstevel@tonic-gate			_cursorstate,	/* cursor: 0=invis, 1=norm, 2=vvis */
469*7c478bd9Sstevel@tonic-gate			_iwait;		/* true if input-pending */
470*7c478bd9Sstevel@tonic-gate	short		_regs[26];	/* tparm static registers */
471*7c478bd9Sstevel@tonic-gate#define	INP_QSIZE	32
472*7c478bd9Sstevel@tonic-gate	chtype				/* a place to put stuff ungetch'ed */
473*7c478bd9Sstevel@tonic-gate			_input_queue[INP_QSIZE];
474*7c478bd9Sstevel@tonic-gate	short	_ungotten;	/* # chars ungotten by ungetch() */
475*7c478bd9Sstevel@tonic-gate	char		_chars_on_queue; /* # chars on queue */
476*7c478bd9Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE
477*7c478bd9Sstevel@tonic-gate	_ochtype	*_acsmap;
478*7c478bd9Sstevel@tonic-gate	chtype		*_acs32map;	/* map of alternate char set chars */
479*7c478bd9Sstevel@tonic-gate#else /* _VR3_COMPAT_CODE */
480*7c478bd9Sstevel@tonic-gate	chtype		*_acsmap;	/* map of alternate char set chars */
481*7c478bd9Sstevel@tonic-gate#endif /* _VR3_COMPAT_CODE */
482*7c478bd9Sstevel@tonic-gate	char		*turn_on_seq[NUM_ATTRIBUTES];
483*7c478bd9Sstevel@tonic-gate	chtype		bit_vector;
484*7c478bd9Sstevel@tonic-gate	char		*cursor_seq[3];
485*7c478bd9Sstevel@tonic-gate	char		_termname[15];
486*7c478bd9Sstevel@tonic-gate	char		*turn_off_seq[3];
487*7c478bd9Sstevel@tonic-gate	chtype		check_turn_off;
488*7c478bd9Sstevel@tonic-gate	chtype		non_faked_mode;
489*7c478bd9Sstevel@tonic-gate	_Color_pair	_cur_pair;
490*7c478bd9Sstevel@tonic-gate	_Color_pair	*_pairs_tbl;
491*7c478bd9Sstevel@tonic-gate	_Color		*_color_tbl;
492*7c478bd9Sstevel@tonic-gate};
493*7c478bd9Sstevel@tonic-gate
494*7c478bd9Sstevel@tonic-gatetypedef struct term TERMINAL;
495*7c478bd9Sstevel@tonic-gate
496*7c478bd9Sstevel@tonic-gate/* allow old names for these capabilities */
497*7c478bd9Sstevel@tonic-gate#define	beehive_glitch	no_esc_ctlc
498*7c478bd9Sstevel@tonic-gate#define	teleray_glitch	dest_tabs_magic_smso
499*7c478bd9Sstevel@tonic-gate
500*7c478bd9Sstevel@tonic-gateextern TERMINAL			*cur_term;
501*7c478bd9Sstevel@tonic-gateextern struct _bool_struct	*cur_bools;
502*7c478bd9Sstevel@tonic-gateextern struct _num_struct	*cur_nums;
503*7c478bd9Sstevel@tonic-gateextern struct _str_struct	*cur_strs;
504*7c478bd9Sstevel@tonic-gate
505*7c478bd9Sstevel@tonic-gate#ifdef	SINGLE
506*7c478bd9Sstevel@tonic-gateextern TERMINAL			_first_term;
507*7c478bd9Sstevel@tonic-gateextern struct _bool_struct	_frst_bools;
508*7c478bd9Sstevel@tonic-gateextern struct _num_struct	_frst_nums;
509*7c478bd9Sstevel@tonic-gateextern struct _str_struct	_frst_strs;
510*7c478bd9Sstevel@tonic-gate
511*7c478bd9Sstevel@tonic-gate#define	CUR			_first_term.
512*7c478bd9Sstevel@tonic-gate#define	CURB			_frst_bools.
513*7c478bd9Sstevel@tonic-gate#define	CURN			_frst_nums.
514*7c478bd9Sstevel@tonic-gate#define	CURS			_frst_strs.
515*7c478bd9Sstevel@tonic-gate#define	PROGTTY			_first_term.Nttyb
516*7c478bd9Sstevel@tonic-gate#define	SHELLTTY		_first_term.Ottyb
517*7c478bd9Sstevel@tonic-gate#ifdef SYSV
518*7c478bd9Sstevel@tonic-gate#define	PROGTTYS		_first_term.Nttybs
519*7c478bd9Sstevel@tonic-gate#define	SHELLTTYS		_first_term.Ottybs
520*7c478bd9Sstevel@tonic-gate#endif
521*7c478bd9Sstevel@tonic-gate#else
522*7c478bd9Sstevel@tonic-gate#define	CUR			cur_term->
523*7c478bd9Sstevel@tonic-gate#define	CURB			cur_bools->
524*7c478bd9Sstevel@tonic-gate#define	CURN			cur_nums->
525*7c478bd9Sstevel@tonic-gate#define	CURS			cur_strs->
526*7c478bd9Sstevel@tonic-gate#define	PROGTTY			(cur_term->Nttyb)
527*7c478bd9Sstevel@tonic-gate#define	SHELLTTY		(cur_term->Ottyb)
528*7c478bd9Sstevel@tonic-gate#ifdef SYSV
529*7c478bd9Sstevel@tonic-gate#define	PROGTTYS		(cur_term->Nttybs)
530*7c478bd9Sstevel@tonic-gate#define	SHELLTTYS		(cur_term->Ottybs)
531*7c478bd9Sstevel@tonic-gate#endif
532*7c478bd9Sstevel@tonic-gate#endif
533*7c478bd9Sstevel@tonic-gate
534*7c478bd9Sstevel@tonic-gate#ifndef	NOMACROS
535*7c478bd9Sstevel@tonic-gate#define	set_curterm	setcurterm
536*7c478bd9Sstevel@tonic-gate#define	del_curterm	delterm
537*7c478bd9Sstevel@tonic-gate#else	/* NOMACROS */
538*7c478bd9Sstevel@tonic-gate
539*7c478bd9Sstevel@tonic-gate#ifdef	__STDC__
540*7c478bd9Sstevel@tonic-gateextern	TERMINAL	*set_curterm(TERMINAL *);
541*7c478bd9Sstevel@tonic-gateextern	int		del_curterm(TERMINAL *);
542*7c478bd9Sstevel@tonic-gate#else	/* __STDC__ */
543*7c478bd9Sstevel@tonic-gateextern	TERMINAL	*set_curterm();
544*7c478bd9Sstevel@tonic-gateextern	int		del_curterm();
545*7c478bd9Sstevel@tonic-gate#endif	/* __STDC__ */
546*7c478bd9Sstevel@tonic-gate
547*7c478bd9Sstevel@tonic-gate#endif  /* NOMACROS */
548*7c478bd9Sstevel@tonic-gate
549*7c478bd9Sstevel@tonic-gateextern	short	term_errno;
550*7c478bd9Sstevel@tonic-gate
551*7c478bd9Sstevel@tonic-gate#ifdef SYSV
552*7c478bd9Sstevel@tonic-gateextern	int	prog_istermios;
553*7c478bd9Sstevel@tonic-gateextern	int	shell_istermios;
554*7c478bd9Sstevel@tonic-gate#endif
555*7c478bd9Sstevel@tonic-gate
556*7c478bd9Sstevel@tonic-gateextern	char	term_parm_err[], *term_err_strings[], *Def_term,
557*7c478bd9Sstevel@tonic-gate		*boolnames[], *boolcodes[], *boolfnames[],
558*7c478bd9Sstevel@tonic-gate		*numnames[], *numcodes[], *numfnames[],
559*7c478bd9Sstevel@tonic-gate		*strnames[], *strcodes[], *strfnames[];
560*7c478bd9Sstevel@tonic-gate
561*7c478bd9Sstevel@tonic-gate#ifdef __STDC__
562*7c478bd9Sstevel@tonic-gateextern	TERMINAL	*setcurterm(TERMINAL *);
563*7c478bd9Sstevel@tonic-gate
564*7c478bd9Sstevel@tonic-gate#if defined(_XPG4_2) || defined(_LP64) || defined(__cplusplus)
565*7c478bd9Sstevel@tonic-gateextern	char
566*7c478bd9Sstevel@tonic-gate	*tparm(char *, long, long, long, long, long, long, long, long, long);
567*7c478bd9Sstevel@tonic-gate#else
568*7c478bd9Sstevel@tonic-gate/* this is wrong, but is needed for historical reasons */
569*7c478bd9Sstevel@tonic-gateextern	char	*tparm();
570*7c478bd9Sstevel@tonic-gate#endif
571*7c478bd9Sstevel@tonic-gate
572*7c478bd9Sstevel@tonic-gateextern char	*tgetstr(char *, char **),
573*7c478bd9Sstevel@tonic-gate		*tigetstr(char *),
574*7c478bd9Sstevel@tonic-gate		*termname(void);
575*7c478bd9Sstevel@tonic-gate
576*7c478bd9Sstevel@tonic-gateextern	int	tgetent(char *, char *), tgetflag(char *), tgetnum(char *),
577*7c478bd9Sstevel@tonic-gate		tputs(char *, int, int (*)(char)), putp(char *),
578*7c478bd9Sstevel@tonic-gate		tigetint(char *), tigetflag(char *), tigetnum(char *),
579*7c478bd9Sstevel@tonic-gate		vidputs(chtype, int (*)(char)), vidattr(chtype);
580*7c478bd9Sstevel@tonic-gate
581*7c478bd9Sstevel@tonic-gateextern	int	resetterm(void), fixterm(void), saveterm(void),
582*7c478bd9Sstevel@tonic-gate		restartterm(char *, int, int *), delterm(TERMINAL *);
583*7c478bd9Sstevel@tonic-gate
584*7c478bd9Sstevel@tonic-gateextern	void	termerr(void), tinputfd(int);
585*7c478bd9Sstevel@tonic-gate#else  /* __STDC__ */
586*7c478bd9Sstevel@tonic-gateextern	TERMINAL	*setcurterm();
587*7c478bd9Sstevel@tonic-gateextern	char	*tparm(), *tgoto(), *tgetstr(), *tigetstr(),
588*7c478bd9Sstevel@tonic-gate		*termname();
589*7c478bd9Sstevel@tonic-gate
590*7c478bd9Sstevel@tonic-gateextern	int	tgetent(), tgetflag(), tgetnum(),
591*7c478bd9Sstevel@tonic-gate		tigetint(), tigetflag(), tigetnum(),
592*7c478bd9Sstevel@tonic-gate		tputs(), putp(), vidputs(), vidattr();
593*7c478bd9Sstevel@tonic-gate
594*7c478bd9Sstevel@tonic-gateextern	int	resetterm(), fixterm(), saveterm(),
595*7c478bd9Sstevel@tonic-gate		restartterm(), delterm();
596*7c478bd9Sstevel@tonic-gate
597*7c478bd9Sstevel@tonic-gateextern	void	termerr(), tinputfd();
598*7c478bd9Sstevel@tonic-gate#endif /* __STDC__ */
599*7c478bd9Sstevel@tonic-gate
600*7c478bd9Sstevel@tonic-gate#ifdef	__cplusplus
601*7c478bd9Sstevel@tonic-gate}
602*7c478bd9Sstevel@tonic-gate#endif
603*7c478bd9Sstevel@tonic-gate
604*7c478bd9Sstevel@tonic-gate#endif	/* _TERM_H */
605*7c478bd9Sstevel@tonic-gate.
606*7c478bd9Sstevel@tonic-gate0r copyright.h
607*7c478bd9Sstevel@tonic-gate/copyright\.h/d
608*7c478bd9Sstevel@tonic-gate1,$s/\@(\#)maketerm.ed/\@(\#)term.h/
609*7c478bd9Sstevel@tonic-gate1,$s/,\/\*/, \/\*/
610*7c478bd9Sstevel@tonic-gatew term.h
611*7c478bd9Sstevel@tonic-gate!rm -f boolnames boolvals bool numnames numvals num strnames strvals str ./tmp/term.h.new ./tmp/tmp.awk ./tmp/tmp.term.h
612*7c478bd9Sstevel@tonic-gateq
613