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