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