⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curses.priv.h

📁 ncurses 库 可能有用酒用 没用就算了 我觉得还可以用
💻 H
📖 第 1 页 / 共 3 页
字号:
	int             _cbreak;        /* 1 if in cbreak mode              */	                                /* > 1 if in halfdelay mode         */	int             _echo;          /* True if echo on                  */	int             _use_meta;      /* use the meta key?                */	struct _SLK     *_slk;          /* ptr to soft key struct / NULL    */        int             slk_format;     /* selected format for this screen  */	/* cursor movement costs; units are 10ths of milliseconds */#if NCURSES_NO_PADDING	int             _no_padding;    /* flag to set if padding disabled  */#endif	int             _char_padding;  /* cost of character put            */	int             _cr_cost;       /* cost of (carriage_return)        */	int             _cup_cost;      /* cost of (cursor_address)         */	int             _home_cost;     /* cost of (cursor_home)            */	int             _ll_cost;       /* cost of (cursor_to_ll)           */#if USE_HARD_TABS	int             _ht_cost;       /* cost of (tab)                    */	int             _cbt_cost;      /* cost of (backtab)                */#endif /* USE_HARD_TABS */	int             _cub1_cost;     /* cost of (cursor_left)            */	int             _cuf1_cost;     /* cost of (cursor_right)           */	int             _cud1_cost;     /* cost of (cursor_down)            */	int             _cuu1_cost;     /* cost of (cursor_up)              */	int             _cub_cost;      /* cost of (parm_cursor_left)       */	int             _cuf_cost;      /* cost of (parm_cursor_right)      */	int             _cud_cost;      /* cost of (parm_cursor_down)       */	int             _cuu_cost;      /* cost of (parm_cursor_up)         */	int             _hpa_cost;      /* cost of (column_address)         */	int             _vpa_cost;      /* cost of (row_address)            */	/* used in tty_update.c, must be chars */	int             _ed_cost;       /* cost of (clr_eos)                */	int             _el_cost;       /* cost of (clr_eol)                */	int             _el1_cost;      /* cost of (clr_bol)                */	int             _dch1_cost;     /* cost of (delete_character)       */	int             _ich1_cost;     /* cost of (insert_character)       */	int             _dch_cost;      /* cost of (parm_dch)               */	int             _ich_cost;      /* cost of (parm_ich)               */	int             _ech_cost;      /* cost of (erase_chars)            */	int             _rep_cost;      /* cost of (repeat_char)            */	int             _hpa_ch_cost;   /* cost of (column_address)         */	int             _cup_ch_cost;   /* cost of (cursor_address)         */	int             _cuf_ch_cost;   /* cost of (parm_cursor_right)      */	int             _inline_cost;   /* cost of inline-move              */	int             _smir_cost;	/* cost of (enter_insert_mode)      */	int             _rmir_cost;	/* cost of (exit_insert_mode)       */	int             _ip_cost;       /* cost of (insert_padding)         */	/* used in lib_mvcur.c */	char *          _address_cursor;	/* used in tty_update.c */	int             _scrolling;     /* 1 if terminal's smart enough to  */	/* used in lib_color.c */	color_t         *_color_table;  /* screen's color palette            */	int             _color_count;   /* count of colors in palette        */	colorpair_t     *_color_pairs;  /* screen's color pair list          */	int             _pair_count;    /* count of color pairs              */#if NCURSES_EXT_FUNCS	bool            _default_color; /* use default colors                */	bool            _has_sgr_39_49; /* has ECMA default color support    */	int             _default_fg;    /* assumed default foreground        */	int             _default_bg;    /* assumed default background        */#endif	chtype          _xmc_suppress;  /* attributes to suppress if xmc     */	chtype          _xmc_triggers;  /* attributes to process if xmc      */	chtype          _acs_map[ACS_LEN]; /* the real alternate-charset map */	/* used in lib_vidattr.c */	bool            _use_rmso;	/* true if we may use 'rmso'         */	bool            _use_rmul;	/* true if we may use 'rmul'         */	/*	 * These data correspond to the state of the idcok() and idlok()	 * functions.  A caveat is in order here:  the XSI and SVr4	 * documentation specify that these functions apply to the window which	 * is given as an argument.  However, ncurses implements this logic	 * only for the newscr/curscr update process, _not_ per-window.	 */	bool            _nc_sp_idlok;	bool            _nc_sp_idcok;#define _nc_idlok SP->_nc_sp_idlok#define _nc_idcok SP->_nc_sp_idcok	/*	 * These are the data that support the mouse interface.	 */	MouseType	_mouse_type;	int             _maxclick;	bool            (*_mouse_event) (SCREEN *);	bool            (*_mouse_inline)(SCREEN *);	bool            (*_mouse_parse) (int);	void            (*_mouse_resume)(SCREEN *);	void            (*_mouse_wrap)  (SCREEN *);	int             _mouse_fd;      /* file-descriptor, if any */	bool		_mouse_active;	/* true if initialized */	NCURSES_CONST char *_mouse_xtermcap; /* string to enable/disable mouse */#if USE_SYSMOUSE	MEVENT		_sysmouse_fifo[FIFO_SIZE];	int		_sysmouse_head;	int		_sysmouse_tail;	int		_sysmouse_char_width;	/* character width */	int		_sysmouse_char_height;	/* character height */	int		_sysmouse_old_buttons;	int		_sysmouse_new_buttons;#endif	/*	 * This supports automatic resizing	 */#if USE_SIZECHANGE	int		(*_resize)(int,int);#endif        /*	 * These are data that support the proper handling of the panel stack on an	 * per screen basis.	 */        struct panelhook _panelHook;	/*	 * Linked-list of all windows, to support '_nc_resizeall()' and	 * '_nc_freeall()'	 */	WINDOWLIST      *_nc_sp_windows;#define _nc_windows SP->_nc_sp_windows	bool            _sig_winch;	SCREEN          *_next_screen;	/* hashes for old and new lines */	unsigned long	*oldhash, *newhash;	HASHMAP		*hashtab;	int		hashtab_len;	bool            _cleanup;	/* cleanup after int/quit signal */	int             (*_outch)(int);	/* output handler if not putc */	/* recent versions of 'screen' have partially-working support for	 * UTF-8, but do not permit ACS at the same time (see tty_update.c).	 */#if USE_WIDEC_SUPPORT	bool		_legacy_coding;	bool		_screen_acs_fix;#endif	bool		_screen_acs_map[ACS_LEN];};extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;#if NCURSES_NOMACROS#include <nomacros.h>#endif	WINDOWLIST {	WINDOW	win;	/* first, so WINDOW_EXT() works */	WINDOWLIST *next;#ifdef _XOPEN_SOURCE_EXTENDED	char addch_work[(MB_LEN_MAX * 9) + 1];	unsigned addch_used;	/* number of bytes in addch_work[] */	int addch_x;		/* x-position for addch_work[] */	int addch_y;		/* y-position for addch_work[] */#endif};#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field)/* usually in <limits.h> */#ifndef UCHAR_MAX#define UCHAR_MAX 255#endif/* The terminfo source is assumed to be 7-bit ASCII */#define is7bits(c)	((unsigned)(c) < 128)/* Checks for isprint() should be done on 8-bit characters (non-wide) */#define is8bits(c)	((unsigned)(c) <= UCHAR_MAX)#ifndef min#define min(a,b)	((a) > (b)  ?  (b)  :  (a))#endif#ifndef max#define max(a,b)	((a) < (b)  ?  (b)  :  (a))#endif/* usually in <unistd.h> */#ifndef STDIN_FILENO#define STDIN_FILENO 0#endif#ifndef STDOUT_FILENO#define STDOUT_FILENO 1#endif#ifndef STDERR_FILENO#define STDERR_FILENO 2#endif#ifndef EXIT_SUCCESS#define EXIT_SUCCESS 0#endif#ifndef EXIT_FAILURE#define EXIT_FAILURE 1#endif#ifndef R_OK#define	R_OK	4		/* Test for read permission.  */#endif#ifndef W_OK#define	W_OK	2		/* Test for write permission.  */#endif#ifndef X_OK#define	X_OK	1		/* Test for execute permission.  */#endif#ifndef F_OK#define	F_OK	0		/* Test for existence.  */#endif#if HAVE_FCNTL_H#include <fcntl.h>		/* may define O_BINARY	*/#endif#ifndef O_BINARY#define O_BINARY 0#endif#ifdef TRACE#define TRACE_OUTCHARS(n) _nc_outchars += (n);#else#define TRACE_OUTCHARS(n) /* nothing */#endif#define UChar(c)	((unsigned char)(c))#define ChCharOf(c)	((c) & (chtype)A_CHARTEXT)#define ChAttrOf(c)     ((c) & (chtype)A_ATTRIBUTES)#ifndef MB_LEN_MAX#define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */#endif#if USE_WIDEC_SUPPORT /* { */#define isEILSEQ(status) ((status == (size_t)-1) && (errno == EILSEQ))#define init_mb(state)	memset(&state, 0, sizeof(state))#if NCURSES_EXT_COLORS#define NulColor	, 0#else#define NulColor	/* nothing */#endif#define NulChar		0,0,0,0	/* FIXME: see CCHARW_MAX */#define CharOf(c)	((c).chars[0])#define AttrOf(c)	((c).attr)#define AddAttr(c,a)	AttrOf(c) |= a#define RemAttr(c,a)	AttrOf(c) &= ~(a)#define SetAttr(c,a)	AttrOf(c) = a#define NewChar(ch)	{ ChAttrOf(ch), { ChCharOf(ch), NulChar } NulColor }#define NewChar2(c,a)	{ a, { c, NulChar } NulColor }#define CharEq(a,b)	(!memcmp(&a, &b, sizeof(a)))#define SetChar(ch,c,a) do {							    \			    NCURSES_CH_T *_cp = &ch;				    \			    memset(_cp, 0, sizeof(ch));				    \			    _cp->chars[0] = c;					    \			    _cp->attr = a;					    \			    if_EXT_COLORS(SetPair(ch, PAIR_NUMBER(a)));		    \			} while (0)#define CHREF(wch)	(&wch)#define CHDEREF(wch)	(*wch)#define ARG_CH_T	NCURSES_CH_T *#define CARG_CH_T	const NCURSES_CH_T *#define PUTC_DATA	char PUTC_buf[MB_LEN_MAX]; int PUTC_i, PUTC_n; \			mbstate_t PUT_st; wchar_t PUTC_ch#define PUTC_INIT	init_mb (PUT_st);					    \			PUTC_i = 0#define PUTC(ch,b)	do { if(!isWidecExt(ch)) {				    \			if (Charable(ch)) {					    \			    fputc(CharOf(ch), b);				    \			    TRACE_OUTCHARS(1);					    \			} else {						    \			    PUTC_INIT;						    \			    do {						    \				PUTC_ch = PUTC_i < CCHARW_MAX ?			    \					    (ch).chars[PUTC_i] : L'\0';		    \				PUTC_n = wcrtomb(PUTC_buf,			    \						 (ch).chars[PUTC_i], &PUT_st);	    \				if (PUTC_ch == L'\0')				    \				    --PUTC_n;					    \				if (PUTC_n <= 0)				    \				    break;					    \				fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b);	    \				++PUTC_i;					    \			    } while (PUTC_ch != L'\0');				    \			    TRACE_OUTCHARS(PUTC_i);				    \			} } } while (0)#define BLANK		{ WA_NORMAL, {' '} NulColor }#define ZEROS		{ WA_NORMAL, {'\0'} NulColor }#define ISBLANK(ch)	((ch).chars[0] == L' ' && (ch).chars[1] == L'\0')	/*	 * Wide characters cannot be represented in the A_CHARTEXT mask of	 * attr_t's but an application might have set a narrow character there.	 * But even in that case, it would only be a printable character, or	 * zero.  Otherwise we can use those bits to tell if a cell is the	 * first or extension part of a wide character.	 */#define WidecExt(ch)	(AttrOf(ch) & A_CHARTEXT)#define isWidecBase(ch)	(WidecExt(ch) == 1)#define isWidecExt(ch)	(WidecExt(ch) > 1 && WidecExt(ch) < 32)#define SetWidecExt(dst, ext)	AttrOf(dst) &= ~A_CHARTEXT,		\				AttrOf(dst) |= (ext + 1)#define if_WIDEC(code)  code#define Charable(ch)	((SP != 0 && SP->_legacy_coding)		\			 || (AttrOf(ch) & A_ALTCHARSET)			\			 || (!isWidecExt(ch) &&				\			     (ch).chars[1] == L'\0' &&			\                             _nc_is_charable(CharOf(ch))))#define L(ch)		L ## ch#else /* }{ */#define CharOf(c)	ChCharOf(c)#define AttrOf(c)	ChAttrOf(c)#define AddAttr(c,a)	c |= a#define RemAttr(c,a)	c &= ~(a & A_ATTRIBUTES)#define SetAttr(c,a)	c = (c & ~A_ATTRIBUTES) | a#define NewChar(ch)	(ch)#define NewChar2(c,a)	(c | a)#define CharEq(a,b)	(a == b)#define SetChar(ch,c,a)	ch = c | a#define CHREF(wch)	wch#define CHDEREF(wch)	wch#define ARG_CH_T	NCURSES_CH_T#define CARG_CH_T	NCURSES_CH_T#define PUTC_DATA	int data = 0#define PUTC(a,b)	do { data = CharOf(ch); putc(data,b); } while (0)#define BLANK		(' '|A_NORMAL)#define ZEROS		('\0'|A_NORMAL)#define ISBLANK(ch)	(CharOf(ch) == ' ')#define isWidecExt(ch)	(0)#define if_WIDEC(code) /* nothing */#define L(ch)		ch#endif /* } */#define AttrOfD(ch)	AttrOf(CHDEREF(ch))#define CharOfD(ch)	CharOf(CHDEREF(ch))#define SetChar2(wch,ch)    SetChar(wch,ChCharOf(ch),ChAttrOf(ch))#define BLANK_ATTR	A_NORMAL#define BLANK_TEXT	L(' ')#define CHANGED     -1#define LEGALYX(w, y, x) \	      ((w) != 0 && \		((x) >= 0 && (x) <= (w)->_maxx && \		 (y) >= 0 && (y) <= (w)->_maxy))#define CHANGED_CELL(line,col) \	if (line->firstchar == _NOCHANGE) \		line->firstchar = line->lastchar = col; \	else if ((col) < line->firstchar) \		line->firstchar = col; \	else if ((col) > line->lastchar) \		line->lastchar = col#define CHANGED_RANGE(line,start,end) \	if (line->firstchar == _NOCHANGE \	 || line->firstchar > (start)) \		line->firstchar = start; \	if (line->lastchar == _NOCHANGE \	 || line->lastchar < (end)) \		line->lastchar = end#define CHANGED_TO_EOL(line,start,end) \	if (line->firstchar == _NOCHANGE \	 || line->firstchar > (start)) \		line->firstchar = start; \	line->lastchar = end#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))#define FreeIfNeeded(p)  if ((p) != 0) free(p)/* FreeAndNull() is not a comma-separated expression because some compilers * do not accept a mixture of void with values. */#define FreeAndNull(p)   free(p); p = 0#include <nc_alloc.h>/* * Prefixes for call/return points of library function traces.  We use these to * instrument the public functions so that the traces can be easily transformed * into regression scripts. */#define T_CALLED(fmt) "called {" fmt#define T_CREATE(fmt) "create :" fmt#define T_RETURN(fmt) "return }" fmt#ifdef TRACE#define START_TRACE() \	if ((_nc_tracing & TRACE_MAXIMUM) == 0) { \	    int t = _nc_getenv_num("NCURSES_TRACE"); \	    if (t >= 0) \		trace((unsigned) t); \	}#define TR(n, a)	if (_nc_tracing & (n)) _tracef a

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -