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