/****************************************************************************
* Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
****************************************************************************/
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: curses.h.in,v 1.257 2017/11/21 00:11:37 tom Exp $ */
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 6
#define NCURSES_VERSION_MINOR 1
#define NCURSES_VERSION_PATCH 20180224
/* This is defined in more than one ncurses header, for identification */
#define NCURSES_VERSION "6.1"
* Identify the mouse encoding version.
#define NCURSES_MOUSE_VERSION 2
* Definitions to facilitate DLL's.
* User-definable tweak to disable the include of <stdbool.h>.
#ifndef NCURSES_ENABLE_STDBOOL_H
#define NCURSES_ENABLE_STDBOOL_H 1
* NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
* configured using --disable-macros.
#define NCURSES_ATTR_T int
* Expands to 'const' if ncurses is configured using --enable-const. Note that
* doing so makes it incompatible with other implementations of X/Open Curses.
#define NCURSES_CONST const
#define NCURSES_INLINE inline
* The standard type used for color values, and for color-pairs. The latter
* allows the curses library to enumerate the combinations of foreground and
* background colors used by an application, and is normally the product of the
* total foreground and background colors.
* X/Open uses "short" for both of these types, ultimately because they are
* numbers from the SVr4 terminal database, which uses 16-bit signed values.
#define NCURSES_COLOR_T short
#define NCURSES_PAIRS_T short
* Definitions used to make WINDOW and similar structs opaque.
#ifndef NCURSES_INTERNALS
#define NCURSES_OPAQUE_FORM 0
#define NCURSES_OPAQUE_MENU 0
#define NCURSES_OPAQUE_PANEL 0
* Definition used to optionally suppress wattr* macros to help with the
* transition from ncurses5 to ncurses6 by allowing the header files to
* be shared across development packages for ncursesw in both ABIs.
#ifndef NCURSES_WATTR_MACROS
#define NCURSES_WATTR_MACROS 0
* The reentrant code relies on the opaque setting, but adds features.
#ifndef NCURSES_REENTRANT
#define NCURSES_REENTRANT 0
* Control whether bindings for interop support are added.
#undef NCURSES_INTEROP_FUNCS
#define NCURSES_INTEROP_FUNCS 1
* The internal type used for window dimensions.
#define NCURSES_SIZE_T short
* Control whether tparm() supports varargs or fixed-parameter list.
#undef NCURSES_TPARM_VARARGS
#define NCURSES_TPARM_VARARGS 1
* Control type used for tparm's arguments. While X/Open equates long and
* char* values, this is not always workable for 64-bit platforms.
#define NCURSES_TPARM_ARG intptr_t
* Control whether ncurses uses wcwidth() for checking width of line-drawing
#undef NCURSES_WCWIDTH_GRAPHICS
#define NCURSES_WCWIDTH_GRAPHICS 1
* NCURSES_CH_T is used in building the library, but not used otherwise in
* this header file, since that would make the normal/wide-character versions
* of the header incompatible.
#define NCURSES_CH_T cchar_t
typedef unsigned mmask_t;
typedef uint32_t mmask_t;
* We need FILE, etc. Include this before checking any feature symbols.
* With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or
* conflicting) when _XOPEN_SOURCE is 500 or greater. If NCURSES_WIDECHAR is
* not already defined, e.g., if the platform relies upon nonstandard feature
* test macros, define it at this point if the standard feature test macros
* indicate that it should be defined.
#if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500))
#define NCURSES_WIDECHAR 1
#define NCURSES_WIDECHAR 0
#endif /* NCURSES_WIDECHAR */
#include <stdarg.h> /* we need va_list */
#include <stddef.h> /* we want wchar_t */
/* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also
* implement it. If so, we must use the C++ compiler's type to avoid conflict
* A further complication is that <stdbool.h> may declare 'bool' to be a
* different type, such as an enum which is not necessarily compatible with
* C++. If we have <stdbool.h>, make 'bool' a macro, so users may #undef it.
* Otherwise, let it remain a typedef to avoid conflicts with other #define's.
* In either case, make a typedef for NCURSES_BOOL which can be used if needed
typedef unsigned char NCURSES_BOOL;
#if defined(__cplusplus) /* __cplusplus, etc. */
/* use the C++ compiler's bool type */
#define NCURSES_BOOL bool
#else /* c89, c99, etc. */
#if NCURSES_ENABLE_STDBOOL_H
/* use whatever the C compiler decides bool really is */
#define NCURSES_BOOL bool
/* there is no predefined bool - use our own */
#define bool NCURSES_BOOL
#endif /* !__cplusplus, etc. */
#define NCURSES_CAST(type,value) static_cast<type>(value)
#define NCURSES_CAST(type,value) (type)(value)
#define NCURSES_OK_ADDR(p) (0 != NCURSES_CAST(const void *, (p)))
* X/Open attributes. In the ncurses implementation, they are identical to the
#define WA_ATTRIBUTES A_ATTRIBUTES
#define WA_NORMAL A_NORMAL
#define WA_STANDOUT A_STANDOUT
#define WA_UNDERLINE A_UNDERLINE
#define WA_REVERSE A_REVERSE
#define WA_ALTCHARSET A_ALTCHARSET
#define WA_PROTECT A_PROTECT
#define WA_HORIZONTAL A_HORIZONTAL
#define WA_VERTICAL A_VERTICAL
#define WA_ITALIC A_ITALIC /* ncurses extension */
#if 0 || NCURSES_REENTRANT
NCURSES_WRAPPED_VAR(chtype*, acs_map);
#define acs_map NCURSES_PUBLIC_VAR(acs_map())
extern NCURSES_EXPORT_VAR(chtype) acs_map[];
#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,(c))])
/* VT100 symbols begin here */
#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */
#define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */
#define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */
#define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */
#define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */
#define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */
#define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */
#define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */
#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */
#define ACS_VLINE NCURSES_ACS('x') /* vertical line */
#define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */
#define ACS_S1 NCURSES_ACS('o') /* scan line 1 */
#define ACS_S9 NCURSES_ACS('s') /* scan line 9 */
#define ACS_DIAMOND NCURSES_ACS('`') /* diamond */
#define ACS_CKBOARD NCURSES_ACS('a') /* checker board (stipple) */
#define ACS_DEGREE NCURSES_ACS('f') /* degree symbol */
#define ACS_PLMINUS NCURSES_ACS('g') /* plus/minus */
#define ACS_BULLET NCURSES_ACS('~') /* bullet */
/* Teletype 5410v1 symbols begin here */
#define ACS_LARROW NCURSES_ACS(',') /* arrow pointing left */
#define ACS_RARROW NCURSES_ACS('+') /* arrow pointing right */
#define ACS_DARROW NCURSES_ACS('.') /* arrow pointing down */
#define ACS_UARROW NCURSES_ACS('-') /* arrow pointing up */
#define ACS_BOARD NCURSES_ACS('h') /* board of squares */
#define ACS_LANTERN NCURSES_ACS('i') /* lantern symbol */
#define ACS_BLOCK NCURSES_ACS('0') /* solid square block */
* These aren't documented, but a lot of System Vs have them anyway
* (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
* The ACS_names may not match AT&T's, our source didn't know them.
#define ACS_S3 NCURSES_ACS('p') /* scan line 3 */
#define ACS_S7 NCURSES_ACS('r') /* scan line 7 */
#define ACS_LEQUAL NCURSES_ACS('y') /* less/equal */
#define ACS_GEQUAL NCURSES_ACS('z') /* greater/equal */
#define ACS_PI NCURSES_ACS('{') /* Pi */
#define ACS_NEQUAL NCURSES_ACS('|') /* not equal */
#define ACS_STERLING NCURSES_ACS('}') /* UK pound sign */
* Line drawing ACS names are of the form ACS_trbl, where t is the top, r
* is the right, b is the bottom, and l is the left. t, r, b, and l might
* be B (blank), S (single), D (double), or T (thick). The subset defined
* here only uses B and S.
#define ACS_BSSB ACS_ULCORNER
#define ACS_SSBB ACS_LLCORNER
#define ACS_BBSS ACS_URCORNER
#define ACS_SBBS ACS_LRCORNER
#define ACS_SBSS ACS_RTEE
#define ACS_SSSB ACS_LTEE
#define ACS_SSBS ACS_BTEE
#define ACS_BSSS ACS_TTEE
#define ACS_BSBS ACS_HLINE
#define ACS_SBSB ACS_VLINE
#define ACS_SSSS ACS_PLUS
/* values for the _flags member */
#define _SUBWIN 0x01 /* is this a sub-window? */
#define _ENDLINE 0x02 /* is the window flush right? */
#define _FULLWIN 0x04 /* is the window full-screen? */
#define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */
#define _ISPAD 0x10 /* is this window a pad? */
#define _HASMOVED 0x20 /* has cursor moved since last refresh? */
#define _WRAPPED 0x40 /* cursor was just wrappped */
* this value is used in the firstchar and lastchar fields to mark
* this value is used in the oldindex field to mark lines created by insertions
typedef struct screen SCREEN;
typedef struct _win_st WINDOW;
typedef chtype attr_t; /* ...must be at least as wide as chtype */
#ifdef mblen /* libutf8.h defines it w/o undefining first */
#include <wchar.h> /* ...to get mbstate_t, etc. */
typedef unsigned short wchar_t1;
typedef unsigned int wint_t1;
* cchar_t stores an array of CCHARW_MAX wide characters. The first is
* normally a spacing character. The others are non-spacing. If those
* (spacing and nonspacing) do not fill the array, a null L'\0' follows.
* Otherwise, a null is assumed to follow when extracting via getcchar().
wchar_t chars[CCHARW_MAX];
#undef NCURSES_EXT_COLORS
#define NCURSES_EXT_COLORS 20180224
int ext_color; /* color pair, must be more than 16-bits */
#endif /* NCURSES_WIDECHAR */
NCURSES_SIZE_T _cury, _curx; /* current cursor position */
/* window location and size */
NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */
NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */
short _flags; /* window state flags */
attr_t _attrs; /* current attribute for non-space character */
chtype _bkgd; /* current background char/attribute pair */
/* option values set by user */
bool _notimeout; /* no time out on function-key entry? */
bool _clear; /* consider all data in the window invalid? */
bool _leaveok; /* OK to not reset cursor on exit? */
bool _scroll; /* OK to scroll this window? */
bool _idlok; /* OK to use insert/delete line? */
bool _idcok; /* OK to use insert/delete char? */
bool _immed; /* window in immed mode? (not yet used) */
bool _sync; /* window in sync mode? */
bool _use_keypad; /* process function keys into KEY_ symbols? */
int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */
struct ldat *_line; /* the actual line data */
/* global screen state */
NCURSES_SIZE_T _regtop; /* top line of scrolling region */
NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */
/* these are used only if this is a sub-window */
int _parx; /* x coordinate of this window in parent */
int _pary; /* y coordinate of this window in parent */
WINDOW *_parent; /* pointer to parent if a sub-window */
/* these are used only if this is a pad */
NCURSES_SIZE_T _pad_y, _pad_x;
NCURSES_SIZE_T _pad_top, _pad_left;
NCURSES_SIZE_T _pad_bottom, _pad_right;
NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
cchar_t _bkgrnd; /* current background char/attribute pair */
int _color; /* current color-pair for non-space character */
#endif /* NCURSES_OPAQUE */
* This is an extension to support events...
#ifdef NCURSES_WGETCH_EVENTS
#if !defined(__BEOS__) || defined(__HAIKU__)
/* Fix _nc_timed_wait() on BEOS... */
# define NCURSES_EVENT_VERSION 1
#endif /* !defined(__BEOS__) */