xref: /onnv-gate/usr/src/lib/libcurses/screen/maketerm.ed (revision 12545:4850116ee928)
10Sstevel@tonic-gateH
20Sstevel@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
30Sstevel@tonic-gatee caps
40Sstevel@tonic-gateg/^#/d
50Sstevel@tonic-gate/--- begin bool/+1,/--- end bool/-1 w bool
60Sstevel@tonic-gate/--- begin num/+1,/--- end num/-1 w num
70Sstevel@tonic-gate/--- begin str/+1,/--- end str/-1 w str
80Sstevel@tonic-gateE bool
90Sstevel@tonic-gate1,$s/"	.*/", /
100Sstevel@tonic-gate1,$s/.*	"/"/
110Sstevel@tonic-gate1,$-10g/^/.,+9j
120Sstevel@tonic-gate+,$j
130Sstevel@tonic-gate1i
140Sstevel@tonic-gatechar	*boolnames[] =
150Sstevel@tonic-gate	{
160Sstevel@tonic-gate.
170Sstevel@tonic-gate$a
180Sstevel@tonic-gate0
190Sstevel@tonic-gate	};
200Sstevel@tonic-gate
210Sstevel@tonic-gate.
220Sstevel@tonic-gatew tinames.c
230Sstevel@tonic-gatee bool
240Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
250Sstevel@tonic-gate1,$s/"	.*/", /
260Sstevel@tonic-gate1,$-10g/^/.,+9j
270Sstevel@tonic-gate+,$j
280Sstevel@tonic-gate1i
290Sstevel@tonic-gatechar	*boolcodes[] =
300Sstevel@tonic-gate	{
310Sstevel@tonic-gate.
320Sstevel@tonic-gate$a
330Sstevel@tonic-gate0
340Sstevel@tonic-gate	};
350Sstevel@tonic-gate
360Sstevel@tonic-gate.
370Sstevel@tonic-gatew tnames.c
380Sstevel@tonic-gatee bool
390Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
400Sstevel@tonic-gate1,$-4g/^/.,+3j
410Sstevel@tonic-gate+,$j
420Sstevel@tonic-gate1i
430Sstevel@tonic-gatechar	*boolfnames[] =
440Sstevel@tonic-gate	{
450Sstevel@tonic-gate.
460Sstevel@tonic-gate$a
470Sstevel@tonic-gate0
480Sstevel@tonic-gate	};
490Sstevel@tonic-gate
500Sstevel@tonic-gate.
510Sstevel@tonic-gatew tifnames.c
520Sstevel@tonic-gatee bool
530Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
540Sstevel@tonic-gate1,$s;$; */;
550Sstevel@tonic-gate1,$s;^;	;
560Sstevel@tonic-gate1i
570Sstevel@tonic-gate    char
580Sstevel@tonic-gate.
590Sstevel@tonic-gate$a
600Sstevel@tonic-gate	Sentinel;		/* End of bools. DO NOT MOVE! */
610Sstevel@tonic-gate.
620Sstevel@tonic-gatew boolvals
630Sstevel@tonic-gatee num
640Sstevel@tonic-gate1,$s/"	.*/", /
650Sstevel@tonic-gate1,$s/.*	"/"/
660Sstevel@tonic-gate1,$-10g/^/.,+9j
670Sstevel@tonic-gate+,$j
680Sstevel@tonic-gate1i
690Sstevel@tonic-gatechar	*numnames[] =
700Sstevel@tonic-gate	{
710Sstevel@tonic-gate.
720Sstevel@tonic-gate$a
730Sstevel@tonic-gate0
740Sstevel@tonic-gate	};
750Sstevel@tonic-gate
760Sstevel@tonic-gate.
770Sstevel@tonic-gate0r tinames.c
780Sstevel@tonic-gatew tinames.c
790Sstevel@tonic-gatee num
800Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
810Sstevel@tonic-gate1,$s/"	.*/", /
820Sstevel@tonic-gate1,$-10g/^/.,+9j
830Sstevel@tonic-gate+,$j
840Sstevel@tonic-gate1i
850Sstevel@tonic-gatechar	*numcodes[] =
860Sstevel@tonic-gate	{
870Sstevel@tonic-gate.
880Sstevel@tonic-gate$a
890Sstevel@tonic-gate0
900Sstevel@tonic-gate	};
910Sstevel@tonic-gate
920Sstevel@tonic-gate.
930Sstevel@tonic-gate0r tnames.c
940Sstevel@tonic-gatew tnames.c
950Sstevel@tonic-gatee num
960Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
970Sstevel@tonic-gate1,$-4g/^/.,+3j
980Sstevel@tonic-gate+,$j
990Sstevel@tonic-gate1i
1000Sstevel@tonic-gatechar	*numfnames[] =
1010Sstevel@tonic-gate	{
1020Sstevel@tonic-gate.
1030Sstevel@tonic-gate$a
1040Sstevel@tonic-gate0
1050Sstevel@tonic-gate	};
1060Sstevel@tonic-gate
1070Sstevel@tonic-gate.
1080Sstevel@tonic-gate0r tifnames.c
1090Sstevel@tonic-gatew tifnames.c
1100Sstevel@tonic-gatee num
1110Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
1120Sstevel@tonic-gate1,$s;$; */;
1130Sstevel@tonic-gate1,$s;^;	;
1140Sstevel@tonic-gate1i
1150Sstevel@tonic-gate    short
1160Sstevel@tonic-gate.
1170Sstevel@tonic-gate$a
1180Sstevel@tonic-gate	Sentinel;		/* End of nums. DO NOT MOVE! */
1190Sstevel@tonic-gate.
1200Sstevel@tonic-gatew numvals
1210Sstevel@tonic-gatee str
1220Sstevel@tonic-gate1,$s/"	.*/", /
1230Sstevel@tonic-gate1,$s/.*	"/"/
1240Sstevel@tonic-gate1,$-10g/^/.,+9j
1250Sstevel@tonic-gate+,$j
1260Sstevel@tonic-gate1i
1270Sstevel@tonic-gatechar	*strnames[] =
1280Sstevel@tonic-gate	{
1290Sstevel@tonic-gate.
1300Sstevel@tonic-gate$a
1310Sstevel@tonic-gate0
1320Sstevel@tonic-gate	};
1330Sstevel@tonic-gate
1340Sstevel@tonic-gate.
1350Sstevel@tonic-gate0r tinames.c
1360Sstevel@tonic-gatew tinames.c
1370Sstevel@tonic-gatee str
1380Sstevel@tonic-gate1,$s/^[^"]*"[^"]*".//
1390Sstevel@tonic-gate1,$s/"	.*/", /
1400Sstevel@tonic-gate1,$-10g/^/.,+9j
1410Sstevel@tonic-gate+,$j
1420Sstevel@tonic-gate1i
1430Sstevel@tonic-gatechar	*strcodes[] =
1440Sstevel@tonic-gate	{
1450Sstevel@tonic-gate.
1460Sstevel@tonic-gate$a
1470Sstevel@tonic-gate0
1480Sstevel@tonic-gate	};
1490Sstevel@tonic-gate
1500Sstevel@tonic-gate.
1510Sstevel@tonic-gate0r tnames.c
1520Sstevel@tonic-gatew tnames.c
1530Sstevel@tonic-gatee str
1540Sstevel@tonic-gate1,$s/^\([a-z][0-9a-z_]*\),.*/"\1", /
1550Sstevel@tonic-gate1,$-4g/^/.,+3j
1560Sstevel@tonic-gate+,$j
1570Sstevel@tonic-gate1i
1580Sstevel@tonic-gatechar	*strfnames[] =
1590Sstevel@tonic-gate	{
1600Sstevel@tonic-gate.
1610Sstevel@tonic-gate$a
1620Sstevel@tonic-gate0
1630Sstevel@tonic-gate	};
1640Sstevel@tonic-gate
1650Sstevel@tonic-gate.
1660Sstevel@tonic-gate0r tifnames.c
1670Sstevel@tonic-gatew tifnames.c
1680Sstevel@tonic-gatee str
1690Sstevel@tonic-gate1,$s;"[^"]*"[ 	]*".."	;/* ;
1700Sstevel@tonic-gate1,$s;$; */;
1710Sstevel@tonic-gate1,$s;^;	strs.;
1720Sstevel@tonic-gate$a
1730Sstevel@tonic-gate	Sentinel;		/* End of strings. DO NOT MOVE! */
1740Sstevel@tonic-gate.
1750Sstevel@tonic-gatew strvals
1760Sstevel@tonic-gate1,$d
1770Sstevel@tonic-gater tnames.c
1780Sstevel@tonic-gate1i
1790Sstevel@tonic-gate/* tnames.c: Made automatically from caps and maketerm.ed - don't edit me! */
1800Sstevel@tonic-gate.
1810Sstevel@tonic-gate1,$s/ $//
1820Sstevel@tonic-gate0r copyright.h
1832026Sstevel1,.g/#pragma ident/d
1840Sstevel@tonic-gatew tnames.c
1850Sstevel@tonic-gate1,$d
1860Sstevel@tonic-gater tinames.c
1870Sstevel@tonic-gate1i
1880Sstevel@tonic-gate/* tinames.c: Made automatically from caps and maketerm.ed - don't edit me! */
1890Sstevel@tonic-gate.
1900Sstevel@tonic-gate1,$s/ $//
1910Sstevel@tonic-gate0r copyright.h
1922026Sstevel1,.g/#pragma ident/d
1930Sstevel@tonic-gatew tinames.c
1940Sstevel@tonic-gate1,$d
1950Sstevel@tonic-gater tifnames.c
1960Sstevel@tonic-gate1i
1970Sstevel@tonic-gate/* tifnames.c: Made automatically from caps and maketerm.ed - don't edit me! */
1980Sstevel@tonic-gate.
1990Sstevel@tonic-gate1,$s/ $//
2000Sstevel@tonic-gate0r copyright.h
2012026Sstevel1,.g/#pragma ident/d
2020Sstevel@tonic-gatew tifnames.c
2030Sstevel@tonic-gatee bool
2040Sstevel@tonic-gate1,$d
2050Sstevel@tonic-gatea
2060Sstevel@tonic-gate
2070Sstevel@tonic-gatetypedef char *charptr;
2080Sstevel@tonic-gatestruct strs {
2090Sstevel@tonic-gate    charptr
2100Sstevel@tonic-gate.
2110Sstevel@tonic-gater strvals
2120Sstevel@tonic-gate1,.s/strs\.//
2130Sstevel@tonic-gate$a
2140Sstevel@tonic-gate};
2150Sstevel@tonic-gate
2160Sstevel@tonic-gatestruct _bool_struct {
2170Sstevel@tonic-gate.
2180Sstevel@tonic-gater boolvals
2190Sstevel@tonic-gatea
2200Sstevel@tonic-gate};
2210Sstevel@tonic-gate
2220Sstevel@tonic-gatestruct _num_struct {
2230Sstevel@tonic-gate.
2240Sstevel@tonic-gater numvals
2250Sstevel@tonic-gatea
2260Sstevel@tonic-gate};
2270Sstevel@tonic-gate.
2280Sstevel@tonic-gatew ./tmp/term.h.new
2290Sstevel@tonic-gatee ./tmp/term.h.new
2300Sstevel@tonic-gateg/^	./s/^	/	_/
2310Sstevel@tonic-gatew ./tmp/term.h.new
2320Sstevel@tonic-gatee boolvals
2330Sstevel@tonic-gate.kb
2340Sstevel@tonic-gate.r numvals
2350Sstevel@tonic-gate.kn
2360Sstevel@tonic-gate1,$v/^	/d
2370Sstevel@tonic-gate1,$s/^	//
2380Sstevel@tonic-gate1,$s/	[^	].*/	/
2390Sstevel@tonic-gate1,$s/,/ /
2400Sstevel@tonic-gate1,'bs/.*/#define	&	CURB _&/
2410Sstevel@tonic-gate'b+1,'ns/.*/#define	&	CURN _&/
2420Sstevel@tonic-gate1,$g/;/d
2430Sstevel@tonic-gatew ./tmp/term.h.new2
2440Sstevel@tonic-gatee strvals
2450Sstevel@tonic-gate1,$v/^	/d
2460Sstevel@tonic-gate1,$s/^	//
2470Sstevel@tonic-gate1,$s/	[^	].*/	/
2480Sstevel@tonic-gate1,$s/,/ /
2490Sstevel@tonic-gate1,$s/.*/#define	&	CURS _&/
2500Sstevel@tonic-gate1,$s/strs\.//
2510Sstevel@tonic-gate1,$s/strs.\(.\)/strs._\1/
2520Sstevel@tonic-gate1,$g/;/d
2530Sstevel@tonic-gatew
2540Sstevel@tonic-gatee ./tmp/term.h.new2
2550Sstevel@tonic-gate$r strvals
2560Sstevel@tonic-gatew ./tmp/term.h.new1
2570Sstevel@tonic-gatee ./tmp/term.h.new1
2580Sstevel@tonic-gate$r ./tmp/term.h.new
2590Sstevel@tonic-gatew ./tmp/term.h.new
2600Sstevel@tonic-gatee ./tmp/term.h.new
2610Sstevel@tonic-gate1,$s/[ 	]*$//
2620Sstevel@tonic-gate1,$s/CURS _strs/CURS strs/
2630Sstevel@tonic-gatew ./tmp/term.h.new
2640Sstevel@tonic-gatee ./tmp/term.h.new
2650Sstevel@tonic-gate1;/CURS strs/+100;.,+99s/CURS strs/CURS strs2/
2660Sstevel@tonic-gate.+1,+100s/CURS strs/CURS strs3/
2670Sstevel@tonic-gate.+1,$s/CURS strs/CURS strs4/
2680Sstevel@tonic-gate/^struct strs/+101s/,/;/
2690Sstevel@tonic-gatea
2700Sstevel@tonic-gate};
2710Sstevel@tonic-gate
2720Sstevel@tonic-gatestruct strs2 {
2730Sstevel@tonic-gate    charptr
2740Sstevel@tonic-gate.
2750Sstevel@tonic-gate+100s/,/;/
2760Sstevel@tonic-gatea
2770Sstevel@tonic-gate};
2780Sstevel@tonic-gate
2790Sstevel@tonic-gatestruct strs3 {
2800Sstevel@tonic-gate    charptr
2810Sstevel@tonic-gate.
2820Sstevel@tonic-gate+100s/,/;/
2830Sstevel@tonic-gatea
2840Sstevel@tonic-gate};
2850Sstevel@tonic-gate
2860Sstevel@tonic-gatestruct strs4 {
2870Sstevel@tonic-gate    charptr
2880Sstevel@tonic-gate.
2890Sstevel@tonic-gate1,$s/_Sentinel/Sentinel/
2900Sstevel@tonic-gatew ./tmp/term.h.new
2910Sstevel@tonic-gatee ./tmp/term.h.new
2920Sstevel@tonic-gateg/[ 	.]_cursor_/s/_cursor_/_crsr_/
2930Sstevel@tonic-gateg/[ 	.]_delete_/s/_delete_/_dlt_/
2940Sstevel@tonic-gateg/[ 	.]_enter_/s/_enter_/_entr_/
2950Sstevel@tonic-gateg/[ 	.]_insert_/s/_insert_/_ins_/
2960Sstevel@tonic-gateg/[ 	.]_key_/s/_key_/_ky_/
2970Sstevel@tonic-gateg/[ 	.]_keypad_/s/_keypad_/_kpad_/
2980Sstevel@tonic-gateg/[ 	.]_label_/s/_label_/_labl_/
2990Sstevel@tonic-gateg/[ 	.]_memory_/s/_memory_/_mem_/
3000Sstevel@tonic-gateg/[ 	.]_parm_/s/_parm_/_prm_/
3010Sstevel@tonic-gateg/[ 	.]_scroll_/s/_scroll_/_scrll_/
3020Sstevel@tonic-gateg/^	_......[,;]			\//s/,	/,/
3030Sstevel@tonic-gateg/^	_..............[,;]		\//s/,	/,/
3040Sstevel@tonic-gateg/^	_......................[,;]	\//s/,	/,/
3050Sstevel@tonic-gatew ./tmp/term.h.new
3060Sstevel@tonic-gatee ./tmp/term.h.new
3070Sstevel@tonic-gate!# the following lines GO away when Vr2 compat code goes away
3080Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/s/CURB.*/CUR _b/
3090Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/w ./tmp/tmp.term.h
3100Sstevel@tonic-gate1;/^#define	auto_left_margin/,/^#define	xon_xoff/d
3110Sstevel@tonic-gate!/usr/bin/echo '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3120Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3130Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/s/CURN.*/CUR _c/
3140Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/w ./tmp/tmp.term.h
3150Sstevel@tonic-gate1;/^#define	columns/,/^#define	width_status_line/d
3160Sstevel@tonic-gate!/usr/bin/echo '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3170Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3180Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/s/CURS.*/CUR _Vr2_Astrs._s/
3190Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/w ./tmp/tmp.term.h
3200Sstevel@tonic-gate1;/^#define	back_tab/,/^#define	lab_f8/d
3210Sstevel@tonic-gate!/usr/bin/echo '{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3220Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3230Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/s/CURS.*/CUR _Vr2_Bstrs._s/
3240Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/w ./tmp/tmp.term.h
3250Sstevel@tonic-gate1;/^#define	lab_f9/,/^#define	prtr_non/d
3260Sstevel@tonic-gate!/usr/bin/echo 'BEGIN{i=100}\n{printf "\%s\%d\\n", $0,++i}' > ./tmp/tmp.awk
3270Sstevel@tonic-gate.-1r !awk -f ./tmp/tmp.awk < ./tmp/tmp.term.h
3280Sstevel@tonic-gate!rm -f ./tmp/tmp.term.h ./tmp/tmp.awk
3290Sstevel@tonic-gatew ./tmp/term.h.new
3300Sstevel@tonic-gatee ./tmp/term.h.new
3310Sstevel@tonic-gate!# Vr2 compat code ends here
3320Sstevel@tonic-gate1i
3330Sstevel@tonic-gate#ifndef	_TERM_H
3340Sstevel@tonic-gate#define	_TERM_H
3350Sstevel@tonic-gate
3360Sstevel@tonic-gate/*
3370Sstevel@tonic-gate * term.h - this file is automatically made from caps and maketerm.ed.
3380Sstevel@tonic-gate * Don't make changes directly to term.h.
3390Sstevel@tonic-gate */
3400Sstevel@tonic-gate
3410Sstevel@tonic-gate#ifdef	__cplusplus
3420Sstevel@tonic-gateextern "C" {
3430Sstevel@tonic-gate#endif
3440Sstevel@tonic-gate
3450Sstevel@tonic-gate.
3460Sstevel@tonic-gate$a
3470Sstevel@tonic-gate
3480Sstevel@tonic-gatestruct _str_struct {
3490Sstevel@tonic-gate	struct strs strs;
3500Sstevel@tonic-gate	struct strs2 strs2;
3510Sstevel@tonic-gate	struct strs3 strs3;
3520Sstevel@tonic-gate	struct strs4 strs4;
3530Sstevel@tonic-gate};
3540Sstevel@tonic-gate
3550Sstevel@tonic-gate#define	NUM_ATTRIBUTES	9
3560Sstevel@tonic-gate#define	UNACCESSIBLE		1
3570Sstevel@tonic-gate#define	NO_TERMINAL		2
3580Sstevel@tonic-gate#define	CORRUPTED		3
3590Sstevel@tonic-gate#define	ENTRY_TOO_LONG		4
3600Sstevel@tonic-gate#define	TERMINFO_TOO_LONG	5
3610Sstevel@tonic-gate#define	TERM_BAD_MALLOC		6
3620Sstevel@tonic-gate#define	NOT_READABLE		7
3630Sstevel@tonic-gate#define	_VR2_COMPAT_CODE
3640Sstevel@tonic-gate#ifdef _VR2_COMPAT_CODE
3650Sstevel@tonic-gatestruct _Vr2_Astrs {
3660Sstevel@tonic-gate    charptr
3670Sstevel@tonic-gate	_s1,  _s2,  _s3,  _s4,  _s5,  _s6,  _s7,  _s8,  _s9,  _s10,
3680Sstevel@tonic-gate	_s11, _s12, _s13, _s14, _s15, _s16, _s17, _s18, _s19, _s20,
3690Sstevel@tonic-gate	_s21, _s22, _s23, _s24, _s25, _s26, _s27, _s28, _s29, _s30,
3700Sstevel@tonic-gate	_s31, _s32, _s33, _s34, _s35, _s36, _s37, _s38, _s39, _s40,
3710Sstevel@tonic-gate	_s41, _s42, _s43, _s44, _s45, _s46, _s47, _s48, _s49, _s50,
3720Sstevel@tonic-gate	_s51, _s52, _s53, _s54, _s55, _s56, _s57, _s58, _s59, _s60,
3730Sstevel@tonic-gate	_s61, _s62, _s63, _s64, _s65, _s66, _s67, _s68, _s69, _s70,
3740Sstevel@tonic-gate	_s71, _s72, _s73, _s74, _s75, _s76, _s77, _s78, _s79, _s80,
3750Sstevel@tonic-gate	_s81, _s82, _s83, _s84, _s85, _s86, _s87, _s88, _s89, _s90,
3760Sstevel@tonic-gate	_s91, _s92, _s93, _s94, _s95, _s96, _s97, _s98, _s99, _s100;
3770Sstevel@tonic-gate};
3780Sstevel@tonic-gate
3790Sstevel@tonic-gatestruct _Vr2_Bstrs {
3800Sstevel@tonic-gate    charptr
3810Sstevel@tonic-gate	_s101, _s102, _s103, _s104, _s105, _s106, _s107, _s108, _s109, _s110,
3820Sstevel@tonic-gate	_s111, _s112, _s113, _s114, _s115, _s116, _s117, _s118, _s119, _s120,
3830Sstevel@tonic-gate	_s121, _s122, _s123, _s124, _s125, _s126, _s127, _s128, _s129, _s130,
3840Sstevel@tonic-gate	_s131, _s132, _s133, _s134, _s135, _s136, _s137, _s138, _s139, _s140,
3850Sstevel@tonic-gate	_s141, _s142, _s143, _s144, _s145;
3860Sstevel@tonic-gate};
3870Sstevel@tonic-gate#endif /* _VR2_COMPAT_CODE */
3880Sstevel@tonic-gate
3890Sstevel@tonic-gatetypedef struct {
3900Sstevel@tonic-gate	char	*_sends;	/* Characters sent when key is pressed */
3910Sstevel@tonic-gate	short	_keyval;	/* "char" we pass back to program */
3920Sstevel@tonic-gate} _KEY_MAP;
3930Sstevel@tonic-gate
3940Sstevel@tonic-gatetypedef struct {
3950Sstevel@tonic-gate	short	foreground;	/* foreground color */
3960Sstevel@tonic-gate	short	background;	/* background color */
3970Sstevel@tonic-gate	bool	init;		/* TRUE if pair was initialized */
3980Sstevel@tonic-gate} _Color_pair;
3990Sstevel@tonic-gate
4000Sstevel@tonic-gate
4010Sstevel@tonic-gatetypedef struct {
4020Sstevel@tonic-gate	short	r, g, b;
4030Sstevel@tonic-gate} _Color;
4040Sstevel@tonic-gate
4050Sstevel@tonic-gate
4060Sstevel@tonic-gate/*
4070Sstevel@tonic-gate * This definition for the term struct allows the boolean, number
4080Sstevel@tonic-gate * and string information to grow in the future and still allow .o
4090Sstevel@tonic-gate * compatibility.
4100Sstevel@tonic-gate */
4110Sstevel@tonic-gate
4120Sstevel@tonic-gatestruct term {
4130Sstevel@tonic-gate#ifdef _VR2_COMPAT_CODE
4140Sstevel@tonic-gate    char
4150Sstevel@tonic-gate	_b1,  _b2,  _b3,  _b4,  _b5,  _b6,  _b7,  _b8,  _b9,  _b10,
4160Sstevel@tonic-gate	_b11, _b12, _b13, _b14, _b15, _b16, _b17, _b18, _b19, _b20, _b21;
4170Sstevel@tonic-gate    short
4180Sstevel@tonic-gate	_c1, _c2, _c3, _c4, _c5, _c6, _c7, _c8;
4190Sstevel@tonic-gate	struct _Vr2_Astrs _Vr2_Astrs;
4200Sstevel@tonic-gate	struct _Vr2_Bstrs _Vr2_Bstrs;
4210Sstevel@tonic-gate#endif /* _VR2_COMPAT_CODE */
4220Sstevel@tonic-gate	short	Filedes;	/* file descriptor being written to */
4230Sstevel@tonic-gate	SGTTY	Ottyb,		/* original state of the terminal */
4240Sstevel@tonic-gate		Nttyb;		/* current state of the terminal */
4250Sstevel@tonic-gate#ifdef SYSV
4260Sstevel@tonic-gate	SGTTYS	Ottybs,		/* original state of the terminal */
4270Sstevel@tonic-gate		Nttybs;		/* current state of the terminal */
4280Sstevel@tonic-gate#endif
4290Sstevel@tonic-gate#ifdef DIOCSETT
4300Sstevel@tonic-gate	struct termcb new, old;	/* CB/UNIX virtual terminals */
4310Sstevel@tonic-gate#endif
4320Sstevel@tonic-gate#ifdef LTILDE
4330Sstevel@tonic-gate	int newlmode, oldlmode;	/* BSD tty driver */
4340Sstevel@tonic-gate#endif
4350Sstevel@tonic-gate	/* end of Vr2 structure */
4360Sstevel@tonic-gate	struct _bool_struct *_bools;
4370Sstevel@tonic-gate	struct _num_struct *_nums;
4380Sstevel@tonic-gate	struct _str_struct *_strs;
4390Sstevel@tonic-gate	char	*_strtab;
4400Sstevel@tonic-gate#ifdef FIONREAD
4410Sstevel@tonic-gate	long	timeout;		/* for BSD halfdelay mode */
4420Sstevel@tonic-gate#endif
4430Sstevel@tonic-gate	/* end of Vr3 structure */
4440Sstevel@tonic-gate	chtype	sgr_mode;		/* current phys. graphic rendition */
4450Sstevel@tonic-gate	chtype	sgr_faked;		/* attributes faked by vidputs */
4460Sstevel@tonic-gate	int	_delay;			/* timeout for inputs */
4470Sstevel@tonic-gate	int	_inputfd;		/* input file descriptor */
4480Sstevel@tonic-gate	int	_check_fd;		/* typeahead file descriptor */
4490Sstevel@tonic-gate	_KEY_MAP	**_keys,	/* key map */
4500Sstevel@tonic-gate			*internal_keys;	/* pointer to free key structures */
4510Sstevel@tonic-gate	short		_ksz,		/* size of keymap */
4520Sstevel@tonic-gate			_lastkey_ordered, /* where the last ordered key is */
4530Sstevel@tonic-gate			_lastmacro_ordered, /* where last ordered macro is */
4540Sstevel@tonic-gate			_first_macro;
4550Sstevel@tonic-gate	bool		funckeystarter[0400];
4560Sstevel@tonic-gate					/* map of which chars start fn keys */
4570Sstevel@tonic-gate	bool		_fl_rawmode,	/* in cbreak(=1) or raw(=2) mode */
4580Sstevel@tonic-gate			fl_typeahdok,	/* ok to use typeahead */
4590Sstevel@tonic-gate			_cursorstate,	/* cursor: 0=invis, 1=norm, 2=vvis */
4600Sstevel@tonic-gate			_iwait;		/* true if input-pending */
4610Sstevel@tonic-gate	short		_regs[26];	/* tparm static registers */
4620Sstevel@tonic-gate#define	INP_QSIZE	32
4630Sstevel@tonic-gate	chtype				/* a place to put stuff ungetch'ed */
4640Sstevel@tonic-gate			_input_queue[INP_QSIZE];
4650Sstevel@tonic-gate	short	_ungotten;	/* # chars ungotten by ungetch() */
4660Sstevel@tonic-gate	char		_chars_on_queue; /* # chars on queue */
4670Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE
4680Sstevel@tonic-gate	_ochtype	*_acsmap;
4690Sstevel@tonic-gate	chtype		*_acs32map;	/* map of alternate char set chars */
4700Sstevel@tonic-gate#else /* _VR3_COMPAT_CODE */
4710Sstevel@tonic-gate	chtype		*_acsmap;	/* map of alternate char set chars */
4720Sstevel@tonic-gate#endif /* _VR3_COMPAT_CODE */
4730Sstevel@tonic-gate	char		*turn_on_seq[NUM_ATTRIBUTES];
4740Sstevel@tonic-gate	chtype		bit_vector;
4750Sstevel@tonic-gate	char		*cursor_seq[3];
4760Sstevel@tonic-gate	char		_termname[15];
4770Sstevel@tonic-gate	char		*turn_off_seq[3];
4780Sstevel@tonic-gate	chtype		check_turn_off;
4790Sstevel@tonic-gate	chtype		non_faked_mode;
4800Sstevel@tonic-gate	_Color_pair	_cur_pair;
4810Sstevel@tonic-gate	_Color_pair	*_pairs_tbl;
4820Sstevel@tonic-gate	_Color		*_color_tbl;
4830Sstevel@tonic-gate};
4840Sstevel@tonic-gate
4850Sstevel@tonic-gatetypedef struct term TERMINAL;
4860Sstevel@tonic-gate
4870Sstevel@tonic-gate/* allow old names for these capabilities */
4880Sstevel@tonic-gate#define	beehive_glitch	no_esc_ctlc
4890Sstevel@tonic-gate#define	teleray_glitch	dest_tabs_magic_smso
4900Sstevel@tonic-gate
4910Sstevel@tonic-gateextern TERMINAL			*cur_term;
4920Sstevel@tonic-gateextern struct _bool_struct	*cur_bools;
4930Sstevel@tonic-gateextern struct _num_struct	*cur_nums;
4940Sstevel@tonic-gateextern struct _str_struct	*cur_strs;
4950Sstevel@tonic-gate
4960Sstevel@tonic-gate#ifdef	SINGLE
4970Sstevel@tonic-gateextern TERMINAL			_first_term;
4980Sstevel@tonic-gateextern struct _bool_struct	_frst_bools;
4990Sstevel@tonic-gateextern struct _num_struct	_frst_nums;
5000Sstevel@tonic-gateextern struct _str_struct	_frst_strs;
5010Sstevel@tonic-gate
5020Sstevel@tonic-gate#define	CUR			_first_term.
5030Sstevel@tonic-gate#define	CURB			_frst_bools.
5040Sstevel@tonic-gate#define	CURN			_frst_nums.
5050Sstevel@tonic-gate#define	CURS			_frst_strs.
5060Sstevel@tonic-gate#define	PROGTTY			_first_term.Nttyb
5070Sstevel@tonic-gate#define	SHELLTTY		_first_term.Ottyb
5080Sstevel@tonic-gate#ifdef SYSV
5090Sstevel@tonic-gate#define	PROGTTYS		_first_term.Nttybs
5100Sstevel@tonic-gate#define	SHELLTTYS		_first_term.Ottybs
5110Sstevel@tonic-gate#endif
5120Sstevel@tonic-gate#else
5130Sstevel@tonic-gate#define	CUR			cur_term->
5140Sstevel@tonic-gate#define	CURB			cur_bools->
5150Sstevel@tonic-gate#define	CURN			cur_nums->
5160Sstevel@tonic-gate#define	CURS			cur_strs->
5170Sstevel@tonic-gate#define	PROGTTY			(cur_term->Nttyb)
5180Sstevel@tonic-gate#define	SHELLTTY		(cur_term->Ottyb)
5190Sstevel@tonic-gate#ifdef SYSV
5200Sstevel@tonic-gate#define	PROGTTYS		(cur_term->Nttybs)
5210Sstevel@tonic-gate#define	SHELLTTYS		(cur_term->Ottybs)
5220Sstevel@tonic-gate#endif
5230Sstevel@tonic-gate#endif
5240Sstevel@tonic-gate
5250Sstevel@tonic-gate#ifndef	NOMACROS
5260Sstevel@tonic-gate#define	set_curterm	setcurterm
5270Sstevel@tonic-gate#define	del_curterm	delterm
5280Sstevel@tonic-gate#else	/* NOMACROS */
5290Sstevel@tonic-gate
5300Sstevel@tonic-gate#ifdef	__STDC__
5310Sstevel@tonic-gateextern	TERMINAL	*set_curterm(TERMINAL *);
5320Sstevel@tonic-gateextern	int		del_curterm(TERMINAL *);
5330Sstevel@tonic-gate#else	/* __STDC__ */
5340Sstevel@tonic-gateextern	TERMINAL	*set_curterm();
5350Sstevel@tonic-gateextern	int		del_curterm();
5360Sstevel@tonic-gate#endif	/* __STDC__ */
5370Sstevel@tonic-gate
5380Sstevel@tonic-gate#endif  /* NOMACROS */
5390Sstevel@tonic-gate
5400Sstevel@tonic-gateextern	short	term_errno;
5410Sstevel@tonic-gate
5420Sstevel@tonic-gate#ifdef SYSV
5430Sstevel@tonic-gateextern	int	prog_istermios;
5440Sstevel@tonic-gateextern	int	shell_istermios;
5450Sstevel@tonic-gate#endif
5460Sstevel@tonic-gate
5470Sstevel@tonic-gateextern	char	term_parm_err[], *term_err_strings[], *Def_term,
5480Sstevel@tonic-gate		*boolnames[], *boolcodes[], *boolfnames[],
5490Sstevel@tonic-gate		*numnames[], *numcodes[], *numfnames[],
5500Sstevel@tonic-gate		*strnames[], *strcodes[], *strfnames[];
5510Sstevel@tonic-gate
5520Sstevel@tonic-gate#ifdef __STDC__
5530Sstevel@tonic-gateextern	TERMINAL	*setcurterm(TERMINAL *);
5540Sstevel@tonic-gate
5550Sstevel@tonic-gate#if defined(_XPG4_2) || defined(_LP64) || defined(__cplusplus)
5560Sstevel@tonic-gateextern	char
5570Sstevel@tonic-gate	*tparm(char *, long, long, long, long, long, long, long, long, long);
5580Sstevel@tonic-gate#else
5590Sstevel@tonic-gate/* this is wrong, but is needed for historical reasons */
5600Sstevel@tonic-gateextern	char	*tparm();
5610Sstevel@tonic-gate#endif
5620Sstevel@tonic-gate
563*12545SDavid.Marx@Sun.COMextern char	*tgoto(char *, int, int),
564*12545SDavid.Marx@Sun.COM		*tgetstr(char *, char **),
5650Sstevel@tonic-gate		*tigetstr(char *),
5660Sstevel@tonic-gate		*termname(void);
5670Sstevel@tonic-gate
5680Sstevel@tonic-gateextern	int	tgetent(char *, char *), tgetflag(char *), tgetnum(char *),
5690Sstevel@tonic-gate		tputs(char *, int, int (*)(char)), putp(char *),
5700Sstevel@tonic-gate		tigetint(char *), tigetflag(char *), tigetnum(char *),
5710Sstevel@tonic-gate		vidputs(chtype, int (*)(char)), vidattr(chtype);
5720Sstevel@tonic-gate
5730Sstevel@tonic-gateextern	int	resetterm(void), fixterm(void), saveterm(void),
5740Sstevel@tonic-gate		restartterm(char *, int, int *), delterm(TERMINAL *);
5750Sstevel@tonic-gate
5760Sstevel@tonic-gateextern	void	termerr(void), tinputfd(int);
5770Sstevel@tonic-gate#else  /* __STDC__ */
5780Sstevel@tonic-gateextern	TERMINAL	*setcurterm();
5790Sstevel@tonic-gateextern	char	*tparm(), *tgoto(), *tgetstr(), *tigetstr(),
5800Sstevel@tonic-gate		*termname();
5810Sstevel@tonic-gate
5820Sstevel@tonic-gateextern	int	tgetent(), tgetflag(), tgetnum(),
5830Sstevel@tonic-gate		tigetint(), tigetflag(), tigetnum(),
5840Sstevel@tonic-gate		tputs(), putp(), vidputs(), vidattr();
5850Sstevel@tonic-gate
5860Sstevel@tonic-gateextern	int	resetterm(), fixterm(), saveterm(),
5870Sstevel@tonic-gate		restartterm(), delterm();
5880Sstevel@tonic-gate
5890Sstevel@tonic-gateextern	void	termerr(), tinputfd();
5900Sstevel@tonic-gate#endif /* __STDC__ */
5910Sstevel@tonic-gate
5920Sstevel@tonic-gate#ifdef	__cplusplus
5930Sstevel@tonic-gate}
5940Sstevel@tonic-gate#endif
5950Sstevel@tonic-gate
5960Sstevel@tonic-gate#endif	/* _TERM_H */
5970Sstevel@tonic-gate.
5980Sstevel@tonic-gate0r copyright.h
5992026Sstevel1,.g/#pragma ident/d
6002026Sstevelg/\@(\#)maketerm.ed/s//\@(\#)term.h/
6010Sstevel@tonic-gate1,$s/,\/\*/, \/\*/
6020Sstevel@tonic-gatew term.h
6030Sstevel@tonic-gate!rm -f boolnames boolvals bool numnames numvals num strnames strvals str ./tmp/term.h.new ./tmp/tmp.awk ./tmp/tmp.term.h
6040Sstevel@tonic-gateq
605