xref: /onnv-gate/usr/src/ucblib/libcurses/curses.c (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
3*0Sstevel@tonic-gate  * Use is subject to license terms.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
7*0Sstevel@tonic-gate /*	  All Rights Reserved  	*/
8*0Sstevel@tonic-gate 
9*0Sstevel@tonic-gate /*
10*0Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
11*0Sstevel@tonic-gate  * All rights reserved.  The Berkeley software License Agreement
12*0Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
13*0Sstevel@tonic-gate  */
14*0Sstevel@tonic-gate 
15*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
16*0Sstevel@tonic-gate 
17*0Sstevel@tonic-gate #ifndef lint
18*0Sstevel@tonic-gate static char
19*0Sstevel@tonic-gate sccsid[] = "@(#)curses.c 1.8 88/02/08 SMI"; /* from UCB 5.2 85/11/08 */
20*0Sstevel@tonic-gate #endif /* not lint */
21*0Sstevel@tonic-gate 
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Define global variables
24*0Sstevel@tonic-gate  *
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #include <curses.h>
28*0Sstevel@tonic-gate 
29*0Sstevel@tonic-gate bool	_echoit		= TRUE,	/* set if stty indicates ECHO		*/
30*0Sstevel@tonic-gate 	_rawmode	= FALSE, /* set if stty indicates RAW mode	*/
31*0Sstevel@tonic-gate 	My_term		= FALSE, /* set if user specifies terminal type	*/
32*0Sstevel@tonic-gate 	_endwin		= FALSE; /* set if endwin has been called	*/
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate char	ttytype[50];		/* long name of tty			*/
35*0Sstevel@tonic-gate char *Def_term	= "unknown";	/* default terminal type	*/
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate int	_tty_ch		= 1,	/* file channel which is a tty		*/
38*0Sstevel@tonic-gate 	LINES,			/* number of lines allowed on screen	*/
39*0Sstevel@tonic-gate 	COLS,			/* number of columns allowed on screen	*/
40*0Sstevel@tonic-gate 	_res_flg;		/* sgtty flags for reseting later	*/
41*0Sstevel@tonic-gate 
42*0Sstevel@tonic-gate WINDOW	*stdscr		= NULL,
43*0Sstevel@tonic-gate 	*curscr		= NULL;
44*0Sstevel@tonic-gate 
45*0Sstevel@tonic-gate #ifdef DEBUG
46*0Sstevel@tonic-gate FILE	*outf;			/* debug output file			*/
47*0Sstevel@tonic-gate #endif
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate SGTTY	_tty;			/* tty modes				*/
50*0Sstevel@tonic-gate 
51*0Sstevel@tonic-gate bool	AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL, XB, XN,
52*0Sstevel@tonic-gate 	XT, XS, XX;
53*0Sstevel@tonic-gate char	*AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL, *DM,
54*0Sstevel@tonic-gate 	*DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6, *K7, *K8,
55*0Sstevel@tonic-gate 	*K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL, *KR, *KS, *KU,
56*0Sstevel@tonic-gate 	*LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF, *SO, *SR, *TA, *TE,
57*0Sstevel@tonic-gate 	*TI, *UC, *UE, *UP, *US, *VB, *VS, *VE, *AL_PARM, *DL_PARM,
58*0Sstevel@tonic-gate 	*UP_PARM, *DOWN_PARM, *LEFT_PARM, *RIGHT_PARM;
59*0Sstevel@tonic-gate char	PC;
60*0Sstevel@tonic-gate 
61*0Sstevel@tonic-gate /*
62*0Sstevel@tonic-gate  * From the tty modes...
63*0Sstevel@tonic-gate  */
64*0Sstevel@tonic-gate 
65*0Sstevel@tonic-gate bool	GT, NONL, UPPERCASE, normtty, _pfast;
66