xref: /titanic_50/usr/src/lib/libcurses/screen/maketerm.ed (revision fca4268092e9961ebb9b5e0098dcebc545023586)
17c478bd9Sstevel@tonic-gateH
27c478bd9Sstevel@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
37c478bd9Sstevel@tonic-gatee caps
47c478bd9Sstevel@tonic-gateg/^#/d
57c478bd9Sstevel@tonic-gate/--- begin bool/+1,/--- end bool/-1 w bool
67c478bd9Sstevel@tonic-gate/--- begin num/+1,/--- end num/-1 w num
77c478bd9Sstevel@tonic-gate/--- begin str/+1,/--- end str/-1 w str
87c478bd9Sstevel@tonic-gateE bool
97c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
107c478bd9Sstevel@tonic-gate1,$s/.*	"/"/
117c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
127c478bd9Sstevel@tonic-gate+,$j
137c478bd9Sstevel@tonic-gate1i
147c478bd9Sstevel@tonic-gatechar	*boolnames[] =
157c478bd9Sstevel@tonic-gate	{
167c478bd9Sstevel@tonic-gate.
177c478bd9Sstevel@tonic-gate$a
187c478bd9Sstevel@tonic-gate0
197c478bd9Sstevel@tonic-gate	};
207c478bd9Sstevel@tonic-gate
217c478bd9Sstevel@tonic-gate.
227c478bd9Sstevel@tonic-gatew tinames.c
237c478bd9Sstevel@tonic-gatee bool
247c478bd9Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
257c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
267c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
277c478bd9Sstevel@tonic-gate+,$j
287c478bd9Sstevel@tonic-gate1i
297c478bd9Sstevel@tonic-gatechar	*boolcodes[] =
307c478bd9Sstevel@tonic-gate	{
317c478bd9Sstevel@tonic-gate.
327c478bd9Sstevel@tonic-gate$a
337c478bd9Sstevel@tonic-gate0
347c478bd9Sstevel@tonic-gate	};
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gate.
377c478bd9Sstevel@tonic-gatew tnames.c
387c478bd9Sstevel@tonic-gatee bool
397c478bd9Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
407c478bd9Sstevel@tonic-gate1,$-4g/^/.,+3j
417c478bd9Sstevel@tonic-gate+,$j
427c478bd9Sstevel@tonic-gate1i
437c478bd9Sstevel@tonic-gatechar	*boolfnames[] =
447c478bd9Sstevel@tonic-gate	{
457c478bd9Sstevel@tonic-gate.
467c478bd9Sstevel@tonic-gate$a
477c478bd9Sstevel@tonic-gate0
487c478bd9Sstevel@tonic-gate	};
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gate.
517c478bd9Sstevel@tonic-gatew tifnames.c
527c478bd9Sstevel@tonic-gatee bool
537c478bd9Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
547c478bd9Sstevel@tonic-gate1,$s;$; */;
557c478bd9Sstevel@tonic-gate1,$s;^;	;
567c478bd9Sstevel@tonic-gate1i
577c478bd9Sstevel@tonic-gate    char
587c478bd9Sstevel@tonic-gate.
597c478bd9Sstevel@tonic-gate$a
607c478bd9Sstevel@tonic-gate	Sentinel;		/* End of bools. DO NOT MOVE! */
617c478bd9Sstevel@tonic-gate.
627c478bd9Sstevel@tonic-gatew boolvals
637c478bd9Sstevel@tonic-gatee num
647c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
657c478bd9Sstevel@tonic-gate1,$s/.*	"/"/
667c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
677c478bd9Sstevel@tonic-gate+,$j
687c478bd9Sstevel@tonic-gate1i
697c478bd9Sstevel@tonic-gatechar	*numnames[] =
707c478bd9Sstevel@tonic-gate	{
717c478bd9Sstevel@tonic-gate.
727c478bd9Sstevel@tonic-gate$a
737c478bd9Sstevel@tonic-gate0
747c478bd9Sstevel@tonic-gate	};
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate.
777c478bd9Sstevel@tonic-gate0r tinames.c
787c478bd9Sstevel@tonic-gatew tinames.c
797c478bd9Sstevel@tonic-gatee num
807c478bd9Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
817c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
827c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
837c478bd9Sstevel@tonic-gate+,$j
847c478bd9Sstevel@tonic-gate1i
857c478bd9Sstevel@tonic-gatechar	*numcodes[] =
867c478bd9Sstevel@tonic-gate	{
877c478bd9Sstevel@tonic-gate.
887c478bd9Sstevel@tonic-gate$a
897c478bd9Sstevel@tonic-gate0
907c478bd9Sstevel@tonic-gate	};
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gate.
937c478bd9Sstevel@tonic-gate0r tnames.c
947c478bd9Sstevel@tonic-gatew tnames.c
957c478bd9Sstevel@tonic-gatee num
967c478bd9Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
977c478bd9Sstevel@tonic-gate1,$-4g/^/.,+3j
987c478bd9Sstevel@tonic-gate+,$j
997c478bd9Sstevel@tonic-gate1i
1007c478bd9Sstevel@tonic-gatechar	*numfnames[] =
1017c478bd9Sstevel@tonic-gate	{
1027c478bd9Sstevel@tonic-gate.
1037c478bd9Sstevel@tonic-gate$a
1047c478bd9Sstevel@tonic-gate0
1057c478bd9Sstevel@tonic-gate	};
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate.
1087c478bd9Sstevel@tonic-gate0r tifnames.c
1097c478bd9Sstevel@tonic-gatew tifnames.c
1107c478bd9Sstevel@tonic-gatee num
1117c478bd9Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
1127c478bd9Sstevel@tonic-gate1,$s;$; */;
1137c478bd9Sstevel@tonic-gate1,$s;^;	;
1147c478bd9Sstevel@tonic-gate1i
1157c478bd9Sstevel@tonic-gate    short
1167c478bd9Sstevel@tonic-gate.
1177c478bd9Sstevel@tonic-gate$a
1187c478bd9Sstevel@tonic-gate	Sentinel;		/* End of nums. DO NOT MOVE! */
1197c478bd9Sstevel@tonic-gate.
1207c478bd9Sstevel@tonic-gatew numvals
1217c478bd9Sstevel@tonic-gatee str
1227c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
1237c478bd9Sstevel@tonic-gate1,$s/.*	"/"/
1247c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
1257c478bd9Sstevel@tonic-gate+,$j
1267c478bd9Sstevel@tonic-gate1i
1277c478bd9Sstevel@tonic-gatechar	*strnames[] =
1287c478bd9Sstevel@tonic-gate	{
1297c478bd9Sstevel@tonic-gate.
1307c478bd9Sstevel@tonic-gate$a
1317c478bd9Sstevel@tonic-gate0
1327c478bd9Sstevel@tonic-gate	};
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gate.
1357c478bd9Sstevel@tonic-gate0r tinames.c
1367c478bd9Sstevel@tonic-gatew tinames.c
1377c478bd9Sstevel@tonic-gatee str
1387c478bd9Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
1397c478bd9Sstevel@tonic-gate1,$s/"	.*/", /
1407c478bd9Sstevel@tonic-gate1,$-10g/^/.,+9j
1417c478bd9Sstevel@tonic-gate+,$j
1427c478bd9Sstevel@tonic-gate1i
1437c478bd9Sstevel@tonic-gatechar	*strcodes[] =
1447c478bd9Sstevel@tonic-gate	{
1457c478bd9Sstevel@tonic-gate.
1467c478bd9Sstevel@tonic-gate$a
1477c478bd9Sstevel@tonic-gate0
1487c478bd9Sstevel@tonic-gate	};
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gate.
1517c478bd9Sstevel@tonic-gate0r tnames.c
1527c478bd9Sstevel@tonic-gatew tnames.c
1537c478bd9Sstevel@tonic-gatee str
1547c478bd9Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
1557c478bd9Sstevel@tonic-gate1,$-4g/^/.,+3j
1567c478bd9Sstevel@tonic-gate+,$j
1577c478bd9Sstevel@tonic-gate1i
1587c478bd9Sstevel@tonic-gatechar	*strfnames[] =
1597c478bd9Sstevel@tonic-gate	{
1607c478bd9Sstevel@tonic-gate.
1617c478bd9Sstevel@tonic-gate$a
1627c478bd9Sstevel@tonic-gate0
1637c478bd9Sstevel@tonic-gate	};
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gate.
1667c478bd9Sstevel@tonic-gate0r tifnames.c
1677c478bd9Sstevel@tonic-gatew tifnames.c
1687c478bd9Sstevel@tonic-gatee str
1697c478bd9Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
1707c478bd9Sstevel@tonic-gate1,$s;$; */;
1717c478bd9Sstevel@tonic-gate1,$s;^;	strs.;
1727c478bd9Sstevel@tonic-gate$a
1737c478bd9Sstevel@tonic-gate	Sentinel;		/* End of strings. DO NOT MOVE! */
1747c478bd9Sstevel@tonic-gate.
1757c478bd9Sstevel@tonic-gatew strvals
1767c478bd9Sstevel@tonic-gate1,$d
1777c478bd9Sstevel@tonic-gater tnames.c
1787c478bd9Sstevel@tonic-gate1i
1797c478bd9Sstevel@tonic-gate/* tnames.c: Made automatically from caps and maketerm.ed - don't edit me! */
1807c478bd9Sstevel@tonic-gate.
1817c478bd9Sstevel@tonic-gate1,$s/ $//
1827c478bd9Sstevel@tonic-gate0r copyright.h
183a6600459Sstevel1,.g/#pragma ident/d
1847c478bd9Sstevel@tonic-gatew tnames.c
1857c478bd9Sstevel@tonic-gate1,$d
1867c478bd9Sstevel@tonic-gater tinames.c
1877c478bd9Sstevel@tonic-gate1i
1887c478bd9Sstevel@tonic-gate/* tinames.c: Made automatically from caps and maketerm.ed - don't edit me! */
1897c478bd9Sstevel@tonic-gate.
1907c478bd9Sstevel@tonic-gate1,$s/ $//
1917c478bd9Sstevel@tonic-gate0r copyright.h
192a6600459Sstevel1,.g/#pragma ident/d
1937c478bd9Sstevel@tonic-gatew tinames.c
1947c478bd9Sstevel@tonic-gate1,$d
1957c478bd9Sstevel@tonic-gater tifnames.c
1967c478bd9Sstevel@tonic-gate1i
1977c478bd9Sstevel@tonic-gate/* tifnames.c: Made automatically from caps and maketerm.ed - don't edit me! */
1987c478bd9Sstevel@tonic-gate.
1997c478bd9Sstevel@tonic-gate1,$s/ $//
2007c478bd9Sstevel@tonic-gate0r copyright.h
201a6600459Sstevel1,.g/#pragma ident/d
2027c478bd9Sstevel@tonic-gatew tifnames.c
2037c478bd9Sstevel@tonic-gatee bool
2047c478bd9Sstevel@tonic-gate1,$d
2057c478bd9Sstevel@tonic-gatea
2067c478bd9Sstevel@tonic-gate
2077c478bd9Sstevel@tonic-gatetypedef char *charptr;
2087c478bd9Sstevel@tonic-gatestruct strs {
2097c478bd9Sstevel@tonic-gate    charptr
2107c478bd9Sstevel@tonic-gate.
2117c478bd9Sstevel@tonic-gater strvals
2127c478bd9Sstevel@tonic-gate1,.s/strs\.//
2137c478bd9Sstevel@tonic-gate$a
2147c478bd9Sstevel@tonic-gate};
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gatestruct _bool_struct {
2177c478bd9Sstevel@tonic-gate.
2187c478bd9Sstevel@tonic-gater boolvals
2197c478bd9Sstevel@tonic-gatea
2207c478bd9Sstevel@tonic-gate};
2217c478bd9Sstevel@tonic-gate
2227c478bd9Sstevel@tonic-gatestruct _num_struct {
2237c478bd9Sstevel@tonic-gate.
2247c478bd9Sstevel@tonic-gater numvals
2257c478bd9Sstevel@tonic-gatea
2267c478bd9Sstevel@tonic-gate};
2277c478bd9Sstevel@tonic-gate.
2287c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
2297c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
2307c478bd9Sstevel@tonic-gateg/^	./s/^	/	_/
2317c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
2327c478bd9Sstevel@tonic-gatee boolvals
2337c478bd9Sstevel@tonic-gate.kb
2347c478bd9Sstevel@tonic-gate.r numvals
2357c478bd9Sstevel@tonic-gate.kn
2367c478bd9Sstevel@tonic-gate1,$v/^	/d
2377c478bd9Sstevel@tonic-gate1,$s/^	//
2387c478bd9Sstevel@tonic-gate1,$s/	[^	].*/	/
2397c478bd9Sstevel@tonic-gate1,$s/,/ /
2407c478bd9Sstevel@tonic-gate1,'bs/.*/#define	&	CURB _&/
2417c478bd9Sstevel@tonic-gate'b+1,'ns/.*/#define	&	CURN _&/
2427c478bd9Sstevel@tonic-gate1,$g/;/d
2437c478bd9Sstevel@tonic-gatew ./tmp/term.h.new2
2447c478bd9Sstevel@tonic-gatee strvals
2457c478bd9Sstevel@tonic-gate1,$v/^	/d
2467c478bd9Sstevel@tonic-gate1,$s/^	//
2477c478bd9Sstevel@tonic-gate1,$s/	[^	].*/	/
2487c478bd9Sstevel@tonic-gate1,$s/,/ /
2497c478bd9Sstevel@tonic-gate1,$s/.*/#define	&	CURS _&/
2507c478bd9Sstevel@tonic-gate1,$s/strs\.//
2517c478bd9Sstevel@tonic-gate1,$s/strs.\(.\)/strs._\1/
2527c478bd9Sstevel@tonic-gate1,$g/;/d
2537c478bd9Sstevel@tonic-gatew
2547c478bd9Sstevel@tonic-gatee ./tmp/term.h.new2
2557c478bd9Sstevel@tonic-gate$r strvals
2567c478bd9Sstevel@tonic-gatew ./tmp/term.h.new1
2577c478bd9Sstevel@tonic-gatee ./tmp/term.h.new1
2587c478bd9Sstevel@tonic-gate$r ./tmp/term.h.new
2597c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
2607c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
2617c478bd9Sstevel@tonic-gate1,$s/[ 	]*$//
2627c478bd9Sstevel@tonic-gate1,$s/CURS _strs/CURS strs/
2637c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
2647c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
2657c478bd9Sstevel@tonic-gate1;/CURS strs/+100;.,+99s/CURS strs/CURS strs2/
2667c478bd9Sstevel@tonic-gate.+1,+100s/CURS strs/CURS strs3/
2677c478bd9Sstevel@tonic-gate.+1,$s/CURS strs/CURS strs4/
2687c478bd9Sstevel@tonic-gate/^struct strs/+101s/,/;/
2697c478bd9Sstevel@tonic-gatea
2707c478bd9Sstevel@tonic-gate};
2717c478bd9Sstevel@tonic-gate
2727c478bd9Sstevel@tonic-gatestruct strs2 {
2737c478bd9Sstevel@tonic-gate    charptr
2747c478bd9Sstevel@tonic-gate.
2757c478bd9Sstevel@tonic-gate+100s/,/;/
2767c478bd9Sstevel@tonic-gatea
2777c478bd9Sstevel@tonic-gate};
2787c478bd9Sstevel@tonic-gate
2797c478bd9Sstevel@tonic-gatestruct strs3 {
2807c478bd9Sstevel@tonic-gate    charptr
2817c478bd9Sstevel@tonic-gate.
2827c478bd9Sstevel@tonic-gate+100s/,/;/
2837c478bd9Sstevel@tonic-gatea
2847c478bd9Sstevel@tonic-gate};
2857c478bd9Sstevel@tonic-gate
2867c478bd9Sstevel@tonic-gatestruct strs4 {
2877c478bd9Sstevel@tonic-gate    charptr
2887c478bd9Sstevel@tonic-gate.
2897c478bd9Sstevel@tonic-gate1,$s/_Sentinel/Sentinel/
2907c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
2917c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
2927c478bd9Sstevel@tonic-gateg/[ 	.]_cursor_/s/_cursor_/_crsr_/
2937c478bd9Sstevel@tonic-gateg/[ 	.]_delete_/s/_delete_/_dlt_/
2947c478bd9Sstevel@tonic-gateg/[ 	.]_enter_/s/_enter_/_entr_/
2957c478bd9Sstevel@tonic-gateg/[ 	.]_insert_/s/_insert_/_ins_/
2967c478bd9Sstevel@tonic-gateg/[ 	.]_key_/s/_key_/_ky_/
2977c478bd9Sstevel@tonic-gateg/[ 	.]_keypad_/s/_keypad_/_kpad_/
2987c478bd9Sstevel@tonic-gateg/[ 	.]_label_/s/_label_/_labl_/
2997c478bd9Sstevel@tonic-gateg/[ 	.]_memory_/s/_memory_/_mem_/
3007c478bd9Sstevel@tonic-gateg/[ 	.]_parm_/s/_parm_/_prm_/
3017c478bd9Sstevel@tonic-gateg/[ 	.]_scroll_/s/_scroll_/_scrll_/
3027c478bd9Sstevel@tonic-gateg/^	_......[,;]			\//s/,	/,/
3037c478bd9Sstevel@tonic-gateg/^	_..............[,;]		\//s/,	/,/
3047c478bd9Sstevel@tonic-gateg/^	_......................[,;]	\//s/,	/,/
3057c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
3067c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
3077c478bd9Sstevel@tonic-gate!# the following lines GO away when Vr2 compat code goes away
3087c478bd9Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/s/CURB.*/CUR _b/
3097c478bd9Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/w ./tmp/tmp.term.h
3107c478bd9Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/d
311*fca42680SGary Mills!/usr/bin/print '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3127c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3137c478bd9Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/s/CURN.*/CUR _c/
3147c478bd9Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/w ./tmp/tmp.term.h
3157c478bd9Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/d
316*fca42680SGary Mills!/usr/bin/print '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3177c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3187c478bd9Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/s/CURS.*/CUR _Vr2_Astrs._s/
3197c478bd9Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/w ./tmp/tmp.term.h
3207c478bd9Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/d
321*fca42680SGary Mills!/usr/bin/print '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3227c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3237c478bd9Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/s/CURS.*/CUR _Vr2_Bstrs._s/
3247c478bd9Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/w ./tmp/tmp.term.h
3257c478bd9Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/d
326*fca42680SGary Mills!/usr/bin/print 'BEGIN{i=100}\n{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3277c478bd9Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3287c478bd9Sstevel@tonic-gate!rm -f ./tmp/tmp.term.h ./tmp/tmp.awk
3297c478bd9Sstevel@tonic-gatew ./tmp/term.h.new
3307c478bd9Sstevel@tonic-gatee ./tmp/term.h.new
3317c478bd9Sstevel@tonic-gate!# Vr2 compat code ends here
3327c478bd9Sstevel@tonic-gate1i
3337c478bd9Sstevel@tonic-gate#ifndef	_TERM_H
3347c478bd9Sstevel@tonic-gate#define	_TERM_H
3357c478bd9Sstevel@tonic-gate
3367c478bd9Sstevel@tonic-gate/*
3377c478bd9Sstevel@tonic-gate * term.h - this file is automatically made from caps and maketerm.ed.
3387c478bd9Sstevel@tonic-gate * Don't make changes directly to term.h.
3397c478bd9Sstevel@tonic-gate */
3407c478bd9Sstevel@tonic-gate
3417c478bd9Sstevel@tonic-gate#ifdef	__cplusplus
3427c478bd9Sstevel@tonic-gateextern "C" {
3437c478bd9Sstevel@tonic-gate#endif
3447c478bd9Sstevel@tonic-gate
3457c478bd9Sstevel@tonic-gate.
3467c478bd9Sstevel@tonic-gate$a
3477c478bd9Sstevel@tonic-gate
3487c478bd9Sstevel@tonic-gatestruct _str_struct {
3497c478bd9Sstevel@tonic-gate	struct strs strs;
3507c478bd9Sstevel@tonic-gate	struct strs2 strs2;
3517c478bd9Sstevel@tonic-gate	struct strs3 strs3;
3527c478bd9Sstevel@tonic-gate	struct strs4 strs4;
3537c478bd9Sstevel@tonic-gate};
3547c478bd9Sstevel@tonic-gate
3557c478bd9Sstevel@tonic-gate#define	NUM_ATTRIBUTES	9
3567c478bd9Sstevel@tonic-gate#define	UNACCESSIBLE		1
3577c478bd9Sstevel@tonic-gate#define	NO_TERMINAL		2
3587c478bd9Sstevel@tonic-gate#define	CORRUPTED		3
3597c478bd9Sstevel@tonic-gate#define	ENTRY_TOO_LONG		4
3607c478bd9Sstevel@tonic-gate#define	TERMINFO_TOO_LONG	5
3617c478bd9Sstevel@tonic-gate#define	TERM_BAD_MALLOC		6
3627c478bd9Sstevel@tonic-gate#define	NOT_READABLE		7
3637c478bd9Sstevel@tonic-gate#define	_VR2_COMPAT_CODE
3647c478bd9Sstevel@tonic-gate#ifdef _VR2_COMPAT_CODE
3657c478bd9Sstevel@tonic-gatestruct _Vr2_Astrs {
3667c478bd9Sstevel@tonic-gate    charptr
3677c478bd9Sstevel@tonic-gate	_s1,  _s2,  _s3,  _s4,  _s5,  _s6,  _s7,  _s8,  _s9,  _s10,
3687c478bd9Sstevel@tonic-gate	_s11, _s12, _s13, _s14, _s15, _s16, _s17, _s18, _s19, _s20,
3697c478bd9Sstevel@tonic-gate	_s21, _s22, _s23, _s24, _s25, _s26, _s27, _s28, _s29, _s30,
3707c478bd9Sstevel@tonic-gate	_s31, _s32, _s33, _s34, _s35, _s36, _s37, _s38, _s39, _s40,
3717c478bd9Sstevel@tonic-gate	_s41, _s42, _s43, _s44, _s45, _s46, _s47, _s48, _s49, _s50,
3727c478bd9Sstevel@tonic-gate	_s51, _s52, _s53, _s54, _s55, _s56, _s57, _s58, _s59, _s60,
3737c478bd9Sstevel@tonic-gate	_s61, _s62, _s63, _s64, _s65, _s66, _s67, _s68, _s69, _s70,
3747c478bd9Sstevel@tonic-gate	_s71, _s72, _s73, _s74, _s75, _s76, _s77, _s78, _s79, _s80,
3757c478bd9Sstevel@tonic-gate	_s81, _s82, _s83, _s84, _s85, _s86, _s87, _s88, _s89, _s90,
3767c478bd9Sstevel@tonic-gate	_s91, _s92, _s93, _s94, _s95, _s96, _s97, _s98, _s99, _s100;
3777c478bd9Sstevel@tonic-gate};
3787c478bd9Sstevel@tonic-gate
3797c478bd9Sstevel@tonic-gatestruct _Vr2_Bstrs {
3807c478bd9Sstevel@tonic-gate    charptr
3817c478bd9Sstevel@tonic-gate	_s101, _s102, _s103, _s104, _s105, _s106, _s107, _s108, _s109, _s110,
3827c478bd9Sstevel@tonic-gate	_s111, _s112, _s113, _s114, _s115, _s116, _s117, _s118, _s119, _s120,
3837c478bd9Sstevel@tonic-gate	_s121, _s122, _s123, _s124, _s125, _s126, _s127, _s128, _s129, _s130,
3847c478bd9Sstevel@tonic-gate	_s131, _s132, _s133, _s134, _s135, _s136, _s137, _s138, _s139, _s140,
3857c478bd9Sstevel@tonic-gate	_s141, _s142, _s143, _s144, _s145;
3867c478bd9Sstevel@tonic-gate};
3877c478bd9Sstevel@tonic-gate#endif /* _VR2_COMPAT_CODE */
3887c478bd9Sstevel@tonic-gate
3897c478bd9Sstevel@tonic-gatetypedef struct {
3907c478bd9Sstevel@tonic-gate	char	*_sends;	/* Characters sent when key is pressed */
3917c478bd9Sstevel@tonic-gate	short	_keyval;	/* "char" we pass back to program */
3927c478bd9Sstevel@tonic-gate} _KEY_MAP;
3937c478bd9Sstevel@tonic-gate
3947c478bd9Sstevel@tonic-gatetypedef struct {
3957c478bd9Sstevel@tonic-gate	short	foreground;	/* foreground color */
3967c478bd9Sstevel@tonic-gate	short	background;	/* background color */
3977c478bd9Sstevel@tonic-gate	bool	init;		/* TRUE if pair was initialized */
3987c478bd9Sstevel@tonic-gate} _Color_pair;
3997c478bd9Sstevel@tonic-gate
4007c478bd9Sstevel@tonic-gate
4017c478bd9Sstevel@tonic-gatetypedef struct {
4027c478bd9Sstevel@tonic-gate	short	r, g, b;
4037c478bd9Sstevel@tonic-gate} _Color;
4047c478bd9Sstevel@tonic-gate
4057c478bd9Sstevel@tonic-gate
4067c478bd9Sstevel@tonic-gate/*
4077c478bd9Sstevel@tonic-gate * This definition for the term struct allows the boolean, number
4087c478bd9Sstevel@tonic-gate * and string information to grow in the future and still allow .o
4097c478bd9Sstevel@tonic-gate * compatibility.
4107c478bd9Sstevel@tonic-gate */
4117c478bd9Sstevel@tonic-gate
4127c478bd9Sstevel@tonic-gatestruct term {
4137c478bd9Sstevel@tonic-gate#ifdef _VR2_COMPAT_CODE
4147c478bd9Sstevel@tonic-gate    char
4157c478bd9Sstevel@tonic-gate	_b1,  _b2,  _b3,  _b4,  _b5,  _b6,  _b7,  _b8,  _b9,  _b10,
4167c478bd9Sstevel@tonic-gate	_b11, _b12, _b13, _b14, _b15, _b16, _b17, _b18, _b19, _b20, _b21;
4177c478bd9Sstevel@tonic-gate    short
4187c478bd9Sstevel@tonic-gate	_c1, _c2, _c3, _c4, _c5, _c6, _c7, _c8;
4197c478bd9Sstevel@tonic-gate	struct _Vr2_Astrs _Vr2_Astrs;
4207c478bd9Sstevel@tonic-gate	struct _Vr2_Bstrs _Vr2_Bstrs;
4217c478bd9Sstevel@tonic-gate#endif /* _VR2_COMPAT_CODE */
4227c478bd9Sstevel@tonic-gate	short	Filedes;	/* file descriptor being written to */
4237c478bd9Sstevel@tonic-gate	SGTTY	Ottyb,		/* original state of the terminal */
4247c478bd9Sstevel@tonic-gate		Nttyb;		/* current state of the terminal */
4257c478bd9Sstevel@tonic-gate#ifdef SYSV
4267c478bd9Sstevel@tonic-gate	SGTTYS	Ottybs,		/* original state of the terminal */
4277c478bd9Sstevel@tonic-gate		Nttybs;		/* current state of the terminal */
4287c478bd9Sstevel@tonic-gate#endif
4297c478bd9Sstevel@tonic-gate#ifdef DIOCSETT
4307c478bd9Sstevel@tonic-gate	struct termcb new, old;	/* CB/UNIX virtual terminals */
4317c478bd9Sstevel@tonic-gate#endif
4327c478bd9Sstevel@tonic-gate#ifdef LTILDE
4337c478bd9Sstevel@tonic-gate	int newlmode, oldlmode;	/* BSD tty driver */
4347c478bd9Sstevel@tonic-gate#endif
4357c478bd9Sstevel@tonic-gate	/* end of Vr2 structure */
4367c478bd9Sstevel@tonic-gate	struct _bool_struct *_bools;
4377c478bd9Sstevel@tonic-gate	struct _num_struct *_nums;
4387c478bd9Sstevel@tonic-gate	struct _str_struct *_strs;
4397c478bd9Sstevel@tonic-gate	char	*_strtab;
4407c478bd9Sstevel@tonic-gate#ifdef FIONREAD
4417c478bd9Sstevel@tonic-gate	long	timeout;		/* for BSD halfdelay mode */
4427c478bd9Sstevel@tonic-gate#endif
4437c478bd9Sstevel@tonic-gate	/* end of Vr3 structure */
4447c478bd9Sstevel@tonic-gate	chtype	sgr_mode;		/* current phys. graphic rendition */
4457c478bd9Sstevel@tonic-gate	chtype	sgr_faked;		/* attributes faked by vidputs */
4467c478bd9Sstevel@tonic-gate	int	_delay;			/* timeout for inputs */
4477c478bd9Sstevel@tonic-gate	int	_inputfd;		/* input file descriptor */
4487c478bd9Sstevel@tonic-gate	int	_check_fd;		/* typeahead file descriptor */
4497c478bd9Sstevel@tonic-gate	_KEY_MAP	**_keys,	/* key map */
4507c478bd9Sstevel@tonic-gate			*internal_keys;	/* pointer to free key structures */
4517c478bd9Sstevel@tonic-gate	short		_ksz,		/* size of keymap */
4527c478bd9Sstevel@tonic-gate			_lastkey_ordered, /* where the last ordered key is */
4537c478bd9Sstevel@tonic-gate			_lastmacro_ordered, /* where last ordered macro is */
4547c478bd9Sstevel@tonic-gate			_first_macro;
4557c478bd9Sstevel@tonic-gate	bool		funckeystarter[0400];
4567c478bd9Sstevel@tonic-gate					/* map of which chars start fn keys */
4577c478bd9Sstevel@tonic-gate	bool		_fl_rawmode,	/* in cbreak(=1) or raw(=2) mode */
4587c478bd9Sstevel@tonic-gate			fl_typeahdok,	/* ok to use typeahead */
4597c478bd9Sstevel@tonic-gate			_cursorstate,	/* cursor: 0=invis, 1=norm, 2=vvis */
4607c478bd9Sstevel@tonic-gate			_iwait;		/* true if input-pending */
4617c478bd9Sstevel@tonic-gate	short		_regs[26];	/* tparm static registers */
4627c478bd9Sstevel@tonic-gate#define	INP_QSIZE	32
4637c478bd9Sstevel@tonic-gate	chtype				/* a place to put stuff ungetch'ed */
4647c478bd9Sstevel@tonic-gate			_input_queue[INP_QSIZE];
4657c478bd9Sstevel@tonic-gate	short	_ungotten;	/* # chars ungotten by ungetch() */
4667c478bd9Sstevel@tonic-gate	char		_chars_on_queue; /* # chars on queue */
4677c478bd9Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE
4687c478bd9Sstevel@tonic-gate	_ochtype	*_acsmap;
4697c478bd9Sstevel@tonic-gate	chtype		*_acs32map;	/* map of alternate char set chars */
4707c478bd9Sstevel@tonic-gate#else /* _VR3_COMPAT_CODE */
4717c478bd9Sstevel@tonic-gate	chtype		*_acsmap;	/* map of alternate char set chars */
4727c478bd9Sstevel@tonic-gate#endif /* _VR3_COMPAT_CODE */
4737c478bd9Sstevel@tonic-gate	char		*turn_on_seq[NUM_ATTRIBUTES];
4747c478bd9Sstevel@tonic-gate	chtype		bit_vector;
4757c478bd9Sstevel@tonic-gate	char		*cursor_seq[3];
4767c478bd9Sstevel@tonic-gate	char		_termname[15];
4777c478bd9Sstevel@tonic-gate	char		*turn_off_seq[3];
4787c478bd9Sstevel@tonic-gate	chtype		check_turn_off;
4797c478bd9Sstevel@tonic-gate	chtype		non_faked_mode;
4807c478bd9Sstevel@tonic-gate	_Color_pair	_cur_pair;
4817c478bd9Sstevel@tonic-gate	_Color_pair	*_pairs_tbl;
4827c478bd9Sstevel@tonic-gate	_Color		*_color_tbl;
4837c478bd9Sstevel@tonic-gate};
4847c478bd9Sstevel@tonic-gate
4857c478bd9Sstevel@tonic-gatetypedef struct term TERMINAL;
4867c478bd9Sstevel@tonic-gate
4877c478bd9Sstevel@tonic-gate/* allow old names for these capabilities */
4887c478bd9Sstevel@tonic-gate#define	beehive_glitch	no_esc_ctlc
4897c478bd9Sstevel@tonic-gate#define	teleray_glitch	dest_tabs_magic_smso
4907c478bd9Sstevel@tonic-gate
4917c478bd9Sstevel@tonic-gateextern TERMINAL			*cur_term;
4927c478bd9Sstevel@tonic-gateextern struct _bool_struct	*cur_bools;
4937c478bd9Sstevel@tonic-gateextern struct _num_struct	*cur_nums;
4947c478bd9Sstevel@tonic-gateextern struct _str_struct	*cur_strs;
4957c478bd9Sstevel@tonic-gate
4967c478bd9Sstevel@tonic-gate#ifdef	SINGLE
4977c478bd9Sstevel@tonic-gateextern TERMINAL			_first_term;
4987c478bd9Sstevel@tonic-gateextern struct _bool_struct	_frst_bools;
4997c478bd9Sstevel@tonic-gateextern struct _num_struct	_frst_nums;
5007c478bd9Sstevel@tonic-gateextern struct _str_struct	_frst_strs;
5017c478bd9Sstevel@tonic-gate
5027c478bd9Sstevel@tonic-gate#define	CUR			_first_term.
5037c478bd9Sstevel@tonic-gate#define	CURB			_frst_bools.
5047c478bd9Sstevel@tonic-gate#define	CURN			_frst_nums.
5057c478bd9Sstevel@tonic-gate#define	CURS			_frst_strs.
5067c478bd9Sstevel@tonic-gate#define	PROGTTY			_first_term.Nttyb
5077c478bd9Sstevel@tonic-gate#define	SHELLTTY		_first_term.Ottyb
5087c478bd9Sstevel@tonic-gate#ifdef SYSV
5097c478bd9Sstevel@tonic-gate#define	PROGTTYS		_first_term.Nttybs
5107c478bd9Sstevel@tonic-gate#define	SHELLTTYS		_first_term.Ottybs
5117c478bd9Sstevel@tonic-gate#endif
5127c478bd9Sstevel@tonic-gate#else
5137c478bd9Sstevel@tonic-gate#define	CUR			cur_term->
5147c478bd9Sstevel@tonic-gate#define	CURB			cur_bools->
5157c478bd9Sstevel@tonic-gate#define	CURN			cur_nums->
5167c478bd9Sstevel@tonic-gate#define	CURS			cur_strs->
5177c478bd9Sstevel@tonic-gate#define	PROGTTY			(cur_term->Nttyb)
5187c478bd9Sstevel@tonic-gate#define	SHELLTTY		(cur_term->Ottyb)
5197c478bd9Sstevel@tonic-gate#ifdef SYSV
5207c478bd9Sstevel@tonic-gate#define	PROGTTYS		(cur_term->Nttybs)
5217c478bd9Sstevel@tonic-gate#define	SHELLTTYS		(cur_term->Ottybs)
5227c478bd9Sstevel@tonic-gate#endif
5237c478bd9Sstevel@tonic-gate#endif
5247c478bd9Sstevel@tonic-gate
5257c478bd9Sstevel@tonic-gate#ifndef	NOMACROS
5267c478bd9Sstevel@tonic-gate#define	set_curterm	setcurterm
5277c478bd9Sstevel@tonic-gate#define	del_curterm	delterm
5287c478bd9Sstevel@tonic-gate#else	/* NOMACROS */
5297c478bd9Sstevel@tonic-gate
5307c478bd9Sstevel@tonic-gate#ifdef	__STDC__
5317c478bd9Sstevel@tonic-gateextern	TERMINAL	*set_curterm(TERMINAL *);
5327c478bd9Sstevel@tonic-gateextern	int		del_curterm(TERMINAL *);
5337c478bd9Sstevel@tonic-gate#else	/* __STDC__ */
5347c478bd9Sstevel@tonic-gateextern	TERMINAL	*set_curterm();
5357c478bd9Sstevel@tonic-gateextern	int		del_curterm();
5367c478bd9Sstevel@tonic-gate#endif	/* __STDC__ */
5377c478bd9Sstevel@tonic-gate
5387c478bd9Sstevel@tonic-gate#endif  /* NOMACROS */
5397c478bd9Sstevel@tonic-gate
5407c478bd9Sstevel@tonic-gateextern	short	term_errno;
5417c478bd9Sstevel@tonic-gate
5427c478bd9Sstevel@tonic-gate#ifdef SYSV
5437c478bd9Sstevel@tonic-gateextern	int	prog_istermios;
5447c478bd9Sstevel@tonic-gateextern	int	shell_istermios;
5457c478bd9Sstevel@tonic-gate#endif
5467c478bd9Sstevel@tonic-gate
5477c478bd9Sstevel@tonic-gateextern	char	term_parm_err[], *term_err_strings[], *Def_term,
5487c478bd9Sstevel@tonic-gate		*boolnames[], *boolcodes[], *boolfnames[],
5497c478bd9Sstevel@tonic-gate		*numnames[], *numcodes[], *numfnames[],
5507c478bd9Sstevel@tonic-gate		*strnames[], *strcodes[], *strfnames[];
5517c478bd9Sstevel@tonic-gate
5527c478bd9Sstevel@tonic-gate#ifdef __STDC__
5537c478bd9Sstevel@tonic-gateextern	TERMINAL	*setcurterm(TERMINAL *);
5547c478bd9Sstevel@tonic-gate
5557c478bd9Sstevel@tonic-gate#if defined(_XPG4_2) || defined(_LP64) || defined(__cplusplus)
5567c478bd9Sstevel@tonic-gateextern	char
5577c478bd9Sstevel@tonic-gate	*tparm(char *, long, long, long, long, long, long, long, long, long);
5587c478bd9Sstevel@tonic-gate#else
5597c478bd9Sstevel@tonic-gate/* this is wrong, but is needed for historical reasons */
5607c478bd9Sstevel@tonic-gateextern	char	*tparm();
5617c478bd9Sstevel@tonic-gate#endif
5627c478bd9Sstevel@tonic-gate
56327954b0dSDavid Marxextern char	*tgoto(char *, int, int),
56427954b0dSDavid Marx		*tgetstr(char *, char **),
5657c478bd9Sstevel@tonic-gate		*tigetstr(char *),
5667c478bd9Sstevel@tonic-gate		*termname(void);
5677c478bd9Sstevel@tonic-gate
5687c478bd9Sstevel@tonic-gateextern	int	tgetent(char *, char *), tgetflag(char *), tgetnum(char *),
5697c478bd9Sstevel@tonic-gate		tputs(char *, int, int (*)(char)), putp(char *),
5707c478bd9Sstevel@tonic-gate		tigetint(char *), tigetflag(char *), tigetnum(char *),
5717c478bd9Sstevel@tonic-gate		vidputs(chtype, int (*)(char)), vidattr(chtype);
5727c478bd9Sstevel@tonic-gate
5737c478bd9Sstevel@tonic-gateextern	int	resetterm(void), fixterm(void), saveterm(void),
5747c478bd9Sstevel@tonic-gate		restartterm(char *, int, int *), delterm(TERMINAL *);
5757c478bd9Sstevel@tonic-gate
5767c478bd9Sstevel@tonic-gateextern	void	termerr(void), tinputfd(int);
5777c478bd9Sstevel@tonic-gate#else  /* __STDC__ */
5787c478bd9Sstevel@tonic-gateextern	TERMINAL	*setcurterm();
5797c478bd9Sstevel@tonic-gateextern	char	*tparm(), *tgoto(), *tgetstr(), *tigetstr(),
5807c478bd9Sstevel@tonic-gate		*termname();
5817c478bd9Sstevel@tonic-gate
5827c478bd9Sstevel@tonic-gateextern	int	tgetent(), tgetflag(), tgetnum(),
5837c478bd9Sstevel@tonic-gate		tigetint(), tigetflag(), tigetnum(),
5847c478bd9Sstevel@tonic-gate		tputs(), putp(), vidputs(), vidattr();
5857c478bd9Sstevel@tonic-gate
5867c478bd9Sstevel@tonic-gateextern	int	resetterm(), fixterm(), saveterm(),
5877c478bd9Sstevel@tonic-gate		restartterm(), delterm();
5887c478bd9Sstevel@tonic-gate
5897c478bd9Sstevel@tonic-gateextern	void	termerr(), tinputfd();
5907c478bd9Sstevel@tonic-gate#endif /* __STDC__ */
5917c478bd9Sstevel@tonic-gate
5927c478bd9Sstevel@tonic-gate#ifdef	__cplusplus
5937c478bd9Sstevel@tonic-gate}
5947c478bd9Sstevel@tonic-gate#endif
5957c478bd9Sstevel@tonic-gate
5967c478bd9Sstevel@tonic-gate#endif	/* _TERM_H */
5977c478bd9Sstevel@tonic-gate.
5987c478bd9Sstevel@tonic-gate0r copyright.h
599a6600459Sstevel1,.g/#pragma ident/d
600a6600459Sstevelg/\@(\#)maketerm.ed/s//\@(\#)term.h/
6017c478bd9Sstevel@tonic-gate1,$s/,\/\*/, \/\*/
6027c478bd9Sstevel@tonic-gatew term.h
6037c478bd9Sstevel@tonic-gate!rm -f boolnames boolvals bool numnames numvals num strnames strvals str ./tmp/term.h.new ./tmp/tmp.awk ./tmp/tmp.term.h
6047c478bd9Sstevel@tonic-gateq
605