📄 curses.h.in
字号:
/**************************************************************************** * Copyright (c) 1998-2003,2004 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 * * authorization. * ****************************************************************************//**************************************************************************** * 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.148 2004/01/14 23:50:12 tom Exp $ */#ifndef __NCURSES_H#define __NCURSES_H#define CURSES 1#define CURSES_H 1/* This should be defined for the enhanced functionality to be visible. * However, some of the wide-character (enhanced) functionality is missing. * So we do not define it (yet).#define _XOPEN_CURSES 1 *//* These are defined only in curses.h, and are used for conditional compiles */#define NCURSES_VERSION_MAJOR @NCURSES_MAJOR@#define NCURSES_VERSION_MINOR @NCURSES_MINOR@#define NCURSES_VERSION_PATCH @NCURSES_PATCH@/* This is defined in more than one ncurses header, for identification */#undef NCURSES_VERSION#define NCURSES_VERSION "@NCURSES_MAJOR@.@NCURSES_MINOR@"#include <ncurses_dll.h>/* * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses * configured using --disable-macros. */#ifdef NCURSES_NOMACROS#define NCURSES_ATTR_T attr_t#endif#ifndef NCURSES_ATTR_T#define NCURSES_ATTR_T int#endif/* * Expands to 'const' if ncurses is configured using --enable-const. Note that * doing so makes it incompatible with other implementations of X/Open Curses. */#undef NCURSES_CONST#define NCURSES_CONST @NCURSES_CONST@/* * The internal type used for color values */#undef NCURSES_COLOR_T#define NCURSES_COLOR_T short/* * The internal type used for window dimensions. */#undef NCURSES_SIZE_T#define NCURSES_SIZE_T short/* * 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. */#undef NCURSES_CH_T#define NCURSES_CH_T @NCURSES_CH_T@typedef unsigned @cf_cv_typeof_chtype@ chtype;#include <stdio.h>#include <unctrl.h>#include <stdarg.h> /* we need va_list */#ifdef _XOPEN_SOURCE_EXTENDED#include <stddef.h> /* we want wchar_t */#endif /* _XOPEN_SOURCE_EXTENDED *//* XSI 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 * with other interfaces. * * 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 * from either C or C++. */#undef TRUE#define TRUE 1#undef FALSE#define FALSE 0typedef @cf_cv_type_of_bool@ NCURSES_BOOL;#if @USE_CXX_BOOL@ /* __cplusplus, etc. *//* use the C++ compiler's bool type */#define NCURSES_BOOL bool#else /* c89, c99, etc. */#if @cf_cv_header_stdbool_h@#include <stdbool.h>/* use whatever the C compiler decides bool really is */#define NCURSES_BOOL bool#else/* there is no predefined bool - use our own */#undef bool#define bool NCURSES_BOOL#endif#endif /* !__cplusplus, etc. */#ifdef __cplusplusextern "C" {#endif/* * XSI attributes. In the ncurses implementation, they are identical to the * A_ attributes. */#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_BLINK A_BLINK#define WA_DIM A_DIM#define WA_BOLD A_BOLD#define WA_ALTCHARSET A_ALTCHARSET#define WA_INVIS A_INVIS#define WA_PROTECT A_PROTECT#define WA_HORIZONTAL A_HORIZONTAL#define WA_LEFT A_LEFT#define WA_LOW A_LOW#define WA_RIGHT A_RIGHT#define WA_TOP A_TOP#define WA_VERTICAL A_VERTICAL/* colors */extern NCURSES_EXPORT_VAR(int) COLORS;extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;#define COLOR_BLACK 0#define COLOR_RED 1#define COLOR_GREEN 2#define COLOR_YELLOW 3#define COLOR_BLUE 4#define COLOR_MAGENTA 5#define COLOR_CYAN 6#define COLOR_WHITE 7/* line graphics */#if @BROKEN_LINKER@extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void);#define acs_map (_nc_acs_map())#elseextern NCURSES_EXPORT_VAR(chtype) acs_map[];#endif#define NCURSES_ACS(c) (acs_map[(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#undef ERR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -