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