xref: /onnv-gate/usr/src/lib/libxcurses2/h/curses.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 1996-2003 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _CURSES_H
28*0Sstevel@tonic-gate #define	_CURSES_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate /*
33*0Sstevel@tonic-gate  * curses.h
34*0Sstevel@tonic-gate  *
35*0Sstevel@tonic-gate  * XCurses Library
36*0Sstevel@tonic-gate  *
37*0Sstevel@tonic-gate  * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
38*0Sstevel@tonic-gate  *
39*0Sstevel@tonic-gate  */
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate #include <sys/isa_defs.h>
42*0Sstevel@tonic-gate #include <stdio.h>
43*0Sstevel@tonic-gate #include <term.h>
44*0Sstevel@tonic-gate #include <wchar.h>
45*0Sstevel@tonic-gate 
46*0Sstevel@tonic-gate #ifdef	__cplusplus
47*0Sstevel@tonic-gate extern "C" {
48*0Sstevel@tonic-gate #endif
49*0Sstevel@tonic-gate 
50*0Sstevel@tonic-gate #define	_XOPEN_CURSES
51*0Sstevel@tonic-gate 
52*0Sstevel@tonic-gate #ifndef EOF
53*0Sstevel@tonic-gate #define	EOF			(-1)
54*0Sstevel@tonic-gate #endif
55*0Sstevel@tonic-gate 
56*0Sstevel@tonic-gate #ifndef WEOF
57*0Sstevel@tonic-gate #define	WEOF		((wint_t)(-1))
58*0Sstevel@tonic-gate #endif
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate #define	ERR			EOF
61*0Sstevel@tonic-gate #define	OK			0
62*0Sstevel@tonic-gate 
63*0Sstevel@tonic-gate #if !(defined(__cplusplus) && defined(_BOOL))
64*0Sstevel@tonic-gate #ifndef _BOOL_DEFINED
65*0Sstevel@tonic-gate typedef short	bool;
66*0Sstevel@tonic-gate #define	_BOOL_DEFINED
67*0Sstevel@tonic-gate #endif
68*0Sstevel@tonic-gate #endif
69*0Sstevel@tonic-gate 
70*0Sstevel@tonic-gate #define	TRUE    		1
71*0Sstevel@tonic-gate #define	FALSE   		0
72*0Sstevel@tonic-gate 
73*0Sstevel@tonic-gate typedef unsigned short	attr_t;
74*0Sstevel@tonic-gate 
75*0Sstevel@tonic-gate /*
76*0Sstevel@tonic-gate  * These attributes and masks can be applied to an attr_t.
77*0Sstevel@tonic-gate  * These are ordered according to the <no_color_video> mask,
78*0Sstevel@tonic-gate  * which has been extended to include additional attributes.
79*0Sstevel@tonic-gate  */
80*0Sstevel@tonic-gate #define	WA_NORMAL	0x0
81*0Sstevel@tonic-gate #define	WA_STANDOUT	0x0001
82*0Sstevel@tonic-gate #define	WA_UNDERLINE	0x0002
83*0Sstevel@tonic-gate #define	WA_REVERSE	0x0004
84*0Sstevel@tonic-gate #define	WA_BLINK	0x0008
85*0Sstevel@tonic-gate #define	WA_DIM		0x0010
86*0Sstevel@tonic-gate #define	WA_BOLD		0x0020
87*0Sstevel@tonic-gate #define	WA_INVIS	0x0040
88*0Sstevel@tonic-gate #define	WA_PROTECT	0x0080
89*0Sstevel@tonic-gate #define	WA_ALTCHARSET	0x0100
90*0Sstevel@tonic-gate #define	WA_HORIZONTAL	0x0200
91*0Sstevel@tonic-gate #define	WA_LEFT		0x0400
92*0Sstevel@tonic-gate #define	WA_LOW		0x0800
93*0Sstevel@tonic-gate #define	WA_RIGHT	0x1000
94*0Sstevel@tonic-gate #define	WA_TOP		0x2000
95*0Sstevel@tonic-gate #define	WA_VERTICAL	0x4000
96*0Sstevel@tonic-gate 
97*0Sstevel@tonic-gate #define	WA_SGR_MASK	0x01ff		/* Historical attribute set. */
98*0Sstevel@tonic-gate #define	WA_SGR1_MASK	0x7e00		/* Extended attribute set. */
99*0Sstevel@tonic-gate 
100*0Sstevel@tonic-gate /*
101*0Sstevel@tonic-gate  * Internal attribute used to support <ceol_standout_glitch>.
102*0Sstevel@tonic-gate  */
103*0Sstevel@tonic-gate #define	WA_COOKIE	0x8000
104*0Sstevel@tonic-gate 
105*0Sstevel@tonic-gate /*
106*0Sstevel@tonic-gate  * Color names.
107*0Sstevel@tonic-gate  */
108*0Sstevel@tonic-gate #define	COLOR_BLACK	0
109*0Sstevel@tonic-gate #define	COLOR_RED	1
110*0Sstevel@tonic-gate #define	COLOR_GREEN	2
111*0Sstevel@tonic-gate #define	COLOR_YELLOW	3
112*0Sstevel@tonic-gate #define	COLOR_BLUE	4
113*0Sstevel@tonic-gate #define	COLOR_MAGENTA	5
114*0Sstevel@tonic-gate #define	COLOR_CYAN	6
115*0Sstevel@tonic-gate #define	COLOR_WHITE	7
116*0Sstevel@tonic-gate 
117*0Sstevel@tonic-gate /*
118*0Sstevel@tonic-gate  * A cchar_t details the attributes, color, and a string of wide characters
119*0Sstevel@tonic-gate  * composing a complex character (p12).  The wide character string consists
120*0Sstevel@tonic-gate  * of a spacing character (wcwidth() > 0) and zero or more non-spacing
121*0Sstevel@tonic-gate  * characters.  Xcurses (p17) states that the minimum number of non-spacing
122*0Sstevel@tonic-gate  * characters associated with a spacing character must be at least 5, if a
123*0Sstevel@tonic-gate  * limit is imposed.
124*0Sstevel@tonic-gate  */
125*0Sstevel@tonic-gate #define	_M_CCHAR_MAX	6
126*0Sstevel@tonic-gate 
127*0Sstevel@tonic-gate /*
128*0Sstevel@tonic-gate  * Opaque data type.
129*0Sstevel@tonic-gate  */
130*0Sstevel@tonic-gate typedef struct {
131*0Sstevel@tonic-gate 	short	_f;			/* True if start of character. */
132*0Sstevel@tonic-gate 	short	_n;			/* Number of elements in wc[]. */
133*0Sstevel@tonic-gate 	short	_co;		/* Color pair number. */
134*0Sstevel@tonic-gate 	attr_t	_at;		/* Attribute flags. */
135*0Sstevel@tonic-gate 	wchar_t	_wc[_M_CCHAR_MAX];	/* Complex spacing character. */
136*0Sstevel@tonic-gate } cchar_t;
137*0Sstevel@tonic-gate 
138*0Sstevel@tonic-gate /*
139*0Sstevel@tonic-gate  * Opaque data type.
140*0Sstevel@tonic-gate  */
141*0Sstevel@tonic-gate typedef struct window_t {
142*0Sstevel@tonic-gate 	cchar_t	_bg;		/* Background. */
143*0Sstevel@tonic-gate 	cchar_t	_fg;		/* Foreground, ignore character. */
144*0Sstevel@tonic-gate 	short	_cury, _curx;	/* Curent cursor position in window. */
145*0Sstevel@tonic-gate 	short	_begy, _begx;	/* Upper-left origin on screen. */
146*0Sstevel@tonic-gate 	short	_maxy, _maxx;	/* Window dimensions. */
147*0Sstevel@tonic-gate 	short	_top, _bottom;	/* Window's software scroll region. */
148*0Sstevel@tonic-gate 	short	_refy, _refx;	/* Pad origin of last refresh. */
149*0Sstevel@tonic-gate 	short	_sminy, _sminx;	/* T-L screen corner of last refresh. */
150*0Sstevel@tonic-gate 	short	_smaxy, _smaxx;	/* B-R screen corner of last refresh. */
151*0Sstevel@tonic-gate 	short	_vmin, _vtime;	/* wtimeout() control. */
152*0Sstevel@tonic-gate 	short	*_first, *_last;	/* Dirty region for each screen line. */
153*0Sstevel@tonic-gate 	unsigned short	_flags;		/* Internal flags for the window. */
154*0Sstevel@tonic-gate 	unsigned short	_scroll;	/* Internal for scroll optimization. */
155*0Sstevel@tonic-gate 	cchar_t	**_line;
156*0Sstevel@tonic-gate 	cchar_t	*_base;		/* Block of M*N screen cells. */
157*0Sstevel@tonic-gate 	struct window_t	*_parent;	/* Parent of sub-window. */
158*0Sstevel@tonic-gate } WINDOW;
159*0Sstevel@tonic-gate 
160*0Sstevel@tonic-gate /*
161*0Sstevel@tonic-gate  * Opaque data type.
162*0Sstevel@tonic-gate  */
163*0Sstevel@tonic-gate typedef struct {
164*0Sstevel@tonic-gate 	int _kfd;		/* typeahead() file descriptor. */
165*0Sstevel@tonic-gate 	FILE *_if, *_of;	/* I/O file pointers. */
166*0Sstevel@tonic-gate 	TERMINAL *_term;	/* Associated terminfo entry. */
167*0Sstevel@tonic-gate 	WINDOW *_newscr;	/* New screen image built by wnoutrefresh(). */
168*0Sstevel@tonic-gate 	WINDOW *_curscr;	/* Current screen image after doupdate(). */
169*0Sstevel@tonic-gate 	mbstate_t _state;	/* Current multibyte state of _of. */
170*0Sstevel@tonic-gate #if defined(_LP64)
171*0Sstevel@tonic-gate 	unsigned int	*_hash;	/* Hash values for curscr's screen lines. */
172*0Sstevel@tonic-gate #else
173*0Sstevel@tonic-gate 	unsigned long	*_hash;	/* Hash values for curscr's screen lines. */
174*0Sstevel@tonic-gate #endif /* defined(_LP64) */
175*0Sstevel@tonic-gate 	unsigned short _flags;	/* Assorted flags. */
176*0Sstevel@tonic-gate 	void *_decode;		/* Function key decode tree. */
177*0Sstevel@tonic-gate 	void *_in;		/* Wide I/O object. */
178*0Sstevel@tonic-gate 	struct {
179*0Sstevel@tonic-gate 		int _size;	/* Allocated size of the input stack. */
180*0Sstevel@tonic-gate 		int _count;	/* Number of entries on the input stack. */
181*0Sstevel@tonic-gate 		int *_stack;	/* Buffer used for the input stack. */
182*0Sstevel@tonic-gate 	} _unget;
183*0Sstevel@tonic-gate 	struct {
184*0Sstevel@tonic-gate 		WINDOW *_w;	/* Exists on if emulating soft label keys. */
185*0Sstevel@tonic-gate 		char *_labels[8];	/* Soft label key strings. */
186*0Sstevel@tonic-gate 		short _justify[8];	/* Justification for label. */
187*0Sstevel@tonic-gate 		char	*_saved[8];	/* exact representation of label */
188*0Sstevel@tonic-gate 	} _slk;
189*0Sstevel@tonic-gate } SCREEN;
190*0Sstevel@tonic-gate 
191*0Sstevel@tonic-gate 
192*0Sstevel@tonic-gate /*
193*0Sstevel@tonic-gate  * Backwards compatiblity with historical Curses applications.
194*0Sstevel@tonic-gate  */
195*0Sstevel@tonic-gate #ifndef	_CHTYPE
196*0Sstevel@tonic-gate #define	_CHTYPE
197*0Sstevel@tonic-gate #if defined(_LP64)
198*0Sstevel@tonic-gate typedef unsigned int	chtype;
199*0Sstevel@tonic-gate #else
200*0Sstevel@tonic-gate typedef unsigned long	chtype;
201*0Sstevel@tonic-gate #endif
202*0Sstevel@tonic-gate #endif
203*0Sstevel@tonic-gate 
204*0Sstevel@tonic-gate /*
205*0Sstevel@tonic-gate  * These attributes and masks can be applied to a chtype.
206*0Sstevel@tonic-gate  * They are order according to the <no_color_video> mask.
207*0Sstevel@tonic-gate  */
208*0Sstevel@tonic-gate #if defined(_LP64)
209*0Sstevel@tonic-gate #define	A_NORMAL		0x00000000U
210*0Sstevel@tonic-gate #define	A_ATTRIBUTES	0xffff0000U	/* Color/Attribute mask */
211*0Sstevel@tonic-gate #define	A_CHARTEXT		0x0000ffffU	/* 16-bit character mask */
212*0Sstevel@tonic-gate #define	A_STANDOUT		0x00010000U
213*0Sstevel@tonic-gate #define	A_UNDERLINE		0x00020000U
214*0Sstevel@tonic-gate #define	A_REVERSE		0x00040000U
215*0Sstevel@tonic-gate #define	A_BLINK			0x00080000U
216*0Sstevel@tonic-gate #define	A_DIM			0x00100000U
217*0Sstevel@tonic-gate #define	A_BOLD			0x00200000U
218*0Sstevel@tonic-gate #define	A_INVIS			0x00400000U
219*0Sstevel@tonic-gate #define	A_PROTECT		0x00800000U
220*0Sstevel@tonic-gate #define	A_ALTCHARSET	0x01000000U
221*0Sstevel@tonic-gate #define	A_COLOR			0xfe000000U	/* Color mask */
222*0Sstevel@tonic-gate #else	/* defined(_LP64) */
223*0Sstevel@tonic-gate #define	A_NORMAL		0x00000000UL
224*0Sstevel@tonic-gate #define	A_ATTRIBUTES	0xffff0000UL	/* Color/Attribute mask */
225*0Sstevel@tonic-gate #define	A_CHARTEXT		0x0000ffffUL	/* 16-bit character mask */
226*0Sstevel@tonic-gate #define	A_STANDOUT		0x00010000UL
227*0Sstevel@tonic-gate #define	A_UNDERLINE		0x00020000UL
228*0Sstevel@tonic-gate #define	A_REVERSE		0x00040000UL
229*0Sstevel@tonic-gate #define	A_BLINK			0x00080000UL
230*0Sstevel@tonic-gate #define	A_DIM			0x00100000UL
231*0Sstevel@tonic-gate #define	A_BOLD			0x00200000UL
232*0Sstevel@tonic-gate #define	A_INVIS			0x00400000UL
233*0Sstevel@tonic-gate #define	A_PROTECT		0x00800000UL
234*0Sstevel@tonic-gate #define	A_ALTCHARSET	0x01000000UL
235*0Sstevel@tonic-gate #define	A_COLOR			0xfe000000UL	/* Color mask */
236*0Sstevel@tonic-gate #endif	/* defined(_LP64) */
237*0Sstevel@tonic-gate 
238*0Sstevel@tonic-gate /*
239*0Sstevel@tonic-gate  * Color atttribute support for chtype.
240*0Sstevel@tonic-gate  */
241*0Sstevel@tonic-gate #define	__COLOR_SHIFT	26
242*0Sstevel@tonic-gate 
243*0Sstevel@tonic-gate /*
244*0Sstevel@tonic-gate  * Characters constants used with a chtype.
245*0Sstevel@tonic-gate  * Mapping defined in Xcurses Section 6.2.12 (p260).
246*0Sstevel@tonic-gate  */
247*0Sstevel@tonic-gate #define	ACS_VLINE	(A_ALTCHARSET | 'x')
248*0Sstevel@tonic-gate #define	ACS_HLINE	(A_ALTCHARSET | 'q')
249*0Sstevel@tonic-gate #define	ACS_ULCORNER	(A_ALTCHARSET | 'l')
250*0Sstevel@tonic-gate #define	ACS_URCORNER	(A_ALTCHARSET | 'k')
251*0Sstevel@tonic-gate #define	ACS_LLCORNER	(A_ALTCHARSET | 'm')
252*0Sstevel@tonic-gate #define	ACS_LRCORNER	(A_ALTCHARSET | 'j')
253*0Sstevel@tonic-gate #define	ACS_RTEE	(A_ALTCHARSET | 'u')
254*0Sstevel@tonic-gate #define	ACS_LTEE	(A_ALTCHARSET | 't')
255*0Sstevel@tonic-gate #define	ACS_BTEE	(A_ALTCHARSET | 'v')
256*0Sstevel@tonic-gate #define	ACS_TTEE	(A_ALTCHARSET | 'w')
257*0Sstevel@tonic-gate #define	ACS_PLUS	(A_ALTCHARSET | 'n')
258*0Sstevel@tonic-gate #define	ACS_S1	(A_ALTCHARSET | 'o')
259*0Sstevel@tonic-gate #define	ACS_S9	(A_ALTCHARSET | 's')
260*0Sstevel@tonic-gate #define	ACS_DIAMOND	(A_ALTCHARSET | '`')
261*0Sstevel@tonic-gate #define	ACS_CKBOARD	(A_ALTCHARSET | 'a')
262*0Sstevel@tonic-gate #define	ACS_DEGREE	(A_ALTCHARSET | 'f')
263*0Sstevel@tonic-gate #define	ACS_PLMINUS	(A_ALTCHARSET | 'g')
264*0Sstevel@tonic-gate #define	ACS_BULLET	(A_ALTCHARSET | '~')
265*0Sstevel@tonic-gate #define	ACS_LARROW	(A_ALTCHARSET | ',')
266*0Sstevel@tonic-gate #define	ACS_RARROW	(A_ALTCHARSET | '+')
267*0Sstevel@tonic-gate #define	ACS_DARROW	(A_ALTCHARSET | '.')
268*0Sstevel@tonic-gate #define	ACS_UARROW	(A_ALTCHARSET | '-')
269*0Sstevel@tonic-gate #define	ACS_BOARD	(A_ALTCHARSET | 'h')
270*0Sstevel@tonic-gate #define	ACS_LANTERN	(A_ALTCHARSET | 'i')
271*0Sstevel@tonic-gate #define	ACS_BLOCK	(A_ALTCHARSET | '0')
272*0Sstevel@tonic-gate 
273*0Sstevel@tonic-gate /*
274*0Sstevel@tonic-gate  * Wide characters constants for a cchar_t.
275*0Sstevel@tonic-gate  */
276*0Sstevel@tonic-gate extern const cchar_t __WACS_VLINE;
277*0Sstevel@tonic-gate extern const cchar_t __WACS_HLINE;
278*0Sstevel@tonic-gate extern const cchar_t __WACS_ULCORNER;
279*0Sstevel@tonic-gate extern const cchar_t __WACS_URCORNER;
280*0Sstevel@tonic-gate extern const cchar_t __WACS_LLCORNER;
281*0Sstevel@tonic-gate extern const cchar_t __WACS_LRCORNER;
282*0Sstevel@tonic-gate extern const cchar_t __WACS_RTEE;
283*0Sstevel@tonic-gate extern const cchar_t __WACS_LTEE;
284*0Sstevel@tonic-gate extern const cchar_t __WACS_BTEE;
285*0Sstevel@tonic-gate extern const cchar_t __WACS_TTEE;
286*0Sstevel@tonic-gate extern const cchar_t __WACS_PLUS;
287*0Sstevel@tonic-gate extern const cchar_t __WACS_S1;
288*0Sstevel@tonic-gate extern const cchar_t __WACS_S9;
289*0Sstevel@tonic-gate extern const cchar_t __WACS_DIAMOND;
290*0Sstevel@tonic-gate extern const cchar_t __WACS_CKBOARD;
291*0Sstevel@tonic-gate extern const cchar_t __WACS_DEGREE;
292*0Sstevel@tonic-gate extern const cchar_t __WACS_PLMINUS;
293*0Sstevel@tonic-gate extern const cchar_t __WACS_BULLET;
294*0Sstevel@tonic-gate extern const cchar_t __WACS_LARROW;
295*0Sstevel@tonic-gate extern const cchar_t __WACS_RARROW;
296*0Sstevel@tonic-gate extern const cchar_t __WACS_DARROW;
297*0Sstevel@tonic-gate extern const cchar_t __WACS_UARROW;
298*0Sstevel@tonic-gate extern const cchar_t __WACS_BOARD;
299*0Sstevel@tonic-gate extern const cchar_t __WACS_LANTERN;
300*0Sstevel@tonic-gate extern const cchar_t __WACS_BLOCK;
301*0Sstevel@tonic-gate 
302*0Sstevel@tonic-gate #define	WACS_VLINE	&__WACS_VLINE
303*0Sstevel@tonic-gate #define	WACS_HLINE	&__WACS_HLINE
304*0Sstevel@tonic-gate #define	WACS_ULCORNER	&__WACS_ULCORNER
305*0Sstevel@tonic-gate #define	WACS_URCORNER	&__WACS_URCORNER
306*0Sstevel@tonic-gate #define	WACS_LLCORNER	&__WACS_LLCORNER
307*0Sstevel@tonic-gate #define	WACS_LRCORNER	&__WACS_LRCORNER
308*0Sstevel@tonic-gate #define	WACS_RTEE	&__WACS_RTEE
309*0Sstevel@tonic-gate #define	WACS_LTEE	&__WACS_LTEE
310*0Sstevel@tonic-gate #define	WACS_BTEE	&__WACS_BTEE
311*0Sstevel@tonic-gate #define	WACS_TTEE	&__WACS_TTEE
312*0Sstevel@tonic-gate #define	WACS_PLUS	&__WACS_PLUS
313*0Sstevel@tonic-gate #define	WACS_S1		&__WACS_S1
314*0Sstevel@tonic-gate #define	WACS_S9		&__WACS_S9
315*0Sstevel@tonic-gate #define	WACS_DIAMOND	&__WACS_DIAMOND
316*0Sstevel@tonic-gate #define	WACS_CKBOARD	&__WACS_CKBOARD
317*0Sstevel@tonic-gate #define	WACS_DEGREE	&__WACS_DEGREE
318*0Sstevel@tonic-gate #define	WACS_PLMINUS	&__WACS_PLMINUS
319*0Sstevel@tonic-gate #define	WACS_BULLET	&__WACS_BULLET
320*0Sstevel@tonic-gate #define	WACS_LARROW	&__WACS_LARROW
321*0Sstevel@tonic-gate #define	WACS_RARROW	&__WACS_RARROW
322*0Sstevel@tonic-gate #define	WACS_DARROW	&__WACS_DARROW
323*0Sstevel@tonic-gate #define	WACS_UARROW	&__WACS_UARROW
324*0Sstevel@tonic-gate #define	WACS_BOARD	&__WACS_BOARD
325*0Sstevel@tonic-gate #define	WACS_LANTERN	&__WACS_LANTERN
326*0Sstevel@tonic-gate #define	WACS_BLOCK	&__WACS_BLOCK
327*0Sstevel@tonic-gate 
328*0Sstevel@tonic-gate 
329*0Sstevel@tonic-gate /*
330*0Sstevel@tonic-gate  * Internal macros.
331*0Sstevel@tonic-gate  */
332*0Sstevel@tonic-gate #define	__m_getpary(w)		((w)->_parent == (WINDOW *) 0 ? -1 \
333*0Sstevel@tonic-gate 				: (w)->_begy - (w)->_parent->_begy)
334*0Sstevel@tonic-gate #define	__m_getparx(w)		((w)->_parent == (WINDOW *) 0 ? -1 \
335*0Sstevel@tonic-gate 				: (w)->_begx - (w)->_parent->_begx)
336*0Sstevel@tonic-gate 
337*0Sstevel@tonic-gate /*
338*0Sstevel@tonic-gate  * Global Window Macros
339*0Sstevel@tonic-gate  */
340*0Sstevel@tonic-gate #define	getyx(w, y, x)	(y = (w)->_cury, x = (w)->_curx)
341*0Sstevel@tonic-gate #define	getbegyx(w, y, x)	(y = (w)->_begy, x = (w)->_begx)
342*0Sstevel@tonic-gate #define	getmaxyx(w, y, x)	(y = (w)->_maxy, x = (w)->_maxx)
343*0Sstevel@tonic-gate #define	getparyx(w, y, x)	(y = __m_getpary(w), x = __m_getparx(w))
344*0Sstevel@tonic-gate 
345*0Sstevel@tonic-gate /*
346*0Sstevel@tonic-gate  * Global variables
347*0Sstevel@tonic-gate  */
348*0Sstevel@tonic-gate extern int LINES, COLS;
349*0Sstevel@tonic-gate extern WINDOW *curscr, *stdscr;
350*0Sstevel@tonic-gate extern int COLORS, COLOR_PAIRS;
351*0Sstevel@tonic-gate 
352*0Sstevel@tonic-gate extern int addch(chtype);
353*0Sstevel@tonic-gate extern int addchnstr(const chtype *, int);
354*0Sstevel@tonic-gate extern int addchstr(const chtype *);
355*0Sstevel@tonic-gate extern int addnstr(const char *, int);
356*0Sstevel@tonic-gate extern int addnwstr(const wchar_t *, int);
357*0Sstevel@tonic-gate extern int addstr(const char *);
358*0Sstevel@tonic-gate extern int add_wch(const cchar_t *);
359*0Sstevel@tonic-gate extern int add_wchnstr(const cchar_t *, int);
360*0Sstevel@tonic-gate extern int add_wchstr(const cchar_t *);
361*0Sstevel@tonic-gate extern int addwstr(const wchar_t *);
362*0Sstevel@tonic-gate extern int attroff(int);
363*0Sstevel@tonic-gate extern int attron(int);
364*0Sstevel@tonic-gate extern int attrset(int);
365*0Sstevel@tonic-gate extern int attr_get(attr_t *, short *, void *);
366*0Sstevel@tonic-gate extern int attr_off(attr_t, void *);
367*0Sstevel@tonic-gate extern int attr_on(attr_t, void *);
368*0Sstevel@tonic-gate extern int attr_set(attr_t, short, void *);
369*0Sstevel@tonic-gate extern int baudrate(void);
370*0Sstevel@tonic-gate extern int beep(void);
371*0Sstevel@tonic-gate extern int bkgd(chtype);
372*0Sstevel@tonic-gate extern void	bkgdset(chtype);
373*0Sstevel@tonic-gate extern int bkgrnd(const cchar_t *);
374*0Sstevel@tonic-gate extern void bkgrndset(const cchar_t *);
375*0Sstevel@tonic-gate extern int border(
376*0Sstevel@tonic-gate 	chtype, chtype, chtype, chtype,
377*0Sstevel@tonic-gate 	chtype, chtype, chtype, chtype);
378*0Sstevel@tonic-gate extern int border_set(
379*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *,
380*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *,
381*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *,
382*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *);
383*0Sstevel@tonic-gate extern int box(WINDOW *, chtype, chtype);
384*0Sstevel@tonic-gate extern int box_set(WINDOW *, const cchar_t *, const cchar_t *);
385*0Sstevel@tonic-gate extern bool can_change_color(void);
386*0Sstevel@tonic-gate extern int cbreak(void);
387*0Sstevel@tonic-gate extern int chgat(int, attr_t, short, const void *);
388*0Sstevel@tonic-gate extern int clearok(WINDOW *, bool);
389*0Sstevel@tonic-gate extern int clear(void);
390*0Sstevel@tonic-gate extern int clrtobot(void);
391*0Sstevel@tonic-gate extern int clrtoeol(void);
392*0Sstevel@tonic-gate extern int color_content(short, short *, short *, short *);
393*0Sstevel@tonic-gate extern int COLOR_PAIR(int);
394*0Sstevel@tonic-gate extern int color_set(short, void *);
395*0Sstevel@tonic-gate extern int copywin(const WINDOW *, WINDOW *,
396*0Sstevel@tonic-gate 	int, int, int, int, int, int, int);
397*0Sstevel@tonic-gate extern int curs_set(int);
398*0Sstevel@tonic-gate extern int def_prog_mode(void);
399*0Sstevel@tonic-gate extern int def_shell_mode(void);
400*0Sstevel@tonic-gate extern int delay_output(int);
401*0Sstevel@tonic-gate extern int delch(void);
402*0Sstevel@tonic-gate extern int deleteln(void);
403*0Sstevel@tonic-gate extern void delscreen(SCREEN *);
404*0Sstevel@tonic-gate extern int delwin(WINDOW *);
405*0Sstevel@tonic-gate extern WINDOW *derwin(WINDOW *, int, int, int, int);
406*0Sstevel@tonic-gate extern int doupdate(void);
407*0Sstevel@tonic-gate extern WINDOW *dupwin(WINDOW *);
408*0Sstevel@tonic-gate extern int echo(void);
409*0Sstevel@tonic-gate extern int echochar(const chtype);
410*0Sstevel@tonic-gate extern int echo_wchar(const cchar_t *);
411*0Sstevel@tonic-gate extern int endwin(void);
412*0Sstevel@tonic-gate extern char erasechar(void);
413*0Sstevel@tonic-gate extern int erase(void);
414*0Sstevel@tonic-gate extern int erasewchar(wchar_t *);
415*0Sstevel@tonic-gate extern void filter(void);
416*0Sstevel@tonic-gate extern int flash(void);
417*0Sstevel@tonic-gate extern int flushinp(void);
418*0Sstevel@tonic-gate extern chtype getbkgd(WINDOW *);
419*0Sstevel@tonic-gate extern int getbkgrnd(cchar_t *);
420*0Sstevel@tonic-gate extern int getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
421*0Sstevel@tonic-gate extern int getch(void);
422*0Sstevel@tonic-gate extern int getnstr(char *, int);
423*0Sstevel@tonic-gate extern int getn_wstr(wint_t *, int);
424*0Sstevel@tonic-gate extern int getstr(char *);
425*0Sstevel@tonic-gate extern int get_wch(wint_t *);
426*0Sstevel@tonic-gate extern WINDOW *getwin(FILE *);
427*0Sstevel@tonic-gate extern int get_wstr(wint_t *);
428*0Sstevel@tonic-gate extern int halfdelay(int);
429*0Sstevel@tonic-gate extern bool has_colors(void);
430*0Sstevel@tonic-gate extern bool has_ic(void);
431*0Sstevel@tonic-gate extern bool has_il(void);
432*0Sstevel@tonic-gate extern int hline(chtype, int);
433*0Sstevel@tonic-gate extern int hline_set(const cchar_t *, int);
434*0Sstevel@tonic-gate extern void idcok(WINDOW *, bool);
435*0Sstevel@tonic-gate extern int idlok(WINDOW *, bool);
436*0Sstevel@tonic-gate extern void immedok(WINDOW *, bool);
437*0Sstevel@tonic-gate extern chtype inch(void);
438*0Sstevel@tonic-gate extern int inchnstr(chtype *, int);
439*0Sstevel@tonic-gate extern int inchstr(chtype *);
440*0Sstevel@tonic-gate extern WINDOW *initscr(void);
441*0Sstevel@tonic-gate extern int init_color(short, short, short, short);
442*0Sstevel@tonic-gate extern int init_pair(short, short, short);
443*0Sstevel@tonic-gate extern int innstr(char *, int);
444*0Sstevel@tonic-gate extern int innwstr(wchar_t *, int);
445*0Sstevel@tonic-gate extern int insch(chtype);
446*0Sstevel@tonic-gate extern int insdelln(int);
447*0Sstevel@tonic-gate extern int insertln(void);
448*0Sstevel@tonic-gate extern int insnstr(const char *, int);
449*0Sstevel@tonic-gate extern int ins_nwstr(const wchar_t *, int);
450*0Sstevel@tonic-gate extern int insstr(const char *);
451*0Sstevel@tonic-gate extern int instr(char *);
452*0Sstevel@tonic-gate extern int ins_wch(const cchar_t *);
453*0Sstevel@tonic-gate extern int ins_wstr(const wchar_t *);
454*0Sstevel@tonic-gate extern int intrflush(WINDOW *, bool);
455*0Sstevel@tonic-gate extern int in_wch(cchar_t *);
456*0Sstevel@tonic-gate extern int in_wchnstr(cchar_t *, int);
457*0Sstevel@tonic-gate extern int in_wchstr(cchar_t *);
458*0Sstevel@tonic-gate extern int inwstr(wchar_t *);
459*0Sstevel@tonic-gate extern bool isendwin(void);
460*0Sstevel@tonic-gate extern bool is_linetouched(WINDOW *, int);
461*0Sstevel@tonic-gate extern bool is_wintouched(WINDOW *);
462*0Sstevel@tonic-gate extern char *keyname(int);
463*0Sstevel@tonic-gate extern char *key_name(wchar_t);
464*0Sstevel@tonic-gate extern int keypad(WINDOW *, bool);
465*0Sstevel@tonic-gate extern char killchar(void);
466*0Sstevel@tonic-gate extern int killwchar(wchar_t *);
467*0Sstevel@tonic-gate extern int leaveok(WINDOW *, bool);
468*0Sstevel@tonic-gate extern char *longname(void);
469*0Sstevel@tonic-gate extern int meta(WINDOW *, bool);
470*0Sstevel@tonic-gate extern int move(int, int);
471*0Sstevel@tonic-gate extern int mvaddch(int, int, chtype);
472*0Sstevel@tonic-gate extern int mvaddchnstr(int, int, const chtype *, int);
473*0Sstevel@tonic-gate extern int mvaddchstr(int, int, const chtype *);
474*0Sstevel@tonic-gate extern int mvaddnstr(int, int, const char *, int);
475*0Sstevel@tonic-gate extern int mvaddnwstr(int, int, const wchar_t *, int);
476*0Sstevel@tonic-gate extern int mvaddstr(int, int, const char *);
477*0Sstevel@tonic-gate extern int mvadd_wch(int, int, const cchar_t *);
478*0Sstevel@tonic-gate extern int mvadd_wchnstr(int, int, const cchar_t *, int);
479*0Sstevel@tonic-gate extern int mvadd_wchstr(int, int, const cchar_t *);
480*0Sstevel@tonic-gate extern int mvaddwstr(int, int, const wchar_t *);
481*0Sstevel@tonic-gate extern int mvchgat(int, int, int, attr_t, short, const void *);
482*0Sstevel@tonic-gate extern int mvcur(int, int, int, int);
483*0Sstevel@tonic-gate extern int mvdelch(int, int);
484*0Sstevel@tonic-gate extern int mvderwin(WINDOW *, int, int);
485*0Sstevel@tonic-gate extern int mvgetch(int, int);
486*0Sstevel@tonic-gate extern int mvgetnstr(int, int, char *, int);
487*0Sstevel@tonic-gate extern int mvgetn_wstr(int, int, wint_t *, int);
488*0Sstevel@tonic-gate extern int mvgetstr(int, int, char *);
489*0Sstevel@tonic-gate extern int mvget_wch(int, int, wint_t *);
490*0Sstevel@tonic-gate extern int mvget_wstr(int, int, wint_t *);
491*0Sstevel@tonic-gate extern int mvhline(int, int, chtype, int);
492*0Sstevel@tonic-gate extern int mvhline_set(int, int, const cchar_t *, int);
493*0Sstevel@tonic-gate extern chtype mvinch(int, int);
494*0Sstevel@tonic-gate extern int mvinchnstr(int, int, chtype *, int);
495*0Sstevel@tonic-gate extern int mvinchstr(int, int, chtype *);
496*0Sstevel@tonic-gate extern int mvinnstr(int, int, char *, int);
497*0Sstevel@tonic-gate extern int mvinnwstr(int, int, wchar_t *, int);
498*0Sstevel@tonic-gate extern int mvinsch(int, int, chtype);
499*0Sstevel@tonic-gate extern int mvinsnstr(int, int, const char *, int);
500*0Sstevel@tonic-gate extern int mvins_nwstr(int, int, const wchar_t *, int);
501*0Sstevel@tonic-gate extern int mvinsstr(int, int, const char *);
502*0Sstevel@tonic-gate extern int mvinstr(int, int, char *);
503*0Sstevel@tonic-gate extern int mvins_wch(int, int, const cchar_t *);
504*0Sstevel@tonic-gate extern int mvins_wstr(int, int, const wchar_t *);
505*0Sstevel@tonic-gate extern int mvin_wch(int, int, cchar_t *);
506*0Sstevel@tonic-gate extern int mvin_wchnstr(int, int, cchar_t *, int);
507*0Sstevel@tonic-gate extern int mvin_wchstr(int, int, cchar_t *);
508*0Sstevel@tonic-gate extern int mvinwstr(int, int, wchar_t *);
509*0Sstevel@tonic-gate extern int mvprintw(int, int, char *, ...);
510*0Sstevel@tonic-gate extern int mvscanw(int, int, char *, ...);
511*0Sstevel@tonic-gate extern int mvvline(int, int, chtype, int);
512*0Sstevel@tonic-gate extern int mvvline_set(int, int, const cchar_t *, int);
513*0Sstevel@tonic-gate extern int mvwaddch(WINDOW *, int, int, chtype);
514*0Sstevel@tonic-gate extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
515*0Sstevel@tonic-gate extern int mvwaddchstr(WINDOW *, int, int, const chtype *);
516*0Sstevel@tonic-gate extern int mvwaddnstr(WINDOW *, int, int, const char *, int);
517*0Sstevel@tonic-gate extern int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
518*0Sstevel@tonic-gate extern int mvwaddstr(WINDOW *, int, int, const char *);
519*0Sstevel@tonic-gate extern int mvwadd_wch(WINDOW *, int, int, const cchar_t *);
520*0Sstevel@tonic-gate extern int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
521*0Sstevel@tonic-gate extern int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
522*0Sstevel@tonic-gate extern int mvwaddwstr(WINDOW *, int, int, const wchar_t *);
523*0Sstevel@tonic-gate extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
524*0Sstevel@tonic-gate extern int mvwdelch(WINDOW *, int, int);
525*0Sstevel@tonic-gate extern int mvwgetch(WINDOW *, int, int);
526*0Sstevel@tonic-gate extern int mvwgetnstr(WINDOW *, int, int, char *, int);
527*0Sstevel@tonic-gate extern int mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);
528*0Sstevel@tonic-gate extern int mvwgetstr(WINDOW *, int, int, char *);
529*0Sstevel@tonic-gate extern int mvwget_wch(WINDOW *, int, int, wint_t *);
530*0Sstevel@tonic-gate extern int mvwget_wstr(WINDOW *, int, int, wint_t *);
531*0Sstevel@tonic-gate extern int mvwhline(WINDOW *, int, int, chtype, int);
532*0Sstevel@tonic-gate extern int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
533*0Sstevel@tonic-gate extern int mvwin(WINDOW *, int, int);
534*0Sstevel@tonic-gate extern chtype mvwinch(WINDOW *, int, int);
535*0Sstevel@tonic-gate extern int mvwinchnstr(WINDOW *, int, int, chtype *, int);
536*0Sstevel@tonic-gate extern int mvwinchstr(WINDOW *, int, int, chtype *);
537*0Sstevel@tonic-gate extern int mvwinnstr(WINDOW *, int, int, char *, int);
538*0Sstevel@tonic-gate extern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
539*0Sstevel@tonic-gate extern int mvwinsch(WINDOW *, int, int, chtype);
540*0Sstevel@tonic-gate extern int mvwinsnstr(WINDOW *, int, int, const char *, int);
541*0Sstevel@tonic-gate extern int mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
542*0Sstevel@tonic-gate extern int mvwinsstr(WINDOW *, int, int, const char *);
543*0Sstevel@tonic-gate extern int mvwinstr(WINDOW *, int, int, char *);
544*0Sstevel@tonic-gate extern int mvwins_wch(WINDOW *, int, int, const cchar_t *);
545*0Sstevel@tonic-gate extern int mvwins_wstr(WINDOW *, int, int, const wchar_t *);
546*0Sstevel@tonic-gate extern int mvwin_wch(WINDOW *, int, int, cchar_t *);
547*0Sstevel@tonic-gate extern int mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
548*0Sstevel@tonic-gate extern int mvwin_wchstr(WINDOW *, int, int, cchar_t *);
549*0Sstevel@tonic-gate extern int mvwinwstr(WINDOW *, int, int, wchar_t *);
550*0Sstevel@tonic-gate extern int mvwprintw(WINDOW *, int, int, char *, ...);
551*0Sstevel@tonic-gate extern int mvwscanw(WINDOW *, int, int, char *, ...);
552*0Sstevel@tonic-gate extern int mvwvline(WINDOW *, int, int, chtype, int);
553*0Sstevel@tonic-gate extern int mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
554*0Sstevel@tonic-gate extern int napms(int);
555*0Sstevel@tonic-gate extern WINDOW *newpad(int, int);
556*0Sstevel@tonic-gate extern SCREEN *newterm(char *, FILE *, FILE *);
557*0Sstevel@tonic-gate extern WINDOW *newwin(int, int, int, int);
558*0Sstevel@tonic-gate extern int nl(void);
559*0Sstevel@tonic-gate extern int nocbreak(void);
560*0Sstevel@tonic-gate extern int nodelay(WINDOW *, bool);
561*0Sstevel@tonic-gate extern int noecho(void);
562*0Sstevel@tonic-gate extern int nonl(void);
563*0Sstevel@tonic-gate extern void noqiflush(void);
564*0Sstevel@tonic-gate extern int noraw(void);
565*0Sstevel@tonic-gate extern int notimeout(WINDOW *, bool);
566*0Sstevel@tonic-gate extern int overlay(const WINDOW *, WINDOW *);
567*0Sstevel@tonic-gate extern int overwrite(const WINDOW *, WINDOW *);
568*0Sstevel@tonic-gate extern int pair_content(short, short *, short *);
569*0Sstevel@tonic-gate extern int PAIR_NUMBER(int);
570*0Sstevel@tonic-gate extern int pechochar(WINDOW *, chtype);
571*0Sstevel@tonic-gate extern int pecho_wchar(WINDOW *, const cchar_t *);
572*0Sstevel@tonic-gate extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
573*0Sstevel@tonic-gate extern int prefresh(WINDOW *, int, int, int, int, int, int);
574*0Sstevel@tonic-gate extern int printw(char *, ...);
575*0Sstevel@tonic-gate extern int putwin(WINDOW *,  FILE *);
576*0Sstevel@tonic-gate extern void qiflush(void);
577*0Sstevel@tonic-gate extern int raw(void);
578*0Sstevel@tonic-gate extern int redrawwin(WINDOW *);
579*0Sstevel@tonic-gate extern int refresh(void);
580*0Sstevel@tonic-gate extern int reset_prog_mode(void);
581*0Sstevel@tonic-gate extern int reset_shell_mode(void);
582*0Sstevel@tonic-gate extern int resetty(void);
583*0Sstevel@tonic-gate extern int ripoffline(int, int (*)(WINDOW *, int));
584*0Sstevel@tonic-gate extern int savetty(void);
585*0Sstevel@tonic-gate extern int scanw(char *, ...);
586*0Sstevel@tonic-gate extern int scr_dump(const char *);
587*0Sstevel@tonic-gate extern int scr_init(const char *);
588*0Sstevel@tonic-gate extern int scrl(int);
589*0Sstevel@tonic-gate extern int scroll(WINDOW *);
590*0Sstevel@tonic-gate extern int scrollok(WINDOW *, bool);
591*0Sstevel@tonic-gate extern int scr_restore(const char *);
592*0Sstevel@tonic-gate extern int scr_set(const char *);
593*0Sstevel@tonic-gate extern int setcchar(cchar_t *, const wchar_t *, const attr_t,
594*0Sstevel@tonic-gate 	short, const void *);
595*0Sstevel@tonic-gate extern int setscrreg(int, int);
596*0Sstevel@tonic-gate extern SCREEN *set_term(SCREEN *);
597*0Sstevel@tonic-gate extern int slk_attr_off(const attr_t, void *);
598*0Sstevel@tonic-gate extern int slk_attroff(const chtype);
599*0Sstevel@tonic-gate extern int slk_attr_on(const attr_t, void *);
600*0Sstevel@tonic-gate extern int slk_attron(const chtype);
601*0Sstevel@tonic-gate extern int slk_attr_set(const attr_t, short, void *);
602*0Sstevel@tonic-gate extern int slk_attrset(const chtype);
603*0Sstevel@tonic-gate extern int slk_clear(void);
604*0Sstevel@tonic-gate extern int slk_color(short);
605*0Sstevel@tonic-gate extern int slk_init(int);
606*0Sstevel@tonic-gate extern char *slk_label(int);
607*0Sstevel@tonic-gate extern int slk_noutrefresh(void);
608*0Sstevel@tonic-gate extern int slk_refresh(void);
609*0Sstevel@tonic-gate extern int slk_restore(void);
610*0Sstevel@tonic-gate extern int slk_set(int, const char *, int);
611*0Sstevel@tonic-gate extern int slk_touch(void);
612*0Sstevel@tonic-gate extern int slk_wset(int, const wchar_t *, int);
613*0Sstevel@tonic-gate extern int standend(void);
614*0Sstevel@tonic-gate extern int standout(void);
615*0Sstevel@tonic-gate extern int start_color(void);
616*0Sstevel@tonic-gate extern WINDOW *subpad(WINDOW *, int, int, int, int);
617*0Sstevel@tonic-gate extern WINDOW *subwin(WINDOW *, int, int, int, int);
618*0Sstevel@tonic-gate extern int syncok(WINDOW *, bool);
619*0Sstevel@tonic-gate extern chtype termattrs(void);
620*0Sstevel@tonic-gate extern attr_t term_attrs(void);
621*0Sstevel@tonic-gate extern char *termname(void);
622*0Sstevel@tonic-gate extern void timeout(int);
623*0Sstevel@tonic-gate extern int touchline(WINDOW *, int, int);
624*0Sstevel@tonic-gate extern int touchwin(WINDOW *);
625*0Sstevel@tonic-gate extern int typeahead(int);
626*0Sstevel@tonic-gate extern int ungetch(int);
627*0Sstevel@tonic-gate extern int unget_wch(const wchar_t);
628*0Sstevel@tonic-gate extern int untouchwin(WINDOW *);
629*0Sstevel@tonic-gate extern void use_env(bool);
630*0Sstevel@tonic-gate extern int vid_attr(attr_t, short, void *);
631*0Sstevel@tonic-gate extern int vidattr(chtype);
632*0Sstevel@tonic-gate extern int vid_puts(attr_t, short, void *, int (*)(int));
633*0Sstevel@tonic-gate extern int vidputs(chtype, int (*)(int));
634*0Sstevel@tonic-gate extern int vline(chtype, int);
635*0Sstevel@tonic-gate extern int vline_set(const cchar_t *, int);
636*0Sstevel@tonic-gate extern int vwprintw(WINDOW *, char *, __va_list);
637*0Sstevel@tonic-gate extern int vw_printw(WINDOW *, char *, __va_list);
638*0Sstevel@tonic-gate extern int vwscanw(WINDOW *, char *, __va_list);
639*0Sstevel@tonic-gate extern int vw_scanw(WINDOW *, char *, __va_list);
640*0Sstevel@tonic-gate extern int waddch(WINDOW *, const chtype);
641*0Sstevel@tonic-gate extern int waddchnstr(WINDOW *, const chtype *, int);
642*0Sstevel@tonic-gate extern int waddchstr(WINDOW *, const chtype *);
643*0Sstevel@tonic-gate extern int waddnstr(WINDOW *, const char *, int);
644*0Sstevel@tonic-gate extern int waddnwstr(WINDOW *, const wchar_t *, int);
645*0Sstevel@tonic-gate extern int waddstr(WINDOW *, const char *);
646*0Sstevel@tonic-gate extern int wadd_wch(WINDOW *, const cchar_t *);
647*0Sstevel@tonic-gate extern int wadd_wchnstr(WINDOW *, const cchar_t *, int);
648*0Sstevel@tonic-gate extern int wadd_wchstr(WINDOW *, const cchar_t *);
649*0Sstevel@tonic-gate extern int waddwstr(WINDOW *, const wchar_t *);
650*0Sstevel@tonic-gate extern int wattroff(WINDOW *, int);
651*0Sstevel@tonic-gate extern int wattron(WINDOW *, int);
652*0Sstevel@tonic-gate extern int wattrset(WINDOW *, int);
653*0Sstevel@tonic-gate extern int wattr_get(WINDOW *, attr_t *, short *, void *);
654*0Sstevel@tonic-gate extern int wattr_off(WINDOW *, attr_t, void *);
655*0Sstevel@tonic-gate extern int wattr_on(WINDOW *, attr_t, void *);
656*0Sstevel@tonic-gate extern int wattr_set(WINDOW *, attr_t, short, void *);
657*0Sstevel@tonic-gate extern int wbkgd(WINDOW *, chtype);
658*0Sstevel@tonic-gate extern void	wbkgdset(WINDOW *, chtype);
659*0Sstevel@tonic-gate extern int wbkgrnd(WINDOW *, const cchar_t *);
660*0Sstevel@tonic-gate extern void wbkgrndset(WINDOW *, const cchar_t *);
661*0Sstevel@tonic-gate extern int wborder(WINDOW *,
662*0Sstevel@tonic-gate 	chtype, chtype, chtype, chtype,
663*0Sstevel@tonic-gate 	chtype, chtype, chtype, chtype);
664*0Sstevel@tonic-gate extern int wborder_set(WINDOW *,
665*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *,
666*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *,
667*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *,
668*0Sstevel@tonic-gate 	const cchar_t *, const cchar_t *);
669*0Sstevel@tonic-gate extern int wchgat(WINDOW *, int, attr_t, short, const void *);
670*0Sstevel@tonic-gate extern int wclear(WINDOW *);
671*0Sstevel@tonic-gate extern int wclrtobot(WINDOW *);
672*0Sstevel@tonic-gate extern int wclrtoeol(WINDOW *);
673*0Sstevel@tonic-gate extern void wcursyncup(WINDOW *);
674*0Sstevel@tonic-gate extern int wcolor_set(WINDOW *, short, void *);
675*0Sstevel@tonic-gate extern int wdelch(WINDOW *);
676*0Sstevel@tonic-gate extern int wdeleteln(WINDOW *);
677*0Sstevel@tonic-gate extern int wechochar(WINDOW *, const chtype);
678*0Sstevel@tonic-gate extern int wecho_wchar(WINDOW *, const cchar_t *);
679*0Sstevel@tonic-gate extern int werase(WINDOW *);
680*0Sstevel@tonic-gate extern int wgetbkgrnd(WINDOW *, cchar_t *);
681*0Sstevel@tonic-gate extern int wgetch(WINDOW *);
682*0Sstevel@tonic-gate extern int wgetnstr(WINDOW *, char *, int);
683*0Sstevel@tonic-gate extern int wgetn_wstr(WINDOW *, wint_t *, int);
684*0Sstevel@tonic-gate extern int wgetstr(WINDOW *, char *);
685*0Sstevel@tonic-gate extern int wget_wch(WINDOW *, wint_t *);
686*0Sstevel@tonic-gate extern int wget_wstr(WINDOW *, wint_t *);
687*0Sstevel@tonic-gate extern int whline(WINDOW *, chtype, int);
688*0Sstevel@tonic-gate extern int whline_set(WINDOW *, const cchar_t *, int);
689*0Sstevel@tonic-gate extern chtype winch(WINDOW *);
690*0Sstevel@tonic-gate extern int winchnstr(WINDOW *, chtype *, int);
691*0Sstevel@tonic-gate extern int winchstr(WINDOW *, chtype *);
692*0Sstevel@tonic-gate extern int winnstr(WINDOW *, char *, int);
693*0Sstevel@tonic-gate extern int winnwstr(WINDOW *, wchar_t *, int);
694*0Sstevel@tonic-gate extern int winsch(WINDOW *, chtype);
695*0Sstevel@tonic-gate extern int winsdelln(WINDOW *, int);
696*0Sstevel@tonic-gate extern int winsertln(WINDOW *);
697*0Sstevel@tonic-gate extern int winsnstr(WINDOW *, const char *, int);
698*0Sstevel@tonic-gate extern int wins_nwstr(WINDOW *, const wchar_t *, int);
699*0Sstevel@tonic-gate extern int winsstr(WINDOW *, const char *);
700*0Sstevel@tonic-gate extern int winstr(WINDOW *, char *);
701*0Sstevel@tonic-gate extern int wins_wch(WINDOW *, const cchar_t *);
702*0Sstevel@tonic-gate extern int wins_wstr(WINDOW *, const wchar_t *);
703*0Sstevel@tonic-gate extern int win_wch(WINDOW *, cchar_t *);
704*0Sstevel@tonic-gate extern int win_wchnstr(WINDOW *, cchar_t *, int);
705*0Sstevel@tonic-gate extern int win_wchstr(WINDOW *, cchar_t *);
706*0Sstevel@tonic-gate extern int winwstr(WINDOW *, wchar_t *);
707*0Sstevel@tonic-gate extern int wmove(WINDOW *, int, int);
708*0Sstevel@tonic-gate extern int wnoutrefresh(WINDOW *);
709*0Sstevel@tonic-gate extern int wprintw(WINDOW *, char *, ...);
710*0Sstevel@tonic-gate extern int wredrawln(WINDOW *, int, int);
711*0Sstevel@tonic-gate extern int wrefresh(WINDOW *);
712*0Sstevel@tonic-gate extern int wscanw(WINDOW *, char *, ...);
713*0Sstevel@tonic-gate extern int wscrl(WINDOW *, int);
714*0Sstevel@tonic-gate extern int wsetscrreg(WINDOW *, int, int);
715*0Sstevel@tonic-gate extern int wstandend(WINDOW *);
716*0Sstevel@tonic-gate extern int wstandout(WINDOW *);
717*0Sstevel@tonic-gate extern void wsyncup(WINDOW *);
718*0Sstevel@tonic-gate extern void wsyncdown(WINDOW *);
719*0Sstevel@tonic-gate extern void wtimeout(WINDOW *, int);
720*0Sstevel@tonic-gate extern int wtouchln(WINDOW *, int, int, int);
721*0Sstevel@tonic-gate extern wchar_t *wunctrl(cchar_t *);
722*0Sstevel@tonic-gate extern int wvline(WINDOW *, chtype, int);
723*0Sstevel@tonic-gate extern int wvline_set(WINDOW *, const cchar_t *, int);
724*0Sstevel@tonic-gate 
725*0Sstevel@tonic-gate #if !defined(__lint)
726*0Sstevel@tonic-gate /*
727*0Sstevel@tonic-gate  * These macros can improve speed and size of an application.
728*0Sstevel@tonic-gate  */
729*0Sstevel@tonic-gate extern WINDOW	*__w1;
730*0Sstevel@tonic-gate extern chtype	__cht1;
731*0Sstevel@tonic-gate extern chtype	__cht2;
732*0Sstevel@tonic-gate extern cchar_t	*__pcht1;
733*0Sstevel@tonic-gate extern cchar_t	*__pcht2;
734*0Sstevel@tonic-gate 
735*0Sstevel@tonic-gate #define	addch(ch)	waddch(stdscr, ch)
736*0Sstevel@tonic-gate #define	mvaddch(y, x, ch)	(move(y, x) ? ((ch), ERR) : addch(ch))
737*0Sstevel@tonic-gate #define	mvwaddch(w, y, x, ch)	\
738*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ((ch), ERR) : waddch(__w1, ch))
739*0Sstevel@tonic-gate 
740*0Sstevel@tonic-gate #define	add_wch(cp)	wadd_wch(stdscr, cp)
741*0Sstevel@tonic-gate #define	mvadd_wch(y, x, cp)	(move(y, x) ? ((cp), ERR) : add_wch(cp))
742*0Sstevel@tonic-gate #define	mvwadd_wch(w, y, x, cp)	\
743*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ((cp), ERR) : wadd_wch(__w1, cp))
744*0Sstevel@tonic-gate 
745*0Sstevel@tonic-gate #define	addchnstr(chs, n)	waddchnstr(stdscr, chs, n)
746*0Sstevel@tonic-gate #define	addchstr(chs)	waddchstr(stdscr, chs)
747*0Sstevel@tonic-gate #define	mvaddchnstr(y, x, chs, n)	\
748*0Sstevel@tonic-gate 	(move(y, x) ? ((chs), (n), ERR) : addchnstr(chs, n))
749*0Sstevel@tonic-gate 
750*0Sstevel@tonic-gate #define	mvaddchstr(y, x, chs)	\
751*0Sstevel@tonic-gate 	(move(y, x) ? ((chs), ERR) : addchstr(chs))
752*0Sstevel@tonic-gate 
753*0Sstevel@tonic-gate #define	mvwaddchnstr(w, y, x, chs, n)	\
754*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ((chs), (n), ERR) :\
755*0Sstevel@tonic-gate 	waddchnstr(__w1, chs, n))
756*0Sstevel@tonic-gate 
757*0Sstevel@tonic-gate #define	mvwaddchstr(w, y, x, chs)	\
758*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ((chs), ERR) : waddchstr(__w1, chs))
759*0Sstevel@tonic-gate 
760*0Sstevel@tonic-gate #define	waddchstr(w, chs)	waddchnstr(w, chs, -1)
761*0Sstevel@tonic-gate 
762*0Sstevel@tonic-gate #define	add_wchnstr(cp, n)	wadd_wchnstr(stdscr, cp, n)
763*0Sstevel@tonic-gate #define	add_wchstr(cp)	wadd_wchstr(stdscr, cp)
764*0Sstevel@tonic-gate #define	mvadd_wchnstr(y, x, cp, n)	\
765*0Sstevel@tonic-gate 	(move(y, x) ? ((cp), (n), ERR) : add_wchnstr(cp, n))
766*0Sstevel@tonic-gate 
767*0Sstevel@tonic-gate #define	mvadd_wchstr(y, x, cp)	\
768*0Sstevel@tonic-gate 	(move(y, x) ? ((cp), ERR) : add_wchstr(cp))
769*0Sstevel@tonic-gate 
770*0Sstevel@tonic-gate #define	mvwadd_wchnstr(w, y, x, cp, n)	\
771*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ((cp), (n), ERR) :\
772*0Sstevel@tonic-gate 	wadd_wchnstr(__w1, cp, n))
773*0Sstevel@tonic-gate 
774*0Sstevel@tonic-gate #define	mvwadd_wchstr(w, y, x, cp)	\
775*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ((cp), ERR) :\
776*0Sstevel@tonic-gate 	wadd_wchstr(__w1, cp))
777*0Sstevel@tonic-gate 
778*0Sstevel@tonic-gate #define	wadd_wchstr(w, cp)	wadd_wchnstr(w, cp, -1)
779*0Sstevel@tonic-gate #define	addnstr(s, n)	waddnstr(stdscr, s, n)
780*0Sstevel@tonic-gate #define	addstr(s)	waddstr(stdscr, s)
781*0Sstevel@tonic-gate #define	mvaddnstr(y, x, s, n)	\
782*0Sstevel@tonic-gate 	(move(y, x) ? (s, n, ERR) : addnstr(s, n))
783*0Sstevel@tonic-gate 
784*0Sstevel@tonic-gate #define	mvaddstr(y, x, s)	\
785*0Sstevel@tonic-gate 	(move(y, x) ? (s, ERR) : addstr(s))
786*0Sstevel@tonic-gate 
787*0Sstevel@tonic-gate #define	mvwaddnstr(w, y, x, s, n)	\
788*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : waddnstr(__w1, s, n))
789*0Sstevel@tonic-gate 
790*0Sstevel@tonic-gate #define	mvwaddstr(w, y, x, s)	\
791*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, ERR) : waddstr(__w1, s))
792*0Sstevel@tonic-gate 
793*0Sstevel@tonic-gate #define	waddstr(w, wcs)	waddnstr(w, wcs, -1)
794*0Sstevel@tonic-gate #define	addnwstr(wcs, n)	waddnwstr(stdscr, wcs, n)
795*0Sstevel@tonic-gate #define	addwstr(wcs)	waddwstr(stdscr, wcs)
796*0Sstevel@tonic-gate #define	mvaddnwstr(y, x, wcs, n)	\
797*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, n, ERR) : addnwstr(wcs, n))
798*0Sstevel@tonic-gate 
799*0Sstevel@tonic-gate #define	mvaddwstr(y, x, wcs)	\
800*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, ERR) : addwstr(wcs))
801*0Sstevel@tonic-gate 
802*0Sstevel@tonic-gate #define	mvwaddnwstr(w, y, x, wcs, n)	\
803*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
804*0Sstevel@tonic-gate 	waddnwstr(__w1, wcs, n))
805*0Sstevel@tonic-gate 
806*0Sstevel@tonic-gate #define	mvwaddwstr(w, y, x, wcs)	\
807*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : waddwstr(__w1, wcs))
808*0Sstevel@tonic-gate 
809*0Sstevel@tonic-gate #define	waddwstr(w, wcs)	waddnwstr(w, wcs, -1)
810*0Sstevel@tonic-gate #define	attr_get(a, c, o)	wattr_get(stdscr, a, c, o)
811*0Sstevel@tonic-gate #define	attr_off(a, o)	wattr_off(stdscr, a, o)
812*0Sstevel@tonic-gate #define	attr_on(a, o)	wattr_on(stdscr, a, o)
813*0Sstevel@tonic-gate #define	attr_set(a, c, o)	wattr_set(stdscr, a, c, o)
814*0Sstevel@tonic-gate 
815*0Sstevel@tonic-gate #define	COLOR_PAIR(n)	((chtype)(n) << __COLOR_SHIFT)
816*0Sstevel@tonic-gate #define	PAIR_NUMBER(a)  (((chtype)(a) & A_COLOR) >> __COLOR_SHIFT)
817*0Sstevel@tonic-gate 
818*0Sstevel@tonic-gate #define	bkgd(ch)	wbkgd(stdscr, ch)
819*0Sstevel@tonic-gate #define	bkgdset(ch)	wbkgdset(stdscr, ch)
820*0Sstevel@tonic-gate 
821*0Sstevel@tonic-gate #define	bkgrnd(b)	wbkgrnd(stdscr, b)
822*0Sstevel@tonic-gate #define	bkgrndset(b)	wbkgrndset(stdscr, b)
823*0Sstevel@tonic-gate #define	getbkgrnd(b)	wgetbkgrnd(stdscr, b)
824*0Sstevel@tonic-gate #define	wgetbkgrnd(w, b)	(*(b) = (w)->_bg, OK)
825*0Sstevel@tonic-gate 
826*0Sstevel@tonic-gate #define	border(ls, rs, ts, bs, tl, tr, bl, br)	\
827*0Sstevel@tonic-gate 	wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
828*0Sstevel@tonic-gate 
829*0Sstevel@tonic-gate #define	border_set(ls, rs, ts, bs, tl, tr, bl, br)	\
830*0Sstevel@tonic-gate 	wborder_set(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
831*0Sstevel@tonic-gate 
832*0Sstevel@tonic-gate #define	box(w, v, h)	\
833*0Sstevel@tonic-gate 	wborder(w, __cht1 = (v), __cht1, __cht2 = (h), __cht2, 0, 0, 0, 0)
834*0Sstevel@tonic-gate 
835*0Sstevel@tonic-gate #define	box_set(w, v, h)	\
836*0Sstevel@tonic-gate 	wborder_set(w, __pcht1 = (v), __pcht1, __pcht2 = (h), __pcht2,\
837*0Sstevel@tonic-gate 	0, 0, 0, 0)
838*0Sstevel@tonic-gate 
839*0Sstevel@tonic-gate #define	can_change_color()	\
840*0Sstevel@tonic-gate 	(2 < max_colors && can_change && initialize_color != NULL)
841*0Sstevel@tonic-gate 
842*0Sstevel@tonic-gate #define	has_colors()	(0 < max_colors)
843*0Sstevel@tonic-gate 
844*0Sstevel@tonic-gate #define	chgat(n, a, co, p)	wchgat(stdscr, n, a, co, p)
845*0Sstevel@tonic-gate #define	mvchgat(y, x, n, a, co, p)	\
846*0Sstevel@tonic-gate 	(move(y, x) ? (n, a, co, p, ERR) : chgat(n, a, co, p))
847*0Sstevel@tonic-gate 
848*0Sstevel@tonic-gate #define	mvwchgat(w, y, x, n, a, co, p)	\
849*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (n, a, co, p, ERR) :\
850*0Sstevel@tonic-gate 	wchgat(__w1, n, a, co, p))
851*0Sstevel@tonic-gate 
852*0Sstevel@tonic-gate #define	clear()	wclear(stdscr)
853*0Sstevel@tonic-gate #define	clrtobot()	wclrtobot(stdscr)
854*0Sstevel@tonic-gate #define	clrtoeol()	wclrtoeol(stdscr)
855*0Sstevel@tonic-gate #define	erase()	werase(stdscr)
856*0Sstevel@tonic-gate #define	wclear(w)	\
857*0Sstevel@tonic-gate 	(clearok(__w1 = (w), 1) ? ERR : werase(__w1))
858*0Sstevel@tonic-gate 
859*0Sstevel@tonic-gate #define	werase(w)	\
860*0Sstevel@tonic-gate 	(wmove(__w1 = (w), 0, 0) ? ERR : wclrtobot(__w1))
861*0Sstevel@tonic-gate 
862*0Sstevel@tonic-gate #define	delch()	wdelch(stdscr)
863*0Sstevel@tonic-gate #define	mvdelch(y, x)	(move(y, x) ? ERR : delch())
864*0Sstevel@tonic-gate #define	mvwdelch(w, y, x)	\
865*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ERR : wdelch(__w1))
866*0Sstevel@tonic-gate 
867*0Sstevel@tonic-gate #define	deleteln()	wdeleteln(stdscr)
868*0Sstevel@tonic-gate #define	insdelln(n)	winsdelln(stdscr, n)
869*0Sstevel@tonic-gate #define	insertln()	winsertln(stdscr)
870*0Sstevel@tonic-gate #define	wdeleteln(w)	winsdelln(w, -1)
871*0Sstevel@tonic-gate #define	winsertln(w)	winsdelln(w, 1)
872*0Sstevel@tonic-gate #define	refresh()	wrefresh(stdscr)
873*0Sstevel@tonic-gate #define	echochar(ch)	wechochar(stdscr, ch)
874*0Sstevel@tonic-gate #define	echo_wchar(cp)	wecho_wchar(stdscr, cp)
875*0Sstevel@tonic-gate #define	wechochar(w, ch)	\
876*0Sstevel@tonic-gate 	(waddch(__w1 = (w), ch) ? (wrefresh(__w1), ERR) :\
877*0Sstevel@tonic-gate 	wrefresh(__w1))
878*0Sstevel@tonic-gate 
879*0Sstevel@tonic-gate #define	wecho_wchar(w, cp)	\
880*0Sstevel@tonic-gate 	(wadd_wch(__w1 = (w), cp) ? (wrefresh(__w1), ERR) :\
881*0Sstevel@tonic-gate 	wrefresh(__w1))
882*0Sstevel@tonic-gate 
883*0Sstevel@tonic-gate #define	getch()	wgetch(stdscr)
884*0Sstevel@tonic-gate #define	mvgetch(y, x)	(move(y, x) ? ERR : getch())
885*0Sstevel@tonic-gate #define	mvwgetch(w, y, x)	\
886*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ERR : wgetch(__w1))
887*0Sstevel@tonic-gate 
888*0Sstevel@tonic-gate #define	get_wch(wcp)	wget_wch(stdscr, wcp)
889*0Sstevel@tonic-gate #define	mvget_wch(y, x, wcp)	\
890*0Sstevel@tonic-gate 	(move(y, x) ? (wcp, ERR) : get_wch(wcp))
891*0Sstevel@tonic-gate 
892*0Sstevel@tonic-gate #define	mvwget_wch(w, y, x, wcp)	\
893*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcp, ERR) : wget_wch(__w1, wcp))
894*0Sstevel@tonic-gate 
895*0Sstevel@tonic-gate #define	getnstr(s, n)	wgetnstr(stdscr, s, n)
896*0Sstevel@tonic-gate #define	getstr(s)	wgetstr(stdscr, s)
897*0Sstevel@tonic-gate #define	mvgetnstr(y, x, s, n)	\
898*0Sstevel@tonic-gate 	(move(y, x) ? (s, n, ERR) : getnstr(s, n))
899*0Sstevel@tonic-gate 
900*0Sstevel@tonic-gate #define	mvgetstr(y, x, s)	\
901*0Sstevel@tonic-gate 	(move(y, x) ? (s, ERR) : getstr(s))
902*0Sstevel@tonic-gate 
903*0Sstevel@tonic-gate #define	mvwgetnstr(w, y, x, s, n)	\
904*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : wgetnstr(__w1, s, n))
905*0Sstevel@tonic-gate 
906*0Sstevel@tonic-gate #define	mvwgetstr(w, y, x, s)	\
907*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, ERR) : wgetstr(__w1, s))
908*0Sstevel@tonic-gate 
909*0Sstevel@tonic-gate #define	wgetstr(w, s)	wgetnstr(w, s, -1)
910*0Sstevel@tonic-gate #define	getn_wstr(wcs, n)	wgetn_wstr(stdscr, wcs, n)
911*0Sstevel@tonic-gate #define	get_wstr(wcs)	wget_wstr(stdscr, wcs)
912*0Sstevel@tonic-gate #define	mvgetn_wstr(y, x, wcs, n)	\
913*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, n, ERR) : getn_wstr(wcs, n))
914*0Sstevel@tonic-gate 
915*0Sstevel@tonic-gate #define	mvget_wstr(y, x, wcs)	\
916*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, ERR) : get_wstr(wcs))
917*0Sstevel@tonic-gate 
918*0Sstevel@tonic-gate #define	mvwgetn_wstr(w, y, x, wcs, n)	\
919*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
920*0Sstevel@tonic-gate 	wgetn_wstr(__w1, wcs, n))
921*0Sstevel@tonic-gate 
922*0Sstevel@tonic-gate #define	mvwget_wstr(w, y, x, wcs)	\
923*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : wget_wstr(__w1, wcs))
924*0Sstevel@tonic-gate 
925*0Sstevel@tonic-gate #define	wget_wstr(w, wcs)	wgetn_wstr(w, wcs, -1)
926*0Sstevel@tonic-gate 
927*0Sstevel@tonic-gate #define	has_ic()	\
928*0Sstevel@tonic-gate 	(((insert_character != NULL || parm_ich != NULL) && \
929*0Sstevel@tonic-gate 	(delete_character != NULL || parm_dch != NULL)) || \
930*0Sstevel@tonic-gate 	(enter_insert_mode != NULL && exit_insert_mode))
931*0Sstevel@tonic-gate 
932*0Sstevel@tonic-gate #define	has_il()	\
933*0Sstevel@tonic-gate 	(((insert_line != NULL || parm_insert_line != NULL) && \
934*0Sstevel@tonic-gate 	(delete_line != NULL || parm_delete_line != NULL)) || \
935*0Sstevel@tonic-gate 	change_scroll_region != NULL)
936*0Sstevel@tonic-gate 
937*0Sstevel@tonic-gate #define	hline(ch, n)	whline(stdscr, ch, n)
938*0Sstevel@tonic-gate #define	vline(ch, n)	wvline(stdscr, ch, n)
939*0Sstevel@tonic-gate #define	mvhline(y, x, ch, n)	\
940*0Sstevel@tonic-gate 	(move(y, x) ? (ch, n, ERR) : hline(ch, n))
941*0Sstevel@tonic-gate 
942*0Sstevel@tonic-gate #define	mvvline(y, x, ch, n)	\
943*0Sstevel@tonic-gate 	(move(y, x) ? (ch, n, ERR) : vline(ch, n))
944*0Sstevel@tonic-gate 
945*0Sstevel@tonic-gate #define	mvwhline(w, y, x, ch, n)	\
946*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (ch, n, ERR) : whline(__w1, ch, n))
947*0Sstevel@tonic-gate 
948*0Sstevel@tonic-gate #define	mvwvline(w, y, x, ch, n)	\
949*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (ch, n, ERR) : wvline(__w1, ch, n))
950*0Sstevel@tonic-gate 
951*0Sstevel@tonic-gate #define	hline_set(cp, n)	whline_set(stdscr, cp, n)
952*0Sstevel@tonic-gate #define	vline_set(cp, n)	wvline_set(stdscr, cp, n)
953*0Sstevel@tonic-gate #define	mvhline_set(y, x, cp, n)	\
954*0Sstevel@tonic-gate 	(move(y, x) ? (cp, n, ERR) : hline_set(cp, n))
955*0Sstevel@tonic-gate 
956*0Sstevel@tonic-gate #define	mvvline_set(y, x, cp, n)	\
957*0Sstevel@tonic-gate 	(move(y, x) ? (cp, n, ERR) : vline_set(cp, n))
958*0Sstevel@tonic-gate 
959*0Sstevel@tonic-gate #define	mvwhline_set(w, y, x, cp, n)	\
960*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (cp, n, ERR) : whline_set(__w1, cp, n))
961*0Sstevel@tonic-gate 
962*0Sstevel@tonic-gate #define	mvwvline_set(w, y, x, cp, n)	\
963*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (cp, n, ERR) : wvline_set(__w1, cp, n))
964*0Sstevel@tonic-gate 
965*0Sstevel@tonic-gate #define	inch()	winch(stdscr)
966*0Sstevel@tonic-gate #define	mvinch(y, x)	(move(y, x) ? ERR : inch())
967*0Sstevel@tonic-gate #define	mvwinch(w, y, x)	\
968*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? ERR : winch(__w1))
969*0Sstevel@tonic-gate 
970*0Sstevel@tonic-gate #define	in_wch(cp)	win_wch(stdscr, cp)
971*0Sstevel@tonic-gate #define	mvin_wch(y, x, cp)	\
972*0Sstevel@tonic-gate 	(move(y, x) ? (cp, ERR) : in_wch(cp))
973*0Sstevel@tonic-gate 
974*0Sstevel@tonic-gate #define	mvwin_wch(w, y, x, cp)	\
975*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (cp, ERR) : win_wch(__w1, cp))
976*0Sstevel@tonic-gate 
977*0Sstevel@tonic-gate #define	inchnstr(chs, n)	winchnstr(stdscr, chs, n)
978*0Sstevel@tonic-gate #define	inchstr(chs)	winchstr(stdscr, chs)
979*0Sstevel@tonic-gate #define	mvinchnstr(y, x, chs, n)	\
980*0Sstevel@tonic-gate 	(move(y, x) ? (chs, n, ERR) : inchnstr(chs, n))
981*0Sstevel@tonic-gate 
982*0Sstevel@tonic-gate #define	mvinchstr(y, x, chs)	\
983*0Sstevel@tonic-gate 	(move(y, x) ? (chs, ERR) : inchstr(chs))
984*0Sstevel@tonic-gate 
985*0Sstevel@tonic-gate #define	mvwinchnstr(w, y, x, chs, n)	\
986*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (chs, n, ERR) : winchnstr(__w1, chs, n))
987*0Sstevel@tonic-gate 
988*0Sstevel@tonic-gate #define	mvwinchstr(w, y, x, chs)	\
989*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (chs, ERR) : winchstr(__w1, chs))
990*0Sstevel@tonic-gate 
991*0Sstevel@tonic-gate #define	winchstr(w, chs)	winchnstr(w, chs, -1)
992*0Sstevel@tonic-gate #define	in_wchnstr(cp, n)	win_wchnstr(stdscr, cp, n)
993*0Sstevel@tonic-gate #define	in_wchstr(cp)	win_wchstr(stdscr, cp)
994*0Sstevel@tonic-gate #define	mvin_wchnstr(y, x, cp, n)	\
995*0Sstevel@tonic-gate 	(move(y, x) ? (cp, n, ERR) : in_wchnstr(cp, n))
996*0Sstevel@tonic-gate 
997*0Sstevel@tonic-gate #define	mvin_wchstr(y, x, cp)	\
998*0Sstevel@tonic-gate 	(move(y, x) ? (cp, ERR) : in_wchstr(cp))
999*0Sstevel@tonic-gate 
1000*0Sstevel@tonic-gate #define	mvwin_wchnstr(w, y, x, cp, n)	\
1001*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (cp, n, ERR) :\
1002*0Sstevel@tonic-gate 	win_wchnstr(__w1, cp, n))
1003*0Sstevel@tonic-gate 
1004*0Sstevel@tonic-gate #define	mvwin_wchstr(w, y, x, cp)	\
1005*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (cp, ERR) : win_wchstr(__w1, cp))
1006*0Sstevel@tonic-gate 
1007*0Sstevel@tonic-gate #define	win_wchstr(w, cp)	win_wchnstr(w, cp, -1)
1008*0Sstevel@tonic-gate #define	innstr(s, n)	winnstr(stdscr, s, n)
1009*0Sstevel@tonic-gate #define	instr(s)	winstr(stdscr, s)
1010*0Sstevel@tonic-gate #define	mvinnstr(y, x, s, n)	\
1011*0Sstevel@tonic-gate 	(move(y, x) ? (s, n, ERR) : innstr(s, n))
1012*0Sstevel@tonic-gate 
1013*0Sstevel@tonic-gate #define	mvinstr(y, x, s)	\
1014*0Sstevel@tonic-gate 	(move(y, x) ? (s, ERR) : instr(s))
1015*0Sstevel@tonic-gate 
1016*0Sstevel@tonic-gate #define	mvwinnstr(w, y, x, s, n)	\
1017*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : winnstr(__w1, s, n))
1018*0Sstevel@tonic-gate 
1019*0Sstevel@tonic-gate #define	mvwinstr(w, y, x, s)	\
1020*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, ERR) : winstr(__w1, s))
1021*0Sstevel@tonic-gate 
1022*0Sstevel@tonic-gate #define	winstr(w, s)	(winnstr(w, s, -1), OK)
1023*0Sstevel@tonic-gate #define	innwstr(wcs, n)	winnwstr(stdscr, wcs, n)
1024*0Sstevel@tonic-gate #define	inwstr(wcs)	winwstr(stdscr, wcs)
1025*0Sstevel@tonic-gate #define	mvinnwstr(y, x, wcs, n)	\
1026*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, n, ERR) : innwstr(wcs, n))
1027*0Sstevel@tonic-gate 
1028*0Sstevel@tonic-gate #define	mvinwstr(y, x, wcs)	\
1029*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, ERR) : inwstr(wcs))
1030*0Sstevel@tonic-gate 
1031*0Sstevel@tonic-gate #define	mvwinnwstr(w, y, x, wcs, n)	\
1032*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
1033*0Sstevel@tonic-gate 	winnwstr(__w1, wcs, n))
1034*0Sstevel@tonic-gate 
1035*0Sstevel@tonic-gate #define	mvwinwstr(w, y, x, wcs)	\
1036*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : winwstr(__w1, wcs))
1037*0Sstevel@tonic-gate 
1038*0Sstevel@tonic-gate #define	winwstr(w, wcs)	(winnwstr(w, wcs, -1), OK)
1039*0Sstevel@tonic-gate #define	insch(ch)	winsch(stdscr, ch)
1040*0Sstevel@tonic-gate #define	mvinsch(y, x, ch)	(move(y, x) ? (ch, ERR) : insch(ch))
1041*0Sstevel@tonic-gate #define	mvwinsch(w, y, x, ch)	\
1042*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (ch, ERR) : winsch(__w1, ch))
1043*0Sstevel@tonic-gate 
1044*0Sstevel@tonic-gate #define	ins_wch(cp)	wins_wch(stdscr, cp)
1045*0Sstevel@tonic-gate #define	mvins_wch(y, x, cp)	(move(y, x) ? (cp, ERR) : ins_wch(cp))
1046*0Sstevel@tonic-gate #define	mvwins_wch(w, y, x, cp)	\
1047*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (cp, ERR) : wins_wch(__w1, cp))
1048*0Sstevel@tonic-gate 
1049*0Sstevel@tonic-gate #define	insnstr(s, n)	winsnstr(stdscr, s, n)
1050*0Sstevel@tonic-gate #define	insstr(s)	winsstr(stdscr, s)
1051*0Sstevel@tonic-gate #define	mvinsnstr(y, x, s, n)	(move(y, x) ? (s, n, ERR) : insnstr(s, n))
1052*0Sstevel@tonic-gate #define	mvinsstr(y, x, s)	(move(y, x) ? (s, ERR) : insstr(s))
1053*0Sstevel@tonic-gate #define	mvwinsnstr(w, y, x, s, n)	\
1054*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, n, ERR) : winsnstr(__w1, s, n))
1055*0Sstevel@tonic-gate 
1056*0Sstevel@tonic-gate #define	mvwinsstr(w, y, x, s)	\
1057*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (s, ERR) : winsstr(__w1, s))
1058*0Sstevel@tonic-gate 
1059*0Sstevel@tonic-gate #define	winsstr(w, s)	winsnstr(w, s, -1)
1060*0Sstevel@tonic-gate #define	ins_nwstr(wcs, n)	wins_nwstr(stdscr, wcs, n)
1061*0Sstevel@tonic-gate #define	ins_wstr(wcs)	wins_wstr(stdscr, wcs)
1062*0Sstevel@tonic-gate #define	mvins_nwstr(y, x, wcs, n)	\
1063*0Sstevel@tonic-gate 	(move(y, x) ? (wcs, n, ERR) : ins_nwstr(wcs, n))
1064*0Sstevel@tonic-gate 
1065*0Sstevel@tonic-gate #define	mvins_wstr(y, x, wcs)	(move(y, x) ? (wcs, ERR) : ins_wstr(wcs))
1066*0Sstevel@tonic-gate #define	mvwins_nwstr(w, y, x, wcs, n)	\
1067*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, n, ERR) : wins_nwstr(__w1, wcs, n))
1068*0Sstevel@tonic-gate 
1069*0Sstevel@tonic-gate #define	mvwins_wstr(w, y, x, wcs)	\
1070*0Sstevel@tonic-gate 	(wmove(__w1 = (w), y, x) ? (wcs, ERR) : wins_wstr(__w1, wcs))
1071*0Sstevel@tonic-gate 
1072*0Sstevel@tonic-gate #define	wins_wstr(w, wcs)	wins_nwstr(w, wcs, -1)
1073*0Sstevel@tonic-gate #define	is_linetouched(w, y)	(0 <= (w)->_last[y])
1074*0Sstevel@tonic-gate #define	move(y, x)	wmove(stdscr, y, x)
1075*0Sstevel@tonic-gate #define	subpad(par, ny, nx, by, bx)	subwin(par, ny, nx, by, bx)
1076*0Sstevel@tonic-gate #define	nodelay(w, bf)	(wtimeout(w, (bf) ? 0: -1), OK)
1077*0Sstevel@tonic-gate #define	timeout(n)	wtimeout(stdscr, n)
1078*0Sstevel@tonic-gate #define	qiflush()	((void) intrflush(NULL, 1))
1079*0Sstevel@tonic-gate #define	noqiflush()	((void) intrflush(NULL, 0))
1080*0Sstevel@tonic-gate #define	redrawwin(w)	wredrawln(__w1 = (w), 0, (__w1)->_maxy)
1081*0Sstevel@tonic-gate #define	scrl(n)	wscrl(stdscr, n)
1082*0Sstevel@tonic-gate #define	setscrreg(t, b)	wsetscrreg(stdscr, t, b)
1083*0Sstevel@tonic-gate #define	standend()	wstandend(stdscr)
1084*0Sstevel@tonic-gate #define	standout()	wstandout(stdscr)
1085*0Sstevel@tonic-gate #define	touchline(w, y, n)	wtouchln(w, y, n, 1)
1086*0Sstevel@tonic-gate #define	touchwin(w)	wtouchln(__w1 = (w), 0, __w1->_maxy, 1)
1087*0Sstevel@tonic-gate #define	untouchwin(w)	wtouchln(__w1 = (w), 0, __w1->_maxy, 0)
1088*0Sstevel@tonic-gate #define	termname()			(cur_term->_term)
1089*0Sstevel@tonic-gate 
1090*0Sstevel@tonic-gate #endif	/* !defined(__lint) */
1091*0Sstevel@tonic-gate 
1092*0Sstevel@tonic-gate /*
1093*0Sstevel@tonic-gate  * Special Keys
1094*0Sstevel@tonic-gate  *
1095*0Sstevel@tonic-gate  * Keypad layout
1096*0Sstevel@tonic-gate  *	A1	up	A3
1097*0Sstevel@tonic-gate  *     left	B2     right
1098*0Sstevel@tonic-gate  *	C1     down	C3
1099*0Sstevel@tonic-gate  *
1100*0Sstevel@tonic-gate  * Chossing negative values for KEY_ constants means that they can
1101*0Sstevel@tonic-gate  * be safely returned in either an int or long type.
1102*0Sstevel@tonic-gate  */
1103*0Sstevel@tonic-gate #define	__KEY_BASE	(-2)
1104*0Sstevel@tonic-gate #define	__KEY_MAX	__KEY_BASE
1105*0Sstevel@tonic-gate 
1106*0Sstevel@tonic-gate #define	KEY_CODE_YES	(__KEY_BASE-1)		/* Special indicator. */
1107*0Sstevel@tonic-gate #define	KEY_BREAK	(__KEY_BASE-2)		/* Break key (unreliable) */
1108*0Sstevel@tonic-gate #define	KEY_DOWN	(__KEY_BASE-3)		/* The four arrow keys ... */
1109*0Sstevel@tonic-gate #define	KEY_UP		(__KEY_BASE-4)
1110*0Sstevel@tonic-gate #define	KEY_LEFT	(__KEY_BASE-5)
1111*0Sstevel@tonic-gate #define	KEY_RIGHT	(__KEY_BASE-6)
1112*0Sstevel@tonic-gate #define	KEY_HOME	(__KEY_BASE-7)		/* Move to upper-left corner. */
1113*0Sstevel@tonic-gate #define	KEY_BACKSPACE	(__KEY_BASE-8)		/* Backspace */
1114*0Sstevel@tonic-gate #define	KEY_F0		(__KEY_BASE-9)		/* Function keys.  Space for */
1115*0Sstevel@tonic-gate #define	KEY_F(n)	(KEY_F0-(n))    	/* 64 keys is reserved. */
1116*0Sstevel@tonic-gate #define	KEY_DL		(__KEY_BASE-73)		/* Delete line */
1117*0Sstevel@tonic-gate #define	KEY_IL		(__KEY_BASE-74)		/* Insert line */
1118*0Sstevel@tonic-gate #define	KEY_DC		(__KEY_BASE-75)		/* Delete character */
1119*0Sstevel@tonic-gate #define	KEY_IC		(__KEY_BASE-76)		/* Ins char / enter ins mode */
1120*0Sstevel@tonic-gate #define	KEY_EIC		(__KEY_BASE-77)		/* Exit insert char mode */
1121*0Sstevel@tonic-gate #define	KEY_CLEAR	(__KEY_BASE-78)		/* Clear screen */
1122*0Sstevel@tonic-gate #define	KEY_EOS		(__KEY_BASE-79)		/* Clear to end of screen */
1123*0Sstevel@tonic-gate #define	KEY_EOL		(__KEY_BASE-80)		/* Clear to end of line */
1124*0Sstevel@tonic-gate #define	KEY_SF		(__KEY_BASE-81)		/* Scroll 1 line forward */
1125*0Sstevel@tonic-gate #define	KEY_SR		(__KEY_BASE-82)		/* Scroll 1 line backwards */
1126*0Sstevel@tonic-gate #define	KEY_NPAGE	(__KEY_BASE-83)		/* Next page */
1127*0Sstevel@tonic-gate #define	KEY_PPAGE	(__KEY_BASE-84)		/* Previous page */
1128*0Sstevel@tonic-gate #define	KEY_STAB	(__KEY_BASE-85)		/* Set tab */
1129*0Sstevel@tonic-gate #define	KEY_CTAB	(__KEY_BASE-86)		/* Clear tab */
1130*0Sstevel@tonic-gate #define	KEY_CATAB	(__KEY_BASE-87)		/* Clear all tabs */
1131*0Sstevel@tonic-gate #define	KEY_ENTER	(__KEY_BASE-88)		/* Enter or send */
1132*0Sstevel@tonic-gate #define	KEY_SRESET	(__KEY_BASE-89)		/* Soft (partial) reset */
1133*0Sstevel@tonic-gate #define	KEY_RESET	(__KEY_BASE-90)		/* Hard reset */
1134*0Sstevel@tonic-gate #define	KEY_PRINT	(__KEY_BASE-91)		/* Print or copy */
1135*0Sstevel@tonic-gate #define	KEY_LL		(__KEY_BASE-92)		/* Move to lower left corner. */
1136*0Sstevel@tonic-gate #define	KEY_A1		(__KEY_BASE-93)		/* Upper left of keypad */
1137*0Sstevel@tonic-gate #define	KEY_A3		(__KEY_BASE-94) 	/* Upper rght of keypad */
1138*0Sstevel@tonic-gate #define	KEY_B2		(__KEY_BASE-95) 	/* Center of keypad */
1139*0Sstevel@tonic-gate #define	KEY_C1		(__KEY_BASE-96) 	/* Lower left of keypad */
1140*0Sstevel@tonic-gate #define	KEY_C3		(__KEY_BASE-97) 	/* Lower right of keypad */
1141*0Sstevel@tonic-gate #define	KEY_BTAB	(__KEY_BASE-98) 	/* Back Tab */
1142*0Sstevel@tonic-gate #define	KEY_BEG		(__KEY_BASE-99) 	/* Beginning */
1143*0Sstevel@tonic-gate #define	KEY_CANCEL	(__KEY_BASE-100)
1144*0Sstevel@tonic-gate #define	KEY_CLOSE	(__KEY_BASE-101)
1145*0Sstevel@tonic-gate #define	KEY_COMMAND	(__KEY_BASE-102)
1146*0Sstevel@tonic-gate #define	KEY_COPY	(__KEY_BASE-103)
1147*0Sstevel@tonic-gate #define	KEY_CREATE	(__KEY_BASE-104)
1148*0Sstevel@tonic-gate #define	KEY_END		(__KEY_BASE-105)
1149*0Sstevel@tonic-gate #define	KEY_EXIT	(__KEY_BASE-106)
1150*0Sstevel@tonic-gate #define	KEY_FIND	(__KEY_BASE-107)
1151*0Sstevel@tonic-gate #define	KEY_HELP	(__KEY_BASE-108)
1152*0Sstevel@tonic-gate #define	KEY_MARK	(__KEY_BASE-109)
1153*0Sstevel@tonic-gate #define	KEY_MESSAGE	(__KEY_BASE-110)
1154*0Sstevel@tonic-gate #define	KEY_MOUSE	(__KEY_BASE-111)	/* Mouse event occured */
1155*0Sstevel@tonic-gate #define	KEY_MOVE	(__KEY_BASE-112)
1156*0Sstevel@tonic-gate #define	KEY_NEXT	(__KEY_BASE-113)	/* Next object */
1157*0Sstevel@tonic-gate #define	KEY_OPEN	(__KEY_BASE-114)
1158*0Sstevel@tonic-gate #define	KEY_OPTIONS	(__KEY_BASE-115)
1159*0Sstevel@tonic-gate #define	KEY_PREVIOUS	(__KEY_BASE-116)	/* Previous object */
1160*0Sstevel@tonic-gate #define	KEY_REDO	(__KEY_BASE-117)
1161*0Sstevel@tonic-gate #define	KEY_REFERENCE	(__KEY_BASE-118)
1162*0Sstevel@tonic-gate #define	KEY_REFRESH	(__KEY_BASE-119)
1163*0Sstevel@tonic-gate #define	KEY_REPLACE	(__KEY_BASE-120)
1164*0Sstevel@tonic-gate #define	KEY_RESTART	(__KEY_BASE-121)
1165*0Sstevel@tonic-gate #define	KEY_RESUME	(__KEY_BASE-122)
1166*0Sstevel@tonic-gate #define	KEY_SAVE	(__KEY_BASE-123)
1167*0Sstevel@tonic-gate #define	KEY_SBEG	(__KEY_BASE-124)	/* Shifted keys */
1168*0Sstevel@tonic-gate #define	KEY_SCANCEL	(__KEY_BASE-125)
1169*0Sstevel@tonic-gate #define	KEY_SCOMMAND	(__KEY_BASE-126)
1170*0Sstevel@tonic-gate #define	KEY_SCOPY	(__KEY_BASE-127)
1171*0Sstevel@tonic-gate #define	KEY_SCREATE	(__KEY_BASE-128)
1172*0Sstevel@tonic-gate #define	KEY_SDC		(__KEY_BASE-129)
1173*0Sstevel@tonic-gate #define	KEY_SDL		(__KEY_BASE-130)
1174*0Sstevel@tonic-gate #define	KEY_SELECT	(__KEY_BASE-131)	/* Select */
1175*0Sstevel@tonic-gate #define	KEY_SEND	(__KEY_BASE-132)	/* Shifted end key */
1176*0Sstevel@tonic-gate #define	KEY_SEOL	(__KEY_BASE-133)
1177*0Sstevel@tonic-gate #define	KEY_SEXIT	(__KEY_BASE-134)
1178*0Sstevel@tonic-gate #define	KEY_SFIND	(__KEY_BASE-135)
1179*0Sstevel@tonic-gate #define	KEY_SHELP	(__KEY_BASE-136)
1180*0Sstevel@tonic-gate #define	KEY_SHOME	(__KEY_BASE-137)
1181*0Sstevel@tonic-gate #define	KEY_SIC		(__KEY_BASE-138)
1182*0Sstevel@tonic-gate #define	KEY_SLEFT	(__KEY_BASE-139)
1183*0Sstevel@tonic-gate #define	KEY_SMESSAGE	(__KEY_BASE-140)
1184*0Sstevel@tonic-gate #define	KEY_SMOVE	(__KEY_BASE-141)
1185*0Sstevel@tonic-gate #define	KEY_SNEXT	(__KEY_BASE-142)
1186*0Sstevel@tonic-gate #define	KEY_SOPTIONS	(__KEY_BASE-143)
1187*0Sstevel@tonic-gate #define	KEY_SPREVIOUS	(__KEY_BASE-144)
1188*0Sstevel@tonic-gate #define	KEY_SPRINT	(__KEY_BASE-145)
1189*0Sstevel@tonic-gate #define	KEY_SREDO	(__KEY_BASE-146)
1190*0Sstevel@tonic-gate #define	KEY_SREPLACE	(__KEY_BASE-147)
1191*0Sstevel@tonic-gate #define	KEY_SRIGHT	(__KEY_BASE-148)
1192*0Sstevel@tonic-gate #define	KEY_SRSUME	(__KEY_BASE-149)
1193*0Sstevel@tonic-gate #define	KEY_SSAVE	(__KEY_BASE-150)
1194*0Sstevel@tonic-gate #define	KEY_SSUSPEND	(__KEY_BASE-151)
1195*0Sstevel@tonic-gate #define	KEY_SUNDO	(__KEY_BASE-152)
1196*0Sstevel@tonic-gate #define	KEY_SUSPEND	(__KEY_BASE-153)
1197*0Sstevel@tonic-gate #define	KEY_UNDO	(__KEY_BASE-154)
1198*0Sstevel@tonic-gate 
1199*0Sstevel@tonic-gate #define	__KEY_MIN	(__KEY_BASE-155)
1200*0Sstevel@tonic-gate 
1201*0Sstevel@tonic-gate #ifdef	__cplusplus
1202*0Sstevel@tonic-gate }
1203*0Sstevel@tonic-gate #endif
1204*0Sstevel@tonic-gate 
1205*0Sstevel@tonic-gate #endif /* _CURSES_H */
1206