xref: /onnv-gate/usr/src/lib/libcurses/screen/curses.ed (revision 12713:8c87d3621175)
10Sstevel@tonic-gatee keycaps
20Sstevel@tonic-gateH
30Sstevel@tonic-gateg/.*KEY_/s//KEY_/
40Sstevel@tonic-gateg/KEY_F([1-9]/d
50Sstevel@tonic-gateg'\(KEY_[^,]*\),[ 	]*\([0-9][0-9]*\),[ 	]*\(.*\)'s''#define	\1	\2		/* \3 */'
60Sstevel@tonic-gatew ./tmp/keycaps
70Sstevel@tonic-gatee !sort +2n ./tmp/keycaps
80Sstevel@tonic-gateg'\(KEY_[^	]	\)'s''\1	'
90Sstevel@tonic-gateg'\(KEY_[^	][^	]	\)'s''\1	'
100Sstevel@tonic-gateg'\(KEY_[^	][^	][^	]	\)'s''\1	'
110Sstevel@tonic-gate1i
120Sstevel@tonic-gate/* Funny "characters" enabled for various special function keys for input */
130Sstevel@tonic-gate/* This list is created from caps and curses.ed. Do not edit it! */
140Sstevel@tonic-gate#define	KEY_MIN		0401		/* Minimum curses key */
150Sstevel@tonic-gate#define	KEY_BREAK	0401		/* break key (unreliable) */
160Sstevel@tonic-gate.
170Sstevel@tonic-gate/KEY_F(0)/s//KEY_F0	/
180Sstevel@tonic-gatea
190Sstevel@tonic-gate#define	KEY_F(n)	(KEY_F0+(n))	/* Space for 64 function keys */
200Sstevel@tonic-gate					/* is reserved. */
210Sstevel@tonic-gate.
220Sstevel@tonic-gate/KEY_ENTER/a
230Sstevel@tonic-gate#define	KEY_SRESET	0530		/* soft (partial) reset (unreliable) */
240Sstevel@tonic-gate#define	KEY_RESET	0531		/* reset or hard reset (unreliable) */
250Sstevel@tonic-gate.
260Sstevel@tonic-gate/KEY_A1/i
270Sstevel@tonic-gate					/* The keypad is arranged like this: */
280Sstevel@tonic-gate					/*    a1    up    a3   */
290Sstevel@tonic-gate					/*   left   b2  right  */
300Sstevel@tonic-gate					/*    c1   down   c3   */
310Sstevel@tonic-gate.
320Sstevel@tonic-gate$a
330Sstevel@tonic-gate#define	KEY_MAX		0777		/* Maximum curses key */
340Sstevel@tonic-gate.
350Sstevel@tonic-gate1i
360Sstevel@tonic-gate#ifndef _CURSES_H
370Sstevel@tonic-gate#define	_CURSES_H
380Sstevel@tonic-gate
390Sstevel@tonic-gate/*
400Sstevel@tonic-gate * curses.h - this file is automatically made from caps and
410Sstevel@tonic-gate *	curses.ed. Don't make changes directly to curses.h!
420Sstevel@tonic-gate */
430Sstevel@tonic-gate
440Sstevel@tonic-gate#include <widec.h>
450Sstevel@tonic-gate
460Sstevel@tonic-gate#include <stdio.h>
470Sstevel@tonic-gate
480Sstevel@tonic-gate#ifdef	__cplusplus
490Sstevel@tonic-gateextern "C" {
500Sstevel@tonic-gate#endif
510Sstevel@tonic-gate
520Sstevel@tonic-gate#define	CSMAX   4
530Sstevel@tonic-gate
540Sstevel@tonic-gate/*
550Sstevel@tonic-gate * This trick is used to distinguish between SYSV and V7 systems.
560Sstevel@tonic-gate * We assume that L_ctermid is only defined in stdio.h in SYSV
570Sstevel@tonic-gate * systems, but not in V7 or Berkeley UNIX.
580Sstevel@tonic-gate */
590Sstevel@tonic-gate#ifdef L_ctermid
600Sstevel@tonic-gate#ifdef SYSV
610Sstevel@tonic-gate#undef SYSV
620Sstevel@tonic-gate#endif
630Sstevel@tonic-gate#define	SYSV
640Sstevel@tonic-gate#endif
650Sstevel@tonic-gate/* Some V7 systems define	L_ctermid - we list those here */
660Sstevel@tonic-gate#ifdef BSD
670Sstevel@tonic-gate#undef SYSV
680Sstevel@tonic-gate#endif
690Sstevel@tonic-gate
700Sstevel@tonic-gate#ifdef SYSV
710Sstevel@tonic-gate
720Sstevel@tonic-gate#include <termio.h>
730Sstevel@tonic-gatetypedef struct termio SGTTY;
740Sstevel@tonic-gatetypedef struct termios SGTTYS;
750Sstevel@tonic-gate
760Sstevel@tonic-gate#else /* !SYSV */
770Sstevel@tonic-gate
780Sstevel@tonic-gate#ifndef _SGTTYB_
790Sstevel@tonic-gate#include <sgtty.h>
800Sstevel@tonic-gate#endif /* _SGTTYB_ */
810Sstevel@tonic-gatetypedef struct sgttyb SGTTY;
820Sstevel@tonic-gate
830Sstevel@tonic-gate#endif /* SYSV */
840Sstevel@tonic-gate
850Sstevel@tonic-gate/*
860Sstevel@tonic-gate * bool is a built-in type in standard C++ and as such is not
870Sstevel@tonic-gate * defined here when using standard C++. However, the GNU compiler
880Sstevel@tonic-gate * fixincludes utility nonetheless creates it's own version of this
890Sstevel@tonic-gate * header for use by gcc and g++. In that version it adds a redundant
900Sstevel@tonic-gate * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
910Sstevel@tonic-gate * header we need to include the following magic comment:
920Sstevel@tonic-gate *
930Sstevel@tonic-gate * we must use the C++ compiler's type
940Sstevel@tonic-gate *
950Sstevel@tonic-gate * The above comment should not be removed or changed until GNU
960Sstevel@tonic-gate * gcc/fixinc/inclhack.def is updated to bypass this header.
970Sstevel@tonic-gate */
980Sstevel@tonic-gate#if !defined(__cplusplus) && !defined(_BOOL)
990Sstevel@tonic-gatetypedef	char bool;
1000Sstevel@tonic-gate#endif /* !defined(__cplusplus) && !defined(_BOOL) */
1010Sstevel@tonic-gate
1020Sstevel@tonic-gate#define	_VR3_COMPAT_CODE
1030Sstevel@tonic-gate/*
1040Sstevel@tonic-gate * chtype is the type used to store a character together with attributes.
1050Sstevel@tonic-gate * It can be set to "char" to save space, or "long" to get more attributes.
1060Sstevel@tonic-gate */
1070Sstevel@tonic-gate#ifdef	CHTYPE
1080Sstevel@tonic-gatetypedef	CHTYPE chtype;
1090Sstevel@tonic-gate#else
1100Sstevel@tonic-gate#ifdef _LP64
1110Sstevel@tonic-gatetypedef unsigned int chtype;
1120Sstevel@tonic-gate#else
1130Sstevel@tonic-gatetypedef unsigned long chtype;
1140Sstevel@tonic-gate#endif /* _LP64 */
1150Sstevel@tonic-gate#endif /* CHTYPE */
1160Sstevel@tonic-gate
1170Sstevel@tonic-gate/*
1180Sstevel@tonic-gate *	Define for the 'old' definition of chtype is required
1190Sstevel@tonic-gate *	when we are running in compatibility mode
1200Sstevel@tonic-gate */
1210Sstevel@tonic-gate#ifdef _VR3_COMPAT_CODE
1220Sstevel@tonic-gatetypedef unsigned short _ochtype;
1230Sstevel@tonic-gate#endif
1240Sstevel@tonic-gate
1250Sstevel@tonic-gate/* TRUE and FALSE get defined so many times, */
1260Sstevel@tonic-gate/* let's not get in the way of other definitions. */
1270Sstevel@tonic-gate#if	!defined(TRUE) || ((TRUE) != 1)
1280Sstevel@tonic-gate#define	TRUE	(1)
1290Sstevel@tonic-gate#endif
1300Sstevel@tonic-gate#if	!defined(FALSE) || ((FALSE) != 0)
1310Sstevel@tonic-gate#define	FALSE	(0)
1320Sstevel@tonic-gate#endif
1330Sstevel@tonic-gate#if	!defined(ERR) || ((ERR) != -1)
1340Sstevel@tonic-gate#define	ERR	(-1)
1350Sstevel@tonic-gate#endif
1360Sstevel@tonic-gate#if	!defined(OK) || ((OK) != 0)
1370Sstevel@tonic-gate#define	OK	(0)
1380Sstevel@tonic-gate#endif
1390Sstevel@tonic-gate
1400Sstevel@tonic-gate/* short-hand notations */
1410Sstevel@tonic-gatetypedef struct _win_st	WINDOW;
1420Sstevel@tonic-gatetypedef struct screen	SCREEN;
1430Sstevel@tonic-gatetypedef struct _Mouse	MOUSE_STATUS;
1440Sstevel@tonic-gate
1450Sstevel@tonic-gatestruct _win_st
1460Sstevel@tonic-gate{
1470Sstevel@tonic-gate	short		_cury, _curx;	/* current coordinates */
1480Sstevel@tonic-gate	short		_maxy, _maxx;	/* max coordinates */
1490Sstevel@tonic-gate	short		_begy, _begx;	/* (0,0) screen coordinates */
1500Sstevel@tonic-gate	char		_flags;
1510Sstevel@tonic-gate	short		_yoffset;	/* actual begy is _begy+_yoffset */
1520Sstevel@tonic-gate	bool		_clear,		/* clearok() info */
1530Sstevel@tonic-gate			_leave,		/* leaveok() info */
1540Sstevel@tonic-gate			_immed,		/* window in immediate mode */
1550Sstevel@tonic-gate			_sync;		/* auto syncup of parent */
1560Sstevel@tonic-gate	WINDOW		*_padwin;	/* "pad" area for current window */
1570Sstevel@tonic-gate#ifdef	_VR3_COMPAT_CODE
1580Sstevel@tonic-gate	_ochtype	**_y16;		/* MUST stay at this offset in WINDOW */
1590Sstevel@tonic-gate#endif
1600Sstevel@tonic-gate	short		*_firstch;	/* first change in line */
1610Sstevel@tonic-gate	short		*_lastch;	/* last change in line */
1620Sstevel@tonic-gate	short		_tmarg, _bmarg;	/* scrolling region bounds */
1630Sstevel@tonic-gate					/* MUST stay at this offset in WINDOW */
1640Sstevel@tonic-gate	unsigned	_scroll		: 1;	/* scrollok() info */
1650Sstevel@tonic-gate	unsigned	_use_idl	: 1;
1660Sstevel@tonic-gate	unsigned	_use_keypad	: 1;
1670Sstevel@tonic-gate	unsigned	_notimeout	: 1;
1680Sstevel@tonic-gate	unsigned	_use_idc	: 1;
1690Sstevel@tonic-gate	chtype		_attrs;		/* current window attributes */
1700Sstevel@tonic-gate	chtype		_bkgd;		/* background, normally blank */
1710Sstevel@tonic-gate	int		_delay;		/* delay period on wgetch */
1720Sstevel@tonic-gate					/* 0:  for nodelay */
1730Sstevel@tonic-gate					/* <0: for infinite delay */
1740Sstevel@tonic-gate					/* >0: delay time in millisec */
1750Sstevel@tonic-gate	short		_ndescs;	/* number of descendants */
1760Sstevel@tonic-gate	short		_parx, _pary;	/* coords relative to parent (0,0) */
1770Sstevel@tonic-gate	WINDOW		*_parent;	/* the parent if this is a subwin */
1780Sstevel@tonic-gate	chtype		**_y;		/* lines of data */
1790Sstevel@tonic-gate	short		_nbyte;		/* number of bytes to come */
1800Sstevel@tonic-gate	short		_index;		/* index to hold coming char */
1810Sstevel@tonic-gate	char		_waitc[CSMAX];	/* array to hold partial m-width char */
1820Sstevel@tonic-gate	bool		_insmode;	/* TRUE for inserting, */
1830Sstevel@tonic-gate					/* FALSE for adding */
1840Sstevel@tonic-gate};
1850Sstevel@tonic-gate
1860Sstevel@tonic-gate/* _lastch is initially set to this, _firstch is set to win->_maxx */
1870Sstevel@tonic-gate#define	_NOCHANGE	-1
1880Sstevel@tonic-gate#define	_INFINITY	16000	/* no line can be longer than this */
1890Sstevel@tonic-gate
1900Sstevel@tonic-gate/* values for win->_flags */
1910Sstevel@tonic-gate#define	_ISPAD		001
1920Sstevel@tonic-gate#define	_WINCHANGED	002
1930Sstevel@tonic-gate#define	_WINMOVED	004
1940Sstevel@tonic-gate#define	_WINSDEL	010
1950Sstevel@tonic-gate#define	_CANT_BE_IMMED	020
1960Sstevel@tonic-gate#define	_WIN_ADD_ONE	040
1970Sstevel@tonic-gate#define	_WIN_INS_ONE	100
1980Sstevel@tonic-gate
1990Sstevel@tonic-gatestruct _Mouse {
2000Sstevel@tonic-gate	int x, y;
2010Sstevel@tonic-gate	short button[3];
2020Sstevel@tonic-gate	int   changes;
2030Sstevel@tonic-gate};
2040Sstevel@tonic-gate
2050Sstevel@tonic-gate#define	CURS_STUPID	0
2060Sstevel@tonic-gate#define	CURS_UNKNOWN	1
2070Sstevel@tonic-gate#define	CURS_BAD_MALLOC	2
2080Sstevel@tonic-gate
2090Sstevel@tonic-gate/*
2100Sstevel@tonic-gate * Various tricks to shut up lint about things that are perfectly fine.
2110Sstevel@tonic-gate */
2120Sstevel@tonic-gate#if defined(__lint) && !defined(CURSES) /* if not internal to curses source */
2130Sstevel@tonic-gatestruct screen {
2140Sstevel@tonic-gate	int _nobody_;
2150Sstevel@tonic-gate};
2160Sstevel@tonic-gate#endif /* __lint */
2170Sstevel@tonic-gate
2180Sstevel@tonic-gate/* common external variables */
2190Sstevel@tonic-gate
2200Sstevel@tonic-gateextern	int	LINES, COLS, TABSIZE, COLORS, COLOR_PAIRS;
2210Sstevel@tonic-gate
2220Sstevel@tonic-gateextern	short	curs_errno;
2230Sstevel@tonic-gate
2240Sstevel@tonic-gateextern WINDOW *stdscr, *curscr;
2250Sstevel@tonic-gate
2260Sstevel@tonic-gateextern  MOUSE_STATUS	Mouse_status;
2270Sstevel@tonic-gate
2280Sstevel@tonic-gateextern char ttytype[];
2290Sstevel@tonic-gate
2300Sstevel@tonic-gateextern char	curs_parm_err[],
2310Sstevel@tonic-gate		*curs_err_strings[];
2320Sstevel@tonic-gate
2330Sstevel@tonic-gate/* Function declarations */
2340Sstevel@tonic-gate
2350Sstevel@tonic-gate#ifdef	_VR3_COMPAT_CODE
2360Sstevel@tonic-gate
2370Sstevel@tonic-gateextern	_ochtype	*acs_map;
2380Sstevel@tonic-gateextern chtype 	*acs32map;
2390Sstevel@tonic-gate
2400Sstevel@tonic-gate/* definitions for Vr3 source compatibility */
2410Sstevel@tonic-gate
2420Sstevel@tonic-gate#define	initscr		initscr32
2430Sstevel@tonic-gate#define	newterm		newterm32
2440Sstevel@tonic-gate#define	waddch		w32addch
2450Sstevel@tonic-gate#define	wechochar	w32echochar
2460Sstevel@tonic-gate#define	pechochar	p32echochar
2470Sstevel@tonic-gate#define	winsch		w32insch
2480Sstevel@tonic-gate#define	vidputs		vid32puts
2490Sstevel@tonic-gate#define	vidattr		vid32attr
2500Sstevel@tonic-gate#define	wattroff	w32attroff
2510Sstevel@tonic-gate#define	wattron		w32attron
2520Sstevel@tonic-gate#define	wattrset	w32attrset
2530Sstevel@tonic-gate#define	acs_map		acs32map
2540Sstevel@tonic-gate#define	box		box32
2550Sstevel@tonic-gate
2560Sstevel@tonic-gate#ifdef	__STDC__
2570Sstevel@tonic-gateextern WINDOW *initscr(void);
2580Sstevel@tonic-gateextern	SCREEN	*newterm(char *, FILE *, FILE *);
2590Sstevel@tonic-gate#else
2600Sstevel@tonic-gateextern WINDOW *initscr();
2610Sstevel@tonic-gateextern	SCREEN	*newterm();
2620Sstevel@tonic-gate#endif
2630Sstevel@tonic-gate
2640Sstevel@tonic-gate/* declarations for mini-curses */
2650Sstevel@tonic-gate
2660Sstevel@tonic-gate#ifdef	__STDC__
2670Sstevel@tonic-gateextern	WINDOW 	*m_initscr(void);
2680Sstevel@tonic-gate
2690Sstevel@tonic-gateextern	SCREEN	*m_newterm(char *, FILE *, FILE *);
2700Sstevel@tonic-gate
2710Sstevel@tonic-gateextern	int	m_addch(int), m_addstr(char *), m_clear(void), m_erase(void),
2720Sstevel@tonic-gate		m_move(int, int), m_refresh(void);
2730Sstevel@tonic-gate
2740Sstevel@tonic-gate#else  /* __STDC__ */
2750Sstevel@tonic-gateextern	WINDOW	*m_initscr();
2760Sstevel@tonic-gate
2770Sstevel@tonic-gateextern	SCREEN	*m_newterm();
2780Sstevel@tonic-gate
2790Sstevel@tonic-gateextern	int	m_addch(), m_addstr(), m_clear(), m_erase(),
2800Sstevel@tonic-gate		m_move(), m_refresh();
2810Sstevel@tonic-gate
2820Sstevel@tonic-gate#endif /* __STDC__ */
2830Sstevel@tonic-gate
2840Sstevel@tonic-gate#else	/* _VR3_COMPAT_CODE */
2850Sstevel@tonic-gate
2860Sstevel@tonic-gateextern chtype *acs_map;
2870Sstevel@tonic-gate
2880Sstevel@tonic-gate#endif	/* _VR3_COMPAT_CODE */
2890Sstevel@tonic-gate
2900Sstevel@tonic-gate#ifdef __STDC__
2910Sstevel@tonic-gate
2920Sstevel@tonic-gateextern SCREEN *newscreen(char *, int, int, int, FILE *, FILE *);
2930Sstevel@tonic-gateextern SCREEN *setcurscreen(SCREEN *);
2940Sstevel@tonic-gate
2950Sstevel@tonic-gateextern WINDOW *initscr(void);
2960Sstevel@tonic-gateextern WINDOW *newwin(int, int, int, int);
2970Sstevel@tonic-gateextern WINDOW *newpad(int, int);
2980Sstevel@tonic-gateextern WINDOW *derwin(WINDOW *, int, int, int, int);
2990Sstevel@tonic-gateextern WINDOW *dupwin(WINDOW *);
3000Sstevel@tonic-gateextern WINDOW *getwin(FILE *);
3010Sstevel@tonic-gate
3020Sstevel@tonic-gateextern int wgetch(WINDOW *); /* it can return KEY_*, for instance. */
3030Sstevel@tonic-gate
3040Sstevel@tonic-gateextern char *longname(void);	/* long name of terminal */
3050Sstevel@tonic-gateextern char *termname(void);	/* effective terminal name */
3060Sstevel@tonic-gateextern char *keyname(int); 	/* name of token returned by wgetch() */
3070Sstevel@tonic-gateextern char *slk_label(int);
3080Sstevel@tonic-gateextern char erasechar(void);
3090Sstevel@tonic-gateextern char killchar(void);
3100Sstevel@tonic-gateextern char *unctrl(int);
3110Sstevel@tonic-gate
3120Sstevel@tonic-gateextern chtype termattrs(void);
3130Sstevel@tonic-gate
3140Sstevel@tonic-gateextern void vidupdate(chtype, chtype, int (*)(char));
3150Sstevel@tonic-gateextern void wsyncup(WINDOW *);
3160Sstevel@tonic-gateextern void wsyncdown(WINDOW *);
3170Sstevel@tonic-gateextern void delscreen(SCREEN *);
3180Sstevel@tonic-gateextern void curserr(void);
3190Sstevel@tonic-gateextern void _setqiflush(int);
3200Sstevel@tonic-gateextern void wcursyncup(WINDOW *);
3210Sstevel@tonic-gate
3220Sstevel@tonic-gateextern int cbreak(void);
3230Sstevel@tonic-gateextern int nocbreak(void);
3240Sstevel@tonic-gateextern int reset_prog_mode(void);
3250Sstevel@tonic-gateextern int reset_shell_mode(void);
3260Sstevel@tonic-gateextern int def_prog_mode(void);
3270Sstevel@tonic-gateextern int _setecho(int);
3280Sstevel@tonic-gateextern int _setnonl(int);
3290Sstevel@tonic-gateextern int def_shell_mode(void);
3300Sstevel@tonic-gateextern int raw(void);
3310Sstevel@tonic-gateextern int savetty(void);
3320Sstevel@tonic-gateextern int traceon(void);
3330Sstevel@tonic-gateextern int _meta(int);
3340Sstevel@tonic-gateextern int traceoff(void);
3350Sstevel@tonic-gateextern int noraw(void);
3360Sstevel@tonic-gateextern int flushinp(void);
3370Sstevel@tonic-gateextern int _getsyx(int *, int *);
3380Sstevel@tonic-gateextern int _ring(bool);
3390Sstevel@tonic-gateextern int resetty(void);
3400Sstevel@tonic-gateextern int ripoffline(int, int (*)(WINDOW *, int));
3410Sstevel@tonic-gateextern int setsyx(int, int);
3420Sstevel@tonic-gateextern int slk_refresh(void);
3430Sstevel@tonic-gateextern int slk_restore(void);
3440Sstevel@tonic-gateextern int wstandend(WINDOW *);
3450Sstevel@tonic-gateextern int wstandout(WINDOW *);
3460Sstevel@tonic-gateextern int wattroff(WINDOW *, chtype);
3470Sstevel@tonic-gateextern int wattron(WINDOW *, chtype);
3480Sstevel@tonic-gateextern int wattrset(WINDOW *, chtype);
3490Sstevel@tonic-gateextern int wrefresh(WINDOW *);
3500Sstevel@tonic-gate
3510Sstevel@tonic-gateextern int copywin(WINDOW *, WINDOW *, int, int, int, int, int, int, int);
3520Sstevel@tonic-gateextern int curs_set(int);
3530Sstevel@tonic-gateextern int delay_output(int);
3540Sstevel@tonic-gateextern int delwin(WINDOW *);
3550Sstevel@tonic-gateextern int doupdate(void);
3560Sstevel@tonic-gateextern int drainio(int);
3570Sstevel@tonic-gateextern int endwin(void);
3580Sstevel@tonic-gateextern int isendwin(void);
3590Sstevel@tonic-gateextern int baudrate(void);
3600Sstevel@tonic-gateextern int has_ic(void);
3610Sstevel@tonic-gateextern int has_il(void);
3620Sstevel@tonic-gateextern int keypad(WINDOW *, bool);
3630Sstevel@tonic-gateextern int mvcur(int, int, int, int);
3640Sstevel@tonic-gate
3650Sstevel@tonic-gateextern int mvprintw(int, int, ...);
3660Sstevel@tonic-gateextern int mvscanw(int, int, ...);
3670Sstevel@tonic-gateextern int mvwprintw(WINDOW *, int, int, ...);
3680Sstevel@tonic-gateextern int mvwscanw(WINDOW *, int, int, ...);
3690Sstevel@tonic-gateextern int printw(char *, ...);
3700Sstevel@tonic-gateextern int scanw(char *, ...);
3710Sstevel@tonic-gateextern int wprintw(WINDOW *, ...);
3720Sstevel@tonic-gateextern int wscanw(WINDOW *, ...);
3730Sstevel@tonic-gate
3740Sstevel@tonic-gate		/* __va_list is the ANSI-C safe definition of the	*/
3750Sstevel@tonic-gate		/* va_list type as allowed to be defined in stdlib.h.	*/
3760Sstevel@tonic-gate		/* <stdio.h> provides the nested include of <va_list.h>	*/
3770Sstevel@tonic-gate		/* which provides this namespace safe definition.	*/
3780Sstevel@tonic-gate		/* Either <stdarg.h> or <varargs.h> must be included to	*/
3790Sstevel@tonic-gate		/* use these interfaces.				*/
3800Sstevel@tonic-gate
3810Sstevel@tonic-gateextern int vwprintw(WINDOW *, char *, __va_list);
3820Sstevel@tonic-gateextern int vwscanw(WINDOW *, char *, __va_list);
3830Sstevel@tonic-gate
3840Sstevel@tonic-gateextern int mvwin(WINDOW *, int, int);
3850Sstevel@tonic-gateextern int mvderwin(WINDOW *, int, int);
3860Sstevel@tonic-gateextern int napms(int);
3870Sstevel@tonic-gateextern int newkey(char *, short, bool);
3880Sstevel@tonic-gateextern int filter(void);
3890Sstevel@tonic-gateextern int pechochar(WINDOW *, chtype);
3900Sstevel@tonic-gateextern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
3910Sstevel@tonic-gateextern int prefresh(WINDOW *, int, int, int, int, int, int);
3920Sstevel@tonic-gate
3930Sstevel@tonic-gateextern int putwin(WINDOW *, FILE *);
3940Sstevel@tonic-gateextern int wredrawln(WINDOW *, int, int);
3950Sstevel@tonic-gateextern int scr_dump(char *);
3960Sstevel@tonic-gateextern int setupterm(char *, int, int *);
3970Sstevel@tonic-gate
3980Sstevel@tonic-gateextern int slk_attron(chtype);
3990Sstevel@tonic-gateextern int slk_attroff(chtype);
4000Sstevel@tonic-gateextern int slk_attrset(chtype);
4010Sstevel@tonic-gateextern int slk_clear(void);
4020Sstevel@tonic-gateextern int slk_noutrefresh(void);
4030Sstevel@tonic-gateextern int slk_set(int, char *, int);
4040Sstevel@tonic-gateextern int slk_start(int, int *);
4050Sstevel@tonic-gateextern int slk_touch(void);
4060Sstevel@tonic-gateextern int start_color(void);
4070Sstevel@tonic-gateextern int typeahead(int);
4080Sstevel@tonic-gate
4090Sstevel@tonic-gateextern bool can_change_color(void);
4100Sstevel@tonic-gateextern bool has_colors(void);
4110Sstevel@tonic-gate
4120Sstevel@tonic-gateextern int waddch(WINDOW *, chtype);
4130Sstevel@tonic-gateextern int waddchnstr(WINDOW *, chtype *, int);
4140Sstevel@tonic-gateextern int waddnstr(WINDOW *, char *, int);
4150Sstevel@tonic-gateextern int wbkgd(WINDOW *, chtype);
4160Sstevel@tonic-gateextern int wborder(WINDOW *, chtype, chtype, chtype, chtype,
4170Sstevel@tonic-gate		chtype, chtype, chtype, chtype);
4180Sstevel@tonic-gateextern int wclrtobot(WINDOW *);
4190Sstevel@tonic-gateextern int wclrtoeol(WINDOW *);
4200Sstevel@tonic-gateextern int wdelch(WINDOW *);
4210Sstevel@tonic-gateextern int wechochar(WINDOW *, chtype);
4220Sstevel@tonic-gateextern int wgetstr(WINDOW *, char *);
4230Sstevel@tonic-gateextern int wgetnstr(WINDOW *, char *, int);
4240Sstevel@tonic-gateextern int whline(WINDOW *, chtype, int);
4250Sstevel@tonic-gateextern int wvline(WINDOW *, chtype, int);
4260Sstevel@tonic-gateextern int winchnstr(WINDOW *, chtype *, int);
4270Sstevel@tonic-gateextern int winchstr(WINDOW *, chtype *);
4280Sstevel@tonic-gateextern int winnstr(WINDOW *, char *, int);
4290Sstevel@tonic-gateextern int winsch(WINDOW *, chtype);
4300Sstevel@tonic-gateextern int winsdelln(WINDOW *, int);		/* internal */
4310Sstevel@tonic-gateextern int winsnstr(WINDOW *, char *, int);
4320Sstevel@tonic-gateextern int winstr(WINDOW *, char *);
4330Sstevel@tonic-gateextern int wmove(WINDOW *, int, int);
4340Sstevel@tonic-gateextern int wnoutrefresh(WINDOW *);
4350Sstevel@tonic-gateextern int wredrawln(WINDOW *, int, int);
4360Sstevel@tonic-gateextern int wscrl(WINDOW *, int);
4370Sstevel@tonic-gateextern int wsetscrreg(WINDOW *, int, int);
4380Sstevel@tonic-gateextern int wtouchln(WINDOW *, int, int, int);
4390Sstevel@tonic-gate
4400Sstevel@tonic-gateextern int crmode(void);
4410Sstevel@tonic-gateextern int nocrmode(void);
4420Sstevel@tonic-gateextern int ungetch(int);
4430Sstevel@tonic-gate
4440Sstevel@tonic-gateextern int mouse_set(long int);
4450Sstevel@tonic-gateextern int mouse_on(long int);
4460Sstevel@tonic-gateextern int mouse_off(long int);
4470Sstevel@tonic-gateextern int request_mouse_pos(void);
4480Sstevel@tonic-gateextern int map_button(unsigned long);
4490Sstevel@tonic-gate
4500Sstevel@tonic-gateextern void wmouse_position(WINDOW *, int *, int *);
4510Sstevel@tonic-gate
4520Sstevel@tonic-gateextern unsigned long getmouse(void), getbmap(void);
4530Sstevel@tonic-gate
4540Sstevel@tonic-gate		/* the following declarations take integers as arguments  */
4550Sstevel@tonic-gate		/* to keep the CI5 compiler happy.  what we really want   */
4560Sstevel@tonic-gate		/* to pass is given in comments.  (by the way, we don't   */
4570Sstevel@tonic-gate		/* save anything by passing short or bool, since compiler */
4580Sstevel@tonic-gate		/* expands them to integers any way			  */
4590Sstevel@tonic-gate
4600Sstevel@tonic-gateextern int pair_content(short, short *, short *);
4610Sstevel@tonic-gateextern int color_content(short, short *, short *, short *); /* as above */
4620Sstevel@tonic-gateextern int init_color(short, short, short, short);
4630Sstevel@tonic-gateextern int init_pair(short, short, short);
4640Sstevel@tonic-gateextern int idlok(WINDOW *, bool);
4650Sstevel@tonic-gate
4660Sstevel@tonic-gateextern void immedok(WINDOW *, bool);
4670Sstevel@tonic-gate
4680Sstevel@tonic-gateextern chtype winwch(WINDOW *);
4690Sstevel@tonic-gate
4700Sstevel@tonic-gateextern int pechowchar(WINDOW *, chtype);
4710Sstevel@tonic-gateextern int ungetwch(const wchar_t);
4720Sstevel@tonic-gateextern int waddnwstr(WINDOW *, wchar_t *, int);
4730Sstevel@tonic-gateextern int waddwch(WINDOW *, chtype);
4740Sstevel@tonic-gateextern int waddwchnstr(WINDOW *, chtype *, int);
4750Sstevel@tonic-gateextern int wechowchar(WINDOW *, chtype);
4760Sstevel@tonic-gateextern int wgetnwstr(WINDOW *, wchar_t *, int);
4770Sstevel@tonic-gateextern int wgetwch(WINDOW *);
4780Sstevel@tonic-gateextern int wgetwstr(WINDOW *, wchar_t *);
4790Sstevel@tonic-gateextern int winnwstr(WINDOW *, wchar_t *, int);
4800Sstevel@tonic-gateextern int winsnwstr(WINDOW *, wchar_t *, int);
4810Sstevel@tonic-gateextern int winswch(WINDOW *, chtype);
4820Sstevel@tonic-gateextern int winwchnstr(WINDOW *, chtype *, int);
4830Sstevel@tonic-gateextern int winwstr(WINDOW *, wchar_t *);
4840Sstevel@tonic-gate
4850Sstevel@tonic-gate#else /* __STDC__ */
4860Sstevel@tonic-gate
4870Sstevel@tonic-gateextern	SCREEN	*newscreen(),	/* termname, lines, cols, tabsiz, fout, fin */
4880Sstevel@tonic-gate		*setcurscreen(); /* screenptr */
4890Sstevel@tonic-gate
4900Sstevel@tonic-gateextern	WINDOW 	*initscr(),
4910Sstevel@tonic-gate		*newwin(),		/* nlines, ncols, begy, begx */
4920Sstevel@tonic-gate		*newpad(),		/* nlines, ncols */
4930Sstevel@tonic-gate		*derwin(),		/* orig, nlines, ncols, begy, begx */
4940Sstevel@tonic-gate		*dupwin(),		/* orig */
4950Sstevel@tonic-gate		*getwin();		/* file */
4960Sstevel@tonic-gate
4970Sstevel@tonic-gateextern	int	wgetch(); /* because it can return KEY_*, for instance. */
4980Sstevel@tonic-gate
4990Sstevel@tonic-gateextern	char	*longname(),	/* long name of terminal */
5000Sstevel@tonic-gate		*termname(),	/* effective terminal name */
5010Sstevel@tonic-gate		*keyname(),	/* (int)  name of token returned by wgetch() */
5020Sstevel@tonic-gate		*slk_label(),	/* index */
5030Sstevel@tonic-gate		erasechar(),
5040Sstevel@tonic-gate		killchar(),
5050Sstevel@tonic-gate		*unctrl();
5060Sstevel@tonic-gate
5070Sstevel@tonic-gateextern	chtype	termattrs();
5080Sstevel@tonic-gate
5090Sstevel@tonic-gateextern	void	vidupdate(), wsyncup(), wsyncdown(),
5100Sstevel@tonic-gate		delkeymap(),
5110Sstevel@tonic-gate		delscreen(), curserr(),
5120Sstevel@tonic-gate		_setqiflush(),
5130Sstevel@tonic-gate		immedok(),
5140Sstevel@tonic-gate		wcursyncup();
5150Sstevel@tonic-gate
5160Sstevel@tonic-gateextern	int	cbreak(), nocbreak(),
5170Sstevel@tonic-gate		reset_prog_mode(), reset_shell_mode(), def_prog_mode(),
5180Sstevel@tonic-gate		_setecho(), _setnonl(),
5190Sstevel@tonic-gate		def_shell_mode(), raw(),
5200Sstevel@tonic-gate		savetty(), traceon(), _meta(),
5210Sstevel@tonic-gate		traceoff(), noraw(), flushinp(), _getsyx(),
5220Sstevel@tonic-gate		_ring(), resetty(), ripoffline(), setsyx(), slk_refresh(),
5230Sstevel@tonic-gate		slk_restore(), wstandend(), wstandout(),
5240Sstevel@tonic-gate		wattroff(), wattron(), wattrset(), wrefresh();
5250Sstevel@tonic-gate
5260Sstevel@tonic-gateextern	int	color_cont(), copywin(), curs_set(), delay_output(), delwin(),
5270Sstevel@tonic-gate		doupdate(), drainio(), endwin(), isendwin(),
5280Sstevel@tonic-gate		baudrate(), has_ic(), has_il(), idlok(),
5290Sstevel@tonic-gate		init_color(), init_pair(), keypad(), mvcur();
5300Sstevel@tonic-gate
5310Sstevel@tonic-gateextern	int	mvprintw(), mvscanw(), mvwprintw(), mvwscanw(),
5320Sstevel@tonic-gate		printw(), scanw(), wprintw(), wscanw(), vwprintw(), vwscanw();
5330Sstevel@tonic-gate
5340Sstevel@tonic-gateextern	int	mvwin(), mvderwin(), napms(), newkey(), filter(),
5350Sstevel@tonic-gate		pair_content(), pechochar(), pnoutrefresh(), prefresh();
5360Sstevel@tonic-gate
5370Sstevel@tonic-gateextern 	int	putwin(), wredrawln(), scr_dump(), setupterm();
5380Sstevel@tonic-gate
5390Sstevel@tonic-gateextern	int	slk_attrof(), slk_attrof(), slk_attrset(),
5400Sstevel@tonic-gate		slk_clear(), slk_noutrefresh(), slk_set(),
5410Sstevel@tonic-gate		slk_start(), slk_touch(), start_color(),
5420Sstevel@tonic-gate		typeahead();
5430Sstevel@tonic-gate
5440Sstevel@tonic-gateextern	bool	can_change_color(), has_colors();
5450Sstevel@tonic-gate
5460Sstevel@tonic-gateextern	int	waddch(), waddchnstr(), waddnstr(), wbkgd(),
5470Sstevel@tonic-gate		wborder(), wclrtobot(), wclrtoeol(), wdelch(), wechochar(),
5480Sstevel@tonic-gate		wgetstr(), wgetnstr(), whline(), wvline(), winchnstr(),
5490Sstevel@tonic-gate		winchstr(), winnstr(), winsch(),
5500Sstevel@tonic-gate		winsdelln(),		/* internal */
5510Sstevel@tonic-gate		winsnstr(), winstr(), wmove(), wnoutrefresh(), wredrawln(),
5520Sstevel@tonic-gate		wscrl(), wsetscrreg(), wtouchln();
5530Sstevel@tonic-gate
5540Sstevel@tonic-gateextern	int	crmode(), nocrmode(), ungetch();
5550Sstevel@tonic-gate
5560Sstevel@tonic-gateextern	int	mouse_set(), mouse_on(), mouse_off(),
5570Sstevel@tonic-gate		request_mouse_pos(), map_button();
5580Sstevel@tonic-gate
5590Sstevel@tonic-gateextern void	wmouse_position();
5600Sstevel@tonic-gate
5610Sstevel@tonic-gateextern unsigned long getmouse(), getbmap();
5620Sstevel@tonic-gate
5630Sstevel@tonic-gateextern chtype	winwch();
5640Sstevel@tonic-gate
5650Sstevel@tonic-gateextern int	pechowchar(), ungetwch(), waddnwstr(), waddwch(),
5660Sstevel@tonic-gate		waddwchnstr(), wechowchar(), wgetnwstr(), wgetwch(),
5670Sstevel@tonic-gate		wgetwstr(), winnwstr(), winsnwstr(), winswch(),
5680Sstevel@tonic-gate		winwchnstr(), winwstr();
5690Sstevel@tonic-gate
5700Sstevel@tonic-gate#endif /* __STDC__ */
5710Sstevel@tonic-gate
5720Sstevel@tonic-gate#define	getsyx(y, x)		_getsyx(&(y), &(x))
5730Sstevel@tonic-gate
5740Sstevel@tonic-gate/*
5750Sstevel@tonic-gate * Functions to get at the window structure.
5760Sstevel@tonic-gate */
5770Sstevel@tonic-gate
5780Sstevel@tonic-gate#define	getyx(win, y, x)	((y) = getcury(win), (x) = getcurx(win))
5790Sstevel@tonic-gate#define	getbegyx(win, y, x)	((y) = getbegy(win), (x) = getbegx(win))
5800Sstevel@tonic-gate#define	getmaxyx(win, y, x)	((y) = getmaxy(win), (x) = getmaxx(win))
5810Sstevel@tonic-gate#define	getparyx(win, y, x)	((y) = getpary(win), (x) = getparx(win))
5820Sstevel@tonic-gate
5830Sstevel@tonic-gate#if	defined(CURS_PERFORMANCE) && !defined(__lint)
5840Sstevel@tonic-gate#define	getcury(win)		((win)->_cury)
5850Sstevel@tonic-gate#define	getcurx(win)		((win)->_curx)
5860Sstevel@tonic-gate#define	getbegy(win)		((win)->_begy)
5870Sstevel@tonic-gate#define	getbegx(win)		((win)->_begx)
5880Sstevel@tonic-gate#define	getmaxy(win)		((win)->_maxy)
5890Sstevel@tonic-gate#define	getmaxx(win)		((win)->_maxx)
5900Sstevel@tonic-gate#define	getpary(win)		((win)->_pary)
5910Sstevel@tonic-gate#define	getparx(win)		((win)->_parx)
5920Sstevel@tonic-gate#define	getbkgd(win)		((win)->_bkgd)
5930Sstevel@tonic-gate#define	getattrs(win)		((win)->_attrs)
5940Sstevel@tonic-gate#else 	/* defined(CURS_PERFORMANCE) && !defined(__lint) */
5950Sstevel@tonic-gate
5960Sstevel@tonic-gate#ifdef __STDC__
5970Sstevel@tonic-gateextern int getcury(WINDOW *);
5980Sstevel@tonic-gateextern int getcurx(WINDOW *);
5990Sstevel@tonic-gateextern int getbegy(WINDOW *);
6000Sstevel@tonic-gateextern int getbegx(WINDOW *);
6010Sstevel@tonic-gateextern int getmaxy(WINDOW *);
6020Sstevel@tonic-gateextern int getmaxx(WINDOW *);
6030Sstevel@tonic-gateextern int getpary(WINDOW *);
6040Sstevel@tonic-gateextern int getparx(WINDOW *);
6050Sstevel@tonic-gate
6060Sstevel@tonic-gateextern chtype getbkgd(WINDOW *);
6070Sstevel@tonic-gateextern chtype getattrs(WINDOW *);
6080Sstevel@tonic-gate
6090Sstevel@tonic-gate#else  /* __STDC__ */
6100Sstevel@tonic-gateextern	int	getcury(), getcurx(), getbegy(), getbegx(),
6110Sstevel@tonic-gate		getmaxy(), getmaxx(), getpary(), getparx();
6120Sstevel@tonic-gate
6130Sstevel@tonic-gateextern chtype	getbkgd(), getattrs();
6140Sstevel@tonic-gate
6150Sstevel@tonic-gate#endif  /* __STDC__ */
6160Sstevel@tonic-gate#endif	/* defined(CURS_PERFORMANCE) && !defined(__lint) */
6170Sstevel@tonic-gate
6180Sstevel@tonic-gate#if	defined(NOMACROS) || defined(__lint)
6190Sstevel@tonic-gate
6200Sstevel@tonic-gate#ifdef __STDC__
6210Sstevel@tonic-gate
6220Sstevel@tonic-gateextern	SCREEN	*newterm(char *, FILE *, FILE *);
6230Sstevel@tonic-gateextern	SCREEN  *set_term(SCREEN *);
6240Sstevel@tonic-gate
6250Sstevel@tonic-gateextern WINDOW *subpad(WINDOW *, int, int, int, int);
6260Sstevel@tonic-gateextern WINDOW *subwin(WINDOW *, int, int, int, int);
6270Sstevel@tonic-gate
6280Sstevel@tonic-gateextern char *unctrl(int);
6290Sstevel@tonic-gate
6300Sstevel@tonic-gateextern chtype inch(void);
6310Sstevel@tonic-gateextern chtype winch(WINDOW *);
6320Sstevel@tonic-gateextern chtype mvinch(int, int);
6330Sstevel@tonic-gateextern chtype mvwinch(WINDOW *, int, int);
6340Sstevel@tonic-gate
6350Sstevel@tonic-gateextern int addch(chtype);
6360Sstevel@tonic-gateextern int addchnstr(chtype *, int);
6370Sstevel@tonic-gateextern int addchstr(chtype *);
6380Sstevel@tonic-gateextern int addnstr(char *, int);
6390Sstevel@tonic-gateextern int addstr(char *);
6400Sstevel@tonic-gateextern int attroff(chtype);
6410Sstevel@tonic-gateextern int attron(chtype);
6420Sstevel@tonic-gateextern int attrset(chtype);
6430Sstevel@tonic-gateextern int beep(void);
6440Sstevel@tonic-gateextern int bkgd(chtype);
6450Sstevel@tonic-gateextern int border(chtype, chtype, chtype, chtype,
6460Sstevel@tonic-gate		chtype, chtype, chtype, chtype);
6470Sstevel@tonic-gateextern int box(WINDOW *, chtype, chtype);
6480Sstevel@tonic-gateextern int clear(void);
6490Sstevel@tonic-gateextern int clearok(WINDOW *, bool);
6500Sstevel@tonic-gateextern int clrtobot(void);
6510Sstevel@tonic-gateextern int clrtoeol(void);
6520Sstevel@tonic-gateextern int crmode(void);
6530Sstevel@tonic-gateextern int delch(void);
6540Sstevel@tonic-gateextern int deleteln(void);
6550Sstevel@tonic-gateextern int echo(void);
6560Sstevel@tonic-gateextern int echochar(chtype);
6570Sstevel@tonic-gateextern int erase(void);
6580Sstevel@tonic-gateextern int fixterm(void);
6590Sstevel@tonic-gateextern int flash(void);
6600Sstevel@tonic-gateextern int garbagedlines(WINDOW *, int, int);
6610Sstevel@tonic-gateextern int garbagedwin(WINDOW *);
6620Sstevel@tonic-gateextern int getch(void);
6630Sstevel@tonic-gateextern int getstr(char *);
6640Sstevel@tonic-gateextern int gettmode(void);
6650Sstevel@tonic-gateextern int halfdelay(int);
6660Sstevel@tonic-gateextern int hline(chtype, int);
6670Sstevel@tonic-gateextern int inchnstr(chtype *, int);
6680Sstevel@tonic-gateextern int inchstr(chtype *);
6690Sstevel@tonic-gateextern int innstr(char *, int);
6700Sstevel@tonic-gateextern int insch(chtype);
6710Sstevel@tonic-gateextern int insdelln(int);
6720Sstevel@tonic-gateextern int insertln(void);
6730Sstevel@tonic-gateextern int insnstr(char *, int);
6740Sstevel@tonic-gateextern int insstr(char *);
6750Sstevel@tonic-gateextern int instr(char *);
6760Sstevel@tonic-gateextern int intrflush(WINDOW *, int);
6770Sstevel@tonic-gateextern int is_linetouched(WINDOW *, int);
6780Sstevel@tonic-gateextern int is_wintouched(WINDOW *);
6790Sstevel@tonic-gateextern int leaveok(WINDOW *, bool);
6800Sstevel@tonic-gateextern int meta(WINDOW *, int);
6810Sstevel@tonic-gateextern int move(int, int);
6820Sstevel@tonic-gateextern int mvaddch(int, int, chtype);
6830Sstevel@tonic-gateextern int mvaddchnstr(int, int, chtype *, int);
6840Sstevel@tonic-gateextern int mvaddchstr(int, int, chtype *);
6850Sstevel@tonic-gateextern int mvaddnstr(int, int, char *, int);
6860Sstevel@tonic-gateextern int mvaddstr(int, int, char *);
6870Sstevel@tonic-gateextern int mvdelch(int, int);
6880Sstevel@tonic-gateextern int mvgetch(int, int);
6890Sstevel@tonic-gateextern int mvgetstr(int, int, char *);
6900Sstevel@tonic-gateextern int mvhline(int, int, chtype, int);
6910Sstevel@tonic-gateextern int mvinchnstr(int, int, chtype *, int);
6920Sstevel@tonic-gateextern int mvinchstr(int, int, chtype *);
6930Sstevel@tonic-gateextern int mvinnstr(int, int, char *, int);
6940Sstevel@tonic-gateextern int mvinsch(int, int, chtype);
6950Sstevel@tonic-gateextern int mvinsnstr(int, int, char *, int);
6960Sstevel@tonic-gateextern int mvinsstr(int, int, char *);
6970Sstevel@tonic-gateextern int mvinstr(int, int, char *);
6980Sstevel@tonic-gateextern int mvvline(int, int, chtype, int);
6990Sstevel@tonic-gateextern int mvwaddch(WINDOW *, int, int, chtype);
7000Sstevel@tonic-gateextern int mvwaddchnstr(WINDOW *, int, int, chtype *, int);
7010Sstevel@tonic-gateextern int mvwaddchstr(WINDOW *, int, int, chtype *);
7020Sstevel@tonic-gateextern int mvwaddnstr(WINDOW *, int, int, char *, int);
7030Sstevel@tonic-gateextern int mvwaddstr(WINDOW *, int, int, char *);
7040Sstevel@tonic-gateextern int mvwdelch(WINDOW *, int, int);
7050Sstevel@tonic-gateextern int mvwgetch(WINDOW *, int, int);
7060Sstevel@tonic-gateextern int mvwgetstr(WINDOW *, int, int, char *);
7070Sstevel@tonic-gateextern int mvwhline(WINDOW *, int, int, chtype, int);
7080Sstevel@tonic-gateextern int mvwinchnstr(WINDOW *, int, int, chtype *, int);
7090Sstevel@tonic-gateextern int mvwinchstr(WINDOW *, int, int, chtype *);
7100Sstevel@tonic-gateextern int mvwinnstr(WINDOW *, int, int, char *, int);
7110Sstevel@tonic-gateextern int mvwinsch(WINDOW *, int, int, chtype);
7120Sstevel@tonic-gateextern int mvwinsnstr(WINDOW *, int, int, char *, int);
7130Sstevel@tonic-gateextern int mvwinsstr(WINDOW *, int, int, char *);
7140Sstevel@tonic-gateextern int mvwinstr(WINDOW *, int, int, char *);
7150Sstevel@tonic-gateextern int mvwvline(WINDOW *, int, int, chtype, int);
7160Sstevel@tonic-gateextern int nl(void);
7170Sstevel@tonic-gateextern int nocrmode(void);
7180Sstevel@tonic-gateextern int nodelay(WINDOW *, bool);
7190Sstevel@tonic-gateextern int noecho(void);
7200Sstevel@tonic-gateextern int nonl(void);
7210Sstevel@tonic-gateextern int notimeout(WINDOW *, bool);
7220Sstevel@tonic-gateextern int overlay(WINDOW *, WINDOW *);
7230Sstevel@tonic-gateextern int overwrite(WINDOW *, WINDOW *);
7240Sstevel@tonic-gateextern int redrawwin(WINDOW *);
7250Sstevel@tonic-gateextern int refresh(void);
7260Sstevel@tonic-gateextern int resetterm(void);
7270Sstevel@tonic-gateextern int saveterm(void);
7280Sstevel@tonic-gateextern int scr_init(char *);
7290Sstevel@tonic-gateextern int scr_restore(char *);
7300Sstevel@tonic-gateextern int scr_set(char *);
7310Sstevel@tonic-gateextern int scrl(int);
7320Sstevel@tonic-gateextern int scroll(WINDOW *);
7330Sstevel@tonic-gateextern int scrollok(WINDOW *, bool);
7340Sstevel@tonic-gateextern int setscrreg(int, int);
7350Sstevel@tonic-gateextern int setterm(char *);
7360Sstevel@tonic-gateextern int slk_init(int);
7370Sstevel@tonic-gateextern int standend(void);
7380Sstevel@tonic-gateextern int standout(void);
7390Sstevel@tonic-gateextern int syncok(WINDOW *, bool);
7400Sstevel@tonic-gateextern int touchline(WINDOW *, int, int);
7410Sstevel@tonic-gateextern int touchwin(WINDOW *);
7420Sstevel@tonic-gateextern int untouchwin(WINDOW *);
7430Sstevel@tonic-gateextern int vline(chtype, int);
7440Sstevel@tonic-gateextern int waddchstr(WINDOW *, chtype *);
7450Sstevel@tonic-gateextern int waddstr(WINDOW *, char *);
7460Sstevel@tonic-gateextern int wclear(WINDOW *);
7470Sstevel@tonic-gateextern int wdeleteln(WINDOW *);
7480Sstevel@tonic-gateextern int werase(WINDOW *);
7490Sstevel@tonic-gateextern int winchstr(WINDOW *, chtype *);
7500Sstevel@tonic-gateextern int winsertln(WINDOW *);
7510Sstevel@tonic-gateextern int winsstr(WINDOW *, char *);
7520Sstevel@tonic-gateextern int winstr(WINDOW *, char *);
7530Sstevel@tonic-gateextern int wstandend(WINDOW *);
7540Sstevel@tonic-gateextern int wstandout(WINDOW *);
7550Sstevel@tonic-gate
7560Sstevel@tonic-gateextern void bkgdset(chtype);
7570Sstevel@tonic-gateextern void idcok(WINDOW *, bool);
7580Sstevel@tonic-gateextern void noqiflush(void);
7590Sstevel@tonic-gateextern void wbkgdset(WINDOW *, chtype);
7600Sstevel@tonic-gateextern void qiflush(void);
7610Sstevel@tonic-gateextern void timeout(int);
7620Sstevel@tonic-gateextern void wtimeout(WINDOW *, int);
7630Sstevel@tonic-gateextern void use_env(int);			/* int sb. char */
7640Sstevel@tonic-gate
7650Sstevel@tonic-gateextern chtype inwch(void);
7660Sstevel@tonic-gateextern chtype mvinwch(int, int);
7670Sstevel@tonic-gateextern chtype mvwinwch(WINDOW *, int, int);
7680Sstevel@tonic-gate
7690Sstevel@tonic-gateextern int addnwstr(wchar_t *, int);
7700Sstevel@tonic-gateextern int addwch(chtype);
7710Sstevel@tonic-gateextern int addwchnstr(chtype *, int);
7720Sstevel@tonic-gateextern int addwchstr(chtype *);
7730Sstevel@tonic-gateextern int addwstr(wchar_t *);
7740Sstevel@tonic-gateextern int echowchar(chtype);
7750Sstevel@tonic-gateextern int getnwstr(wchar_t *, int);
7760Sstevel@tonic-gateextern int getwch(void);
7770Sstevel@tonic-gateextern int getwstr(wchar_t *);
7780Sstevel@tonic-gateextern int innwstr(wchar_t *, int);
7790Sstevel@tonic-gateextern int insnwstr(wchar_t *, int);
7800Sstevel@tonic-gateextern int inswch(chtype);
7810Sstevel@tonic-gateextern int inswstr(wchar_t *);
7820Sstevel@tonic-gateextern int inwchnstr(chtype *, int);
7830Sstevel@tonic-gateextern int inwchstr(chtype *);
7840Sstevel@tonic-gateextern int inwstr(wchar_t *);
7850Sstevel@tonic-gateextern int mvaddnwstr(int, int, wchar_t *, int);
7860Sstevel@tonic-gateextern int mvaddwch(int, int, chtype);
7870Sstevel@tonic-gateextern int mvaddwchnstr(int, int, chtype *, int);
7880Sstevel@tonic-gateextern int mvaddwchstr(int, int, chtype *);
7890Sstevel@tonic-gateextern int mvaddwstr(int, int, wchar_t *);
7900Sstevel@tonic-gateextern int mvgetnwstr(int, int, wchar_t *, int);
7910Sstevel@tonic-gateextern int mvgetwch(int, int);
7920Sstevel@tonic-gateextern int mvgetwstr(int, int, wchar_t *);
7930Sstevel@tonic-gateextern int mvinnwstr(int, int, wchar_t *, int);
7940Sstevel@tonic-gateextern int mvinsnwstr(int, int, wchar_t *, int);
7950Sstevel@tonic-gateextern int mvinswch(int, int, chtype);
7960Sstevel@tonic-gateextern int mvinswstr(int, int, wchar_t *);
7970Sstevel@tonic-gateextern int mvinwchnstr(int, int, chtype *, int);
7980Sstevel@tonic-gateextern int mvinwchstr(int, int, chtype *);
7990Sstevel@tonic-gateextern int mvinwstr(int, int, wchar_t *);
8000Sstevel@tonic-gateextern int mvwaddnwstr(WINDOW *, int, int, wchar_t *, int);
8010Sstevel@tonic-gateextern int mvwaddwch(WINDOW *, int, int, chtype);
8020Sstevel@tonic-gateextern int mvwaddwchnstr(WINDOW *, int, int, chtype *, int);
8030Sstevel@tonic-gateextern int mvwaddwchstr(WINDOW *, int, int, chtype *);
8040Sstevel@tonic-gateextern int mvwaddwstr(WINDOW *, int, int, wchar_t *);
8050Sstevel@tonic-gateextern int mvwgetnwstr(WINDOW *, int, int, wchar_t *, int);
8060Sstevel@tonic-gateextern int mvwgetwch(WINDOW *, int, int);
8070Sstevel@tonic-gateextern int mvwgetwstr(WINDOW *, int, int, wchar_t *);
8080Sstevel@tonic-gateextern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
8090Sstevel@tonic-gateextern int mvwinsnwstr(WINDOW *, int, int, wchar_t *, int);
8100Sstevel@tonic-gateextern int mvwinswch(WINDOW *, int, int, chtype);
8110Sstevel@tonic-gateextern int mvwinswstr(WINDOW *, int, int, wchar_t *);
8120Sstevel@tonic-gateextern int mvwinwchnstr(WINDOW *, int, int, chtype *, int);
8130Sstevel@tonic-gateextern int mvwinwchstr(WINDOW *, int, int, chtype *);
8140Sstevel@tonic-gateextern int mvwinwstr(WINDOW *, int, int, wchar_t *);
8150Sstevel@tonic-gateextern int waddwchstr(WINDOW *, chtype *);
8160Sstevel@tonic-gateextern int waddwstr(WINDOW *, wchar_t *);
8170Sstevel@tonic-gateextern int winswstr(WINDOW *, wchar_t *);
8180Sstevel@tonic-gateextern int winwchstr(WINDOW *, chtype *);
8190Sstevel@tonic-gate
8200Sstevel@tonic-gate#else /* __STDC__ */
8210Sstevel@tonic-gate
8220Sstevel@tonic-gateextern	SCREEN	*newterm(),		/* termname, fout, fin */
8230Sstevel@tonic-gateextern	SCREEN	*set_term();		/* screenptr */
8240Sstevel@tonic-gate
8250Sstevel@tonic-gateextern	WINDOW	*subpad(),
8260Sstevel@tonic-gateextern	WINDOW	*subwin();
8270Sstevel@tonic-gate
8280Sstevel@tonic-gateextern	chtype	inch(), winch(), mvinch(), mvwinch();
8290Sstevel@tonic-gate
8300Sstevel@tonic-gateextern	char	*unctrl();
8310Sstevel@tonic-gate
8320Sstevel@tonic-gateextern	int	addch(), addchnstr(), addchstr(), addnstr(), addstr(),
8330Sstevel@tonic-gate		attroff(), attron(), attrset(), beep(), bkgd(),
8340Sstevel@tonic-gate		border(), box(), clear(), clearok(), clrtobot(), clrtoeol(),
8350Sstevel@tonic-gate		crmode(), delch(), deleteln(), echo(), echochar(),
8360Sstevel@tonic-gate		erase(),
8370Sstevel@tonic-gate/* MORE */	fixterm(),
8380Sstevel@tonic-gate		flash(), garbagedlines(), garbagedwin(),
8390Sstevel@tonic-gate		getch(), getstr(), gettmode(), halfdelay(), hline(),
8400Sstevel@tonic-gate		inchnstr(), inchstr(), innstr(), insch(),
8410Sstevel@tonic-gate		insdelln(), insertln(), insnstr(), insstr(), instr(),
8420Sstevel@tonic-gate		intrflush(),
8430Sstevel@tonic-gate		is_linetouched(), is_wintouched(), leaveok(), meta(),
8440Sstevel@tonic-gate		move(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(),
8450Sstevel@tonic-gate		mvaddstr(), mvdelch(), mvgetch(), mvgetstr(), mvhline(),
8460Sstevel@tonic-gate		mvinchnstr(), mvinchstr(), mvinnstr(), mvinsch(), mvinsnstr(),
8470Sstevel@tonic-gate		mvinsstr(), mvinstr(), mvvline(), mvwaddch(), mvwaddchnstr(),
8480Sstevel@tonic-gate		mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(),
8490Sstevel@tonic-gate		mvwgetch(), mvwgetstr(), mvwhline(), mvwinchnstr(),
8500Sstevel@tonic-gate		mvwinchstr(), mvwinnstr(), mvwinsch(), mvwinsnstr(),
8510Sstevel@tonic-gate		mvwinsstr(), mvwinstr(), mvwvline(),
8520Sstevel@tonic-gate		nl(), nocrmode(), nodelay(),
8530Sstevel@tonic-gate		noecho(), nonl(), notimeout(),
8540Sstevel@tonic-gate		overlay(), overwrite(), redrawwin(), refresh(),
8550Sstevel@tonic-gate		resetterm(), saveterm(), scr_init(),
8560Sstevel@tonic-gate		scr_restore(), scr_set(), scrl(),
8570Sstevel@tonic-gate		scroll(), scrollok(), setscrreg(), setterm(),
8580Sstevel@tonic-gate		slk_init(), standend(), standout(),
8590Sstevel@tonic-gate		syncok(), touchline(), touchwin(), untouchwin(), vline(),
8600Sstevel@tonic-gate		waddchstr(), waddstr(), wclear(),
8610Sstevel@tonic-gate		wdeleteln(), werase(), winchstr(), winsertln(),
8620Sstevel@tonic-gate		winsstr(), winstr(), wstandend(), wstandout();
8630Sstevel@tonic-gate
8640Sstevel@tonic-gateextern	void	bkgdset(), wbkgdset(), idcok(), noqiflush(),
8650Sstevel@tonic-gate		qiflush(), timeout(), wtimeout(), use_env();
8660Sstevel@tonic-gate
8670Sstevel@tonic-gateextern unsigned long getmouse(), getbmap();
8680Sstevel@tonic-gate
8690Sstevel@tonic-gateextern chtype   inwch(), mvinwch(), mvwinwch();
8700Sstevel@tonic-gate
8710Sstevel@tonic-gateextern int	addnwstr(), addwch(), addwchnstr(), addwchstr(),
8720Sstevel@tonic-gate		addwstr(), echowchar(), getnwstr(), getwch(),
8730Sstevel@tonic-gate		getwstr(), innwstr(), insnwstr(), inswch(),
8740Sstevel@tonic-gate		inswstr(), inwchnstr(), inwchstr(), inwstr(),
8750Sstevel@tonic-gate		mvaddnwstr(), mvaddwch(), mvaddwchnstr(), mvaddwchstr(),
8760Sstevel@tonic-gate		mvaddwstr(), mvgetnwstr(), mvgetwch(), mvgetwstr(),
8770Sstevel@tonic-gate		mvinnwstr(), mvinsnwstr(), mvinswch(), mvinswstr(),
8780Sstevel@tonic-gate		mvinwchnstr(), mvinwchstr(), mvinwstr(), mvwaddnwstr(),
8790Sstevel@tonic-gate		mvwaddwch(), mvwaddwchnstr(), mvwaddwchstr(), mvwaddwstr(),
8800Sstevel@tonic-gate		mvwgetnwstr(), mvwgetwch(), mvwgetwstr(), mvwinnwstr(),
8810Sstevel@tonic-gate		mvwinsnwstr(), mvwinswch(), mvwinswstr(), mvwinwchnstr(),
8820Sstevel@tonic-gate		mvwinwchstr(), mvwinwstr(), waddwchstr(), waddwstr(),
8830Sstevel@tonic-gate		winswstr(), winwchstr();
8840Sstevel@tonic-gate
8850Sstevel@tonic-gate#endif /* __STDC__ */
8860Sstevel@tonic-gate
8870Sstevel@tonic-gate#else	/* NOMACROS || __lint */
8880Sstevel@tonic-gate
8890Sstevel@tonic-gate/*
8900Sstevel@tonic-gate * The defines from here down to the #endif for NOMACROS
8910Sstevel@tonic-gate * define	macros, which may be more efficient than their
8920Sstevel@tonic-gate * function versions. The functions may be accessed by defining
8930Sstevel@tonic-gate * NOMACROS in C code. This is useful for debugging purposes.
8940Sstevel@tonic-gate */
8950Sstevel@tonic-gate
8960Sstevel@tonic-gate#include  <unctrl.h>
8970Sstevel@tonic-gate
8980Sstevel@tonic-gate/* pseudo functions for stdscr */
8990Sstevel@tonic-gate#define	addch(ch)	waddch(stdscr, ch)
9000Sstevel@tonic-gate#define	addnstr(s, n)	waddnstr(stdscr, s, n)
9010Sstevel@tonic-gate#define	addstr(str)	waddstr(stdscr, str)
9020Sstevel@tonic-gate#define	attroff(at)	wattroff(stdscr, at)
9030Sstevel@tonic-gate#define	attron(at)	wattron(stdscr, at)
9040Sstevel@tonic-gate#define	attrset(at)	wattrset(stdscr, at)
9050Sstevel@tonic-gate#define	bkgd(c)		wbkgd(stdscr, c)
9060Sstevel@tonic-gate#define	border(ls, rs, ts, bs, tl, tr, bl, br) \
9070Sstevel@tonic-gate	wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
9080Sstevel@tonic-gate#define	clear()		wclear(stdscr)
9090Sstevel@tonic-gate#define	clrtobot()	wclrtobot(stdscr)
9100Sstevel@tonic-gate#define	clrtoeol()	wclrtoeol(stdscr)
9110Sstevel@tonic-gate#define	delch()		wdelch(stdscr)
9120Sstevel@tonic-gate#define	deleteln()	wdeleteln(stdscr)
9130Sstevel@tonic-gate#define	echochar(ch)	wechochar(stdscr, ch)
9140Sstevel@tonic-gate#define	erase()		werase(stdscr)
9150Sstevel@tonic-gate#define	getch()		wgetch(stdscr)
9160Sstevel@tonic-gate#define	getstr(str)	wgetstr(stdscr, str)
9170Sstevel@tonic-gate#define	inch()		winch(stdscr)
9180Sstevel@tonic-gate#define	insch(c)	winsch(stdscr, c)
9190Sstevel@tonic-gate#define	insdelln(id)	winsdelln(stdscr, id)
9200Sstevel@tonic-gate#define	insertln()	winsertln(stdscr)
9210Sstevel@tonic-gate#define	insnstr(s, n)	winsnstr(stdscr, s, n)
9220Sstevel@tonic-gate#define	insstr(s)	winsstr(stdscr, s)
9230Sstevel@tonic-gate#define	move(y, x)	wmove(stdscr, y, x)
9240Sstevel@tonic-gate#define	refresh()	wrefresh(stdscr)
9250Sstevel@tonic-gate#define	scrl(n)		wscrl(stdscr, n)
9260Sstevel@tonic-gate#define	setscrreg(t, b)	wsetscrreg(stdscr, t, b)
9270Sstevel@tonic-gate#define	standend()	wstandend(stdscr)
9280Sstevel@tonic-gate#define	standout()	wstandout(stdscr)
9290Sstevel@tonic-gate#define	timeout(tm)	wtimeout(stdscr, tm)
9300Sstevel@tonic-gate#define	hline(c, num)	whline(stdscr, c, num)
9310Sstevel@tonic-gate#define	vline(c, num)	wvline(stdscr, c, num)
9320Sstevel@tonic-gate#define	addchstr(str)	waddchstr(stdscr, str)
9330Sstevel@tonic-gate#define	addchnstr(str, n)	waddchnstr(stdscr, str, n)
9340Sstevel@tonic-gate#define	instr(str)	winstr(stdscr, (str))
9350Sstevel@tonic-gate#define	innstr(str, n)	winnstr(stdscr, (str), (n))
9360Sstevel@tonic-gate#define	inchstr(str)	winchstr(stdscr, str)
9370Sstevel@tonic-gate#define	inchnstr(str, n)	winchnstr(stdscr, str, n)
9380Sstevel@tonic-gate#define	bkgdset(c)	wbkgdset(stdscr, c)
9390Sstevel@tonic-gate
9400Sstevel@tonic-gate#define	addnwstr(ws, n)	waddnwstr(stdscr, ws, n)
9410Sstevel@tonic-gate#define	addwch(ch)	waddwch(stdscr, ch)
9420Sstevel@tonic-gate#define	addwchnstr(str, n)	waddwchnstr(stdscr, str, n)
9430Sstevel@tonic-gate#define	addwchstr(str)	waddwchstr(stdscr, str)
9440Sstevel@tonic-gate#define	addwstr(ws)	waddwstr(stdscr, ws)
9450Sstevel@tonic-gate#define	echowchar(ch)	wechowchar(stdscr, ch)
9460Sstevel@tonic-gate#define	getnwstr(ws, n)	wgetnwstr(stdscr, ws, n)
9470Sstevel@tonic-gate#define	getwch()	wgetwch(stdscr)
9480Sstevel@tonic-gate#define	getwstr(ws)	wgetwstr(stdscr, ws)
9490Sstevel@tonic-gate#define	innwstr(ws, n)	winnwstr(stdscr, ws, n)
9500Sstevel@tonic-gate#define	insnwstr(ws, n)	winsnwstr(stdscr, ws, n)
9510Sstevel@tonic-gate#define	inswch(c)	winswch(stdscr, c)
9520Sstevel@tonic-gate#define	inswstr(ws)	winswstr(stdscr, ws)
9530Sstevel@tonic-gate#define	inwch()	winwch(stdscr)
9540Sstevel@tonic-gate#define	inwchnstr(str, n)	winwchnstr(stdscr, str, n)
9550Sstevel@tonic-gate#define	inwchstr(str)	winwchstr(stdscr, str)
9560Sstevel@tonic-gate#define	inwstr(ws)	winwstr(stdscr, ws)
9570Sstevel@tonic-gate
9580Sstevel@tonic-gate#define	adjcurspos()	wadjcurspos(stdscr)
9590Sstevel@tonic-gate#define	movenextch()	wmovenextch(stdscr)
9600Sstevel@tonic-gate#define	moveprevch()	wmoveprevch(stdscr)
9610Sstevel@tonic-gate
9620Sstevel@tonic-gate/* functions to define	environment flags of a window */
9630Sstevel@tonic-gate#ifdef	CURS_PERFORMANCE
9640Sstevel@tonic-gate#define	wbkgdset(win, c) \
9650Sstevel@tonic-gate	(((win)->_attrs = (((win)->_attrs & ~((win)->_bkgd & A_ATTRIBUTES)) | \
9660Sstevel@tonic-gate	    (c & A_ATTRIBUTES))), ((win)->_bkgd = (c)))
9670Sstevel@tonic-gate#define	syncok(win, bf)		((win)->_parent ? (win)->_sync = (bf) : ERR)
9680Sstevel@tonic-gate#define	notimeout(win, bf) \
9690Sstevel@tonic-gate	(((win)->_notimeout = ((bf) ? TRUE : FALSE)), OK)
9700Sstevel@tonic-gate#define	clearok(win, bf)	(((win)->_clear = (bf)), OK)
9710Sstevel@tonic-gate#define	leaveok(win, bf)	(((win)->_leave = (bf)), OK)
9720Sstevel@tonic-gate#define	scrollok(win, bf)	(((win)->_scroll = ((bf) ? TRUE : FALSE)), OK)
9730Sstevel@tonic-gate#define	idcok(win, bf)		((win)->_use_idc = ((bf) ? TRUE : FALSE))
9740Sstevel@tonic-gate#define	nodelay(win, bf)	(((win)->_delay = (bf) ? 0 : -1), OK)
9750Sstevel@tonic-gate#define	is_wintouched(win)	((win)->_flags & _WINCHANGED)
9760Sstevel@tonic-gate#define	is_linetouched(win, line) \
9770Sstevel@tonic-gate	((((line) >= (win)->_maxy) || ((line) < 0)) ? ERR : \
9780Sstevel@tonic-gate	    (((win)->_firstch[(line)] == _INFINITY) ? FALSE : TRUE))
9790Sstevel@tonic-gate
9800Sstevel@tonic-gate#define	subwin(win, nl, nc, by, bx) \
9810Sstevel@tonic-gate	derwin((win), (nl), (nc), (by-win->_begy), (bx-win->_begx))
9820Sstevel@tonic-gate#define	touchwin(win)		wtouchln((win), 0, (win)->_maxy, TRUE)
9830Sstevel@tonic-gate#define	redrawwin(win)		wredrawln((win), 0, (win)->_maxy)
9840Sstevel@tonic-gate#define	winchstr(win, str) \
9850Sstevel@tonic-gate	winchnstr((win), str, ((win)->_maxx - (win)->_curx))
9860Sstevel@tonic-gate#define	winstr(win, str) \
9870Sstevel@tonic-gate	winnstr((win), str, ((win)->_maxx - (win)->_curx))
9880Sstevel@tonic-gate#define	untouchwin(win)		wtouchln((win), 0, ((win)->_maxy), FALSE)
9890Sstevel@tonic-gate#define	winch(win)		((win)->_y[(win)->_cury][(win)->_curx])
9900Sstevel@tonic-gate
9910Sstevel@tonic-gate#define	wtimeout(win, tm)	((win)->_delay = (tm))
9920Sstevel@tonic-gate#define	use_env(bf)		(_use_env = (bf))
9930Sstevel@tonic-gate
9940Sstevel@tonic-gate#else	/* CURS_PERFORMANCE */
9950Sstevel@tonic-gate
9960Sstevel@tonic-gate#ifdef __STDC__
9970Sstevel@tonic-gate
9980Sstevel@tonic-gateextern void wbkgdset(WINDOW *, chtype);
9990Sstevel@tonic-gateextern void idcok(WINDOW *, bool);
10000Sstevel@tonic-gateextern void wtimeout(WINDOW *, int);
10010Sstevel@tonic-gateextern void use_env(int);			 /* int sb. char */
10020Sstevel@tonic-gate
10030Sstevel@tonic-gateextern int syncok(WINDOW *, bool);
10040Sstevel@tonic-gateextern int notimeout(WINDOW *, bool);
10050Sstevel@tonic-gateextern int clearok(WINDOW *, bool);
10060Sstevel@tonic-gateextern int leaveok(WINDOW *, bool);
10070Sstevel@tonic-gateextern int scrollok(WINDOW *, bool);
10080Sstevel@tonic-gateextern int nodelay(WINDOW *, bool);
10090Sstevel@tonic-gateextern int is_linetouched(WINDOW *, int);
10100Sstevel@tonic-gateextern int is_wintouched(WINDOW *);
10110Sstevel@tonic-gateextern int touchwin(WINDOW *);
10120Sstevel@tonic-gateextern int redrawwin(WINDOW *);
10130Sstevel@tonic-gateextern int winchstr(WINDOW *, chtype *);
10140Sstevel@tonic-gateextern int winstr(WINDOW *, char *);
10150Sstevel@tonic-gateextern int untouchwin(WINDOW *);
10160Sstevel@tonic-gate
10170Sstevel@tonic-gateextern chtype winch(WINDOW *);
10180Sstevel@tonic-gate
10190Sstevel@tonic-gateextern WINDOW *subwin(WINDOW *, int, int, int, int);
10200Sstevel@tonic-gate
10210Sstevel@tonic-gate#else  /* __STDC__ */
10220Sstevel@tonic-gate
10230Sstevel@tonic-gateextern	void	wbkgdset(), idcok(), wtimeout(), use_env();
10240Sstevel@tonic-gate
10250Sstevel@tonic-gateextern	int	syncok(), notimeout(), clearok(), leaveok(),
10260Sstevel@tonic-gate		scrollok(), nodelay(), is_linetouched(), is_wintouched(),
10270Sstevel@tonic-gate		touchwin(), redrawwin(), winchstr(), winstr(),
10280Sstevel@tonic-gate		untouchwin();
10290Sstevel@tonic-gate
10300Sstevel@tonic-gateextern  chtype  winch();
10310Sstevel@tonic-gate
10320Sstevel@tonic-gateextern WINDOW *subwin();
10330Sstevel@tonic-gate
10340Sstevel@tonic-gate#endif /* __STDC__ */
10350Sstevel@tonic-gate
10360Sstevel@tonic-gate#endif	/* CURS_PERFORMANCE */
10370Sstevel@tonic-gate
10380Sstevel@tonic-gate/* functions for move and update */
10390Sstevel@tonic-gate#define	mvaddch(y, x, ch) \
10400Sstevel@tonic-gate	mvwaddch(stdscr, y, x, ch)
10410Sstevel@tonic-gate#define	mvaddnstr(y, x, s, n) \
10420Sstevel@tonic-gate	mvwaddnstr(stdscr, y, x, s, n)
10430Sstevel@tonic-gate#define	mvaddstr(y, x, str) \
10440Sstevel@tonic-gate	mvwaddstr(stdscr, y, x, str)
10450Sstevel@tonic-gate#define	mvdelch(y, x) \
10460Sstevel@tonic-gate	mvwdelch(stdscr, y, x)
10470Sstevel@tonic-gate#define	mvgetch(y, x) \
10480Sstevel@tonic-gate	mvwgetch(stdscr, y, x)
10490Sstevel@tonic-gate#define	mvgetstr(y, x, str) \
10500Sstevel@tonic-gate	mvwgetstr(stdscr, y, x, str)
10510Sstevel@tonic-gate#define	mvinch(y, x) \
10520Sstevel@tonic-gate	mvwinch(stdscr, y, x)
10530Sstevel@tonic-gate#define	mvinsch(y, x, c) \
10540Sstevel@tonic-gate	mvwinsch(stdscr, y, x, c)
10550Sstevel@tonic-gate#define	mvinsnstr(y, x, s, n) \
10560Sstevel@tonic-gate	mvwinsnstr(stdscr, y, x, s, n)
10570Sstevel@tonic-gate#define	mvinsstr(y, x, s) \
10580Sstevel@tonic-gate	mvwinsstr(stdscr, y, x, s)
10590Sstevel@tonic-gate#define	mvaddchstr(y, x, str) \
10600Sstevel@tonic-gate	mvwaddchstr(stdscr, y, x, str)
10610Sstevel@tonic-gate#define	mvaddchnstr(y, x, str, n) \
10620Sstevel@tonic-gate	mvwaddchnstr(stdscr, y, x, str, n)
10630Sstevel@tonic-gate#define	mvinstr(y, x, str) \
10640Sstevel@tonic-gate	mvwinstr(stdscr, y, x, (str))
10650Sstevel@tonic-gate#define	mvinnstr(y, x, str, n) \
10660Sstevel@tonic-gate	mvwinnstr(stdscr, y, x, (str), (n))
10670Sstevel@tonic-gate#define	mvinchstr(y, x, str) \
10680Sstevel@tonic-gate	mvwinchstr(stdscr, y, x, str)
10690Sstevel@tonic-gate#define	mvinchnstr(y, x, str, n) \
10700Sstevel@tonic-gate	mvwinchnstr(stdscr, y, x, str, n)
10710Sstevel@tonic-gate#define	mvhline(y, x, c, num) \
10720Sstevel@tonic-gate	mvwhline(stdscr, y, x, c, num)
10730Sstevel@tonic-gate#define	mvvline(y, x, c, num) \
10740Sstevel@tonic-gate	mvwvline(stdscr, y, x, c, num)
10750Sstevel@tonic-gate
10760Sstevel@tonic-gate#define	mvaddnwstr(y, x, ws, n) \
10770Sstevel@tonic-gate	mvwaddnwstr(stdscr, y, x, ws, n)
10780Sstevel@tonic-gate#define	mvaddwch(y, x, ch) \
10790Sstevel@tonic-gate	mvwaddwch(stdscr, y, x, ch)
10800Sstevel@tonic-gate#define	mvaddwchnstr(y, x, str, n) \
10810Sstevel@tonic-gate	mvwaddwchnstr(stdscr, y, x, str, n)
10820Sstevel@tonic-gate#define	mvaddwchstr(y, x, str) \
10830Sstevel@tonic-gate	mvwaddwchstr(stdscr, y, x, str)
10840Sstevel@tonic-gate#define	mvaddwstr(y, x, ws) \
10850Sstevel@tonic-gate	mvwaddwstr(stdscr, y, x, ws)
10860Sstevel@tonic-gate#define	mvgetnwstr(y, x, ws, n) \
10870Sstevel@tonic-gate	mvwgetnwstr(stdscr, y, x, ws, n)
10880Sstevel@tonic-gate#define	mvgetwch(y, x) \
10890Sstevel@tonic-gate	mvwgetwch(stdscr, y, x)
10900Sstevel@tonic-gate#define	mvgetwstr(y, x, ws) \
10910Sstevel@tonic-gate	mvwgetwstr(stdscr, y, x, ws)
10920Sstevel@tonic-gate#define	mvinnwstr(y, x, ws, n) \
10930Sstevel@tonic-gate	mvwinnwstr(stdscr, y, x, ws, n)
10940Sstevel@tonic-gate#define	mvinsnwstr(y, x, ws, n) \
10950Sstevel@tonic-gate	mvwinsnwstr(stdscr, y, x, ws, n)
10960Sstevel@tonic-gate#define	mvinswch(y, x, c) \
10970Sstevel@tonic-gate	mvwinswch(stdscr, y, x, c)
10980Sstevel@tonic-gate#define	mvinswstr(y, x, ws) \
10990Sstevel@tonic-gate	mvwinswstr(stdscr, y, x, ws)
11000Sstevel@tonic-gate#define	mvinwch(y, x) \
11010Sstevel@tonic-gate	mvwinwch(stdscr, y, x)
11020Sstevel@tonic-gate#define	mvinwchnstr(y, x, str, n) \
11030Sstevel@tonic-gate	mvwinwchnstr(stdscr, y, x, str, n)
11040Sstevel@tonic-gate#define	mvinwchstr(y, x, str) \
11050Sstevel@tonic-gate	mvwinwchstr(stdscr, y, x, str)
11060Sstevel@tonic-gate#define	mvinwstr(y, x, ws) \
11070Sstevel@tonic-gate	mvwinwstr(stdscr, y, x, ws)
11080Sstevel@tonic-gate
11090Sstevel@tonic-gate#define	mvwaddch(win, y, x, ch) \
11100Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddch(win, ch))
11110Sstevel@tonic-gate#define	mvwaddnstr(win, y, x, s, n) \
11120Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddnstr(win, s, n))
11130Sstevel@tonic-gate#define	mvwaddstr(win, y, x, str) \
11140Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddstr(win, str))
11150Sstevel@tonic-gate#define	mvwdelch(win, y, x) \
11160Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wdelch(win))
11170Sstevel@tonic-gate#define	mvwgetch(win, y, x) \
11180Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wgetch(win))
11190Sstevel@tonic-gate#define	mvwgetstr(win, y, x, str) \
11200Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wgetstr(win, str))
11210Sstevel@tonic-gate#define	mvwinch(win, y, x) \
11220Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? (chtype)ERR : winch(win))
11230Sstevel@tonic-gate#define	mvwinsch(win, y, x, c) \
11240Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winsch(win, c))
11250Sstevel@tonic-gate#define	mvwinsnstr(win, y, x, s, n) \
11260Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winsnstr(win, s, n))
11270Sstevel@tonic-gate#define	mvwinsstr(win, y, x, s) \
11280Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winsstr(win, s))
11290Sstevel@tonic-gate#define	mvwhline(win, y, x, c, num) \
11300Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : whline(win, c, num))
11310Sstevel@tonic-gate#define	mvwvline(win, y, x, c, num) \
11320Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wvline(win, c, num))
11330Sstevel@tonic-gate#define	mvwaddchstr(win, y, x, str) \
11340Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddchstr(win, str))
11350Sstevel@tonic-gate#define	mvwaddchnstr(win, y, x, str, n) \
11360Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddchnstr(win, str, n))
11370Sstevel@tonic-gate#define	mvwinstr(win, y, x, str) \
11380Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winstr(win, str))
11390Sstevel@tonic-gate#define	mvwinnstr(win, y, x, str, n) \
11400Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winnstr(win, str, n))
11410Sstevel@tonic-gate#define	mvwinchstr(win, y, x, str) \
11420Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winchstr(win, str))
11430Sstevel@tonic-gate#define	mvwinchnstr(win, y, x, str, n) \
11440Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winchnstr(win, str, n))
11450Sstevel@tonic-gate#define	mvwaddnwstr(win, y, x, ws, n) \
11460Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddnwstr(win, ws, n))
11470Sstevel@tonic-gate#define	mvwaddwch(win, y, x, ch) \
11480Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddwch(win, ch))
11490Sstevel@tonic-gate#define	mvwaddwchnstr(win, y, x, str, n) \
11500Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddwchnstr(win, str, n))
11510Sstevel@tonic-gate#define	mvwaddwchstr(win, y, x, str) \
11520Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddwchstr(win, str))
11530Sstevel@tonic-gate#define	mvwaddwstr(win, y, x, ws) \
11540Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : waddwstr(win, ws))
11550Sstevel@tonic-gate#define	mvwgetnwstr(win, y, x, ws, n) \
11560Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wgetnwstr(win, ws, n))
11570Sstevel@tonic-gate#define	mvwgetwch(win, y, x) \
11580Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wgetwch(win))
11590Sstevel@tonic-gate#define	mvwgetwstr(win, y, x, ws) \
11600Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : wgetwstr(win, ws))
11610Sstevel@tonic-gate#define	mvwinnwstr(win, y, x, ws, n) \
11620Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winnwstr(win, ws, n))
11630Sstevel@tonic-gate#define	mvwinsnwstr(win, y, x, ws, n) \
11640Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winsnwstr(win, ws, n))
11650Sstevel@tonic-gate#define	mvwinswch(win, y, x, c) \
11660Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winswch(win, c))
11670Sstevel@tonic-gate#define	mvwinswstr(win, y, x, ws) \
11680Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winswstr(win, ws))
11690Sstevel@tonic-gate#define	mvwinwch(win, y, x) \
11700Sstevel@tonic-gate	(wmove(win, y, x) == ERR ?(chtype) ERR : winwch(win))
11710Sstevel@tonic-gate#define	mvwinwchnstr(win, y, x, str, n) \
11720Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winwchnstr(win, str, n))
11730Sstevel@tonic-gate#define	mvwinwchstr(win, y, x, str) \
11740Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winwchstr(win, str))
11750Sstevel@tonic-gate#define	mvwinwstr(win, y, x, ws) \
11760Sstevel@tonic-gate	(wmove(win, y, x) == ERR ? ERR : winwstr(win, ws))
11770Sstevel@tonic-gate
11780Sstevel@tonic-gate#define	waddwchstr(win, str)	waddwchnstr(win, str, -1)
11790Sstevel@tonic-gate#define	winwchstr(win, str)	winwchnstr(win, str, -1)
11800Sstevel@tonic-gate#define	waddwstr(win, ws)	waddnwstr(win, ws, -1)
11810Sstevel@tonic-gate#define	winswstr(win, ws)	winsnwstr(win, ws, -1)
11820Sstevel@tonic-gate
11830Sstevel@tonic-gate#ifdef CURS_MACROS
11840Sstevel@tonic-gate#define	overlay(src, dst)	_overlap((src), (dst), TRUE)
11850Sstevel@tonic-gate#define	overwrite(src, dst)	_overlap((src), (dst), FALSE)
11860Sstevel@tonic-gate#define	wdeleteln(win)		winsdelln((win), -1)
11870Sstevel@tonic-gate#define	winsertln(win)		winsdelln((win), 1)
11880Sstevel@tonic-gate#define	wstandend(win)		wattrset((win), A_NORMAL)
11890Sstevel@tonic-gate#define	wstandout(win)		wattron((win), A_STANDOUT)
11900Sstevel@tonic-gate#define	beep()			_ring(TRUE)
11910Sstevel@tonic-gate#define	flash()			_ring(FALSE)
11920Sstevel@tonic-gate#define	scroll(win)		wscrl((win), 1)
11930Sstevel@tonic-gate#define	slk_init(f)		slk_start(((f == 0) ? 3 : 2), NULL)
11940Sstevel@tonic-gate#define	scr_init(file)		_scr_all(file, 0)
11950Sstevel@tonic-gate#define	scr_restore(file)	_scr_all(file, 1)
11960Sstevel@tonic-gate#define	scr_set(file)		_scr_all(file, 2)
11970Sstevel@tonic-gate#define	subpad(win, nl, nc, by, bx) derwin((win), (nl), (nc), (by), (bx))
11980Sstevel@tonic-gate#define	box(win, v, h)		wborder((win), (v), (v), (h), (h), 0, 0, 0, 0)
11990Sstevel@tonic-gate#define	newterm(type, fout, fin) newscreen((type), 0, 0, 0, (fout), (fin))
12000Sstevel@tonic-gate#define	touchline(win, y, n)	wtouchln((win), (y), (n), TRUE)
12010Sstevel@tonic-gate
12020Sstevel@tonic-gate#define	waddstr(win, str)	waddnstr((win), (str), -1)
12030Sstevel@tonic-gate#define	werase(win)		(wmove((win), 0, 0), wclrtobot(win))
12040Sstevel@tonic-gate#define	wclear(win)		(clearok((win), TRUE), werase(win))
12050Sstevel@tonic-gate#define	intrflush(win, flag)	_setqiflush(flag)
12060Sstevel@tonic-gate#define	meta(win, flag)		_meta(flag)
12070Sstevel@tonic-gate
12080Sstevel@tonic-gate#define	setterm(name)		setupterm((name), 1, (char *)NULL)
12090Sstevel@tonic-gate#define	gettmode()		(OK)
12100Sstevel@tonic-gate#define	halfdelay(tens)		ttimeout((tens)*100)
12110Sstevel@tonic-gate
12120Sstevel@tonic-gate#define	echo()			_setecho(TRUE)
12130Sstevel@tonic-gate#define	noecho()		_setecho(FALSE)
12140Sstevel@tonic-gate#define	nl()			_setnonl(FALSE)
12150Sstevel@tonic-gate#define	nonl()			_setnonl(TRUE)
12160Sstevel@tonic-gate
12170Sstevel@tonic-gate#else /* CURS_MACROS */
12180Sstevel@tonic-gate
12190Sstevel@tonic-gate#ifdef __STDC__
12200Sstevel@tonic-gate
12210Sstevel@tonic-gateextern int overlay(WINDOW *, WINDOW *);
12220Sstevel@tonic-gateextern int overwrite(WINDOW *, WINDOW *);
12230Sstevel@tonic-gateextern int wdeleteln(WINDOW *);
12240Sstevel@tonic-gateextern int winsertln(WINDOW *);
12250Sstevel@tonic-gateextern int wstandend(WINDOW *);
12260Sstevel@tonic-gateextern int wstandout(WINDOW *);
12270Sstevel@tonic-gateextern int beep(void);
12280Sstevel@tonic-gateextern int flash(void);
12290Sstevel@tonic-gateextern int scroll(WINDOW *);
12300Sstevel@tonic-gateextern int slk_init(int);
12310Sstevel@tonic-gateextern int scr_init(char *);
12320Sstevel@tonic-gateextern int scr_restore(char *);
12330Sstevel@tonic-gateextern int box(WINDOW *, chtype, chtype);
12340Sstevel@tonic-gateextern int touchline(WINDOW *, int, int);
12350Sstevel@tonic-gateextern int waddstr(WINDOW *, char *);
12360Sstevel@tonic-gateextern int werase(WINDOW *);
12370Sstevel@tonic-gateextern int wclear(WINDOW *);
12380Sstevel@tonic-gateextern int intrflush(WINDOW *, int);
12390Sstevel@tonic-gateextern int meta(WINDOW *, int);
12400Sstevel@tonic-gateextern int setterm(char *);
12410Sstevel@tonic-gateextern int gettmode(void);
12420Sstevel@tonic-gateextern int halfdelay(int);
12430Sstevel@tonic-gateextern int echo(void);
12440Sstevel@tonic-gateextern int noecho(void);
12450Sstevel@tonic-gateextern int nl(void);
12460Sstevel@tonic-gateextern int nonl(void);
12470Sstevel@tonic-gate
12480Sstevel@tonic-gateextern WINDOW *subpad(WINDOW *, int, int, int, int);
12490Sstevel@tonic-gate
12500Sstevel@tonic-gateextern  SCREEN *newterm(char *, FILE *, FILE *);
12510Sstevel@tonic-gate
12520Sstevel@tonic-gate#else  /* __STDC__ */
12530Sstevel@tonic-gate
12540Sstevel@tonic-gateextern	int	overlay(), overwrite(), wdeleteln(), winsertln(),
12550Sstevel@tonic-gate		wstandend(), wstandout(), beep(), flash(),
12560Sstevel@tonic-gate		scroll(), slk_init(), scr_init(), scr_restore(),
12570Sstevel@tonic-gate		box(), touchline(), waddstr(), werase(),
12580Sstevel@tonic-gate		wclear(), intrflush(), meta(), setterm(), gettmode(),
12590Sstevel@tonic-gate		halfdelay(), echo(), noecho(), nl(), nonl();
12600Sstevel@tonic-gate
12610Sstevel@tonic-gateextern	WINDOW *subpad();
12620Sstevel@tonic-gate
12630Sstevel@tonic-gateextern  SCREEN  *newterm();
12640Sstevel@tonic-gate
12650Sstevel@tonic-gate#endif /* __STDC__ */
12660Sstevel@tonic-gate#endif /* CURS_MACROS */
12670Sstevel@tonic-gate
12680Sstevel@tonic-gate#define	garbagedlines		wredrawln
12690Sstevel@tonic-gate#define	garbagedwin		redrawwin
12700Sstevel@tonic-gate
12710Sstevel@tonic-gate#define	crmode			cbreak
12720Sstevel@tonic-gate#define	nocrmode		nocbreak
12730Sstevel@tonic-gate#define	saveterm		def_prog_mode
12740Sstevel@tonic-gate#define	fixterm			reset_prog_mode
12750Sstevel@tonic-gate#define	resetterm		reset_shell_mode
12760Sstevel@tonic-gate
12770Sstevel@tonic-gate#define	waddchstr(win, str)	waddchnstr((win), (str), -1)
12780Sstevel@tonic-gate#define	winsstr(win, str)	winsnstr((win), (str), -1)
12790Sstevel@tonic-gate
12800Sstevel@tonic-gate/* iocontrol functions */
12810Sstevel@tonic-gate#define	qiflush()		_setqiflush(TRUE)
12820Sstevel@tonic-gate#define	noqiflush()		_setqiflush(FALSE)
12830Sstevel@tonic-gate
12840Sstevel@tonic-gate#define	set_term		setcurscreen
12850Sstevel@tonic-gate
12860Sstevel@tonic-gate#endif	/* NOMACROS || __lint */
12870Sstevel@tonic-gate
12880Sstevel@tonic-gate/*
12890Sstevel@tonic-gate * Standard alternate character set.  The current ACS world is evolving,
12900Sstevel@tonic-gate * so we support only a widely available subset: the line drawing characters
12910Sstevel@tonic-gate * from the VT100, plus a few from the Teletype 5410v1.  Eventually there
12920Sstevel@tonic-gate * may be support of more sophisticated ACS line drawing, such as that
12930Sstevel@tonic-gate * in the Teletype 5410, the HP line drawing set, and the like.  There may
12940Sstevel@tonic-gate * be support for some non line oriented characters as well.
12950Sstevel@tonic-gate *
12960Sstevel@tonic-gate * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
12970Sstevel@tonic-gate * is the right, b is the bottom, and l is the left.  t, r, b, and l might
12980Sstevel@tonic-gate * be B (blank), S (single), D (double), or T (thick).  The subset defined
12990Sstevel@tonic-gate * here only uses B and S.
13000Sstevel@tonic-gate */
13010Sstevel@tonic-gate
13020Sstevel@tonic-gate#define	ACS_BSSB	(acs_map['l'])
13030Sstevel@tonic-gate#define	ACS_SSBB	(acs_map['m'])
13040Sstevel@tonic-gate#define	ACS_BBSS	(acs_map['k'])
13050Sstevel@tonic-gate#define	ACS_SBBS	(acs_map['j'])
13060Sstevel@tonic-gate#define	ACS_SBSS	(acs_map['u'])
13070Sstevel@tonic-gate#define	ACS_SSSB	(acs_map['t'])
13080Sstevel@tonic-gate#define	ACS_SSBS	(acs_map['v'])
13090Sstevel@tonic-gate#define	ACS_BSSS	(acs_map['w'])
13100Sstevel@tonic-gate#define	ACS_BSBS	(acs_map['q'])
13110Sstevel@tonic-gate#define	ACS_SBSB	(acs_map['x'])
13120Sstevel@tonic-gate#define	ACS_SSSS	(acs_map['n'])
13130Sstevel@tonic-gate
13140Sstevel@tonic-gate/*
13150Sstevel@tonic-gate * Human readable names for the most commonly used characters.
13160Sstevel@tonic-gate * "Upper", "right", etc. are chosen to be consistent with the vt100 manual.
13170Sstevel@tonic-gate */
13180Sstevel@tonic-gate
13190Sstevel@tonic-gate#define	ACS_ULCORNER	ACS_BSSB
13200Sstevel@tonic-gate#define	ACS_LLCORNER	ACS_SSBB
13210Sstevel@tonic-gate#define	ACS_URCORNER	ACS_BBSS
13220Sstevel@tonic-gate#define	ACS_LRCORNER	ACS_SBBS
13230Sstevel@tonic-gate#define	ACS_RTEE	ACS_SBSS
13240Sstevel@tonic-gate#define	ACS_LTEE	ACS_SSSB
13250Sstevel@tonic-gate#define	ACS_BTEE	ACS_SSBS
13260Sstevel@tonic-gate#define	ACS_TTEE	ACS_BSSS
13270Sstevel@tonic-gate#define	ACS_HLINE	ACS_BSBS
13280Sstevel@tonic-gate#define	ACS_VLINE	ACS_SBSB
13290Sstevel@tonic-gate#define	ACS_PLUS	ACS_SSSS
13300Sstevel@tonic-gate#define	ACS_S1		(acs_map['o'])	/* scan line 1 */
13310Sstevel@tonic-gate#define	ACS_S9		(acs_map['s'])	/* scan line 9 */
13320Sstevel@tonic-gate#define	ACS_DIAMOND	(acs_map['`'])	/* diamond */
13330Sstevel@tonic-gate#define	ACS_CKBOARD	(acs_map['a'])	/* checker board (stipple) */
13340Sstevel@tonic-gate#define	ACS_DEGREE	(acs_map['f'])	/* degree symbol */
13350Sstevel@tonic-gate#define	ACS_PLMINUS	(acs_map['g'])	/* plus/minus */
13360Sstevel@tonic-gate#define	ACS_BULLET	(acs_map['~'])	/* bullet */
13370Sstevel@tonic-gate	/* Teletype 5410v1 symbols */
13380Sstevel@tonic-gate#define	ACS_LARROW	(acs_map[','])	/* arrow pointing left */
13390Sstevel@tonic-gate#define	ACS_RARROW	(acs_map['+'])	/* arrow pointing right */
13400Sstevel@tonic-gate#define	ACS_DARROW	(acs_map['.'])	/* arrow pointing down */
13410Sstevel@tonic-gate#define	ACS_UARROW	(acs_map['-'])	/* arrow pointing up */
13420Sstevel@tonic-gate#define	ACS_BOARD	(acs_map['h'])	/* board of squares */
13430Sstevel@tonic-gate#define	ACS_LANTERN	(acs_map['i'])	/* lantern symbol */
13440Sstevel@tonic-gate#define	ACS_BLOCK	(acs_map['0'])	/* solid square block */
13450Sstevel@tonic-gate
13460Sstevel@tonic-gate.
13470Sstevel@tonic-gate$a
13480Sstevel@tonic-gate
13490Sstevel@tonic-gate/*
13500Sstevel@tonic-gate *	The definition for 'reg' is not standard, and is provided for
13510Sstevel@tonic-gate *	compatibility reasons. User's are discouraged from using this.
13520Sstevel@tonic-gate */
13530Sstevel@tonic-gate#define	reg	register
13540Sstevel@tonic-gate
13550Sstevel@tonic-gate/* Various video attributes */
13560Sstevel@tonic-gate#define	A_STANDOUT	000010000000
13570Sstevel@tonic-gate#define	_STANDOUT	A_STANDOUT    /* for compatability with old curses */
13580Sstevel@tonic-gate#define	A_UNDERLINE	000020000000
13590Sstevel@tonic-gate#define	A_REVERSE	000040000000
13600Sstevel@tonic-gate#define	A_BLINK		000100000000
13610Sstevel@tonic-gate#define	A_DIM		000200000000
13620Sstevel@tonic-gate#define	A_BOLD		000400000000
13630Sstevel@tonic-gate#define	A_ALTCHARSET	001000000000
13640Sstevel@tonic-gate
13650Sstevel@tonic-gate/* The next two are subject to change so don't depend on them */
13660Sstevel@tonic-gate#define	A_INVIS		010000000000
13670Sstevel@tonic-gate#define	A_PROTECT	020000000000U
13680Sstevel@tonic-gate
13690Sstevel@tonic-gate#define	A_NORMAL	000000000000
13700Sstevel@tonic-gate#define	A_ATTRIBUTES	031777700000U	/* 0xCFFF8000 */
13710Sstevel@tonic-gate#define	A_CHARTEXT	006000077777	/* 0x30007FFF */
13720Sstevel@tonic-gate#define	A_COLOR		000007700000
13730Sstevel@tonic-gate
13740Sstevel@tonic-gate#define	A_WATTRIBUTES	031770000000U	/* 0xCFE00000 */
13750Sstevel@tonic-gate#define	A_WCHARTEXT	006007777777	/* 0x301FFFFF */
13760Sstevel@tonic-gate
13770Sstevel@tonic-gate#define	COLOR_PAIR(n)	((n) << 15)
13780Sstevel@tonic-gate#define	PAIR_NUMBER(n)	(((n) & A_COLOR) >> 15)
13790Sstevel@tonic-gate
13800Sstevel@tonic-gate/* definition of 8 basic color	*/
13810Sstevel@tonic-gate#define	COLOR_BLACK	0
13820Sstevel@tonic-gate#define	COLOR_RED	1
13830Sstevel@tonic-gate#define	COLOR_GREEN	2
13840Sstevel@tonic-gate#define	COLOR_YELLOW	3
13850Sstevel@tonic-gate#define	COLOR_BLUE	4
13860Sstevel@tonic-gate#define	COLOR_MAGENTA	5
13870Sstevel@tonic-gate#define	COLOR_CYAN	6
13880Sstevel@tonic-gate#define	COLOR_WHITE	7
13890Sstevel@tonic-gate
13900Sstevel@tonic-gate/* mouse related macros: don't change these definitions or bit-masks.	*/
13910Sstevel@tonic-gate/* they are interdependent (used by _map_button() in tgetch()		*/
13920Sstevel@tonic-gate#define	BUTTON_RELEASED		0
13930Sstevel@tonic-gate#define	BUTTON_PRESSED		1
13940Sstevel@tonic-gate#define	BUTTON_CLICKED		2
13950Sstevel@tonic-gate#define	BUTTON_DOUBLE_CLICKED	3
13960Sstevel@tonic-gate#define	BUTTON_TRIPLE_CLICKED	4
13970Sstevel@tonic-gate
13980Sstevel@tonic-gate#define	MOUSE_X_POS		(Mouse_status.x)
13990Sstevel@tonic-gate#define	MOUSE_Y_POS		(Mouse_status.y)
14000Sstevel@tonic-gate#define	A_BUTTON_CHANGED	(Mouse_status.changes & 7)
14010Sstevel@tonic-gate#define	MOUSE_MOVED		(Mouse_status.changes & 8)
14020Sstevel@tonic-gate#define	MOUSE_POS_REPORT	(Mouse_status.changes & 16)
14030Sstevel@tonic-gate#define	BUTTON_CHANGED(x)	(Mouse_status.changes & (1 << ((x) - 1)))
14040Sstevel@tonic-gate#define	BUTTON_STATUS(x)	(Mouse_status.button[(x)-1])
14050Sstevel@tonic-gate
14060Sstevel@tonic-gate/* definition of mouse bit-masks	*/
14070Sstevel@tonic-gate#define	BUTTON1_RELEASED	000000000001
14080Sstevel@tonic-gate#define	BUTTON1_PRESSED		000000000002
14090Sstevel@tonic-gate#define	BUTTON1_CLICKED		000000000004
14100Sstevel@tonic-gate#define	BUTTON1_DOUBLE_CLICKED	000000000010
14110Sstevel@tonic-gate#define	BUTTON1_TRIPLE_CLICKED	000000000020
14120Sstevel@tonic-gate#define	BUTTON2_RELEASED	000000000040
14130Sstevel@tonic-gate#define	BUTTON2_PRESSED		000000000100
14140Sstevel@tonic-gate#define	BUTTON2_CLICKED		000000000200
14150Sstevel@tonic-gate#define	BUTTON2_DOUBLE_CLICKED	000000000400
14160Sstevel@tonic-gate#define	BUTTON2_TRIPLE_CLICKED	000000001000
14170Sstevel@tonic-gate#define	BUTTON3_RELEASED	000000002000
14180Sstevel@tonic-gate#define	BUTTON3_PRESSED		000000004000
14190Sstevel@tonic-gate#define	BUTTON3_CLICKED		000000010000
14200Sstevel@tonic-gate#define	BUTTON3_DOUBLE_CLICKED	000000020000
14210Sstevel@tonic-gate#define	BUTTON3_TRIPLE_CLICKED	000000040000
14220Sstevel@tonic-gate#define	ALL_MOUSE_EVENTS	000000077777
14230Sstevel@tonic-gate#define	REPORT_MOUSE_POSITION	000000100000
14240Sstevel@tonic-gate
14250Sstevel@tonic-gate#ifdef	__cplusplus
14260Sstevel@tonic-gate}
14270Sstevel@tonic-gate#endif
14280Sstevel@tonic-gate
14290Sstevel@tonic-gate#endif	/* _CURSES_H */
14300Sstevel@tonic-gate.
14310Sstevel@tonic-gate0r copyright.h
1432*2026Sstevelg/\@(\#)curses\.ed/s//\@(\#)curses\.h/
14330Sstevel@tonic-gatew curses.h
1434