17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
57c478bdstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
67c478bdstevel@tonic-gate * (the "License").  You may not use this file except in compliance
77c478bdstevel@tonic-gate * with the License.
87c478bdstevel@tonic-gate *
97c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bdstevel@tonic-gate * See the License for the specific language governing permissions
127c478bdstevel@tonic-gate * and limitations under the License.
137c478bdstevel@tonic-gate *
147c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bdstevel@tonic-gate *
207c478bdstevel@tonic-gate * CDDL HEADER END
217c478bdstevel@tonic-gate */
227c478bdstevel@tonic-gate/*
237c478bdstevel@tonic-gate * Copyright 1996-2003 Sun Microsystems, Inc.  All rights reserved.
247c478bdstevel@tonic-gate * Use is subject to license terms.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gate#ifndef _CURSES_H
287c478bdstevel@tonic-gate#define	_CURSES_H
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate/*
337c478bdstevel@tonic-gate * curses.h
347c478bdstevel@tonic-gate *
357c478bdstevel@tonic-gate * XCurses Library
367c478bdstevel@tonic-gate *
377c478bdstevel@tonic-gate * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
387c478bdstevel@tonic-gate *
397c478bdstevel@tonic-gate */
407c478bdstevel@tonic-gate
417c478bdstevel@tonic-gate#include <sys/isa_defs.h>
427c478bdstevel@tonic-gate#include <stdio.h>
437c478bdstevel@tonic-gate#include <term.h>
447c478bdstevel@tonic-gate#include <wchar.h>
457c478bdstevel@tonic-gate
467c478bdstevel@tonic-gate#ifdef	__cplusplus
477c478bdstevel@tonic-gateextern "C" {
487c478bdstevel@tonic-gate#endif
497c478bdstevel@tonic-gate
507c478bdstevel@tonic-gate#define	_XOPEN_CURSES
517c478bdstevel@tonic-gate
527c478bdstevel@tonic-gate#ifndef EOF
537c478bdstevel@tonic-gate#define	EOF			(-1)
547c478bdstevel@tonic-gate#endif
557c478bdstevel@tonic-gate
567c478bdstevel@tonic-gate#ifndef WEOF
577c478bdstevel@tonic-gate#define	WEOF		((wint_t)(-1))
587c478bdstevel@tonic-gate#endif
597c478bdstevel@tonic-gate
607c478bdstevel@tonic-gate#define	ERR			EOF
617c478bdstevel@tonic-gate#define	OK			0
627c478bdstevel@tonic-gate
637c478bdstevel@tonic-gate#if !(defined(__cplusplus) && defined(_BOOL))
647c478bdstevel@tonic-gate#ifndef _BOOL_DEFINED
657c478bdstevel@tonic-gatetypedef short	bool;
667c478bdstevel@tonic-gate#define	_BOOL_DEFINED
677c478bdstevel@tonic-gate#endif
687c478bdstevel@tonic-gate#endif
697c478bdstevel@tonic-gate
707c478bdstevel@tonic-gate#define	TRUE    		1
717c478bdstevel@tonic-gate#define	FALSE   		0
727c478bdstevel@tonic-gate
737c478bdstevel@tonic-gatetypedef unsigned short	attr_t;
747c478bdstevel@tonic-gate
757c478bdstevel@tonic-gate/*
767c478bdstevel@tonic-gate * These attributes and masks can be applied to an attr_t.
777c478bdstevel@tonic-gate * These are ordered according to the <no_color_video> mask,
787c478bdstevel@tonic-gate * which has been extended to include additional attributes.
797c478bdstevel@tonic-gate */
807c478bdstevel@tonic-gate#define	WA_NORMAL	0x0
817c478bdstevel@tonic-gate#define	WA_STANDOUT	0x0001
827c478bdstevel@tonic-gate#define	WA_UNDERLINE	0x0002
837c478bdstevel@tonic-gate#define	WA_REVERSE	0x0004
847c478bdstevel@tonic-gate#define	WA_BLINK	0x0008
857c478bdstevel@tonic-gate#define	WA_DIM		0x0010
867c478bdstevel@tonic-gate#define	WA_BOLD		0x0020
877c478bdstevel@tonic-gate#define	WA_INVIS	0x0040
887c478bdstevel@tonic-gate#define	WA_PROTECT	0x0080
897c478bdstevel@tonic-gate#define	WA_ALTCHARSET	0x0100
907c478bdstevel@tonic-gate#define	WA_HORIZONTAL	0x0200
917c478bdstevel@tonic-gate#define	WA_LEFT		0x0400
927c478bdstevel@tonic-gate#define	WA_LOW		0x0800
937c478bdstevel@tonic-gate#define	WA_RIGHT	0x1000
947c478bdstevel@tonic-gate#define	WA_TOP		0x2000
957c478bdstevel@tonic-gate#define	WA_VERTICAL	0x4000
967c478bdstevel@tonic-gate
977c478bdstevel@tonic-gate#define	WA_SGR_MASK	0x01ff		/* Historical attribute set. */
987c478bdstevel@tonic-gate#define	WA_SGR1_MASK	0x7e00		/* Extended attribute set. */
997c478bdstevel@tonic-gate
1007c478bdstevel@tonic-gate/*
1017c478bdstevel@tonic-gate * Internal attribute used to support <ceol_standout_glitch>.
1027c478bdstevel@tonic-gate */
1037c478bdstevel@tonic-gate#define	WA_COOKIE	0x8000
1047c478bdstevel@tonic-gate
1057c478bdstevel@tonic-gate/*
1067c478bdstevel@tonic-gate * Color names.
1077c478bdstevel@tonic-gate */
1087c478bdstevel@tonic-gate#define	COLOR_BLACK	0
1097c478bdstevel@tonic-gate#define	COLOR_RED	1
1107c478bdstevel@tonic-gate#define	COLOR_GREEN	2
1117c478bdstevel@tonic-gate#define	COLOR_YELLOW	3
1127c478bdstevel@tonic-gate#define	COLOR_BLUE	4
1137c478bdstevel@tonic-gate#define	COLOR_MAGENTA	5
1147c478bdstevel@tonic-gate#define	COLOR_CYAN	6
1157c478bdstevel@tonic-gate#define	COLOR_WHITE	7
1167c478bdstevel@tonic-gate
1177c478bdstevel@tonic-gate/*
1187c478bdstevel@tonic-gate * A cchar_t details the attributes, color, and a string of wide characters
1197c478bdstevel@tonic-gate * composing a complex character (p12).  The wide character string consists
1207c478bdstevel@tonic-gate * of a spacing character (wcwidth() > 0) and zero or more non-spacing
1217c478bdstevel@tonic-gate * characters.  Xcurses (p17) states that the minimum number of non-spacing
1227c478bdstevel@tonic-gate * characters associated with a spacing character must be at least 5, if a
1237c478bdstevel@tonic-gate * limit is imposed.
1247c478bdstevel@tonic-gate */
1257c478bdstevel@tonic-gate#define	_M_CCHAR_MAX	6
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gate/*
1287c478bdstevel@tonic-gate * Opaque data type.
1297c478bdstevel@tonic-gate */
1307c478bdstevel@tonic-gatetypedef struct {
1317c478bdstevel@tonic-gate	short	_f;			/* True if start of character. */
1327c478bdstevel@tonic-gate	short	_n;			/* Number of elements in wc[]. */
1337c478bdstevel@tonic-gate	short	_co;		/* Color pair number. */
1347c478bdstevel@tonic-gate	attr_t	_at;		/* Attribute flags. */
1357c478bdstevel@tonic-gate	wchar_t	_wc[_M_CCHAR_MAX];	/* Complex spacing character. */
1367c478bdstevel@tonic-gate} cchar_t;
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gate/*
1397c478bdstevel@tonic-gate * Opaque data type.
1407c478bdstevel@tonic-gate */
1417c478bdstevel@tonic-gatetypedef struct window_t {
1427c478bdstevel@tonic-gate	cchar_t	_bg;		/* Background. */
1437c478bdstevel@tonic-gate	cchar_t	_fg;		/* Foreground, ignore character. */
1447c478bdstevel@tonic-gate	short	_cury, _curx;	/* Curent cursor position in window. */
1457c478bdstevel@tonic-gate	short	_begy, _begx;	/* Upper-left origin on screen. */
1467c478bdstevel@tonic-gate	short	_maxy, _maxx;	/* Window dimensions. */
1477c478bdstevel@tonic-gate	short	_top, _bottom;	/* Window's software scroll region. */
1487c478bdstevel@tonic-gate	short	_refy, _refx;	/* Pad origin of last refresh. */
1497c478bdstevel@tonic-gate	short	_sminy, _sminx;	/* T-L screen corner of last refresh. */
1507c478bdstevel@tonic-gate	short	_smaxy, _smaxx;	/* B-R screen corner of last refresh. */
1517c478bdstevel@tonic-gate	short	_vmin, _vtime;	/* wtimeout() control. */
1527c478bdstevel@tonic-gate	short	*_first, *_last;	/* Dirty region for each screen line. */
1537c478bdstevel@tonic-gate	unsigned short	_flags;		/* Internal flags for the window. */
1547c478bdstevel@tonic-gate	unsigned short	_scroll;	/* Internal for scroll optimization. */
1557c478bdstevel@tonic-gate	cchar_t	**_line;
1567c478bdstevel@tonic-gate	cchar_t	*_base;		/* Block of M*N screen cells. */
1577c478bdstevel@tonic-gate	struct window_t	*_parent;	/* Parent of sub-window. */
1587c478bdstevel@tonic-gate} WINDOW;
1597c478bdstevel@tonic-gate
1607c478bdstevel@tonic-gate/*
1617c478bdstevel@tonic-gate * Opaque data type.
1627c478bdstevel@tonic-gate */
1637c478bdstevel@tonic-gatetypedef struct {
1647c478bdstevel@tonic-gate	int _kfd;		/* typeahead() file descriptor. */
1657c478bdstevel@tonic-gate	FILE *_if, *_of;	/* I/O file pointers. */
1667c478bdstevel@tonic-gate	TERMINAL *_term;	/* Associated terminfo entry. */
1677c478bdstevel@tonic-gate	WINDOW *_newscr;	/* New screen image built by wnoutrefresh(). */
1687c478bdstevel@tonic-gate	WINDOW *_curscr;	/* Current screen image after doupdate(). */
1697c478bdstevel@tonic-gate	mbstate_t _state;	/* Current multibyte state of _of. */
1707c478bdstevel@tonic-gate#if defined(_LP64)
1717c478bdstevel@tonic-gate	unsigned int	*_hash;	/* Hash values for curscr's screen lines. */
1727c478bdstevel@tonic-gate#else
1737c478bdstevel@tonic-gate	unsigned long	*_hash;	/* Hash values for curscr's screen lines. */
1747c478bdstevel@tonic-gate#endif /* defined(_LP64) */
1757c478bdstevel@tonic-gate	unsigned short _flags;	/* Assorted flags. */
1767c478bdstevel@tonic-gate	void *_decode;		/* Function key decode tree. */
1777c478bdstevel@tonic-gate	void *_in;		/* Wide I/O object. */
1787c478bdstevel@tonic-gate	struct {
1797c478bdstevel@tonic-gate		int _size;	/* Allocated size of the input stack. */
1807c478bdstevel@tonic-gate		int _count;	/* Number of entries on the input stack. */
1817c478bdstevel@tonic-gate		int *_stack;	/* Buffer used for the input stack. */
1827c478bdstevel@tonic-gate	} _unget;
1837c478bdstevel@tonic-gate	struct {
1847c478bdstevel@tonic-gate		WINDOW *_w;	/* Exists on if emulating soft label keys. */
1857c478bdstevel@tonic-gate		char *_labels[8];	/* Soft label key strings. */
1867c478bdstevel@tonic-gate		short _justify[8];	/* Justification for label. */
1877c478bdstevel@tonic-gate		char	*_saved[8];	/* exact representation of label */
1887c478bdstevel@tonic-gate	} _slk;
1897c478bdstevel@tonic-gate} SCREEN;
1907c478bdstevel@tonic-gate
1917c478bdstevel@tonic-gate
1927c478bdstevel@tonic-gate/*
1937c478bdstevel@tonic-gate * Backwards compatiblity with historical Curses applications.
1947c478bdstevel@tonic-gate */
1957c478bdstevel@tonic-gate#ifndef	_CHTYPE
1967c478bdstevel@tonic-gate#define	_CHTYPE
1977c478bdstevel@tonic-gate#if defined(_LP64)
1987c478bdstevel@tonic-gatetypedef unsigned int	chtype;
1997c478bdstevel@tonic-gate#else
2007c478bdstevel@tonic-gatetypedef unsigned long	chtype;
2017c478bdstevel@tonic-gate#endif
2027c478bdstevel@tonic-gate#endif
2037c478bdstevel@tonic-gate
2047c478bdstevel@tonic-gate/*
2057c478bdstevel@tonic-gate * These attributes and masks can be applied to a chtype.
2067c478bdstevel@tonic-gate * They are order according to the <no_color_video> mask.
2077c478bdstevel@tonic-gate */
2087c478bdstevel@tonic-gate#if defined(_LP64)
2097c478bdstevel@tonic-gate#define	A_NORMAL		0x00000000U
2107c478bdstevel@tonic-gate#define	A_ATTRIBUTES	0xffff0000U	/* Color/Attribute mask */
2117c478bdstevel@tonic-gate#define	A_CHARTEXT		0x0000ffffU	/* 16-bit character mask */
2127c478bdstevel@tonic-gate#define	A_STANDOUT		0x00010000U
2137c478bdstevel@tonic-gate#define	A_UNDERLINE		0x00020000U
2147c478bdstevel@tonic-gate#define	A_REVERSE		0x00040000U
2157c478bdstevel@tonic-gate#define	A_BLINK			0x00080000U
2167c478bdstevel@tonic-gate#define	A_DIM			0x00100000U
2177c478bdstevel@tonic-gate#define	A_BOLD			0x00200000U
2187c478bdstevel@tonic-gate#define	A_INVIS			0x00400000U
2197c478bdstevel@tonic-gate#define	A_PROTECT		0x00800000U
2207c478bdstevel@tonic-gate#define	A_ALTCHARSET	0x01000000U
2217c478bdstevel@tonic-gate#define	A_COLOR			0xfe000000U	/* Color mask */
2227c478bdstevel@tonic-gate#else	/* defined(_LP64) */
2237c478bdstevel@tonic-gate#define	A_NORMAL		0x00000000UL
2247c478bdstevel@tonic-gate#define	A_ATTRIBUTES	0xffff0000UL	/* Color/Attribute mask */
2257c478bdstevel@tonic-gate#define	A_CHARTEXT		0x0000ffffUL	/* 16-bit character mask */
2267c478bdstevel@tonic-gate#define	A_STANDOUT		0x00010000UL
2277c478bdstevel@tonic-gate#define	A_UNDERLINE		0x00020000UL
2287c478bdstevel@tonic-gate#define	A_REVERSE		0x00040000UL
2297c478bdstevel@tonic-gate#define	A_BLINK			0x00080000UL
2307c478bdstevel@tonic-gate#define	A_DIM			0x00100000UL
2317c478bdstevel@tonic-gate#define	A_BOLD			0x00200000UL
2327c478bdstevel@tonic-gate#define	A_INVIS			0x00400000UL
2337c478bdstevel@tonic-gate#define	A_PROTECT		0x00800000UL
2347c478bdstevel@tonic-gate#define	A_ALTCHARSET	0x01000000UL
2357c478bdstevel@tonic-gate#define	A_COLOR			0xfe000000UL	/* Color mask */
2367c478bdstevel@tonic-gate#endif	/* defined(_LP64) */
2377c478bdstevel@tonic-gate
2387c478bdstevel@tonic-gate/*
2397c478bdstevel@tonic-gate * Color atttribute support for chtype.
2407c478bdstevel@tonic-gate */
2417c478bdstevel@tonic-gate#define	__COLOR_SHIFT	26
2427c478bdstevel@tonic-gate
2437c478bdstevel@tonic-gate/*
2447c478bdstevel@tonic-gate * Characters constants used with a chtype.
2457c478bdstevel@tonic-gate * Mapping defined in Xcurses Section 6.2.12 (p260).
2467c478bdstevel@tonic-gate */
2477c478bdstevel@tonic-gate#define	ACS_VLINE	(A_ALTCHARSET | 'x')
2487c478bdstevel@tonic-gate#define	ACS_HLINE	(A_ALTCHARSET | 'q')
2497c478bdstevel@tonic-gate#define	ACS_ULCORNER	(A_ALTCHARSET | 'l')
2507c478bdstevel@tonic-gate#define	ACS_URCORNER	(A_ALTCHARSET | 'k')
2517c478bdstevel@tonic-gate#define	ACS_LLCORNER	(A_ALTCHARSET | 'm')
2527c478bdstevel@tonic-gate#define	ACS_LRCORNER	(A_ALTCHARSET | 'j')
2537c478bdstevel@tonic-gate#define	ACS_RTEE	(A_ALTCHARSET | 'u')
2547c478bdstevel@tonic-gate#define	ACS_LTEE	(A_ALTCHARSET | 't')
2557c478bdstevel@tonic-gate#define	ACS_BTEE	(A_ALTCHARSET | 'v')
2567c478bdstevel@tonic-gate#define	ACS_TTEE	(A_ALTCHARSET | 'w')
2577c478bdstevel@tonic-gate#define	ACS_PLUS	(A_ALTCHARSET | 'n')
2587c478bdstevel@tonic-gate#define	ACS_S1	(A_ALTCHARSET | 'o')
2597c478bdstevel@tonic-gate#define	ACS_S9	(A_ALTCHARSET | 's')
2607c478bdstevel@tonic-gate#define	ACS_DIAMOND	(A_ALTCHARSET | '`')
2617c478bdstevel@tonic-gate#define	ACS_CKBOARD	(A_ALTCHARSET | 'a')
2627c478bdstevel@tonic-gate#define	ACS_DEGREE	(A_ALTCHARSET | 'f')
2637c478bdstevel@tonic-gate#define	ACS_PLMINUS	(A_ALTCHARSET | 'g')
2647c478bdstevel@tonic-gate#define	ACS_BULLET	(A_ALTCHARSET | '~')
2657c478bdstevel@tonic-gate#define	ACS_LARROW	(A_ALTCHARSET | ',')
2667c478bdstevel@tonic-gate#define	ACS_RARROW	(A_ALTCHARSET | '+')
2677c478bdstevel@tonic-gate#define	ACS_DARROW	(A_ALTCHARSET | '.')
2687c478bdstevel@tonic-gate#define	ACS_UARROW	(A_ALTCHARSET | '-')
2697c478bdstevel@tonic-gate#define	ACS_BOARD	(A_ALTCHARSET | 'h')
2707c478bdstevel@tonic-gate#define	ACS_LANTERN	(A_ALTCHARSET | 'i')
2717c478bdstevel@tonic-gate#define	ACS_BLOCK	(A_ALTCHARSET | '0')
2727c478bdstevel@tonic-gate
2737c478bdstevel@tonic-gate/*
2747c478bdstevel@tonic-gate * Wide characters constants for a cchar_t.
2757c478bdstevel@tonic-gate */
2767c478bdstevel@tonic-gateextern const cchar_t __WACS_VLINE;
2777c478bdstevel@tonic-gateextern const cchar_t __WACS_HLINE;
2787c478bdstevel@tonic-gateextern const cchar_t __WACS_ULCORNER;
2797c478bdstevel@tonic-gateextern const cchar_t __WACS_URCORNER;
2807c478bdstevel@tonic-gateextern const cchar_t __WACS_LLCORNER;
2817c478bdstevel@tonic-gateextern const cchar_t __WACS_LRCORNER;
2827c478bdstevel@tonic-gateextern const cchar_t __WACS_RTEE;
2837c478bdstevel@tonic-gateextern const cchar_t __WACS_LTEE;
2847c478bdstevel@tonic-gateextern const cchar_t __WACS_BTEE;
2857c478bdstevel@tonic-gateextern const cchar_t __WACS_TTEE;
2867c478bdstevel@tonic-gateextern const cchar_t __WACS_PLUS;
2877c478bdstevel@tonic-gateextern const cchar_t __WACS_S1;
2887c478bdstevel@tonic-gateextern const cchar_t __WACS_S9;
2897c478bdstevel@tonic-gateextern const cchar_t __WACS_DIAMOND;
2907c478bdstevel@tonic-gateextern const cchar_t __WACS_CKBOARD;
2917c478bdstevel@tonic-gateextern const cchar_t __WACS_DEGREE;
2927c478bdstevel@tonic-gateextern const cchar_t __WACS_PLMINUS;
2937c478bdstevel@tonic-gateextern const cchar_t __WACS_BULLET;
2947c478bdstevel@tonic-gateextern const cchar_t __WACS_LARROW;
2957c478bdstevel@tonic-gateextern const cchar_t __WACS_RARROW;
2967c478bdstevel@tonic-gateextern const cchar_t __WACS_DARROW;
2977c478bdstevel@tonic-gateextern const cchar_t __WACS_UARROW;
2987c478bdstevel@tonic-gateextern const cchar_t __WACS_BOARD;
2997c478bdstevel@tonic-gateextern const cchar_t __WACS_LANTERN;
3007c478bdstevel@tonic-gateextern const cchar_t __WACS_BLOCK;
3017c478bdstevel@tonic-gate
3027c478bdstevel@tonic-gate#define	WACS_VLINE	&__WACS_VLINE
3037c478bdstevel@tonic-gate#define	WACS_HLINE	&__WACS_HLINE
3047c478bdstevel@tonic-gate#define	WACS_ULCORNER	&__WACS_ULCORNER
3057c478bdstevel@tonic-gate#define	WACS_URCORNER	&__WACS_URCORNER
3067c478bdstevel@tonic-gate#define	WACS_LLCORNER	&__WACS_LLCORNER
3077c478bdstevel@tonic-gate#define	WACS_LRCORNER	&__WACS_LRCORNER
3087c478bdstevel@tonic-gate#define	WACS_RTEE	&__WACS_RTEE
3097c478bdstevel@tonic-gate#define	WACS_LTEE	&__WACS_LTEE
3107c478bdstevel@tonic-gate#define	WACS_BTEE	&__WACS_BTEE
3117c478bdstevel@tonic-gate#define	WACS_TTEE	&__WACS_TTEE
3127c478bdstevel@tonic-gate#define	WACS_PLUS	&__WACS_PLUS
3137c478bdstevel@tonic-gate#define	WACS_S1		&__WACS_S1
3147c478bdstevel@tonic-gate#define	WACS_S9		&__WACS_S9
3157c478bdstevel@tonic-gate#define	WACS_DIAMOND	&__WACS_DIAMOND
3167c478bdstevel@tonic-gate#define	WACS_CKBOARD	&__WACS_CKBOARD
3177c478bdstevel@tonic-gate#define	WACS_DEGREE	&__WACS_DEGREE
3187c478bdstevel@tonic-gate#define	WACS_PLMINUS	&__WACS_PLMINUS
3197c478bdstevel@tonic-gate#define	WACS_BULLET	&__WACS_BULLET
3207c478bdstevel@tonic-gate#define	WACS_LARROW	&__WACS_LARROW
3217c478bdstevel@tonic-gate#define	WACS_RARROW	&__WACS_RARROW
3227c478bdstevel@tonic-gate#define	WACS_DARROW	&__WACS_DARROW
3237c478bdstevel@tonic-gate#define	WACS_UARROW	&__WACS_UARROW
3247c478bdstevel@tonic-gate#define	WACS_BOARD	&__WACS_BOARD
3257c478bdstevel@tonic-gate#define	WACS_LANTERN	&__WACS_LANTERN
3267c478bdstevel@tonic-gate#define	WACS_BLOCK	&__WACS_BLOCK
3277c478bdstevel@tonic-gate
3287c478bdstevel@tonic-gate
3297c478bdstevel@tonic-gate/*
3307c478bdstevel@tonic-gate * Internal macros.
3317c478bdstevel@tonic-gate */
3327c478bdstevel@tonic-gate#define	__m_getpary(w)		((w)->_parent == (WINDOW *) 0 ? -1 \
3337c478bdstevel@tonic-gate				: (w)->_begy - (w)->_parent->_begy)
3347c478bdstevel@tonic-gate#define	__m_getparx(w)		((w)->_parent == (WINDOW *) 0 ? -1 \
3357c478bdstevel@tonic-gate				: (w)->_begx - (w)->_parent->_begx)
3367c478bdstevel@tonic-gate
3377c478bdstevel@tonic-gate/*
3387c478bdstevel@tonic-gate * Global Window Macros
3397c478bdstevel@tonic-gate */
3407c478bdstevel@tonic-gate#define	getyx(w, y, x)	(y = (w)->_cury, x = (w)->_curx)
3417c478bdstevel@tonic-gate#define	getbegyx(w, y, x)	(y = (w)->_begy, x = (w)->_begx)
3427c478bdstevel@tonic-gate#define	getmaxyx(w, y, x)	(y = (w)->_maxy, x = (w)->_maxx)
3437c478bdstevel@tonic-gate#define	getparyx(w, y, x)	(y = __m_getpary(w), x = __m_getparx(w))
3447c478bdstevel@tonic-gate
3457c478bdstevel@tonic-gate/*
3467c478bdstevel@tonic-gate * Global variables
3477c478bdstevel@tonic-gate */
3487c478bdstevel@tonic-gateextern int LINES, COLS;
3497c478bdstevel@tonic-gateextern WINDOW *curscr, *stdscr;
3507c478bdstevel@tonic-gateextern int COLORS, COLOR_PAIRS;
3517c478bdstevel@tonic-gate
3527c478bdstevel@tonic-gateextern int addch(chtype);
3537c478bdstevel@tonic-gateextern int addchnstr(const chtype *, int);
3547c478bdstevel@tonic-gateextern int addchstr(const chtype *);
3557c478bdstevel@tonic-gateextern int addnstr(const char *, int);
3567c478bdstevel@tonic-gateextern int addnwstr(const wchar_t *, int);
3577c478bdstevel@tonic-gateextern int addstr(const char *);
3587c478bdstevel@tonic-gateextern int add_wch(const cchar_t *);
3597c478bdstevel@tonic-gateextern int add_wchnstr(const cchar_t *, int);
3607c478bdstevel@tonic-gateextern int add_wchstr(const cchar_t *);
3617c478bdstevel@tonic-gateextern int addwstr(const wchar_t *);
3627c478bdstevel@tonic-gateextern int attroff(int);
3637c478bdstevel@tonic-gateextern int attron(int);
3647c478bdstevel@tonic-gateextern int attrset(int);
3657c478bdstevel@tonic-gateextern int attr_get(attr_t *, short *, void *);
3667c478bdstevel@tonic-gateextern int attr_off(attr_t, void *);
3677c478bdstevel@tonic-gateextern int attr_on(attr_t, void *);
3687c478bdstevel@tonic-gateextern int attr_set(attr_t, short, void *);
3697c478bdstevel@tonic-gateextern int baudrate(void);
3707c478bdstevel@tonic-gateextern int beep(void);
3717c478bdstevel@tonic-gateextern int bkgd(chtype);
3727c478bdstevel@tonic-gateextern void	bkgdset(chtype);
3737c478bdstevel@tonic-gateextern int bkgrnd(const cchar_t *);
3747c478bdstevel@tonic-gateextern void bkgrndset(const cchar_t *);
3757c478bdstevel@tonic-gateextern int border(
3767c478bdstevel@tonic-gate	chtype, chtype, chtype, chtype,
3777c478bdstevel@tonic-gate	chtype, chtype, chtype, chtype);
3787c478bdstevel@tonic-gateextern int border_set(
3797c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *,
3807c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *,
3817c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *,
3827c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *);
3837c478bdstevel@tonic-gateextern int box(WINDOW *, chtype, chtype);
3847c478bdstevel@tonic-gateextern int box_set(WINDOW *, const cchar_t *, const cchar_t *);
3857c478bdstevel@tonic-gateextern bool can_change_color(void);
3867c478bdstevel@tonic-gateextern int cbreak(void);
3877c478bdstevel@tonic-gateextern int chgat(int, attr_t, short, const void *);
3887c478bdstevel@tonic-gateextern int clearok(WINDOW *, bool);
3897c478bdstevel@tonic-gateextern int clear(void);
3907c478bdstevel@tonic-gateextern int clrtobot(void);
3917c478bdstevel@tonic-gateextern int clrtoeol(void);
3927c478bdstevel@tonic-gateextern int color_content(short, short *, short *, short *);
3937c478bdstevel@tonic-gateextern int COLOR_PAIR(int);
3947c478bdstevel@tonic-gateextern int color_set(short, void *);
3957c478bdstevel@tonic-gateextern int copywin(const WINDOW *, WINDOW *,
3967c478bdstevel@tonic-gate	int, int, int, int, int, int, int);
3977c478bdstevel@tonic-gateextern int curs_set(int);
3987c478bdstevel@tonic-gateextern int def_prog_mode(void);
3997c478bdstevel@tonic-gateextern int def_shell_mode(void);
4007c478bdstevel@tonic-gateextern int delay_output(int);
4017c478bdstevel@tonic-gateextern int delch(void);
4027c478bdstevel@tonic-gateextern int deleteln(void);
4037c478bdstevel@tonic-gateextern void delscreen(SCREEN *);
4047c478bdstevel@tonic-gateextern int delwin(WINDOW *);
4057c478bdstevel@tonic-gateextern WINDOW *derwin(WINDOW *, int, int, int, int);
4067c478bdstevel@tonic-gateextern int doupdate(void);
4077c478bdstevel@tonic-gateextern WINDOW *dupwin(WINDOW *);
4087c478bdstevel@tonic-gateextern int echo(void);
4097c478bdstevel@tonic-gateextern int echochar(const chtype);
4107c478bdstevel@tonic-gateextern int echo_wchar(const cchar_t *);
4117c478bdstevel@tonic-gateextern int endwin(void);
4127c478bdstevel@tonic-gateextern char erasechar(void);
4137c478bdstevel@tonic-gateextern int erase(void);
4147c478bdstevel@tonic-gateextern int erasewchar(wchar_t *);
4157c478bdstevel@tonic-gateextern void filter(void);
4167c478bdstevel@tonic-gateextern int flash(void);
4177c478bdstevel@tonic-gateextern int flushinp(void);
4187c478bdstevel@tonic-gateextern chtype getbkgd(WINDOW *);
4197c478bdstevel@tonic-gateextern int getbkgrnd(cchar_t *);
4207c478bdstevel@tonic-gateextern int getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
4217c478bdstevel@tonic-gateextern int getch(void);
4227c478bdstevel@tonic-gateextern int getnstr(char *, int);
4237c478bdstevel@tonic-gateextern int getn_wstr(wint_t *, int);
4247c478bdstevel@tonic-gateextern int getstr(char *);
4257c478bdstevel@tonic-gateextern int get_wch(wint_t *);
4267c478bdstevel@tonic-gateextern WINDOW *getwin(FILE *);
4277c478bdstevel@tonic-gateextern int get_wstr(wint_t *);
4287c478bdstevel@tonic-gateextern int halfdelay(int);
4297c478bdstevel@tonic-gateextern bool has_colors(void);
4307c478bdstevel@tonic-gateextern bool has_ic(void);
4317c478bdstevel@tonic-gateextern bool has_il(void);
4327c478bdstevel@tonic-gateextern int hline(chtype, int);
4337c478bdstevel@tonic-gateextern int hline_set(const cchar_t *, int);
4347c478bdstevel@tonic-gateextern void idcok(WINDOW *, bool);
4357c478bdstevel@tonic-gateextern int idlok(WINDOW *, bool);
4367c478bdstevel@tonic-gateextern void immedok(WINDOW *, bool);
4377c478bdstevel@tonic-gateextern chtype inch(void);
4387c478bdstevel@tonic-gateextern int inchnstr(chtype *, int);
4397c478bdstevel@tonic-gateextern int inchstr(chtype *);
4407c478bdstevel@tonic-gateextern WINDOW *initscr(void);
4417c478bdstevel@tonic-gateextern int init_color(short, short, short, short);
4427c478bdstevel@tonic-gateextern int init_pair(short, short, short);
4437c478bdstevel@tonic-gateextern int innstr(char *, int);
4447c478bdstevel@tonic-gateextern int innwstr(wchar_t *, int);
4457c478bdstevel@tonic-gateextern int insch(chtype);
4467c478bdstevel@tonic-gateextern int insdelln(int);
4477c478bdstevel@tonic-gateextern int insertln(void);
4487c478bdstevel@tonic-gateextern int insnstr(const char *, int);
4497c478bdstevel@tonic-gateextern int ins_nwstr(const wchar_t *, int);
4507c478bdstevel@tonic-gateextern int insstr(const char *);
4517c478bdstevel@tonic-gateextern int instr(char *);
4527c478bdstevel@tonic-gateextern int ins_wch(const cchar_t *);
4537c478bdstevel@tonic-gateextern int ins_wstr(const wchar_t *);
4547c478bdstevel@tonic-gateextern int intrflush(WINDOW *, bool);
4557c478bdstevel@tonic-gateextern int in_wch(cchar_t *);
4567c478bdstevel@tonic-gateextern int in_wchnstr(cchar_t *, int);
4577c478bdstevel@tonic-gateextern int in_wchstr(cchar_t *);
4587c478bdstevel@tonic-gateextern int inwstr(wchar_t *);
4597c478bdstevel@tonic-gateextern bool isendwin(void);
4607c478bdstevel@tonic-gateextern bool is_linetouched(WINDOW *, int);
4617c478bdstevel@tonic-gateextern bool is_wintouched(WINDOW *);
4627c478bdstevel@tonic-gateextern char *keyname(int);
4637c478bdstevel@tonic-gateextern char *key_name(wchar_t);
4647c478bdstevel@tonic-gateextern int keypad(WINDOW *, bool);
4657c478bdstevel@tonic-gateextern char killchar(void);
4667c478bdstevel@tonic-gateextern int killwchar(wchar_t *);
4677c478bdstevel@tonic-gateextern int leaveok(WINDOW *, bool);
4687c478bdstevel@tonic-gateextern char *longname(void);
4697c478bdstevel@tonic-gateextern int meta(WINDOW *, bool);
4707c478bdstevel@tonic-gateextern int move(int, int);
4717c478bdstevel@tonic-gateextern int mvaddch(int, int, chtype);
4727c478bdstevel@tonic-gateextern int mvaddchnstr(int, int, const chtype *, int);
4737c478bdstevel@tonic-gateextern int mvaddchstr(int, int, const chtype *);
4747c478bdstevel@tonic-gateextern int mvaddnstr(int, int, const char *, int);
4757c478bdstevel@tonic-gateextern int mvaddnwstr(int, int, const wchar_t *, int);
4767c478bdstevel@tonic-gateextern int mvaddstr(int, int, const char *);
4777c478bdstevel@tonic-gateextern int mvadd_wch(int, int, const cchar_t *);
4787c478bdstevel@tonic-gateextern int mvadd_wchnstr(int, int, const cchar_t *, int);
4797c478bdstevel@tonic-gateextern int mvadd_wchstr(int, int, const cchar_t *);
4807c478bdstevel@tonic-gateextern int mvaddwstr(int, int, const wchar_t *);
4817c478bdstevel@tonic-gateextern int mvchgat(int, int, int, attr_t, short, const void *);
4827c478bdstevel@tonic-gateextern int mvcur(int, int, int, int);
4837c478bdstevel@tonic-gateextern int mvdelch(int, int);
4847c478bdstevel@tonic-gateextern int mvderwin(WINDOW *, int, int);
4857c478bdstevel@tonic-gateextern int mvgetch(int, int);
4867c478bdstevel@tonic-gateextern int mvgetnstr(int, int, char *, int);
4877c478bdstevel@tonic-gateextern int mvgetn_wstr(int, int, wint_t *, int);
4887c478bdstevel@tonic-gateextern int mvgetstr(int, int, char *);
4897c478bdstevel@tonic-gateextern int mvget_wch(int, int, wint_t *);
4907c478bdstevel@tonic-gateextern int mvget_wstr(int, int, wint_t *);
4917c478bdstevel@tonic-gateextern int mvhline(int, int, chtype, int);
4927c478bdstevel@tonic-gateextern int mvhline_set(int, int, const cchar_t *, int);
4937c478bdstevel@tonic-gateextern chtype mvinch(int, int);
4947c478bdstevel@tonic-gateextern int mvinchnstr(int, int, chtype *, int);
4957c478bdstevel@tonic-gateextern int mvinchstr(int, int, chtype *);
4967c478bdstevel@tonic-gateextern int mvinnstr(int, int, char *, int);
4977c478bdstevel@tonic-gateextern int mvinnwstr(int, int, wchar_t *, int);
4987c478bdstevel@tonic-gateextern int mvinsch(int, int, chtype);
4997c478bdstevel@tonic-gateextern int mvinsnstr(int, int, const char *, int);
5007c478bdstevel@tonic-gateextern int mvins_nwstr(int, int, const wchar_t *, int);
5017c478bdstevel@tonic-gateextern int mvinsstr(int, int, const char *);
5027c478bdstevel@tonic-gateextern int mvinstr(int, int, char *);
5037c478bdstevel@tonic-gateextern int mvins_wch(int, int, const cchar_t *);
5047c478bdstevel@tonic-gateextern int mvins_wstr(int, int, const wchar_t *);
5057c478bdstevel@tonic-gateextern int mvin_wch(int, int, cchar_t *);
5067c478bdstevel@tonic-gateextern int mvin_wchnstr(int, int, cchar_t *, int);
5077c478bdstevel@tonic-gateextern int mvin_wchstr(int, int, cchar_t *);
5087c478bdstevel@tonic-gateextern int mvinwstr(int, int, wchar_t *);
5097c478bdstevel@tonic-gateextern int mvprintw(int, int, char *, ...);
5107c478bdstevel@tonic-gateextern int mvscanw(int, int, char *, ...);
5117c478bdstevel@tonic-gateextern int mvvline(int, int, chtype, int);
5127c478bdstevel@tonic-gateextern int mvvline_set(int, int, const cchar_t *, int);
5137c478bdstevel@tonic-gateextern int mvwaddch(WINDOW *, int, int, chtype);
5147c478bdstevel@tonic-gateextern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
5157c478bdstevel@tonic-gateextern int mvwaddchstr(WINDOW *, int, int, const chtype *);
5167c478bdstevel@tonic-gateextern int mvwaddnstr(WINDOW *, int, int, const char *, int);
5177c478bdstevel@tonic-gateextern int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
5187c478bdstevel@tonic-gateextern int mvwaddstr(WINDOW *, int, int, const char *);
5197c478bdstevel@tonic-gateextern int mvwadd_wch(WINDOW *, int, int, const cchar_t *);
5207c478bdstevel@tonic-gateextern int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
5217c478bdstevel@tonic-gateextern int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
5227c478bdstevel@tonic-gateextern int mvwaddwstr(WINDOW *, int, int, const wchar_t *);
5237c478bdstevel@tonic-gateextern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
5247c478bdstevel@tonic-gateextern int mvwdelch(WINDOW *, int, int);
5257c478bdstevel@tonic-gateextern int mvwgetch(WINDOW *, int, int);
5267c478bdstevel@tonic-gateextern int mvwgetnstr(WINDOW *, int, int, char *, int);
5277c478bdstevel@tonic-gateextern int mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);
5287c478bdstevel@tonic-gateextern int mvwgetstr(WINDOW *, int, int, char *);
5297c478bdstevel@tonic-gateextern int mvwget_wch(WINDOW *, int, int, wint_t *);
5307c478bdstevel@tonic-gateextern int mvwget_wstr(WINDOW *, int, int, wint_t *);
5317c478bdstevel@tonic-gateextern int mvwhline(WINDOW *, int, int, chtype, int);
5327c478bdstevel@tonic-gateextern int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
5337c478bdstevel@tonic-gateextern int mvwin(WINDOW *, int, int);
5347c478bdstevel@tonic-gateextern chtype mvwinch(WINDOW *, int, int);
5357c478bdstevel@tonic-gateextern int mvwinchnstr(WINDOW *, int, int, chtype *, int);
5367c478bdstevel@tonic-gateextern int mvwinchstr(WINDOW *, int, int, chtype *);
5377c478bdstevel@tonic-gateextern int mvwinnstr(WINDOW *, int, int, char *, int);
5387c478bdstevel@tonic-gateextern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
5397c478bdstevel@tonic-gateextern int mvwinsch(WINDOW *, int, int, chtype);
5407c478bdstevel@tonic-gateextern int mvwinsnstr(WINDOW *, int, int, const char *, int);
5417c478bdstevel@tonic-gateextern int mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
5427c478bdstevel@tonic-gateextern int mvwinsstr(WINDOW *, int, int, const char *);
5437c478bdstevel@tonic-gateextern int mvwinstr(WINDOW *, int, int, char *);
5447c478bdstevel@tonic-gateextern int mvwins_wch(WINDOW *, int, int, const cchar_t *);
5457c478bdstevel@tonic-gateextern int mvwins_wstr(WINDOW *, int, int, const wchar_t *);
5467c478bdstevel@tonic-gateextern int mvwin_wch(WINDOW *, int, int, cchar_t *);
5477c478bdstevel@tonic-gateextern int mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
5487c478bdstevel@tonic-gateextern int mvwin_wchstr(WINDOW *, int, int, cchar_t *);
5497c478bdstevel@tonic-gateextern int mvwinwstr(WINDOW *, int, int, wchar_t *);
5507c478bdstevel@tonic-gateextern int mvwprintw(WINDOW *, int, int, char *, ...);
5517c478bdstevel@tonic-gateextern int mvwscanw(WINDOW *, int, int, char *, ...);
5527c478bdstevel@tonic-gateextern int mvwvline(WINDOW *, int, int, chtype, int);
5537c478bdstevel@tonic-gateextern int mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
5547c478bdstevel@tonic-gateextern int napms(int);
5557c478bdstevel@tonic-gateextern WINDOW *newpad(int, int);
5567c478bdstevel@tonic-gateextern SCREEN *newterm(char *, FILE *, FILE *);
5577c478bdstevel@tonic-gateextern WINDOW *newwin(int, int, int, int);
5587c478bdstevel@tonic-gateextern int nl(void);
5597c478bdstevel@tonic-gateextern int nocbreak(void);
5607c478bdstevel@tonic-gateextern int nodelay(WINDOW *, bool);
5617c478bdstevel@tonic-gateextern int noecho(void);
5627c478bdstevel@tonic-gateextern int nonl(void);
5637c478bdstevel@tonic-gateextern void noqiflush(void);
5647c478bdstevel@tonic-gateextern int noraw(void);
5657c478bdstevel@tonic-gateextern int notimeout(WINDOW *, bool);
5667c478bdstevel@tonic-gateextern int overlay(const WINDOW *, WINDOW *);
5677c478bdstevel@tonic-gateextern int overwrite(const WINDOW *, WINDOW *);
5687c478bdstevel@tonic-gateextern int pair_content(short, short *, short *);
5697c478bdstevel@tonic-gateextern int PAIR_NUMBER(int);
5707c478bdstevel@tonic-gateextern int pechochar(WINDOW *, chtype);
5717c478bdstevel@tonic-gateextern int pecho_wchar(WINDOW *, const cchar_t *);
5727c478bdstevel@tonic-gateextern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
5737c478bdstevel@tonic-gateextern int prefresh(WINDOW *, int, int, int, int, int, int);
5747c478bdstevel@tonic-gateextern int printw(char *, ...);
5757c478bdstevel@tonic-gateextern int putwin(WINDOW *,  FILE *);
5767c478bdstevel@tonic-gateextern void qiflush(void);
5777c478bdstevel@tonic-gateextern int raw(void);
5787c478bdstevel@tonic-gateextern int redrawwin(WINDOW *);
5797c478bdstevel@tonic-gateextern int refresh(void);
5807c478bdstevel@tonic-gateextern int reset_prog_mode(void);
5817c478bdstevel@tonic-gateextern int reset_shell_mode(void);
5827c478bdstevel@tonic-gateextern int resetty(void);
5837c478bdstevel@tonic-gateextern int ripoffline(int, int (*)(WINDOW *, int));
5847c478bdstevel@tonic-gateextern int savetty(void);
5857c478bdstevel@tonic-gateextern int scanw(char *, ...);
5867c478bdstevel@tonic-gateextern int scr_dump(const char *);
5877c478bdstevel@tonic-gateextern int scr_init(const char *);
5887c478bdstevel@tonic-gateextern int scrl(int);
5897c478bdstevel@tonic-gateextern int scroll(WINDOW *);
5907c478bdstevel@tonic-gateextern int scrollok(WINDOW *, bool);
5917c478bdstevel@tonic-gateextern int scr_restore(const char *);
5927c478bdstevel@tonic-gateextern int scr_set(const char *);
5937c478bdstevel@tonic-gateextern int setcchar(cchar_t *, const wchar_t *, const attr_t,
5947c478bdstevel@tonic-gate	short, const void *);
5957c478bdstevel@tonic-gateextern int setscrreg(int, int);
5967c478bdstevel@tonic-gateextern SCREEN *set_term(SCREEN *);
5977c478bdstevel@tonic-gateextern int slk_attr_off(const attr_t, void *);
5987c478bdstevel@tonic-gateextern int slk_attroff(const chtype);
5997c478bdstevel@tonic-gateextern int slk_attr_on(const attr_t, void *);
6007c478bdstevel@tonic-gateextern int slk_attron(const chtype);
6017c478bdstevel@tonic-gateextern int slk_attr_set(const attr_t, short, void *);
6027c478bdstevel@tonic-gateextern int slk_attrset(const chtype);
6037c478bdstevel@tonic-gateextern int slk_clear(void);
6047c478bdstevel@tonic-gateextern int slk_color(short);
6057c478bdstevel@tonic-gateextern int slk_init(int);
6067c478bdstevel@tonic-gateextern char *slk_label(int);
6077c478bdstevel@tonic-gateextern int slk_noutrefresh(void);
6087c478bdstevel@tonic-gateextern int slk_refresh(void);
6097c478bdstevel@tonic-gateextern int slk_restore(void);
6107c478bdstevel@tonic-gateextern int slk_set(int, const char *, int);
6117c478bdstevel@tonic-gateextern int slk_touch(void);
6127c478bdstevel@tonic-gateextern int slk_wset(int, const wchar_t *, int);
6137c478bdstevel@tonic-gateextern int standend(void);
6147c478bdstevel@tonic-gateextern int standout(void);
6157c478bdstevel@tonic-gateextern int start_color(void);
6167c478bdstevel@tonic-gateextern WINDOW *subpad(WINDOW *, int, int, int, int);
6177c478bdstevel@tonic-gateextern WINDOW *subwin(WINDOW *, int, int, int, int);
6187c478bdstevel@tonic-gateextern int syncok(WINDOW *, bool);
6197c478bdstevel@tonic-gateextern chtype termattrs(void);
6207c478bdstevel@tonic-gateextern attr_t term_attrs(void);
6217c478bdstevel@tonic-gateextern char *termname(void);
6227c478bdstevel@tonic-gateextern void timeout(int);
6237c478bdstevel@tonic-gateextern int touchline(WINDOW *, int, int);
6247c478bdstevel@tonic-gateextern int touchwin(WINDOW *);
6257c478bdstevel@tonic-gateextern int typeahead(int);
6267c478bdstevel@tonic-gateextern int ungetch(int);
6277c478bdstevel@tonic-gateextern int unget_wch(const wchar_t);
6287c478bdstevel@tonic-gateextern int untouchwin(WINDOW *);
6297c478bdstevel@tonic-gateextern void use_env(bool);
6307c478bdstevel@tonic-gateextern int vid_attr(attr_t, short, void *);
6317c478bdstevel@tonic-gateextern int vidattr(chtype);
6327c478bdstevel@tonic-gateextern int vid_puts(attr_t, short, void *, int (*)(int));
6337c478bdstevel@tonic-gateextern int vidputs(chtype, int (*)(int));
6347c478bdstevel@tonic-gateextern int vline(chtype, int);
6357c478bdstevel@tonic-gateextern int vline_set(const cchar_t *, int);
6367c478bdstevel@tonic-gateextern int vwprintw(WINDOW *, char *, __va_list);
6377c478bdstevel@tonic-gateextern int vw_printw(WINDOW *, char *, __va_list);
6387c478bdstevel@tonic-gateextern int vwscanw(WINDOW *, char *, __va_list);
6397c478bdstevel@tonic-gateextern int vw_scanw(WINDOW *, char *, __va_list);
6407c478bdstevel@tonic-gateextern int waddch(WINDOW *, const chtype);
6417c478bdstevel@tonic-gateextern int waddchnstr(WINDOW *, const chtype *, int);
6427c478bdstevel@tonic-gateextern int waddchstr(WINDOW *, const chtype *);
6437c478bdstevel@tonic-gateextern int waddnstr(WINDOW *, const char *, int);
6447c478bdstevel@tonic-gateextern int waddnwstr(WINDOW *, const wchar_t *, int);
6457c478bdstevel@tonic-gateextern int waddstr(WINDOW *, const char *);
6467c478bdstevel@tonic-gateextern int wadd_wch(WINDOW *, const cchar_t *);
6477c478bdstevel@tonic-gateextern int wadd_wchnstr(WINDOW *, const cchar_t *, int);
6487c478bdstevel@tonic-gateextern int wadd_wchstr(WINDOW *, const cchar_t *);
6497c478bdstevel@tonic-gateextern int waddwstr(WINDOW *, const wchar_t *);
6507c478bdstevel@tonic-gateextern int wattroff(WINDOW *, int);
6517c478bdstevel@tonic-gateextern int wattron(WINDOW *, int);
6527c478bdstevel@tonic-gateextern int wattrset(WINDOW *, int);
6537c478bdstevel@tonic-gateextern int wattr_get(WINDOW *, attr_t *, short *, void *);
6547c478bdstevel@tonic-gateextern int wattr_off(WINDOW *, attr_t, void *);
6557c478bdstevel@tonic-gateextern int wattr_on(WINDOW *, attr_t, void *);
6567c478bdstevel@tonic-gateextern int wattr_set(WINDOW *, attr_t, short, void *);
6577c478bdstevel@tonic-gateextern int wbkgd(WINDOW *, chtype);
6587c478bdstevel@tonic-gateextern void	wbkgdset(WINDOW *, chtype);
6597c478bdstevel@tonic-gateextern int wbkgrnd(WINDOW *, const cchar_t *);
6607c478bdstevel@tonic-gateextern void wbkgrndset(WINDOW *, const cchar_t *);
6617c478bdstevel@tonic-gateextern int wborder(WINDOW *,
6627c478bdstevel@tonic-gate	chtype, chtype, chtype, chtype,
6637c478bdstevel@tonic-gate	chtype, chtype, chtype, chtype);
6647c478bdstevel@tonic-gateextern int wborder_set(WINDOW *,
6657c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *,
6667c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *,
6677c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *,
6687c478bdstevel@tonic-gate	const cchar_t *, const cchar_t *);
6697c478bdstevel@tonic-gateextern int wchgat(WINDOW *, int, attr_t, short, const void *);
6707c478bdstevel@tonic-gateextern int wclear(WINDOW *);
6717c478bdstevel@tonic-gateextern int wclrtobot(WINDOW *);
6727c478bdstevel@tonic-gateextern int wclrtoeol(WINDOW *);
6737c478bdstevel@tonic-gateextern void wcursyncup(WINDOW *);
6747c478bdstevel@tonic-gateextern int wcolor_set(WINDOW *, short, void *);
6757c478bdstevel@tonic-gateextern int wdelch(WINDOW *);
6767c478bdstevel@tonic-gateextern int wdeleteln(WINDOW *);
6777c478bdstevel@tonic-gateextern int wechochar(WINDOW *, const chtype);
6787c478bdstevel@tonic-gateextern int wecho_wchar(WINDOW *, const cchar_t *);
6797c478bdstevel@tonic-gateextern int werase(WINDOW *);
6807c478bdstevel@tonic-gateextern int wgetbkgrnd(WINDOW *, cchar_t *);
6817c478bdstevel@tonic-gateextern int wgetch(WINDOW *);
6827c478bdstevel@tonic-gateextern int wgetnstr(WINDOW *, char *, int);
6837c478bdstevel@tonic-gateextern int wgetn_wstr(WINDOW *, wint_t *, int);
6847c478bdstevel@tonic-gateextern int wgetstr(WINDOW *, char *);
6857c478bdstevel@tonic-gateextern int wget_wch(WINDOW *, wint_t *);
6867c478bdstevel@tonic-gateextern int wget_wstr(WINDOW *, wint_t *);
6877c478bdstevel@tonic-gateextern int whline(WINDOW *, chtype, int);
6887c478bdstevel@tonic-gateextern int whline_set(WINDOW *, const cchar_t *, int);
6897c478bdstevel@tonic-gateextern chtype winch(WINDOW *);
6907c478bdstevel@tonic-gateextern int winchnstr(WINDOW *, chtype *, int);
6917c478bdstevel@tonic-gateextern int winchstr(WINDOW *, chtype *);
6927c478bdstevel@tonic-gateextern int winnstr(WINDOW *, char *, int);
6937c478bdstevel@tonic-gateextern int winnwstr(WINDOW *, wchar_t *, int);
6947c478bdstevel@tonic-gateextern int winsch(WINDOW *, chtype);
6957c478bdstevel@tonic-gateextern int winsdelln(WINDOW *, int);
6967c478bdstevel@tonic-gateextern int winsertln(WINDOW *);
6977c478bdstevel@tonic-gateextern int winsnstr(WINDOW *, const char *, int);
6987c478bdstevel@tonic-gateextern int wins_nwstr(WINDOW *, const wchar_t *, int);
6997c478bdstevel@tonic-gateextern int winsstr(WINDOW *, const char *);
7007c478bdstevel@tonic-gateextern int winstr(WINDOW *, char *);
7017c478bdstevel@tonic-gateextern int wins_wch(WINDOW *, const cchar_t *);
7027c478bdstevel@tonic-gateextern int wins_wstr(WINDOW *, const wchar_t *);
7037c478bdstevel@tonic-gateextern int win_wch(WINDOW *, cchar_t *);
7047c478bdstevel@tonic-gateextern int win_wchnstr(WINDOW *, cchar_t *, int);
7057c478bdstevel@tonic-gateextern int win_wchstr(WINDOW *, cchar_t *);
7067c478bdstevel@tonic-gateextern int winwstr(WINDOW *, wchar_t *);
7077c478bdstevel@tonic-gateextern int wmove(WINDOW *, int, int);
7087c478bdstevel@tonic-gateextern int wnoutrefresh(WINDOW *);
7097c478bdstevel@tonic-gateextern int wprintw(WINDOW *, char *, ...);
7107c478bdstevel@tonic-gateextern int wredrawln(WINDOW *, int, int);
7117c478bdstevel@tonic-gateextern int wrefresh(WINDOW *);
7127c478bdstevel@tonic-gateextern int wscanw(WINDOW *, char *, ...);
7137c478bdstevel@tonic-gateextern int wscrl(WINDOW *, int);
7147c478bdstevel@tonic-gateextern int wsetscrreg(WINDOW *, int, int);
7157c478bdstevel@tonic-gateextern int wstandend(WINDOW *);
7167c478bdstevel@tonic-gateextern int wstandout(WINDOW *);
7177c478bdstevel@tonic-gateextern void wsyncup(WINDOW *);
7187c478bdstevel@tonic-gateextern void wsyncdown(WINDOW *);
7197c478bdstevel@tonic-gateextern void wtimeout(WINDOW *, int);
7207c478bdstevel@tonic-gateextern int wtouchln(WINDOW *, int, int, int);
7217c478bdstevel@tonic-gateextern wchar_t *wunctrl(cchar_t *);
7227c478bdstevel@tonic-gateextern int wvline(WINDOW *, chtype, int);
7237c478bdstevel@tonic-gateextern int wvline_set(WINDOW *, const cchar_t *, int);
7247c478bdstevel@tonic-gate
7257c478bdstevel@tonic-gate#if !defined(__lint)
7267c478bdstevel@tonic-gate/*
7277c478bdstevel@tonic-gate * These macros can improve speed and size of an application.
7287c478bdstevel@tonic-gate */
7297c478bdstevel@tonic-gateextern WINDOW	*__w1;
7307c478bdstevel@tonic-gateextern chtype	__cht1;
7317c478bdstevel@tonic-gateextern chtype	__cht2;
7327c478bdstevel@tonic-gateextern cchar_t	*__pcht1;
7337c478bdstevel@tonic-gateextern cchar_t	*__pcht2;
7347c478bdstevel@tonic-gate
7357c478bdstevel@tonic-gate#define	addch(ch)	waddch(stdscr, ch)
7367c478bdstevel@tonic-gate#define	mvaddch(y, x, ch)	(move(y, x) ? ((ch), ERR) : addch(ch))
7377c478bdstevel@tonic-gate#define	mvwaddch(w, y, x, ch)	\
7387c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ((ch), ERR) : waddch(__w1, ch))
7397c478bdstevel@tonic-gate
7407c478bdstevel@tonic-gate#define	add_wch(cp)	wadd_wch(stdscr, cp)
7417c478bdstevel@tonic-gate#define	mvadd_wch(y, x, cp)	(move(y, x) ? ((cp), ERR) : add_wch(cp))
7427c478bdstevel@tonic-gate#define	mvwadd_wch(w, y, x, cp)	\
7437c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ((cp), ERR) : wadd_wch(__w1, cp))
7447c478bdstevel@tonic-gate
7457c478bdstevel@tonic-gate#define	addchnstr(chs, n)	waddchnstr(stdscr, chs, n)
7467c478bdstevel@tonic-gate#define	addchstr(chs)	waddchstr(stdscr, chs)
7477c478bdstevel@tonic-gate#define	mvaddchnstr(y, x, chs, n)	\
7487c478bdstevel@tonic-gate	(move(y, x) ? ((chs), (n), ERR) : addchnstr(chs, n))
7497c478bdstevel@tonic-gate
7507c478bdstevel@tonic-gate#define	mvaddchstr(y, x, chs)	\
7517c478bdstevel@tonic-gate	(move(y, x) ? ((chs), ERR) : addchstr(chs))
7527c478bdstevel@tonic-gate
7537c478bdstevel@tonic-gate#define	mvwaddchnstr(w, y, x, chs, n)	\
7547c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ((chs), (n), ERR) :\
7557c478bdstevel@tonic-gate	waddchnstr(__w1, chs, n))
7567c478bdstevel@tonic-gate
7577c478bdstevel@tonic-gate#define	mvwaddchstr(w, y, x, chs)	\
7587c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ((chs), ERR) : waddchstr(__w1, chs))
7597c478bdstevel@tonic-gate
7607c478bdstevel@tonic-gate#define	waddchstr(w, chs)	waddchnstr(w, chs, -1)
7617c478bdstevel@tonic-gate
7627c478bdstevel@tonic-gate#define	add_wchnstr(cp, n)	wadd_wchnstr(stdscr, cp, n)
7637c478bdstevel@tonic-gate#define	add_wchstr(cp)	wadd_wchstr(stdscr, cp)
7647c478bdstevel@tonic-gate#define	mvadd_wchnstr(y, x, cp, n)	\
7657c478bdstevel@tonic-gate	(move(y, x) ? ((cp), (n), ERR) : add_wchnstr(cp, n))
7667c478bdstevel@tonic-gate
7677c478bdstevel@tonic-gate#define	mvadd_wchstr(y, x, cp)	\
7687c478bdstevel@tonic-gate	(move(y, x) ? ((cp), ERR) : add_wchstr(cp))
7697c478bdstevel@tonic-gate
7707c478bdstevel@tonic-gate#define	mvwadd_wchnstr(w, y, x, cp, n)	\
7717c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ((cp), (n), ERR) :\
7727c478bdstevel@tonic-gate	wadd_wchnstr(__w1, cp, n))
7737c478bdstevel@tonic-gate
7747c478bdstevel@tonic-gate#define	mvwadd_wchstr(w, y, x, cp)	\
7757c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ((cp), ERR) :\
7767c478bdstevel@tonic-gate	wadd_wchstr(__w1, cp))
7777c478bdstevel@tonic-gate
7787c478bdstevel@tonic-gate#define	wadd_wchstr(w, cp)	wadd_wchnstr(w, cp, -1)
7797c478bdstevel@tonic-gate#define	addnstr(s, n)	waddnstr(stdscr, s, n)
7807c478bdstevel@tonic-gate#define	addstr(s)	waddstr(stdscr, s)
7817c478bdstevel@tonic-gate#define	mvaddnstr(y, x, s, n)	\
7827c478bdstevel@tonic-gate	(move(y, x) ? (s, n, ERR) : addnstr(s, n))
7837c478bdstevel@tonic-gate
7847c478bdstevel@tonic-gate#define	mvaddstr(y, x, s)	\
7857c478bdstevel@tonic-gate	(move(y, x) ? (s, ERR) : addstr(s))
7867c478bdstevel@tonic-gate
7877c478bdstevel@tonic-gate#define	mvwaddnstr(w, y, x, s, n)	\
7887c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : waddnstr(__w1, s, n))
7897c478bdstevel@tonic-gate
7907c478bdstevel@tonic-gate#define	mvwaddstr(w, y, x, s)	\
7917c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, ERR) : waddstr(__w1, s))
7927c478bdstevel@tonic-gate
7937c478bdstevel@tonic-gate#define	waddstr(w, wcs)	waddnstr(w, wcs, -1)
7947c478bdstevel@tonic-gate#define	addnwstr(wcs, n)	waddnwstr(stdscr, wcs, n)
7957c478bdstevel@tonic-gate#define	addwstr(wcs)	waddwstr(stdscr, wcs)
7967c478bdstevel@tonic-gate#define	mvaddnwstr(y, x, wcs, n)	\
7977c478bdstevel@tonic-gate	(move(y, x) ? (wcs, n, ERR) : addnwstr(wcs, n))
7987c478bdstevel@tonic-gate
7997c478bdstevel@tonic-gate#define	mvaddwstr(y, x, wcs)	\
8007c478bdstevel@tonic-gate	(move(y, x) ? (wcs, ERR) : addwstr(wcs))
8017c478bdstevel@tonic-gate
8027c478bdstevel@tonic-gate#define	mvwaddnwstr(w, y, x, wcs, n)	\
8037c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
8047c478bdstevel@tonic-gate	waddnwstr(__w1, wcs, n))
8057c478bdstevel@tonic-gate
8067c478bdstevel@tonic-gate#define	mvwaddwstr(w, y, x, wcs)	\
8077c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : waddwstr(__w1, wcs))
8087c478bdstevel@tonic-gate
8097c478bdstevel@tonic-gate#define	waddwstr(w, wcs)	waddnwstr(w, wcs, -1)
8107c478bdstevel@tonic-gate#define	attr_get(a, c, o)	wattr_get(stdscr, a, c, o)
8117c478bdstevel@tonic-gate#define	attr_off(a, o)	wattr_off(stdscr, a, o)
8127c478bdstevel@tonic-gate#define	attr_on(a, o)	wattr_on(stdscr, a, o)
8137c478bdstevel@tonic-gate#define	attr_set(a, c, o)	wattr_set(stdscr, a, c, o)
8147c478bdstevel@tonic-gate
8157c478bdstevel@tonic-gate#define	COLOR_PAIR(n)	((chtype)(n) << __COLOR_SHIFT)
8167c478bdstevel@tonic-gate#define	PAIR_NUMBER(a)  (((chtype)(a) & A_COLOR) >> __COLOR_SHIFT)
8177c478bdstevel@tonic-gate
8187c478bdstevel@tonic-gate#define	bkgd(ch)	wbkgd(stdscr, ch)
8197c478bdstevel@tonic-gate#define	bkgdset(ch)	wbkgdset(stdscr, ch)
8207c478bdstevel@tonic-gate
8217c478bdstevel@tonic-gate#define	bkgrnd(b)	wbkgrnd(stdscr, b)
8227c478bdstevel@tonic-gate#define	bkgrndset(b)	wbkgrndset(stdscr, b)
8237c478bdstevel@tonic-gate#define	getbkgrnd(b)	wgetbkgrnd(stdscr, b)
8247c478bdstevel@tonic-gate#define	wgetbkgrnd(w, b)	(*(b) = (w)->_bg, OK)
8257c478bdstevel@tonic-gate
8267c478bdstevel@tonic-gate#define	border(ls, rs, ts, bs, tl, tr, bl, br)	\
8277c478bdstevel@tonic-gate	wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
8287c478bdstevel@tonic-gate
8297c478bdstevel@tonic-gate#define	border_set(ls, rs, ts, bs, tl, tr, bl, br)	\
8307c478bdstevel@tonic-gate	wborder_set(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
8317c478bdstevel@tonic-gate
8327c478bdstevel@tonic-gate#define	box(w, v, h)	\
8337c478bdstevel@tonic-gate	wborder(w, __cht1 = (v), __cht1, __cht2 = (h), __cht2, 0, 0, 0, 0)
8347c478bdstevel@tonic-gate
8357c478bdstevel@tonic-gate#define	box_set(w, v, h)	\
8367c478bdstevel@tonic-gate	wborder_set(w, __pcht1 = (v), __pcht1, __pcht2 = (h), __pcht2,\
8377c478bdstevel@tonic-gate	0, 0, 0, 0)
8387c478bdstevel@tonic-gate
8397c478bdstevel@tonic-gate#define	can_change_color()	\
8407c478bdstevel@tonic-gate	(2 < max_colors && can_change && initialize_color != NULL)
8417c478bdstevel@tonic-gate
8427c478bdstevel@tonic-gate#define	has_colors()	(0 < max_colors)
8437c478bdstevel@tonic-gate
8447c478bdstevel@tonic-gate#define	chgat(n, a, co, p)	wchgat(stdscr, n, a, co, p)
8457c478bdstevel@tonic-gate#define	mvchgat(y, x, n, a, co, p)	\
8467c478bdstevel@tonic-gate	(move(y, x) ? (n, a, co, p, ERR) : chgat(n, a, co, p))
8477c478bdstevel@tonic-gate
8487c478bdstevel@tonic-gate#define	mvwchgat(w, y, x, n, a, co, p)	\
8497c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (n, a, co, p, ERR) :\
8507c478bdstevel@tonic-gate	wchgat(__w1, n, a, co, p))
8517c478bdstevel@tonic-gate
8527c478bdstevel@tonic-gate#define	clear()	wclear(stdscr)
8537c478bdstevel@tonic-gate#define	clrtobot()	wclrtobot(stdscr)
8547c478bdstevel@tonic-gate#define	clrtoeol()	wclrtoeol(stdscr)
8557c478bdstevel@tonic-gate#define	erase()	werase(stdscr)
8567c478bdstevel@tonic-gate#define	wclear(w)	\
8577c478bdstevel@tonic-gate	(clearok(__w1 = (w), 1) ? ERR : werase(__w1))
8587c478bdstevel@tonic-gate
8597c478bdstevel@tonic-gate#define	werase(w)	\
8607c478bdstevel@tonic-gate	(wmove(__w1 = (w), 0, 0) ? ERR : wclrtobot(__w1))
8617c478bdstevel@tonic-gate
8627c478bdstevel@tonic-gate#define	delch()	wdelch(stdscr)
8637c478bdstevel@tonic-gate#define	mvdelch(y, x)	(move(y, x) ? ERR : delch())
8647c478bdstevel@tonic-gate#define	mvwdelch(w, y, x)	\
8657c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ERR : wdelch(__w1))
8667c478bdstevel@tonic-gate
8677c478bdstevel@tonic-gate#define	deleteln()	wdeleteln(stdscr)
8687c478bdstevel@tonic-gate#define	insdelln(n)	winsdelln(stdscr, n)
8697c478bdstevel@tonic-gate#define	insertln()	winsertln(stdscr)
8707c478bdstevel@tonic-gate#define	wdeleteln(w)	winsdelln(w, -1)
8717c478bdstevel@tonic-gate#define	winsertln(w)	winsdelln(w, 1)
8727c478bdstevel@tonic-gate#define	refresh()	wrefresh(stdscr)
8737c478bdstevel@tonic-gate#define	echochar(ch)	wechochar(stdscr, ch)
8747c478bdstevel@tonic-gate#define	echo_wchar(cp)	wecho_wchar(stdscr, cp)
8757c478bdstevel@tonic-gate#define	wechochar(w, ch)	\
8767c478bdstevel@tonic-gate	(waddch(__w1 = (w), ch) ? (wrefresh(__w1), ERR) :\
8777c478bdstevel@tonic-gate	wrefresh(__w1))
8787c478bdstevel@tonic-gate
8797c478bdstevel@tonic-gate#define	wecho_wchar(w, cp)	\
8807c478bdstevel@tonic-gate	(wadd_wch(__w1 = (w), cp) ? (wrefresh(__w1), ERR) :\
8817c478bdstevel@tonic-gate	wrefresh(__w1))
8827c478bdstevel@tonic-gate
8837c478bdstevel@tonic-gate#define	getch()	wgetch(stdscr)
8847c478bdstevel@tonic-gate#define	mvgetch(y, x)	(move(y, x) ? ERR : getch())
8857c478bdstevel@tonic-gate#define	mvwgetch(w, y, x)	\
8867c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ERR : wgetch(__w1))
8877c478bdstevel@tonic-gate
8887c478bdstevel@tonic-gate#define	get_wch(wcp)	wget_wch(stdscr, wcp)
8897c478bdstevel@tonic-gate#define	mvget_wch(y, x, wcp)	\
8907c478bdstevel@tonic-gate	(move(y, x) ? (wcp, ERR) : get_wch(wcp))
8917c478bdstevel@tonic-gate
8927c478bdstevel@tonic-gate#define	mvwget_wch(w, y, x, wcp)	\
8937c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcp, ERR) : wget_wch(__w1, wcp))
8947c478bdstevel@tonic-gate
8957c478bdstevel@tonic-gate#define	getnstr(s, n)	wgetnstr(stdscr, s, n)
8967c478bdstevel@tonic-gate#define	getstr(s)	wgetstr(stdscr, s)
8977c478bdstevel@tonic-gate#define	mvgetnstr(y, x, s, n)	\
8987c478bdstevel@tonic-gate	(move(y, x) ? (s, n, ERR) : getnstr(s, n))
8997c478bdstevel@tonic-gate
9007c478bdstevel@tonic-gate#define	mvgetstr(y, x, s)	\
9017c478bdstevel@tonic-gate	(move(y, x) ? (s, ERR) : getstr(s))
9027c478bdstevel@tonic-gate
9037c478bdstevel@tonic-gate#define	mvwgetnstr(w, y, x, s, n)	\
9047c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : wgetnstr(__w1, s, n))
9057c478bdstevel@tonic-gate
9067c478bdstevel@tonic-gate#define	mvwgetstr(w, y, x, s)	\
9077c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, ERR) : wgetstr(__w1, s))
9087c478bdstevel@tonic-gate
9097c478bdstevel@tonic-gate#define	wgetstr(w, s)	wgetnstr(w, s, -1)
9107c478bdstevel@tonic-gate#define	getn_wstr(wcs, n)	wgetn_wstr(stdscr, wcs, n)
9117c478bdstevel@tonic-gate#define	get_wstr(wcs)	wget_wstr(stdscr, wcs)
9127c478bdstevel@tonic-gate#define	mvgetn_wstr(y, x, wcs, n)	\
9137c478bdstevel@tonic-gate	(move(y, x) ? (wcs, n, ERR) : getn_wstr(wcs, n))
9147c478bdstevel@tonic-gate
9157c478bdstevel@tonic-gate#define	mvget_wstr(y, x, wcs)	\
9167c478bdstevel@tonic-gate	(move(y, x) ? (wcs, ERR) : get_wstr(wcs))
9177c478bdstevel@tonic-gate
9187c478bdstevel@tonic-gate#define	mvwgetn_wstr(w, y, x, wcs, n)	\
9197c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
9207c478bdstevel@tonic-gate	wgetn_wstr(__w1, wcs, n))
9217c478bdstevel@tonic-gate
9227c478bdstevel@tonic-gate#define	mvwget_wstr(w, y, x, wcs)	\
9237c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : wget_wstr(__w1, wcs))
9247c478bdstevel@tonic-gate
9257c478bdstevel@tonic-gate#define	wget_wstr(w, wcs)	wgetn_wstr(w, wcs, -1)
9267c478bdstevel@tonic-gate
9277c478bdstevel@tonic-gate#define	has_ic()	\
9287c478bdstevel@tonic-gate	(((insert_character != NULL || parm_ich != NULL) && \
9297c478bdstevel@tonic-gate	(delete_character != NULL || parm_dch != NULL)) || \
9307c478bdstevel@tonic-gate	(enter_insert_mode != NULL && exit_insert_mode))
9317c478bdstevel@tonic-gate
9327c478bdstevel@tonic-gate#define	has_il()	\
9337c478bdstevel@tonic-gate	(((insert_line != NULL || parm_insert_line != NULL) && \
9347c478bdstevel@tonic-gate	(delete_line != NULL || parm_delete_line != NULL)) || \
9357c478bdstevel@tonic-gate	change_scroll_region != NULL)
9367c478bdstevel@tonic-gate
9377c478bdstevel@tonic-gate#define	hline(ch, n)	whline(stdscr, ch, n)
9387c478bdstevel@tonic-gate#define	vline(ch, n)	wvline(stdscr, ch, n)
9397c478bdstevel@tonic-gate#define	mvhline(y, x, ch, n)	\
9407c478bdstevel@tonic-gate	(move(y, x) ? (ch, n, ERR) : hline(ch, n))
9417c478bdstevel@tonic-gate
9427c478bdstevel@tonic-gate#define	mvvline(y, x, ch, n)	\
9437c478bdstevel@tonic-gate	(move(y, x) ? (ch, n, ERR) : vline(ch, n))
9447c478bdstevel@tonic-gate
9457c478bdstevel@tonic-gate#define	mvwhline(w, y, x, ch, n)	\
9467c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (ch, n, ERR) : whline(__w1, ch, n))
9477c478bdstevel@tonic-gate
9487c478bdstevel@tonic-gate#define	mvwvline(w, y, x, ch, n)	\
9497c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (ch, n, ERR) : wvline(__w1, ch, n))
9507c478bdstevel@tonic-gate
9517c478bdstevel@tonic-gate#define	hline_set(cp, n)	whline_set(stdscr, cp, n)
9527c478bdstevel@tonic-gate#define	vline_set(cp, n)	wvline_set(stdscr, cp, n)
9537c478bdstevel@tonic-gate#define	mvhline_set(y, x, cp, n)	\
9547c478bdstevel@tonic-gate	(move(y, x) ? (cp, n, ERR) : hline_set(cp, n))
9557c478bdstevel@tonic-gate
9567c478bdstevel@tonic-gate#define	mvvline_set(y, x, cp, n)	\
9577c478bdstevel@tonic-gate	(move(y, x) ? (cp, n, ERR) : vline_set(cp, n))
9587c478bdstevel@tonic-gate
9597c478bdstevel@tonic-gate#define	mvwhline_set(w, y, x, cp, n)	\
9607c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (cp, n, ERR) : whline_set(__w1, cp, n))
9617c478bdstevel@tonic-gate
9627c478bdstevel@tonic-gate#define	mvwvline_set(w, y, x, cp, n)	\
9637c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (cp, n, ERR) : wvline_set(__w1, cp, n))
9647c478bdstevel@tonic-gate
9657c478bdstevel@tonic-gate#define	inch()	winch(stdscr)
9667c478bdstevel@tonic-gate#define	mvinch(y, x)	(move(y, x) ? ERR : inch())
9677c478bdstevel@tonic-gate#define	mvwinch(w, y, x)	\
9687c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? ERR : winch(__w1))
9697c478bdstevel@tonic-gate
9707c478bdstevel@tonic-gate#define	in_wch(cp)	win_wch(stdscr, cp)
9717c478bdstevel@tonic-gate#define	mvin_wch(y, x, cp)	\
9727c478bdstevel@tonic-gate	(move(y, x) ? (cp, ERR) : in_wch(cp))
9737c478bdstevel@tonic-gate
9747c478bdstevel@tonic-gate#define	mvwin_wch(w, y, x, cp)	\
9757c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (cp, ERR) : win_wch(__w1, cp))
9767c478bdstevel@tonic-gate
9777c478bdstevel@tonic-gate#define	inchnstr(chs, n)	winchnstr(stdscr, chs, n)
9787c478bdstevel@tonic-gate#define	inchstr(chs)	winchstr(stdscr, chs)
9797c478bdstevel@tonic-gate#define	mvinchnstr(y, x, chs, n)	\
9807c478bdstevel@tonic-gate	(move(y, x) ? (chs, n, ERR) : inchnstr(chs, n))
9817c478bdstevel@tonic-gate
9827c478bdstevel@tonic-gate#define	mvinchstr(y, x, chs)	\
9837c478bdstevel@tonic-gate	(move(y, x) ? (chs, ERR) : inchstr(chs))
9847c478bdstevel@tonic-gate
9857c478bdstevel@tonic-gate#define	mvwinchnstr(w, y, x, chs, n)	\
9867c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (chs, n, ERR) : winchnstr(__w1, chs, n))
9877c478bdstevel@tonic-gate
9887c478bdstevel@tonic-gate#define	mvwinchstr(w, y, x, chs)	\
9897c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (chs, ERR) : winchstr(__w1, chs))
9907c478bdstevel@tonic-gate
9917c478bdstevel@tonic-gate#define	winchstr(w, chs)	winchnstr(w, chs, -1)
9927c478bdstevel@tonic-gate#define	in_wchnstr(cp, n)	win_wchnstr(stdscr, cp, n)
9937c478bdstevel@tonic-gate#define	in_wchstr(cp)	win_wchstr(stdscr, cp)
9947c478bdstevel@tonic-gate#define	mvin_wchnstr(y, x, cp, n)	\
9957c478bdstevel@tonic-gate	(move(y, x) ? (cp, n, ERR) : in_wchnstr(cp, n))
9967c478bdstevel@tonic-gate
9977c478bdstevel@tonic-gate#define	mvin_wchstr(y, x, cp)	\
9987c478bdstevel@tonic-gate	(move(y, x) ? (cp, ERR) : in_wchstr(cp))
9997c478bdstevel@tonic-gate
10007c478bdstevel@tonic-gate#define	mvwin_wchnstr(w, y, x, cp, n)	\
10017c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (cp, n, ERR) :\
10027c478bdstevel@tonic-gate	win_wchnstr(__w1, cp, n))
10037c478bdstevel@tonic-gate
10047c478bdstevel@tonic-gate#define	mvwin_wchstr(w, y, x, cp)	\
10057c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (cp, ERR) : win_wchstr(__w1, cp))
10067c478bdstevel@tonic-gate
10077c478bdstevel@tonic-gate#define	win_wchstr(w, cp)	win_wchnstr(w, cp, -1)
10087c478bdstevel@tonic-gate#define	innstr(s, n)	winnstr(stdscr, s, n)
10097c478bdstevel@tonic-gate#define	instr(s)	winstr(stdscr, s)
10107c478bdstevel@tonic-gate#define	mvinnstr(y, x, s, n)	\
10117c478bdstevel@tonic-gate	(move(y, x) ? (s, n, ERR) : innstr(s, n))
10127c478bdstevel@tonic-gate
10137c478bdstevel@tonic-gate#define	mvinstr(y, x, s)	\
10147c478bdstevel@tonic-gate	(move(y, x) ? (s, ERR) : instr(s))
10157c478bdstevel@tonic-gate
10167c478bdstevel@tonic-gate#define	mvwinnstr(w, y, x, s, n)	\
10177c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : winnstr(__w1, s, n))
10187c478bdstevel@tonic-gate
10197c478bdstevel@tonic-gate#define	mvwinstr(w, y, x, s)	\
10207c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, ERR) : winstr(__w1, s))
10217c478bdstevel@tonic-gate
10227c478bdstevel@tonic-gate#define	winstr(w, s)	(winnstr(w, s, -1), OK)
10237c478bdstevel@tonic-gate#define	innwstr(wcs, n)	winnwstr(stdscr, wcs, n)
10247c478bdstevel@tonic-gate#define	inwstr(wcs)	winwstr(stdscr, wcs)
10257c478bdstevel@tonic-gate#define	mvinnwstr(y, x, wcs, n)	\
10267c478bdstevel@tonic-gate	(move(y, x) ? (wcs, n, ERR) : innwstr(wcs, n))
10277c478bdstevel@tonic-gate
10287c478bdstevel@tonic-gate#define	mvinwstr(y, x, wcs)	\
10297c478bdstevel@tonic-gate	(move(y, x) ? (wcs, ERR) : inwstr(wcs))
10307c478bdstevel@tonic-gate
10317c478bdstevel@tonic-gate#define	mvwinnwstr(w, y, x, wcs, n)	\
10327c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
10337c478bdstevel@tonic-gate	winnwstr(__w1, wcs, n))
10347c478bdstevel@tonic-gate
10357c478bdstevel@tonic-gate#define	mvwinwstr(w, y, x, wcs)	\
10367c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : winwstr(__w1, wcs))
10377c478bdstevel@tonic-gate
10387c478bdstevel@tonic-gate#define	winwstr(w, wcs)	(winnwstr(w, wcs, -1), OK)
10397c478bdstevel@tonic-gate#define	insch(ch)	winsch(stdscr, ch)
10407c478bdstevel@tonic-gate#define	mvinsch(y, x, ch)	(move(y, x) ? (ch, ERR) : insch(ch))
10417c478bdstevel@tonic-gate#define	mvwinsch(w, y, x, ch)	\
10427c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (ch, ERR) : winsch(__w1, ch))
10437c478bdstevel@tonic-gate
10447c478bdstevel@tonic-gate#define	ins_wch(cp)	wins_wch(stdscr, cp)
10457c478bdstevel@tonic-gate#define	mvins_wch(y, x, cp)	(move(y, x) ? (cp, ERR) : ins_wch(cp))
10467c478bdstevel@tonic-gate#define	mvwins_wch(w, y, x, cp)	\
10477c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (cp, ERR) : wins_wch(__w1, cp))
10487c478bdstevel@tonic-gate
10497c478bdstevel@tonic-gate#define	insnstr(s, n)	winsnstr(stdscr, s, n)
10507c478bdstevel@tonic-gate#define	insstr(s)	winsstr(stdscr, s)
10517c478bdstevel@tonic-gate#define	mvinsnstr(y, x, s, n)	(move(y, x) ? (s, n, ERR) : insnstr(s, n))
10527c478bdstevel@tonic-gate#define	mvinsstr(y, x, s)	(move(y, x) ? (s, ERR) : insstr(s))
10537c478bdstevel@tonic-gate#define	mvwinsnstr(w, y, x, s, n)	\
10547c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : winsnstr(__w1, s, n))
10557c478bdstevel@tonic-gate
10567c478bdstevel@tonic-gate#define	mvwinsstr(w, y, x, s)	\
10577c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (s, ERR) : winsstr(__w1, s))
10587c478bdstevel@tonic-gate
10597c478bdstevel@tonic-gate#define	winsstr(w, s)	winsnstr(w, s, -1)
10607c478bdstevel@tonic-gate#define	ins_nwstr(wcs, n)	wins_nwstr(stdscr, wcs, n)
10617c478bdstevel@tonic-gate#define	ins_wstr(wcs)	wins_wstr(stdscr, wcs)
10627c478bdstevel@tonic-gate#define	mvins_nwstr(y, x, wcs, n)	\
10637c478bdstevel@tonic-gate	(move(y, x) ? (wcs, n, ERR) : ins_nwstr(wcs, n))
10647c478bdstevel@tonic-gate
10657c478bdstevel@tonic-gate#define	mvins_wstr(y, x, wcs)	(move(y, x) ? (wcs, ERR) : ins_wstr(wcs))
10667c478bdstevel@tonic-gate#define	mvwins_nwstr(w, y, x, wcs, n)	\
10677c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) : wins_nwstr(__w1, wcs, n))
10687c478bdstevel@tonic-gate
10697c478bdstevel@tonic-gate#define	mvwins_wstr(w, y, x, wcs)	\
10707c478bdstevel@tonic-gate	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : wins_wstr(__w1, wcs))
10717c478bdstevel@tonic-gate
10727c478bdstevel@tonic-gate#define	wins_wstr(w, wcs)	wins_nwstr(w, wcs, -1)
10737c478bdstevel@tonic-gate#define	is_linetouched(w, y)	(0 <= (w)->_last[y])
10747c478bdstevel@tonic-gate#define	move(y, x)	wmove(stdscr, y, x)
10757c478bdstevel@tonic-gate#define	subpad(par, ny, nx, by, bx)	subwin(par, ny, nx, by, bx)
10767c478bdstevel@tonic-gate#define	nodelay(w, bf)	(wtimeout(w, (bf) ? 0: -1), OK)
10777c478bdstevel@tonic-gate#define	timeout(n)	wtimeout(stdscr, n)
10787c478bdstevel@tonic-gate#define	qiflush()	((void) intrflush(NULL, 1))
10797c478bdstevel@tonic-gate#define	noqiflush()	((void) intrflush(NULL, 0))
10807c478bdstevel@tonic-gate#define	redrawwin(w)	wredrawln(__w1 = (w), 0, (__w1)->_maxy)
10817c478bdstevel@tonic-gate#define	scrl(n)	wscrl(stdscr, n)
10827c478bdstevel@tonic-gate#define	setscrreg(t, b)	wsetscrreg(stdscr, t, b)
10837c478bdstevel@tonic-gate#define	standend()	wstandend(stdscr)
10847c478bdstevel@tonic-gate#define	standout()	wstandout(stdscr)
10857c478bdstevel@tonic-gate#define	touchline(w, y, n)	wtouchln(w, y, n, 1)
10867c478bdstevel@tonic-gate#define	touchwin(w)	wtouchln(__w1 = (w), 0, __w1->_maxy, 1)
10877c478bdstevel@tonic-gate#define	untouchwin(w)	wtouchln(__w1 = (w), 0, __w1->_maxy, 0)
10887c478bdstevel@tonic-gate#define	termname()			(cur_term->_term)
10897c478bdstevel@tonic-gate
10907c478bdstevel@tonic-gate#endif	/* !defined(__lint) */
10917c478bdstevel@tonic-gate
10927c478bdstevel@tonic-gate/*
10937c478bdstevel@tonic-gate * Special Keys
10947c478bdstevel@tonic-gate *
10957c478bdstevel@tonic-gate * Keypad layout
10967c478bdstevel@tonic-gate *	A1	up	A3
10977c478bdstevel@tonic-gate *     left	B2     right
10987c478bdstevel@tonic-gate *	C1     down	C3
10997c478bdstevel@tonic-gate *
11007c478bdstevel@tonic-gate * Chossing negative values for KEY_ constants means that they can
11017c478bdstevel@tonic-gate * be safely returned in either an int or long type.
11027c478bdstevel@tonic-gate */
11037c478bdstevel@tonic-gate#define	__KEY_BASE	(-2)
11047c478bdstevel@tonic-gate#define	__KEY_MAX	__KEY_BASE
11057c478bdstevel@tonic-gate
11067c478bdstevel@tonic-gate#define	KEY_CODE_YES	(__KEY_BASE-1)		/* Special indicator. */
11077c478bdstevel@tonic-gate#define	KEY_BREAK	(__KEY_BASE-2)		/* Break key (unreliable) */
11087c478bdstevel@tonic-gate#define	KEY_DOWN	(__KEY_BASE-3)		/* The four arrow keys ... */
11097c478bdstevel@tonic-gate#define	KEY_UP		(__KEY_BASE-4)
11107c478bdstevel@tonic-gate#define	KEY_LEFT	(__KEY_BASE-5)
11117c478bdstevel@tonic-gate#define	KEY_RIGHT	(__KEY_BASE-6)
11127c478bdstevel@tonic-gate#define	KEY_HOME	(__KEY_BASE-7)		/* Move to upper-left corner. */
11137c478bdstevel@tonic-gate#define	KEY_BACKSPACE	(__KEY_BASE-8)		/* Backspace */
11147c478bdstevel@tonic-gate#define	KEY_F0		(__KEY_BASE-9)		/* Function keys.  Space for */
11157c478bdstevel@tonic-gate#define	KEY_F(n)	(KEY_F0-(n))    	/* 64 keys is reserved. */
11167c478bdstevel@tonic-gate#define	KEY_DL		(__KEY_BASE-73)		/* Delete line */
11177c478bdstevel@tonic-gate#define	KEY_IL		(__KEY_BASE-74)		/* Insert line */
11187c478bdstevel@tonic-gate#define	KEY_DC		(__KEY_BASE-75)		/* Delete character */
11197c478bdstevel@tonic-gate#define	KEY_IC		(__KEY_BASE-76)		/* Ins char / enter ins mode */
11207c478bdstevel@tonic-gate#define	KEY_EIC		(__KEY_BASE-77)		/* Exit insert char mode */
11217c478bdstevel@tonic-gate#define	KEY_CLEAR	(__KEY_BASE-78)		/* Clear screen */
11227c478bdstevel@tonic-gate#define	KEY_EOS		(__KEY_BASE-79)		/* Clear to end of screen */
11237c478bdstevel@tonic-gate#define	KEY_EOL		(__KEY_BASE-80)		/* Clear to end of line */
11247c478bdstevel@tonic-gate#define	KEY_SF		(__KEY_BASE-81)		/* Scroll 1 line forward */
11257c478bdstevel@tonic-gate#define	KEY_SR		(__KEY_BASE-82)		/* Scroll 1 line backwards */
11267c478bdstevel@tonic-gate#define	KEY_NPAGE	(__KEY_BASE-83)		/* Next page */
11277c478bdstevel@tonic-gate#define	KEY_PPAGE	(__KEY_BASE-84)		/* Previous page */
11287c478bdstevel@tonic-gate#define	KEY_STAB	(__KEY_BASE-85)		/* Set tab */
11297c478bdstevel@tonic-gate#define	KEY_CTAB	(__KEY_BASE-86)		/* Clear tab */
11307c478bdstevel@tonic-gate#define	KEY_CATAB	(__KEY_BASE-87)		/* Clear all tabs */
11317c478bdstevel@tonic-gate#define	KEY_ENTER	(__KEY_BASE-88)		/* Enter or send */
11327c478bdstevel@tonic-gate#define	KEY_SRESET	(__KEY_BASE-89)		/* Soft (partial) reset */
11337c478bdstevel@tonic-gate#define	KEY_RESET	(__KEY_BASE-90)		/* Hard reset */
11347c478bdstevel@tonic-gate#define	KEY_PRINT	(__KEY_BASE-91)		/* Print or copy */
11357c478bdstevel@tonic-gate#define	KEY_LL		(__KEY_BASE-92)		/* Move to lower left corner. */
11367c478bdstevel@tonic-gate#define	KEY_A1		(__KEY_BASE-93)		/* Upper left of keypad */
11377c478bdstevel@tonic-gate#define	KEY_A3		(__KEY_BASE-94) 	/* Upper rght of keypad */
11387c478bdstevel@tonic-gate#define	KEY_B2		(__KEY_BASE-95) 	/* Center of keypad */
11397c478bdstevel@tonic-gate#define	KEY_C1		(__KEY_BASE-96) 	/* Lower left of keypad */
11407c478bdstevel@tonic-gate#define	KEY_C3		(__KEY_BASE-97) 	/* Lower right of keypad */
11417c478bdstevel@tonic-gate#define	KEY_BTAB	(__KEY_BASE-98) 	/* Back Tab */
11427c478bdstevel@tonic-gate#define	KEY_BEG		(__KEY_BASE-99) 	/* Beginning */
11437c478bdstevel@tonic-gate#define	KEY_CANCEL	(__KEY_BASE-100)
11447c478bdstevel@tonic-gate#define	KEY_CLOSE	(__KEY_BASE-101)
11457c478bdstevel@tonic-gate#define	KEY_COMMAND	(__KEY_BASE-102)
11467c478bdstevel@tonic-gate#define	KEY_COPY	(__KEY_BASE-103)
11477c478bdstevel@tonic-gate#define	KEY_CREATE	(__KEY_BASE-104)
11487c478bdstevel@tonic-gate#define	KEY_END		(__KEY_BASE-105)
11497c478bdstevel@tonic-gate#define	KEY_EXIT	(__KEY_BASE-106)
11507c478bdstevel@tonic-gate#define	KEY_FIND	(__KEY_BASE-107)
11517c478bdstevel@tonic-gate#define	KEY_HELP	(__KEY_BASE-108)
11527c478bdstevel@tonic-gate#define	KEY_MARK	(__KEY_BASE-109)
11537c478bdstevel@tonic-gate#define	KEY_MESSAGE	(__KEY_BASE-110)
11547c478bdstevel@tonic-gate#define	KEY_MOUSE	(__KEY_BASE-111)	/* Mouse event occured */
11557c478bdstevel@tonic-gate#define	KEY_MOVE	(__KEY_BASE-112)
11567c478bdstevel@tonic-gate#define	KEY_NEXT	(__KEY_BASE-113)	/* Next object */
11577c478bdstevel@tonic-gate#define	KEY_OPEN	(__KEY_BASE-114)
11587c478bdstevel@tonic-gate#define	KEY_OPTIONS	(__KEY_BASE-115)
11597c478bdstevel@tonic-gate#define	KEY_PREVIOUS	(__KEY_BASE-116)	/* Previous object */
11607c478bdstevel@tonic-gate#define	KEY_REDO	(__KEY_BASE-117)
11617c478bdstevel@tonic-gate#define	KEY_REFERENCE	(__KEY_BASE-118)
11627c478bdstevel@tonic-gate#define	KEY_REFRESH	(__KEY_BASE-119)
11637c478bdstevel@tonic-gate#define	KEY_REPLACE	(__KEY_BASE-120)
11647c478bdstevel@tonic-gate#define	KEY_RESTART	(__KEY_BASE-121)
11657c478bdstevel@tonic-gate#define	KEY_RESUME	(__KEY_BASE-122)
11667c478bdstevel@tonic-gate#define	KEY_SAVE	(__KEY_BASE-123)
11677c478bdstevel@tonic-gate#define	KEY_SBEG	(__KEY_BASE-124)	/* Shifted keys */
11687c478bdstevel@tonic-gate#define	KEY_SCANCEL	(__KEY_BASE-125)
11697c478bdstevel@tonic-gate#define	KEY_SCOMMAND	(__KEY_BASE-126)
11707c478bdstevel@tonic-gate#define	KEY_SCOPY	(__KEY_BASE-127)
11717c478bdstevel@tonic-gate#define	KEY_SCREATE	(__KEY_BASE-128)
11727c478bdstevel@tonic-gate#define	KEY_SDC		(__KEY_BASE-129)
11737c478bdstevel@tonic-gate#define	KEY_SDL		(__KEY_BASE-130)
11747c478bdstevel@tonic-gate#define	KEY_SELECT	(__KEY_BASE-131)	/* Select */
11757c478bdstevel@tonic-gate#define	KEY_SEND	(__KEY_BASE-132)	/* Shifted end key */
11767c478bdstevel@tonic-gate#define	KEY_SEOL	(__KEY_BASE-133)
11777c478bdstevel@tonic-gate#define	KEY_SEXIT	(__KEY_BASE-134)
11787c478bdstevel@tonic-gate#define	KEY_SFIND	(__KEY_BASE-135)
11797c478bdstevel@tonic-gate#define	KEY_SHELP	(__KEY_BASE-136)
11807c478bdstevel@tonic-gate#define	KEY_SHOME	(__KEY_BASE-137)
11817c478bdstevel@tonic-gate#define	KEY_SIC		(__KEY_BASE-138)
11827c478bdstevel@tonic-gate#define	KEY_SLEFT	(__KEY_BASE-139)
11837c478bdstevel@tonic-gate#define	KEY_SMESSAGE	(__KEY_BASE-140)
11847c478bdstevel@tonic-gate#define	KEY_SMOVE	(__KEY_BASE-141)
11857c478bdstevel@tonic-gate#define	KEY_SNEXT	(__KEY_BASE-142)
11867c478bdstevel@tonic-gate#define	KEY_SOPTIONS	(__KEY_BASE-143)
11877c478bdstevel@tonic-gate#define	KEY_SPREVIOUS	(__KEY_BASE-144)
11887c478bdstevel@tonic-gate#define	KEY_SPRINT	(__KEY_BASE-145)
11897c478bdstevel@tonic-gate#define	KEY_SREDO	(__KEY_BASE-146)
11907c478bdstevel@tonic-gate#define	KEY_SREPLACE	(__KEY_BASE-147)
11917c478bdstevel@tonic-gate#define	KEY_SRIGHT	(__KEY_BASE-148)
11927c478bdstevel@tonic-gate#define	KEY_SRSUME	(__KEY_BASE-149)
11937c478bdstevel@tonic-gate#define	KEY_SSAVE	(__KEY_BASE-150)
11947c478bdstevel@tonic-gate#define	KEY_SSUSPEND	(__KEY_BASE-151)
11957c478bdstevel@tonic-gate#define	KEY_SUNDO	(__KEY_BASE-152)
11967c478bdstevel@tonic-gate#define	KEY_SUSPEND	(__KEY_BASE-153)
11977c478bdstevel@tonic-gate#define	KEY_UNDO	(__KEY_BASE-154)
11987c478bdstevel@tonic-gate
11997c478bdstevel@tonic-gate#define	__KEY_MIN	(__KEY_BASE-155)
12007c478bdstevel@tonic-gate
12017c478bdstevel@tonic-gate#ifdef	__cplusplus
12027c478bdstevel@tonic-gate}
12037c478bdstevel@tonic-gate#endif
12047c478bdstevel@tonic-gate
12057c478bdstevel@tonic-gate#endif /* _CURSES_H */
1206