xref: /openbsd-src/lib/libcurses/curses.h (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1 /*	$OpenBSD: curses.h,v 1.59 2001/02/28 22:58:53 millert Exp $	*/
2 
3 /****************************************************************************
4  * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.              *
5  *                                                                          *
6  * Permission is hereby granted, free of charge, to any person obtaining a  *
7  * copy of this software and associated documentation files (the            *
8  * "Software"), to deal in the Software without restriction, including      *
9  * without limitation the rights to use, copy, modify, merge, publish,      *
10  * distribute, distribute with modifications, sublicense, and/or sell       *
11  * copies of the Software, and to permit persons to whom the Software is    *
12  * furnished to do so, subject to the following conditions:                 *
13  *                                                                          *
14  * The above copyright notice and this permission notice shall be included  *
15  * in all copies or substantial portions of the Software.                   *
16  *                                                                          *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24  *                                                                          *
25  * Except as contained in this notice, the name(s) of the above copyright   *
26  * holders shall not be used in advertising or otherwise to promote the     *
27  * sale, use or other dealings in this Software without prior written       *
28  * authorization.                                                           *
29  ****************************************************************************/
30 
31 /****************************************************************************
32  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
33  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
34  ****************************************************************************/
35 
36 /* $From: curses.h.in,v 1.97 2000/12/10 02:00:24 tom Exp $ */
37 
38 #ifndef __NCURSES_H
39 #define __NCURSES_H
40 
41 #define CURSES 1
42 #define CURSES_H 1
43 
44 /* This should be defined for the enhanced functionality to be visible.
45  * However, none of the wide-character (enhanced) functionality is implemented.
46  * So we do not define it (yet).
47 #define _XOPEN_CURSES 1
48  */
49 
50 /* These are defined only in curses.h, and are used for conditional compiles */
51 #define NCURSES_VERSION_MAJOR 5
52 #define NCURSES_VERSION_MINOR 2
53 #define NCURSES_VERSION_PATCH 20010224
54 
55 /* This is defined in more than one ncurses header, for identification */
56 #undef  NCURSES_VERSION
57 #define NCURSES_VERSION "5.2"
58 
59 #if !defined(NCURSES_IMPEXP)
60 #  define NCURSES_IMPEXP /* nothing */
61 #endif
62 #if !defined(NCURSES_API)
63 #  define NCURSES_API /* nothing */
64 #endif
65 #if !defined(NCURSES_EXPORT)
66 #  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
67 #endif
68 #if !defined(NCURSES_EXPORT_VAR)
69 #  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
70 #endif
71 
72 #ifdef NCURSES_NOMACROS
73 #define NCURSES_ATTR_T attr_t
74 #endif
75 
76 #ifndef NCURSES_ATTR_T
77 #define NCURSES_ATTR_T int
78 #endif
79 
80 #undef  NCURSES_CONST
81 #define NCURSES_CONST /*nothing*/
82 
83 #undef	NCURSES_COLOR_T
84 #define	NCURSES_COLOR_T short
85 
86 #undef	NCURSES_SIZE_T
87 #define	NCURSES_SIZE_T short
88 
89 typedef unsigned long chtype;
90 
91 #include <stdio.h>
92 #include <unctrl.h>
93 #include <stdarg.h>	/* we need va_list */
94 #ifdef _XOPEN_SOURCE_EXTENDED
95 #include <stddef.h>	/* we want wchar_t */
96 #endif /* _XOPEN_SOURCE_EXTENDED */
97 
98 /* XSI and SVr4 specify that curses implements 'bool'.  However, C++ may also
99  * implement it.  If so, we must use the C++ compiler's type to avoid conflict
100  * with other interfaces.
101  */
102 
103 #undef TRUE
104 #define TRUE    1
105 
106 #undef FALSE
107 #define FALSE   0
108 
109 #if !defined(__cplusplus)
110 #undef bool
111 typedef unsigned char bool;
112 #endif
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
118 /*
119  * XSI attributes.  In the ncurses implementation, they are identical to the
120  * A_ attributes.
121  */
122 #define WA_ATTRIBUTES	A_ATTRIBUTES
123 #define WA_NORMAL	A_NORMAL
124 #define WA_STANDOUT	A_STANDOUT
125 #define WA_UNDERLINE	A_UNDERLINE
126 #define WA_REVERSE	A_REVERSE
127 #define WA_BLINK	A_BLINK
128 #define WA_DIM		A_DIM
129 #define WA_BOLD		A_BOLD
130 #define WA_ALTCHARSET	A_ALTCHARSET
131 #define WA_INVIS	A_INVIS
132 #define WA_PROTECT	A_PROTECT
133 #define WA_HORIZONTAL	A_HORIZONTAL
134 #define WA_LEFT		A_LEFT
135 #define WA_LOW		A_LOW
136 #define WA_RIGHT	A_RIGHT
137 #define WA_TOP		A_TOP
138 #define WA_VERTICAL	A_VERTICAL
139 
140 /* colors */
141 extern NCURSES_EXPORT_VAR(int) COLORS;
142 extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
143 
144 #define COLOR_BLACK	0
145 #define COLOR_RED	1
146 #define COLOR_GREEN	2
147 #define COLOR_YELLOW	3
148 #define COLOR_BLUE	4
149 #define COLOR_MAGENTA	5
150 #define COLOR_CYAN	6
151 #define COLOR_WHITE	7
152 
153 /* line graphics */
154 
155 extern NCURSES_EXPORT_VAR(chtype) acs_map[];
156 
157 /* VT100 symbols begin here */
158 #define ACS_ULCORNER	(acs_map['l'])	/* upper left corner */
159 #define ACS_LLCORNER	(acs_map['m'])	/* lower left corner */
160 #define ACS_URCORNER	(acs_map['k'])	/* upper right corner */
161 #define ACS_LRCORNER	(acs_map['j'])	/* lower right corner */
162 #define ACS_LTEE	(acs_map['t'])	/* tee pointing right */
163 #define ACS_RTEE	(acs_map['u'])	/* tee pointing left */
164 #define ACS_BTEE	(acs_map['v'])	/* tee pointing up */
165 #define ACS_TTEE	(acs_map['w'])	/* tee pointing down */
166 #define ACS_HLINE	(acs_map['q'])	/* horizontal line */
167 #define ACS_VLINE	(acs_map['x'])	/* vertical line */
168 #define ACS_PLUS	(acs_map['n'])	/* large plus or crossover */
169 #define ACS_S1		(acs_map['o'])	/* scan line 1 */
170 #define ACS_S9		(acs_map['s'])	/* scan line 9 */
171 #define ACS_DIAMOND	(acs_map['`'])	/* diamond */
172 #define ACS_CKBOARD	(acs_map['a'])	/* checker board (stipple) */
173 #define ACS_DEGREE	(acs_map['f'])	/* degree symbol */
174 #define ACS_PLMINUS	(acs_map['g'])	/* plus/minus */
175 #define ACS_BULLET	(acs_map['~'])	/* bullet */
176 /* Teletype 5410v1 symbols begin here */
177 #define ACS_LARROW	(acs_map[','])	/* arrow pointing left */
178 #define ACS_RARROW	(acs_map['+'])	/* arrow pointing right */
179 #define ACS_DARROW	(acs_map['.'])	/* arrow pointing down */
180 #define ACS_UARROW	(acs_map['-'])	/* arrow pointing up */
181 #define ACS_BOARD	(acs_map['h'])	/* board of squares */
182 #define ACS_LANTERN	(acs_map['i'])	/* lantern symbol */
183 #define ACS_BLOCK	(acs_map['0'])	/* solid square block */
184 /*
185  * These aren't documented, but a lot of System Vs have them anyway
186  * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
187  * The ACS_names may not match AT&T's, our source didn't know them.
188  */
189 #define ACS_S3		(acs_map['p'])	/* scan line 3 */
190 #define ACS_S7		(acs_map['r'])	/* scan line 7 */
191 #define ACS_LEQUAL	(acs_map['y'])	/* less/equal */
192 #define ACS_GEQUAL	(acs_map['z'])	/* greater/equal */
193 #define ACS_PI		(acs_map['{'])	/* Pi */
194 #define ACS_NEQUAL	(acs_map['|'])	/* not equal */
195 #define ACS_STERLING	(acs_map['}'])	/* UK pound sign */
196 
197 /*
198  * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
199  * is the right, b is the bottom, and l is the left.  t, r, b, and l might
200  * be B (blank), S (single), D (double), or T (thick).  The subset defined
201  * here only uses B and S.
202  */
203 #define ACS_BSSB	ACS_ULCORNER
204 #define ACS_SSBB	ACS_LLCORNER
205 #define ACS_BBSS	ACS_URCORNER
206 #define ACS_SBBS	ACS_LRCORNER
207 #define ACS_SBSS	ACS_RTEE
208 #define ACS_SSSB	ACS_LTEE
209 #define ACS_SSBS	ACS_BTEE
210 #define ACS_BSSS	ACS_TTEE
211 #define ACS_BSBS	ACS_HLINE
212 #define ACS_SBSB	ACS_VLINE
213 #define ACS_SSSS	ACS_PLUS
214 
215 #if	!defined(ERR) || ((ERR) != -1)
216 #define ERR     (-1)
217 #endif
218 
219 #if	!defined(OK) || ((OK) != 0)
220 #define OK      (0)
221 #endif
222 
223 /* values for the _flags member */
224 #define _SUBWIN         0x01	/* is this a sub-window? */
225 #define _ENDLINE        0x02	/* is the window flush right? */
226 #define _FULLWIN        0x04	/* is the window full-screen? */
227 #define _SCROLLWIN      0x08	/* bottom edge is at screen bottom? */
228 #define _ISPAD	        0x10	/* is this window a pad? */
229 #define _HASMOVED       0x20	/* has cursor moved since last refresh? */
230 #define _WRAPPED        0x40	/* cursor was just wrappped */
231 
232 /*
233  * this value is used in the firstchar and lastchar fields to mark
234  * unchanged lines
235  */
236 #define _NOCHANGE       -1
237 
238 /*
239  * this value is used in the oldindex field to mark lines created by insertions
240  * and scrolls.
241  */
242 #define _NEWINDEX	-1
243 
244 typedef struct screen  SCREEN;
245 typedef struct _win_st WINDOW;
246 
247 typedef	chtype	attr_t;		/* ...must be at least as wide as chtype */
248 
249 #ifdef _XOPEN_SOURCE_EXTENDED
250 #ifndef _WCHAR_T
251 typedef unsigned long wchar_t;
252 #endif /* _WCHAR_T */
253 #ifndef _WINT_T
254 typedef long int wint_t;
255 #endif /* _WINT_T */
256 
257 #define CCHARW_MAX	5
258 typedef struct
259 {
260     attr_t	attr;
261     wchar_t	chars[CCHARW_MAX];
262 }
263 cchar_t;
264 #endif /* _XOPEN_SOURCE_EXTENDED */
265 
266 struct ldat
267 {
268 	chtype  *text;		/* text of the line */
269 	NCURSES_SIZE_T firstchar; /* first changed character in the line */
270 	NCURSES_SIZE_T lastchar; /* last changed character in the line */
271 	NCURSES_SIZE_T oldindex; /* index of the line at last update */
272 };
273 
274 struct _win_st
275 {
276 	NCURSES_SIZE_T _cury, _curx; /* current cursor position */
277 
278 	/* window location and size */
279 	NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */
280 	NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */
281 
282 	short   _flags;		/* window state flags */
283 
284 	/* attribute tracking */
285 	attr_t  _attrs;		/* current attribute for non-space character */
286 	chtype  _bkgd;		/* current background char/attribute pair */
287 
288 	/* option values set by user */
289 	bool	_notimeout;	/* no time out on function-key entry? */
290 	bool    _clear;		/* consider all data in the window invalid? */
291 	bool    _leaveok;	/* OK to not reset cursor on exit? */
292 	bool    _scroll;	/* OK to scroll this window? */
293 	bool    _idlok;		/* OK to use insert/delete line? */
294 	bool    _idcok;		/* OK to use insert/delete char? */
295 	bool	_immed;		/* window in immed mode? (not yet used) */
296 	bool	_sync;		/* window in sync mode? */
297 	bool    _use_keypad;    /* process function keys into KEY_ symbols? */
298 	int	_delay;		/* 0 = nodelay, <0 = blocking, >0 = delay */
299 
300 	struct ldat *_line;	/* the actual line data */
301 
302 	/* global screen state */
303 	NCURSES_SIZE_T _regtop;	/* top line of scrolling region */
304 	NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */
305 
306 	/* these are used only if this is a sub-window */
307 	int	_parx;		/* x coordinate of this window in parent */
308 	int	_pary;		/* y coordinate of this window in parent */
309 	WINDOW	*_parent;	/* pointer to parent if a sub-window */
310 
311 	/* these are used only if this is a pad */
312 	struct pdat
313 	{
314 	    NCURSES_SIZE_T _pad_y,      _pad_x;
315 	    NCURSES_SIZE_T _pad_top,    _pad_left;
316 	    NCURSES_SIZE_T _pad_bottom, _pad_right;
317 	} _pad;
318 
319 	NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
320 };
321 
322 extern NCURSES_EXPORT_VAR(WINDOW *)   stdscr;
323 extern NCURSES_EXPORT_VAR(WINDOW *)   curscr;
324 extern NCURSES_EXPORT_VAR(WINDOW *)   newscr;
325 
326 extern NCURSES_EXPORT_VAR(int)	LINES;
327 extern NCURSES_EXPORT_VAR(int)	COLS;
328 extern NCURSES_EXPORT_VAR(int)	TABSIZE;
329 
330 /*
331  * This global was an undocumented feature under AIX curses.
332  */
333 extern NCURSES_EXPORT_VAR(int) ESCDELAY;	/* ESC expire time in milliseconds */
334 
335 extern NCURSES_EXPORT_VAR(char) ttytype[];	/* needed for backward compatibility */
336 
337 /*
338  * These functions are extensions - not in XSI Curses.
339  */
340 extern NCURSES_EXPORT(char *) keybound (int, int);
341 extern NCURSES_EXPORT(const char *) curses_version (void);
342 extern NCURSES_EXPORT(int) assume_default_colors (int, int);
343 extern NCURSES_EXPORT(int) define_key (char *, int);
344 extern NCURSES_EXPORT(int) keyok (int, bool);
345 extern NCURSES_EXPORT(int) resizeterm (int, int);
346 extern NCURSES_EXPORT(int) use_default_colors (void);
347 extern NCURSES_EXPORT(int) use_extended_names (bool);
348 extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
349 
350 /*
351  * GCC (and some other compilers) define '__attribute__'; we're using this
352  * macro to alert the compiler to flag inconsistencies in printf/scanf-like
353  * function calls.  Just in case '__attribute__' isn't defined, make a dummy.
354  * G++ doesn't accept it anyway.
355  */
356 #if !defined(__GNUC__) && !defined(__attribute__)
357 #define __attribute__(p) /* nothing */
358 #endif
359 
360 /*
361  * For g++, turn off our macros that use __attribute__ (g++ recognizes some
362  * of them, but not at the same version levels as gcc).
363  */
364 #ifdef __cplusplus
365 #undef GCC_NORETURN
366 #undef GCC_PRINTF
367 #undef GCC_SCANF
368 #undef GCC_UNUSED
369 #endif
370 
371 /*
372  * We cannot define these in ncurses_cfg.h, since they require parameters to be
373  * passed (that's non-portable).
374  */
375 #ifdef	GCC_PRINTF
376 #define GCC_PRINTFLIKE(fmt,var) __attribute__((__format__(printf,fmt,var)))
377 #else
378 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
379 #endif
380 
381 #ifdef	GCC_SCANF
382 #define GCC_SCANFLIKE(fmt,var)  __attribute__((__format__(scanf,fmt,var)))
383 #else
384 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
385 #endif
386 
387 #ifndef	GCC_NORETURN
388 #define	GCC_NORETURN /* nothing */
389 #endif
390 
391 #ifndef	GCC_UNUSED
392 #define	GCC_UNUSED /* nothing */
393 #endif
394 
395 /*
396  * Function prototypes.  This is the complete XSI Curses list of required
397  * functions.  Those marked `generated' will have sources generated from the
398  * macro definitions later in this file, in order to satisfy XPG4.2
399  * requirements.
400  */
401 
402 extern NCURSES_EXPORT(int) addch (const chtype);			/* generated */
403 extern NCURSES_EXPORT(int) addchnstr (const chtype *, int);		/* generated */
404 extern NCURSES_EXPORT(int) addchstr (const chtype *);			/* generated */
405 extern NCURSES_EXPORT(int) addnstr (const char *, int);			/* generated */
406 extern NCURSES_EXPORT(int) addstr (const char *);			/* generated */
407 #ifdef _XOPEN_SOURCE_EXTENDED
408 extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int);		/* missing */
409 extern NCURSES_EXPORT(int) addwstr (const wchar_t *);			/* missing */
410 extern NCURSES_EXPORT(int) add_wch (const cchar_t *);			/* missing */
411 extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int);		/* missing */
412 extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *);		/* missing */
413 #endif /* _XOPEN_SOURCE_EXTENDED */
414 extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T);			/* generated */
415 extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T);			/* generated */
416 extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T);			/* generated */
417 extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *);	/* generated */
418 extern NCURSES_EXPORT(int) attr_off (attr_t, void *);			/* generated */
419 extern NCURSES_EXPORT(int) attr_on (attr_t, void *);			/* generated */
420 extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *);		/* generated */
421 extern NCURSES_EXPORT(int) baudrate (void);				/* implemented */
422 extern NCURSES_EXPORT(int) beep  (void);				/* implemented */
423 extern NCURSES_EXPORT(int) bkgd (chtype);				/* generated */
424 extern NCURSES_EXPORT(void) bkgdset (chtype);				/* generated */
425 #ifdef _XOPEN_SOURCE_EXTENDED
426 extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *);		/* missing */
427 extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *);			/* missing */
428 #endif /* _XOPEN_SOURCE_EXTENDED */
429 extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype);	/* generated */
430 #ifdef _XOPEN_SOURCE_EXTENDED
431 extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*);	/* missing */
432 #endif /* _XOPEN_SOURCE_EXTENDED */
433 extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype);		/* generated */
434 #ifdef _XOPEN_SOURCE_EXTENDED
435 extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *);	/* missing */
436 #endif /* _XOPEN_SOURCE_EXTENDED */
437 extern NCURSES_EXPORT(bool) can_change_color (void);			/* implemented */
438 extern NCURSES_EXPORT(int) cbreak (void);				/* implemented */
439 extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *);	/* generated */
440 extern NCURSES_EXPORT(int) clear (void);				/* generated */
441 extern NCURSES_EXPORT(int) clearok (WINDOW *,bool);			/* implemented */
442 extern NCURSES_EXPORT(int) clrtobot (void);				/* generated */
443 extern NCURSES_EXPORT(int) clrtoeol (void);				/* generated */
444 extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*);	/* implemented */
445 extern NCURSES_EXPORT(int) color_set (short,void*);			/* generated */
446 extern NCURSES_EXPORT(int) COLOR_PAIR (int);				/* generated */
447 extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int);	/* implemented */
448 extern NCURSES_EXPORT(int) curs_set (int);				/* implemented */
449 extern NCURSES_EXPORT(int) def_prog_mode (void);			/* implemented */
450 extern NCURSES_EXPORT(int) def_shell_mode (void);			/* implemented */
451 extern NCURSES_EXPORT(int) delay_output (int);				/* implemented */
452 extern NCURSES_EXPORT(int) delch (void);				/* generated */
453 extern NCURSES_EXPORT(void) delscreen (SCREEN *);			/* implemented */
454 extern NCURSES_EXPORT(int) delwin (WINDOW *);				/* implemented */
455 extern NCURSES_EXPORT(int) deleteln (void);				/* generated */
456 extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int);	/* implemented */
457 extern NCURSES_EXPORT(int) doupdate (void);				/* implemented */
458 extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *);			/* implemented */
459 extern NCURSES_EXPORT(int) echo (void);					/* implemented */
460 extern NCURSES_EXPORT(int) echochar (const chtype);			/* generated */
461 extern NCURSES_EXPORT(int) erase (void);				/* generated */
462 #ifdef _XOPEN_SOURCE_EXTENDED
463 extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *);		/* missing */
464 extern NCURSES_EXPORT(int) erasewchar (wchar_t*);			/* missing */
465 #endif /* _XOPEN_SOURCE_EXTENDED */
466 extern NCURSES_EXPORT(int) endwin (void);				/* implemented */
467 extern NCURSES_EXPORT(char) erasechar (void);				/* implemented */
468 extern NCURSES_EXPORT(void) filter (void);				/* implemented */
469 extern NCURSES_EXPORT(int) flash (void);				/* implemented */
470 extern NCURSES_EXPORT(int) flushinp (void);				/* implemented */
471 extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *);			/* generated */
472 #ifdef _XOPEN_SOURCE_EXTENDED
473 extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *);			/* missing */
474 extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*);	/* missing */
475 #endif /* _XOPEN_SOURCE_EXTENDED */
476 extern NCURSES_EXPORT(int) getch (void);				/* generated */
477 extern NCURSES_EXPORT(int) getnstr (char *, int);			/* generated */
478 #ifdef _XOPEN_SOURCE_EXTENDED
479 extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int);			/* missing */
480 #endif /* _XOPEN_SOURCE_EXTENDED */
481 extern NCURSES_EXPORT(int) getstr (char *);				/* generated */
482 #ifdef _XOPEN_SOURCE_EXTENDED
483 extern NCURSES_EXPORT(int) get_wch (wint_t *);				/* missing */
484 #endif /* _XOPEN_SOURCE_EXTENDED */
485 extern NCURSES_EXPORT(WINDOW *) getwin (FILE *);			/* implemented */
486 #ifdef _XOPEN_SOURCE_EXTENDED
487 extern NCURSES_EXPORT(int) get_wstr (wint_t *);				/* missing */
488 #endif /* _XOPEN_SOURCE_EXTENDED */
489 extern NCURSES_EXPORT(int) halfdelay (int);				/* implemented */
490 extern NCURSES_EXPORT(bool) has_colors (void);				/* implemented */
491 extern NCURSES_EXPORT(bool) has_ic (void);				/* implemented */
492 extern NCURSES_EXPORT(bool) has_il (void);				/* implemented */
493 extern NCURSES_EXPORT(int) hline (chtype, int);				/* generated */
494 #ifdef _XOPEN_SOURCE_EXTENDED
495 extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int);		/* missing */
496 #endif /* _XOPEN_SOURCE_EXTENDED */
497 extern NCURSES_EXPORT(void) idcok (WINDOW *, bool);			/* implemented */
498 extern NCURSES_EXPORT(int) idlok (WINDOW *, bool);			/* implemented */
499 extern NCURSES_EXPORT(void) immedok (WINDOW *, bool);			/* implemented */
500 extern NCURSES_EXPORT(chtype) inch (void);				/* generated */
501 extern NCURSES_EXPORT(int) inchnstr (chtype *, int);			/* generated */
502 extern NCURSES_EXPORT(int) inchstr (chtype *);				/* generated */
503 extern NCURSES_EXPORT(WINDOW *) initscr (void);				/* implemented */
504 extern NCURSES_EXPORT(int) init_color (short,short,short,short);	/* implemented */
505 extern NCURSES_EXPORT(int) init_pair (short,short,short);		/* implemented */
506 extern NCURSES_EXPORT(int) innstr (char *, int);			/* generated */
507 #ifdef _XOPEN_SOURCE_EXTENDED
508 extern NCURSES_EXPORT(int) innwstr (wchar_t *, int);			/* missing */
509 #endif /* _XOPEN_SOURCE_EXTENDED */
510 extern NCURSES_EXPORT(int) insch (chtype);				/* generated */
511 extern NCURSES_EXPORT(int) insdelln (int);				/* generated */
512 extern NCURSES_EXPORT(int) insertln (void);				/* generated */
513 extern NCURSES_EXPORT(int) insnstr (const char *, int);			/* generated */
514 extern NCURSES_EXPORT(int) insstr (const char *);			/* generated */
515 extern NCURSES_EXPORT(int) instr (char *);				/* generated */
516 #ifdef _XOPEN_SOURCE_EXTENDED
517 extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int);		/* missing */
518 extern NCURSES_EXPORT(int) ins_wch (const cchar_t *);			/* missing */
519 extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *);			/* missing */
520 #endif /* _XOPEN_SOURCE_EXTENDED */
521 extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool);			/* implemented */
522 #ifdef _XOPEN_SOURCE_EXTENDED
523 extern NCURSES_EXPORT(int) inwstr (wchar_t *);				/* missing */
524 extern NCURSES_EXPORT(int) in_wch (NCURSES_CONST cchar_t *);		/* missing */
525 extern NCURSES_EXPORT(int) in_wchstr (NCURSES_CONST cchar_t *);		/* missing */
526 extern NCURSES_EXPORT(int) in_wchnstr (NCURSES_CONST cchar_t *, int);	/* missing */
527 #endif /* _XOPEN_SOURCE_EXTENDED */
528 extern NCURSES_EXPORT(bool) isendwin (void);				/* implemented */
529 extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int);		/* implemented */
530 extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *);			/* implemented */
531 extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);		/* implemented */
532 #ifdef _XOPEN_SOURCE_EXTENDED
533 extern NCURSES_EXPORT(char *) key_name (wchar_t);			/* missing */
534 #endif /* _XOPEN_SOURCE_EXTENDED */
535 extern NCURSES_EXPORT(int) keypad (WINDOW *,bool);			/* implemented */
536 extern NCURSES_EXPORT(char) killchar (void);				/* implemented */
537 #ifdef _XOPEN_SOURCE_EXTENDED
538 extern NCURSES_EXPORT(int) killwchar (wchar_t *);			/* missing */
539 #endif /* _XOPEN_SOURCE_EXTENDED */
540 extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool);			/* implemented */
541 extern NCURSES_EXPORT(char *) longname (void);				/* implemented */
542 extern NCURSES_EXPORT(int) meta (WINDOW *,bool);			/* implemented */
543 extern NCURSES_EXPORT(int) move (int, int);				/* generated */
544 extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype);		/* generated */
545 extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int);	/* generated */
546 extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *);	/* generated */
547 extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int);	/* generated */
548 extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *);		/* generated */
549 #ifdef _XOPEN_SOURCE_EXTENDED
550 extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int);	/* missing */
551 extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *);	/* missing */
552 extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *);	/* missing */
553 extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* missing */
554 extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *);	/* missing */
555 #endif /* _XOPEN_SOURCE_EXTENDED */
556 extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *);	/* generated */
557 extern NCURSES_EXPORT(int) mvcur (int,int,int,int);			/* implemented */
558 extern NCURSES_EXPORT(int) mvdelch (int, int);				/* generated */
559 extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int);		/* implemented */
560 extern NCURSES_EXPORT(int) mvgetch (int, int);				/* generated */
561 extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int);		/* generated */
562 #ifdef _XOPEN_SOURCE_EXTENDED
563 extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int);	/* missing */
564 #endif /* _XOPEN_SOURCE_EXTENDED */
565 extern NCURSES_EXPORT(int) mvgetstr (int, int, char *);			/* generated */
566 #ifdef _XOPEN_SOURCE_EXTENDED
567 extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *);		/* missing */
568 #endif /* _XOPEN_SOURCE_EXTENDED */
569 #ifdef _XOPEN_SOURCE_EXTENDED
570 extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *);		/* missing */
571 #endif /* _XOPEN_SOURCE_EXTENDED */
572 extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int);		/* generated */
573 #ifdef _XOPEN_SOURCE_EXTENDED
574 extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int);	/* missing */
575 #endif /* _XOPEN_SOURCE_EXTENDED */
576 extern NCURSES_EXPORT(chtype) mvinch (int, int);			/* generated */
577 extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int);	/* generated */
578 extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *);		/* generated */
579 extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int);		/* generated */
580 #ifdef _XOPEN_SOURCE_EXTENDED
581 extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int);	/* missing */
582 #endif /* _XOPEN_SOURCE_EXTENDED */
583 extern NCURSES_EXPORT(int) mvinsch (int, int, chtype);			/* generated */
584 extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int);	/* generated */
585 extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *);		/* generated */
586 extern NCURSES_EXPORT(int) mvinstr (int, int, char *);			/* generated */
587 #ifdef _XOPEN_SOURCE_EXTENDED
588 extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int);	/* missing */
589 extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *);	/* missing */
590 extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *);	/* missing */
591 extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *);		/* missing */
592 extern NCURSES_EXPORT(int) mvin_wch (int, int, NCURSES_CONST cchar_t *);	/* missing */
593 extern NCURSES_EXPORT(int) mvin_wchstr (int, int, NCURSES_CONST cchar_t *);	/* missing */
594 extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, NCURSES_CONST cchar_t *, int);	/* missing */
595 #endif /* _XOPEN_SOURCE_EXTENDED */
596 extern NCURSES_EXPORT(int) mvprintw (int,int, NCURSES_CONST char *,...)	/* implemented */
597 		GCC_PRINTFLIKE(3,4);
598 extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...)	/* implemented */
599 		GCC_SCANFLIKE(3,4);
600 extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int);		/* generated */
601 #ifdef _XOPEN_SOURCE_EXTENDED
602 extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int);	/* missing */
603 #endif /* _XOPEN_SOURCE_EXTENDED */
604 extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype);	/* generated */
605 extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */
606 extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *);	/* generated */
607 extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int);	/* generated */
608 extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *);	/* generated */
609 #ifdef _XOPEN_SOURCE_EXTENDED
610 extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* missing */
611 extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *);	/* missing */
612 extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *);	/* missing */
613 extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* missing */
614 extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *);	/* missing */
615 #endif /* _XOPEN_SOURCE_EXTENDED */
616 extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */
617 extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int);		/* generated */
618 extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int);		/* generated */
619 extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int);	/* generated */
620 #ifdef _XOPEN_SOURCE_EXTENDED
621 extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* missing */
622 #endif /* _XOPEN_SOURCE_EXTENDED */
623 extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *);	/* generated */
624 #ifdef _XOPEN_SOURCE_EXTENDED
625 extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *);	/* missing */
626 #endif /* _XOPEN_SOURCE_EXTENDED */
627 #ifdef _XOPEN_SOURCE_EXTENDED
628 extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *);	/* missing */
629 #endif /* _XOPEN_SOURCE_EXTENDED */
630 extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int);	/* generated */
631 #ifdef _XOPEN_SOURCE_EXTENDED
632 extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* missing */
633 #endif /* _XOPEN_SOURCE_EXTENDED */
634 extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int);			/* implemented */
635 extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int);			/* generated */
636 extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int);	/* generated */
637 extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *);		/* generated */
638 extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int);		/* generated */
639 #ifdef _XOPEN_SOURCE_EXTENDED
640 extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int);	/* missing */
641 #endif /* _XOPEN_SOURCE_EXTENDED */
642 extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype);		/* generated */
643 extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int);	/* generated */
644 extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *);		/* generated */
645 extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *);		/* generated */
646 #ifdef _XOPEN_SOURCE_EXTENDED
647 extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* missing */
648 extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *);	/* missing */
649 extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *);	/* missing */
650 extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *);		/* missing */
651 extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, NCURSES_CONST cchar_t *);	/* missing */
652 extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, NCURSES_CONST cchar_t *,int); /* missing */
653 extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, NCURSES_CONST cchar_t *);	/* missing */
654 #endif /* _XOPEN_SOURCE_EXTENDED */
655 extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, NCURSES_CONST char *,...)	/* implemented */
656 		GCC_PRINTFLIKE(4,5);
657 extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...)	/* implemented */
658 		GCC_SCANFLIKE(4,5);
659 extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int);	/* generated */
660 #ifdef _XOPEN_SOURCE_EXTENDED
661 extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* missing */
662 #endif /* _XOPEN_SOURCE_EXTENDED */
663 extern NCURSES_EXPORT(int) napms (int);					/* implemented */
664 extern NCURSES_EXPORT(WINDOW *) newpad (int,int);				/* implemented */
665 extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *);	/* implemented */
666 extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int);			/* implemented */
667 extern NCURSES_EXPORT(int) nl (void);					/* implemented */
668 extern NCURSES_EXPORT(int) nocbreak (void);				/* implemented */
669 extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool);			/* implemented */
670 extern NCURSES_EXPORT(int) noecho (void);				/* implemented */
671 extern NCURSES_EXPORT(int) nonl (void);					/* implemented */
672 extern NCURSES_EXPORT(void) noqiflush (void);				/* implemented */
673 extern NCURSES_EXPORT(int) noraw (void);				/* implemented */
674 extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool);			/* implemented */
675 extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *);		/* implemented */
676 extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *);		/* implemented */
677 extern NCURSES_EXPORT(int) pair_content (short,short*,short*);		/* implemented */
678 extern NCURSES_EXPORT(int) PAIR_NUMBER (int);				/* generated */
679 extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype);		/* implemented */
680 #ifdef _XOPEN_SOURCE_EXTENDED
681 extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *);	/* missing */
682 #endif /* _XOPEN_SOURCE_EXTENDED */
683 extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
684 extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int);	/* implemented */
685 extern NCURSES_EXPORT(int) printw (NCURSES_CONST char *,...)		/* implemented */
686 		GCC_PRINTFLIKE(1,2);
687 extern NCURSES_EXPORT(int) putp (const char *);				/* implemented */
688 extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *);			/* implemented */
689 extern NCURSES_EXPORT(void) qiflush (void);				/* implemented */
690 extern NCURSES_EXPORT(int) raw (void);					/* implemented */
691 extern NCURSES_EXPORT(int) redrawwin (WINDOW *);			/* generated */
692 extern NCURSES_EXPORT(int) refresh (void);				/* generated */
693 extern NCURSES_EXPORT(int) resetty (void);				/* implemented */
694 extern NCURSES_EXPORT(int) reset_prog_mode (void);			/* implemented */
695 extern NCURSES_EXPORT(int) reset_shell_mode (void);			/* implemented */
696 extern NCURSES_EXPORT(int) ripoffline (int, int (*init)(WINDOW *, int));	/* implemented */
697 extern NCURSES_EXPORT(int) savetty (void);				/* implemented */
698 extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...)		/* implemented */
699 		GCC_SCANFLIKE(1,2);
700 extern NCURSES_EXPORT(int) scr_dump (const char *);			/* implemented */
701 extern NCURSES_EXPORT(int) scr_init (const char *);			/* implemented */
702 extern NCURSES_EXPORT(int) scrl (int);					/* generated */
703 extern NCURSES_EXPORT(int) scroll (WINDOW *);				/* generated */
704 extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool);			/* implemented */
705 extern NCURSES_EXPORT(int) scr_restore (const char *);			/* implemented */
706 extern NCURSES_EXPORT(int) scr_set (const char *);			/* implemented */
707 #ifdef _XOPEN_SOURCE_EXTENDED
708 extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *);	/* missing */
709 #endif /* _XOPEN_SOURCE_EXTENDED */
710 extern NCURSES_EXPORT(int) setscrreg (int,int);				/* generated */
711 extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *);			/* implemented */
712 extern NCURSES_EXPORT(int) slk_attroff (const chtype);			/* implemented */
713 extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *);		/* generated:WIDEC */
714 extern NCURSES_EXPORT(int) slk_attron (const chtype);			/* implemented */
715 extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*);			/* generated:WIDEC */
716 extern NCURSES_EXPORT(int) slk_attrset (const chtype);			/* implemented */
717 extern NCURSES_EXPORT(attr_t) slk_attr (void);				/* implemented */
718 extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*);	/* implemented */
719 extern NCURSES_EXPORT(int) slk_clear (void);				/* implemented */
720 extern NCURSES_EXPORT(int) slk_color (short);				/* implemented */
721 extern NCURSES_EXPORT(int) slk_init (int);				/* implemented */
722 extern NCURSES_EXPORT(char *) slk_label (int);				/* implemented */
723 extern NCURSES_EXPORT(int) slk_noutrefresh (void);			/* implemented */
724 extern NCURSES_EXPORT(int) slk_refresh (void);				/* implemented */
725 extern NCURSES_EXPORT(int) slk_restore (void);				/* implemented */
726 extern NCURSES_EXPORT(int) slk_set (int,const char *,int);		/* implemented */
727 extern NCURSES_EXPORT(int) slk_touch (void);				/* implemented */
728 #ifdef _XOPEN_SOURCE_EXTENDED
729 extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int);	/* missing */
730 #endif /* _XOPEN_SOURCE_EXTENDED */
731 extern NCURSES_EXPORT(int) standout (void);				/* generated */
732 extern NCURSES_EXPORT(int) standend (void);				/* generated */
733 extern NCURSES_EXPORT(int) start_color (void);				/* implemented */
734 extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int);	/* implemented */
735 extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *,int,int,int,int);	/* implemented */
736 extern NCURSES_EXPORT(int) syncok (WINDOW *, bool);			/* implemented */
737 extern NCURSES_EXPORT(chtype) termattrs (void);				/* implemented */
738 extern NCURSES_EXPORT(attr_t) term_attrs (void);			/* missing */
739 extern NCURSES_EXPORT(char *) termname (void);				/* implemented */
740 extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);		/* implemented */
741 extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);		/* implemented */
742 extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);		/* implemented */
743 extern NCURSES_EXPORT(void) timeout (int);				/* generated */
744 extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int);		/* generated */
745 extern NCURSES_EXPORT(int) touchwin (WINDOW *);				/* generated */
746 extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);	/* implemented */
747 extern NCURSES_EXPORT(int) typeahead (int);				/* implemented */
748 extern NCURSES_EXPORT(int) ungetch (int);				/* implemented */
749 #ifdef _XOPEN_SOURCE_EXTENDED
750 extern NCURSES_EXPORT(int) unget_wch (const wchar_t);			/* missing */
751 #endif /* _XOPEN_SOURCE_EXTENDED */
752 extern NCURSES_EXPORT(int) untouchwin (WINDOW *);			/* generated */
753 extern NCURSES_EXPORT(void) use_env (bool);				/* implemented */
754 extern NCURSES_EXPORT(int) vidattr (chtype);				/* implemented */
755 extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *);		/* generated:WIDEC */
756 extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int));		/* implemented */
757 #ifdef _XOPEN_SOURCE_EXTENDED
758 extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* missing */
759 #endif /* _XOPEN_SOURCE_EXTENDED */
760 extern NCURSES_EXPORT(int) vline (chtype, int);				/* generated */
761 #ifdef _XOPEN_SOURCE_EXTENDED
762 extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int);		/* missing */
763 #endif /* _XOPEN_SOURCE_EXTENDED */
764 extern NCURSES_EXPORT(int) vwprintw (WINDOW *, NCURSES_CONST char *,va_list);	/* implemented */
765 extern NCURSES_EXPORT(int) vw_printw (WINDOW *, NCURSES_CONST char *,va_list);	/* generated */
766 extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list);	/* implemented */
767 extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list);	/* generated */
768 extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype);		/* implemented */
769 extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *const,int); /* implemented */
770 extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *);		/* generated */
771 extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *const,int);	/* implemented */
772 extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *);		/* generated */
773 #ifdef _XOPEN_SOURCE_EXTENDED
774 extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *);		/* missing */
775 extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int);	/* missing */
776 extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *);		/* missing */
777 extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int);	/* missing */
778 extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *);	/* missing */
779 #endif /* _XOPEN_SOURCE_EXTENDED */
780 extern NCURSES_EXPORT(int) wattron (WINDOW *, int);			/* generated */
781 extern NCURSES_EXPORT(int) wattroff (WINDOW *, int);			/* generated */
782 extern NCURSES_EXPORT(int) wattrset (WINDOW *, int);			/* generated */
783 extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *);	/* generated */
784 extern NCURSES_EXPORT(int) wattr_on (WINDOW *, NCURSES_CONST attr_t, void *);	/* implemented */
785 extern NCURSES_EXPORT(int) wattr_off (WINDOW *, NCURSES_CONST attr_t, void *);	/* implemented */
786 extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *);		/* generated */
787 extern NCURSES_EXPORT(int) wbkgd (WINDOW *,const chtype);		/* implemented */
788 extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype);			/* implemented */
789 #ifdef _XOPEN_SOURCE_EXTENDED
790 extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *);	/* missing */
791 extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *);		/* missing */
792 #endif /* _XOPEN_SOURCE_EXTENDED */
793 extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype);	/* implemented */
794 #ifdef _XOPEN_SOURCE_EXTENDED
795 extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*);	/* missing */
796 #endif /* _XOPEN_SOURCE_EXTENDED */
797 extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */
798 extern NCURSES_EXPORT(int) wclear (WINDOW *);				/* implemented */
799 extern NCURSES_EXPORT(int) wclrtobot (WINDOW *);			/* implemented */
800 extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *);			/* implemented */
801 extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*);		/* implemented */
802 extern NCURSES_EXPORT(void) wcursyncup (WINDOW *);			/* implemented */
803 extern NCURSES_EXPORT(int) wdelch (WINDOW *);				/* implemented */
804 extern NCURSES_EXPORT(int) wdeleteln (WINDOW *);			/* generated */
805 extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype);		/* implemented */
806 #ifdef _XOPEN_SOURCE_EXTENDED
807 extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *);	/* missing */
808 #endif /* _XOPEN_SOURCE_EXTENDED */
809 extern NCURSES_EXPORT(int) werase (WINDOW *);				/* implemented */
810 #ifdef _XOPEN_SOURCE_EXTENDED
811 extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *);		/* missing */
812 #endif /* _XOPEN_SOURCE_EXTENDED */
813 extern NCURSES_EXPORT(int) wgetch (WINDOW *);				/* implemented */
814 extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int);		/* implemented */
815 #ifdef _XOPEN_SOURCE_EXTENDED
816 extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int);		/* missing */
817 #endif /* _XOPEN_SOURCE_EXTENDED */
818 extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *);			/* generated */
819 #ifdef _XOPEN_SOURCE_EXTENDED
820 extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *);		/* missing */
821 extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *);		/* missing */
822 #endif /* _XOPEN_SOURCE_EXTENDED */
823 extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int);		/* implemented */
824 #ifdef _XOPEN_SOURCE_EXTENDED
825 extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int);	/* missing */
826 #endif /* _XOPEN_SOURCE_EXTENDED */
827 extern NCURSES_EXPORT(chtype) winch (WINDOW *);				/* implemented */
828 extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int);		/* implemented */
829 extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *);		/* generated */
830 extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int);		/* implemented */
831 #ifdef _XOPEN_SOURCE_EXTENDED
832 extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int);		/* missing */
833 #endif /* _XOPEN_SOURCE_EXTENDED */
834 extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype);			/* implemented */
835 extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int);			/* implemented */
836 extern NCURSES_EXPORT(int) winsertln (WINDOW *);			/* generated */
837 extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int);	/* implemented */
838 extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *);		/* generated */
839 extern NCURSES_EXPORT(int) winstr (WINDOW *, char *);			/* generated */
840 #ifdef _XOPEN_SOURCE_EXTENDED
841 extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int);	/* missing */
842 extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *);	/* missing */
843 extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *);	/* missing */
844 extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *);		/* missing */
845 extern NCURSES_EXPORT(int) win_wch (WINDOW *, NCURSES_CONST cchar_t *);	/* missing */
846 extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, NCURSES_CONST cchar_t *, int);	/* missing */
847 extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, NCURSES_CONST cchar_t *);	/* missing */
848 #endif /* _XOPEN_SOURCE_EXTENDED */
849 extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int);			/* implemented */
850 extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *);			/* implemented */
851 extern NCURSES_EXPORT(int) wprintw (WINDOW *, NCURSES_CONST char *,...)	/* implemented */
852 		GCC_PRINTFLIKE(2,3);
853 extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int);		/* implemented */
854 extern NCURSES_EXPORT(int) wrefresh (WINDOW *);				/* implemented */
855 extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...)	/* implemented */
856 		GCC_SCANFLIKE(2,3);
857 extern NCURSES_EXPORT(int) wscrl (WINDOW *,int);			/* implemented */
858 extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int);		/* implemented */
859 extern NCURSES_EXPORT(int) wstandout (WINDOW *);			/* generated */
860 extern NCURSES_EXPORT(int) wstandend (WINDOW *);			/* generated */
861 extern NCURSES_EXPORT(void) wsyncdown (WINDOW *);			/* implemented */
862 extern NCURSES_EXPORT(void) wsyncup (WINDOW *);				/* implemented */
863 extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int);			/* implemented */
864 extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int);		/* implemented */
865 #ifdef _XOPEN_SOURCE_EXTENDED
866 extern NCURSES_EXPORT(wchar_t *) wunctrl (cchar_t *);			/* missing */
867 #endif /* _XOPEN_SOURCE_EXTENDED */
868 extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int);		/* implemented */
869 #ifdef _XOPEN_SOURCE_EXTENDED
870 extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int);	/* missing */
871 #endif /* _XOPEN_SOURCE_EXTENDED */
872 
873 extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool);              /* generated */
874 
875 /* attributes */
876 
877 #define NCURSES_BITS(mask,shift) ((mask) << ((shift) + 8))
878 
879 #define A_NORMAL	0L
880 #define A_ATTRIBUTES	NCURSES_BITS(~(1UL - 1UL),0)
881 #define A_CHARTEXT	(NCURSES_BITS(1UL,0) - 1UL)
882 #define A_COLOR		NCURSES_BITS(((1UL) << 8) - 1UL,0)
883 #define A_STANDOUT	NCURSES_BITS(1UL,8)
884 #define A_UNDERLINE	NCURSES_BITS(1UL,9)
885 #define A_REVERSE	NCURSES_BITS(1UL,10)
886 #define A_BLINK		NCURSES_BITS(1UL,11)
887 #define A_DIM		NCURSES_BITS(1UL,12)
888 #define A_BOLD		NCURSES_BITS(1UL,13)
889 #define A_ALTCHARSET	NCURSES_BITS(1UL,14)
890 #define A_INVIS		NCURSES_BITS(1UL,15)
891 
892 /* Tradeoff on 32-bit machines ('protect' vs widec).  The others (e.g., left
893  * highlight are not implemented in any terminal descriptions, anyway.
894  */
895 #if ((16 + 8) < 32)
896 #define A_PROTECT	NCURSES_BITS(1UL,16)
897 #define A_HORIZONTAL	NCURSES_BITS(1UL,17)
898 #define A_LEFT		NCURSES_BITS(1UL,18)
899 #define A_LOW		NCURSES_BITS(1UL,19)
900 #define A_RIGHT		NCURSES_BITS(1UL,20)
901 #define A_TOP		NCURSES_BITS(1UL,21)
902 #define A_VERTICAL	NCURSES_BITS(1UL,22)
903 #else
904 #define A_PROTECT	0L
905 #define A_HORIZONTAL	0L
906 #define A_LEFT		0L
907 #define A_LOW		0L
908 #define A_RIGHT		0L
909 #define A_TOP		0L
910 #define A_VERTICAL	0L
911 #endif
912 
913 #define COLOR_PAIR(n)	NCURSES_BITS(n, 0)
914 #define PAIR_NUMBER(a)	(((a) & A_COLOR) >> 8)
915 
916 /*
917  * pseudo functions
918  */
919 #define wgetstr(w, s)		wgetnstr(w, s, -1)
920 #define getnstr(s, n)		wgetnstr(stdscr, s, n)
921 
922 #define setterm(term)		setupterm(term, 1, (int *)0)
923 
924 #define fixterm()		reset_prog_mode()
925 #define resetterm()		reset_shell_mode()
926 #define saveterm()		def_prog_mode()
927 #define crmode()		cbreak()
928 #define nocrmode()		nocbreak()
929 #define gettmode()
930 
931 #define getyx(win,y,x)   	(y = (win)?(win)->_cury:ERR, x = (win)?(win)->_curx:ERR)
932 #define getbegyx(win,y,x)	(y = (win)?(win)->_begy:ERR, x = (win)?(win)->_begx:ERR)
933 #define getmaxyx(win,y,x)	(y = (win)?((win)->_maxy + 1):ERR, x = (win)?((win)->_maxx + 1):ERR)
934 #define getparyx(win,y,x)	(y = (win)?(win)->_pary:ERR, x = (win)?(win)->_parx:ERR)
935 #define getsyx(y,x) do { if(newscr->_leaveok) (y)=(x)=-1; \
936 			 else getyx(newscr,(y),(x)); \
937 		    } while(0)
938 #define setsyx(y,x) do { if((y)==-1 && (x)==-1) newscr->_leaveok=TRUE; \
939 			 else {newscr->_leaveok=FALSE;wmove(newscr,(y),(x));} \
940 		    } while(0)
941 
942 /* It seems older SYSV curses versions define these */
943 #define getattrs(win)		((win)?(win)->_attrs:A_NORMAL)
944 #define getcurx(win)		((win)?(win)->_curx:ERR)
945 #define getcury(win)		((win)?(win)->_cury:ERR)
946 #define getbegx(win)		((win)?(win)->_begx:ERR)
947 #define getbegy(win)		((win)?(win)->_begy:ERR)
948 #define getmaxx(win)		((win)?((win)->_maxx + 1):ERR)
949 #define getmaxy(win)		((win)?((win)->_maxy + 1):ERR)
950 #define getparx(win)		((win)?(win)->_parx:ERR)
951 #define getpary(win)		((win)?(win)->_pary:ERR)
952 
953 #define wstandout(win)      	(wattrset(win,A_STANDOUT))
954 #define wstandend(win)      	(wattrset(win,A_NORMAL))
955 #define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
956 
957 #define wattron(win,at)		wattr_on(win, at, (void *)0)
958 #define wattroff(win,at)	wattr_off(win, at, (void *)0)
959 #define wattrset(win,at)    	((win)->_attrs = (at))
960 
961 #define scroll(win)		wscrl(win,1)
962 
963 #define touchwin(win)		wtouchln((win), 0, getmaxy(win), 1)
964 #define touchline(win, s, c)	wtouchln((win), s, c, 1)
965 #define untouchwin(win)		wtouchln((win), 0, getmaxy(win), 0)
966 
967 #define box(win, v, h)		wborder(win, v, v, h, h, 0, 0, 0, 0)
968 #define border(ls, rs, ts, bs, tl, tr, bl, br)	wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
969 #define hline(ch, n)		whline(stdscr, ch, n)
970 #define vline(ch, n)		wvline(stdscr, ch, n)
971 
972 #define winstr(w, s)		winnstr(w, s, -1)
973 #define winchstr(w, s)		winchnstr(w, s, -1)
974 #define winsstr(w, s)		winsnstr(w, s, -1)
975 
976 #define redrawwin(win)		wredrawln(win, 0, (win)->_maxy+1)
977 #define waddstr(win,str)	waddnstr(win,str,-1)
978 #define waddchstr(win,str)	waddchnstr(win,str,-1)
979 
980 /*
981  * pseudo functions for standard screen
982  */
983 
984 #define addch(ch)      		waddch(stdscr,ch)
985 #define addchnstr(str,n)	waddchnstr(stdscr,str,n)
986 #define addchstr(str)		waddchstr(stdscr,str)
987 #define addnstr(str,n)		waddnstr(stdscr,str,n)
988 #define addstr(str)    		waddnstr(stdscr,str,-1)
989 #define attroff(at)    		wattroff(stdscr,at)
990 #define attron(at)     		wattron(stdscr,at)
991 #define attrset(at)    		wattrset(stdscr,at)
992 #define bkgd(ch)		wbkgd(stdscr,ch)
993 #define bkgdset(ch)		wbkgdset(stdscr,ch)
994 #define clear()        		wclear(stdscr)
995 #define clrtobot()     		wclrtobot(stdscr)
996 #define clrtoeol()     		wclrtoeol(stdscr)
997 #define color_set(c,o)		wcolor_set(stdscr,c,o)
998 #define delch()        		wdelch(stdscr)
999 #define deleteln()     		winsdelln(stdscr,-1)
1000 #define echochar(c)		wechochar(stdscr,c)
1001 #define erase()        		werase(stdscr)
1002 #define getch()        		wgetch(stdscr)
1003 #define getstr(str)    		wgetstr(stdscr,str)
1004 #define inch()       		winch(stdscr)
1005 #define inchnstr(s,n)		winchnstr(stdscr,s,n)
1006 #define inchstr(s)		winchstr(stdscr,s)
1007 #define innstr(s,n)		winnstr(stdscr,s,n)
1008 #define insch(c)       		winsch(stdscr,c)
1009 #define insdelln(n)		winsdelln(stdscr,n)
1010 #define insertln()     		winsdelln(stdscr,1)
1011 #define insnstr(s,n)		winsnstr(stdscr,s,n)
1012 #define insstr(s)		winsstr(stdscr,s)
1013 #define instr(s)		winstr(stdscr,s)
1014 #define move(y,x)     		wmove(stdscr,y,x)
1015 #define refresh()      		wrefresh(stdscr)
1016 #define scrl(n)			wscrl(stdscr,n)
1017 #define setscrreg(t,b) 		wsetscrreg(stdscr,t,b)
1018 #define standend()     		wstandend(stdscr)
1019 #define standout()     		wstandout(stdscr)
1020 #define timeout(delay)		wtimeout(stdscr,delay)
1021 #define wdeleteln(win)     	winsdelln(win,-1)
1022 #define winsertln(win)     	winsdelln(win,1)
1023 
1024 /*
1025  * mv functions
1026  */
1027 
1028 #define mvwaddch(win,y,x,ch)    	(wmove(win,y,x) == ERR ? ERR : waddch(win,ch))
1029 #define mvwaddchnstr(win,y,x,str,n)	(wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n))
1030 #define mvwaddchstr(win,y,x,str)  	(wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1))
1031 #define mvwaddnstr(win,y,x,str,n)	(wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n))
1032 #define mvwaddstr(win,y,x,str)  	(wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1))
1033 #define mvwdelch(win,y,x)       	(wmove(win,y,x) == ERR ? ERR : wdelch(win))
1034 #define mvwgetch(win,y,x)       	(wmove(win,y,x) == ERR ? ERR : wgetch(win))
1035 #define mvwgetnstr(win,y,x,str,n)    	(wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n))
1036 #define mvwgetstr(win,y,x,str)      	(wmove(win,y,x) == ERR ? ERR : wgetstr(win,str))
1037 #define mvwhline(win,y,x,c,n)     	(wmove(win,y,x) == ERR ? ERR : whline(win,c,n))
1038 #define mvwinch(win,y,x)        	(wmove(win,y,x) == ERR ? (chtype)ERR : winch(win))
1039 #define mvwinchnstr(win,y,x,s,n)	(wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n))
1040 #define mvwinchstr(win,y,x,s)		(wmove(win,y,x) == ERR ? ERR : winchstr(win,s))
1041 #define mvwinnstr(win,y,x,s,n)		(wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n))
1042 #define mvwinsch(win,y,x,c)     	(wmove(win,y,x) == ERR ? ERR : winsch(win,c))
1043 #define mvwinsnstr(win,y,x,s,n)		(wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n))
1044 #define mvwinsstr(win,y,x,s)		(wmove(win,y,x) == ERR ? ERR : winsstr(win,s))
1045 #define mvwinstr(win,y,x,s)		(wmove(win,y,x) == ERR ? ERR : winstr(win,s))
1046 #define mvwvline(win,y,x,c,n)     	(wmove(win,y,x) == ERR ? ERR : wvline(win,c,n))
1047 
1048 #define mvaddch(y,x,ch)         	mvwaddch(stdscr,y,x,ch)
1049 #define mvaddchnstr(y,x,str,n)		mvwaddchnstr(stdscr,y,x,str,n)
1050 #define mvaddchstr(y,x,str)		mvwaddchstr(stdscr,y,x,str)
1051 #define mvaddnstr(y,x,str,n)		mvwaddnstr(stdscr,y,x,str,n)
1052 #define mvaddstr(y,x,str)       	mvwaddstr(stdscr,y,x,str)
1053 #define mvdelch(y,x)            	mvwdelch(stdscr,y,x)
1054 #define mvgetch(y,x)            	mvwgetch(stdscr,y,x)
1055 #define mvgetnstr(y,x,str,n)		mvwgetnstr(stdscr,y,x,str,n)
1056 #define mvgetstr(y,x,str)           	mvwgetstr(stdscr,y,x,str)
1057 #define mvhline(y,x,c,n)		mvwhline(stdscr,y,x,c,n)
1058 #define mvinch(y,x)             	mvwinch(stdscr,y,x)
1059 #define mvinchnstr(y,x,s,n)		mvwinchnstr(stdscr,y,x,s,n)
1060 #define mvinchstr(y,x,s)		mvwinchstr(stdscr,y,x,s)
1061 #define mvinnstr(y,x,s,n)		mvwinnstr(stdscr,y,x,s,n)
1062 #define mvinsch(y,x,c)          	mvwinsch(stdscr,y,x,c)
1063 #define mvinsnstr(y,x,s,n)		mvwinsnstr(stdscr,y,x,s,n)
1064 #define mvinsstr(y,x,s)			mvwinsstr(stdscr,y,x,s)
1065 #define mvinstr(y,x,s)			mvwinstr(stdscr,y,x,s)
1066 #define mvvline(y,x,c,n)		mvwvline(stdscr,y,x,c,n)
1067 
1068 /*
1069  * XSI curses macros for XPG4 conformance.
1070  * The underlying functions needed to make these work are:
1071  * waddnwstr(), waddchnwstr(), wadd_wch(), wborder_set(), wchgat(),
1072  * wecho_wchar(), wgetn_wstr(), wget_wch(), whline_set(), vhline_set(),
1073  * winnwstr(), wins_nwstr(), wins_wch(), win_wch(), win_wchnstr().
1074  * Except for wchgat(), these are not yet implemented.  They will be someday.
1075  */
1076 #define add_wch(c)			wadd_wch(stdscr,c)
1077 #define addnwstr(wstr,n)		waddnwstr(stdscr,wstr,n)
1078 #define addwstr(wstr,n)			waddnwstr(stdscr,wstr,-1)
1079 #define attr_get(a,pair,opts)		wattr_get(stdscr,a,pair,opts)
1080 #define attr_off(a,opts)		wattr_off(stdscr,a,opts)
1081 #define attr_on(a,opts)			wattr_on(stdscr,a,opts)
1082 #define attr_set(a,pair,opts)		wattr_set(stdscr,a,pair,opts)
1083 #define box_set(w,v,h)			wborder_set(w,v,v,h,h,0,0,0,0)
1084 #define chgat(n,a,c,o)			wchgat(stdscr,n,a,c,o)
1085 #define echo_wchar(c)			wecho_wchar(stdscr,c)
1086 #define getbkgd(win)			((win)->_bkgd)
1087 #define get_wch(c)			wget_wch(stdscr,c)
1088 #define get_wstr(t)			wgetn_wstr(stdscr,t,-1)
1089 #define getn_wstr(t,n)			wgetn_wstr(stdscr,t,n)
1090 #define hline_set(c,n)			whline_set(stdscr,c,n)
1091 #define in_wch(c)			win_wch(stdscr,c)
1092 #define in_wchnstr(c,n)			win_wchnstr(stdscr,c,n)
1093 #define in_wchstr(c)			win_wchnstr(stdscr,c,-1)
1094 #define innwstr(c,n)			winnwstr(stdscr,c,n)
1095 #define ins_nwstr(t,n)			wins_nwstr(stdscr,t,n)
1096 #define ins_wch(c)			wins_wch(stdscr,c)
1097 #define ins_wstr(t)			wins_nwstr(stdscr,t,-1)
1098 #define inwstr(c)			winnwstr(stdscr,c,-1)
1099 
1100 #define mvadd_wch(y,x,c)		mvwadd_wch(stdscr,y,x,c)
1101 #define mvaddnwstr(y,x,wstr,n)		mvwaddnwstr(stdscr,y,x,wstr,n)
1102 #define mvaddwstr(y,x,wstr,n)		mvwaddnwstr(stdscr,y,x,wstr,-1)
1103 #define mvchgat(y,x,n,a,c,o)		mvwchgat(stdscr,y,x,n,a,c,o)
1104 #define mvget_wch(y,x,c)		mvwget_wch(stdscr,y,x,c)
1105 #define mvget_wstr(y,x,t)		mvwgetn_wstr(stdscr,y,x,t,-1)
1106 #define mvgetn_wstr(y,x,t,n)		mvwgetn_wstr(stdscr,y,x,t,n)
1107 #define mvhline_set(y,x,c,n)		mvwhline_set(stdscr,y,x,c,n)
1108 #define mvin_wch(y,x,c)			mvwin_wch(stdscr,y,x,c)
1109 #define mvin_wchnstr(y,x,c,n)		mvwin_wchnstr(stdscr,y,x,c,n)
1110 #define mvin_wchstr(y,x,c)		mvwin_wchnstr(stdscr,y,x,c,-1)
1111 #define mvinnwstr(y,x,c,n)		mvwinnwstr(stdscr,y,x,c,n)
1112 #define mvins_nwstr(y,x,t,n)		mvwins_nwstr(stdscr,y,x,t,n)
1113 #define mvins_wch(y,x,c)		mvwins_wch(stdscr,y,x,c)
1114 #define mvins_wstr(y,x,t)		mvwins_nwstr(stdscr,y,x,t,-1)
1115 #define mvinwstr(y,x,c)			mvwinnwstr(stdscr,y,x,c,-1)
1116 #define mvvline_set(y,x,c,n)		mvwvline_set(stdscr,y,x,c,n)
1117 
1118 #define mvwadd_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : wadd_wch(stdscr,c))
1119 #define mvwaddnwstr(win,y,x,wstr,n)	(wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,n))
1120 #define mvwaddwstr(win,y,x,wstr,n)	(wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,-1))
1121 #define mvwchgat(win,y,x,n,a,c,o)	(wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o))
1122 #define mvwget_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : wget_wch(win,c))
1123 #define mvwget_wstr(win,y,x,t)		(wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,-1))
1124 #define mvwgetn_wstr(win,y,x,t,n)	(wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n))
1125 #define mvwhline_set(win,y,x,c,n)	(wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n))
1126 #define mvwin_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : win_wch(win,c))
1127 #define mvwin_wchnstr(win,y,x,c,n)	(wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,n))
1128 #define mvwin_wchstr(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,-1))
1129 #define mvwinnwstr(win,y,x,c,n)		(wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,n))
1130 #define mvwins_nwstr(win,y,x,t,n)	(wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,n))
1131 #define mvwins_wch(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : wins_wch(stdscr,c))
1132 #define mvwins_wstr(win,y,x,t)		(wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,-1))
1133 #define mvwinwstr(win,y,x,c)		(wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,-1))
1134 #define mvwvline_set(win,y,x,c,n)	(wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n))
1135 
1136 #define slk_attr_off(a,v)		((v) ? ERR : slk_attroff(a))
1137 #define slk_attr_on(a,v)		((v) ? ERR : slk_attron(a))
1138 
1139 #define vid_attr(a,pair,opts)		vidattr(a)
1140 #define vline_set(c,n)			wvline_set(stdscr,c,n)
1141 #define waddwstr(win,wstr,n)		waddnwstr(win,wstr,-1)
1142 #define wattr_get(win,a,p,opts)		((void)((a) != 0 && (*(a) = (win)->_attrs)), \
1143 					 (void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \
1144 					 OK)
1145 #define wget_wstr(w,t)			wgetn_wstr(w,t,-1)
1146 #define win_wchstr(w,c)			win_wchnstr(w,c,-1)
1147 #define wins_wstr(w,t)			wins_nwstr(w,t,-1)
1148 #define winwstr(w,c)			winnwstr(w,c,-1)
1149 
1150 
1151 /*
1152  * XSI curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
1153  * varargs.h.  It adds new calls vw_printw/vw_scanw, which are supposed to
1154  * use POSIX stdarg.h.  The ncurses versions of vwprintw/vwscanw already
1155  * use stdarg.h, so...
1156  */
1157 #define vw_printw		vwprintw
1158 #define vw_scanw		vwscanw
1159 
1160 /*
1161  * Pseudo-character tokens outside ASCII range.  The curses wgetch() function
1162  * will return any given one of these only if the corresponding k- capability
1163  * is defined in your terminal's terminfo entry.
1164  */
1165 #define KEY_CODE_YES	0400		/* A wchar_t contains a key code */
1166 #define KEY_MIN		0401		/* Minimum curses key */
1167 #define KEY_BREAK       0401            /* Break key (unreliable) */
1168 #define KEY_DOWN        0402            /* Down-arrow */
1169 #define KEY_UP          0403		/* Up-arrow */
1170 #define KEY_LEFT        0404		/* Left-arrow */
1171 #define KEY_RIGHT       0405            /* Right-arrow */
1172 #define KEY_HOME        0406            /* Home key (upward+left arrow) */
1173 #define KEY_BACKSPACE   0407            /* Backspace (unreliable) */
1174 #define KEY_F0          0410            /* Function keys.  Space for 64 */
1175 #define KEY_F(n)        (KEY_F0+(n))    /* Value of function key n */
1176 #define KEY_DL          0510            /* Delete line */
1177 #define KEY_IL          0511            /* Insert line */
1178 #define KEY_DC          0512            /* Delete character */
1179 #define KEY_IC          0513            /* Insert char or enter insert mode */
1180 #define KEY_EIC         0514            /* Exit insert char mode */
1181 #define KEY_CLEAR       0515            /* Clear screen */
1182 #define KEY_EOS         0516            /* Clear to end of screen */
1183 #define KEY_EOL         0517            /* Clear to end of line */
1184 #define KEY_SF          0520            /* Scroll 1 line forward */
1185 #define KEY_SR          0521            /* Scroll 1 line backward (reverse) */
1186 #define KEY_NPAGE       0522            /* Next page */
1187 #define KEY_PPAGE       0523            /* Previous page */
1188 #define KEY_STAB        0524            /* Set tab */
1189 #define KEY_CTAB        0525            /* Clear tab */
1190 #define KEY_CATAB       0526            /* Clear all tabs */
1191 #define KEY_ENTER       0527            /* Enter or send (unreliable) */
1192 #define KEY_SRESET      0530            /* Soft (partial) reset (unreliable) */
1193 #define KEY_RESET       0531            /* Reset or hard reset (unreliable) */
1194 #define KEY_PRINT       0532            /* Print */
1195 #define KEY_LL          0533            /* Home down or bottom (lower left) */
1196 
1197 /* The keypad is arranged like this: */
1198 /* a1    up    a3   */
1199 /* left   b2  right  */
1200 /* c1   down   c3   */
1201 
1202 #define KEY_A1		0534		/* Upper left of keypad */
1203 #define KEY_A3		0535		/* Upper right of keypad */
1204 #define KEY_B2		0536		/* Center of keypad */
1205 #define KEY_C1		0537		/* Lower left of keypad */
1206 #define KEY_C3		0540		/* Lower right of keypad */
1207 #define KEY_BTAB	0541		/* Back tab */
1208 #define KEY_BEG		0542		/* Beg (beginning) */
1209 #define KEY_CANCEL	0543		/* Cancel */
1210 #define KEY_CLOSE	0544		/* Close */
1211 #define KEY_COMMAND	0545		/* Cmd (command) */
1212 #define KEY_COPY	0546		/* Copy */
1213 #define KEY_CREATE	0547		/* Create */
1214 #define KEY_END		0550		/* End */
1215 #define KEY_EXIT	0551		/* Exit */
1216 #define KEY_FIND	0552		/* Find */
1217 #define KEY_HELP	0553		/* Help */
1218 #define KEY_MARK	0554		/* Mark */
1219 #define KEY_MESSAGE	0555		/* Message */
1220 #define KEY_MOVE	0556		/* Move */
1221 #define KEY_NEXT	0557		/* Next */
1222 #define KEY_OPEN	0560		/* Open */
1223 #define KEY_OPTIONS	0561		/* Options */
1224 #define KEY_PREVIOUS	0562		/* Prev (previous) */
1225 #define KEY_REDO	0563		/* Redo */
1226 #define KEY_REFERENCE	0564		/* Ref (reference) */
1227 #define KEY_REFRESH	0565		/* Refresh */
1228 #define KEY_REPLACE	0566		/* Replace */
1229 #define KEY_RESTART	0567		/* Restart */
1230 #define KEY_RESUME	0570		/* Resume */
1231 #define KEY_SAVE	0571		/* Save */
1232 #define KEY_SBEG	0572		/* Shifted Beg (beginning) */
1233 #define KEY_SCANCEL	0573		/* Shifted Cancel */
1234 #define KEY_SCOMMAND	0574		/* Shifted Command */
1235 #define KEY_SCOPY	0575		/* Shifted Copy */
1236 #define KEY_SCREATE	0576		/* Shifted Create */
1237 #define KEY_SDC		0577		/* Shifted Delete char */
1238 #define KEY_SDL		0600		/* Shifted Delete line */
1239 #define KEY_SELECT	0601		/* Select */
1240 #define KEY_SEND	0602		/* Shifted End */
1241 #define KEY_SEOL	0603		/* Shifted Clear line */
1242 #define KEY_SEXIT	0604		/* Shifted Dxit */
1243 #define KEY_SFIND	0605		/* Shifted Find */
1244 #define KEY_SHELP	0606		/* Shifted Help */
1245 #define KEY_SHOME	0607		/* Shifted Home */
1246 #define KEY_SIC		0610		/* Shifted Input */
1247 #define KEY_SLEFT	0611		/* Shifted Left arrow */
1248 #define KEY_SMESSAGE	0612		/* Shifted Message */
1249 #define KEY_SMOVE	0613		/* Shifted Move */
1250 #define KEY_SNEXT	0614		/* Shifted Next */
1251 #define KEY_SOPTIONS	0615		/* Shifted Options */
1252 #define KEY_SPREVIOUS	0616		/* Shifted Prev */
1253 #define KEY_SPRINT	0617		/* Shifted Print */
1254 #define KEY_SREDO	0620		/* Shifted Redo */
1255 #define KEY_SREPLACE	0621		/* Shifted Replace */
1256 #define KEY_SRIGHT	0622		/* Shifted Right arrow */
1257 #define KEY_SRSUME	0623		/* Shifted Resume */
1258 #define KEY_SSAVE	0624		/* Shifted Save */
1259 #define KEY_SSUSPEND	0625		/* Shifted Suspend */
1260 #define KEY_SUNDO	0626		/* Shifted Undo */
1261 #define KEY_SUSPEND	0627		/* Suspend */
1262 #define KEY_UNDO	0630		/* Undo */
1263 #define KEY_MOUSE	0631		/* Mouse event has occurred */
1264 #define KEY_RESIZE	0632		/* Terminal resize event */
1265 #define KEY_MAX		0777		/* Maximum key value */
1266 
1267 /* mouse interface */
1268 #define NCURSES_MOUSE_VERSION	1
1269 
1270 /* event masks */
1271 #define	BUTTON1_RELEASED	000000000001L
1272 #define	BUTTON1_PRESSED		000000000002L
1273 #define	BUTTON1_CLICKED		000000000004L
1274 #define	BUTTON1_DOUBLE_CLICKED	000000000010L
1275 #define	BUTTON1_TRIPLE_CLICKED	000000000020L
1276 #define BUTTON1_RESERVED_EVENT	000000000040L
1277 #define	BUTTON2_RELEASED	000000000100L
1278 #define	BUTTON2_PRESSED		000000000200L
1279 #define	BUTTON2_CLICKED		000000000400L
1280 #define	BUTTON2_DOUBLE_CLICKED	000000001000L
1281 #define	BUTTON2_TRIPLE_CLICKED	000000002000L
1282 #define BUTTON2_RESERVED_EVENT	000000004000L
1283 #define	BUTTON3_RELEASED	000000010000L
1284 #define	BUTTON3_PRESSED		000000020000L
1285 #define	BUTTON3_CLICKED		000000040000L
1286 #define	BUTTON3_DOUBLE_CLICKED	000000100000L
1287 #define	BUTTON3_TRIPLE_CLICKED	000000200000L
1288 #define BUTTON3_RESERVED_EVENT	000000400000L
1289 #define	BUTTON4_RELEASED	000001000000L
1290 #define	BUTTON4_PRESSED		000002000000L
1291 #define	BUTTON4_CLICKED		000004000000L
1292 #define	BUTTON4_DOUBLE_CLICKED	000010000000L
1293 #define	BUTTON4_TRIPLE_CLICKED	000020000000L
1294 #define BUTTON4_RESERVED_EVENT	000040000000L
1295 #define BUTTON_CTRL		000100000000L
1296 #define BUTTON_SHIFT		000200000000L
1297 #define BUTTON_ALT		000400000000L
1298 #define	ALL_MOUSE_EVENTS	000777777777L
1299 #define	REPORT_MOUSE_POSITION	001000000000L
1300 
1301 /* macros to extract single event-bits from masks */
1302 #define	BUTTON_RELEASE(e, x)		((e) & (001 << (6 * ((x) - 1))))
1303 #define	BUTTON_PRESS(e, x)		((e) & (002 << (6 * ((x) - 1))))
1304 #define	BUTTON_CLICK(e, x)		((e) & (004 << (6 * ((x) - 1))))
1305 #define	BUTTON_DOUBLE_CLICK(e, x)	((e) & (010 << (6 * ((x) - 1))))
1306 #define	BUTTON_TRIPLE_CLICK(e, x)	((e) & (020 << (6 * ((x) - 1))))
1307 #define	BUTTON_RESERVED_EVENT(e, x)	((e) & (040 << (6 * ((x) - 1))))
1308 
1309 typedef unsigned long mmask_t;
1310 
1311 typedef struct
1312 {
1313     short id;		/* ID to distinguish multiple devices */
1314     int x, y, z;	/* event coordinates (character-cell) */
1315     mmask_t bstate;	/* button state bits */
1316 }
1317 MEVENT;
1318 
1319 extern NCURSES_EXPORT(int) getmouse (MEVENT *);
1320 extern NCURSES_EXPORT(int) ungetmouse (MEVENT *);
1321 extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *);
1322 extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int);
1323 extern NCURSES_EXPORT(int) mouseinterval (int);
1324 extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW* win,int* y, int* x, bool to_screen);
1325 
1326 #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
1327 
1328 /* other non-XSI functions */
1329 
1330 extern NCURSES_EXPORT(int) mcprint (char *, int);	/* direct data to printer */
1331 extern NCURSES_EXPORT(int) has_key (int);		/* do we have given key? */
1332 
1333 /* Debugging : use with libncurses_g.a */
1334 
1335 extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2);
1336 extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *);
1337 extern NCURSES_EXPORT(char *) _traceattr (attr_t);
1338 extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype);
1339 extern NCURSES_EXPORT(char *) _nc_tracebits (void);
1340 extern NCURSES_EXPORT(char *) _tracechar (const unsigned char);
1341 extern NCURSES_EXPORT(char *) _tracechtype (chtype);
1342 extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
1343 extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *);
1344 extern NCURSES_EXPORT(void) trace (const unsigned int);
1345 
1346 /* trace masks */
1347 #define TRACE_DISABLE	0x0000	/* turn off tracing */
1348 #define TRACE_TIMES	0x0001	/* trace user and system times of updates */
1349 #define TRACE_TPUTS	0x0002	/* trace tputs calls */
1350 #define TRACE_UPDATE	0x0004	/* trace update actions, old & new screens */
1351 #define TRACE_MOVE	0x0008	/* trace cursor moves and scrolls */
1352 #define TRACE_CHARPUT	0x0010	/* trace all character outputs */
1353 #define TRACE_ORDINARY	0x001F	/* trace all update actions */
1354 #define TRACE_CALLS	0x0020	/* trace all curses calls */
1355 #define TRACE_VIRTPUT	0x0040	/* trace virtual character puts */
1356 #define TRACE_IEVENT	0x0080	/* trace low-level input processing */
1357 #define TRACE_BITS	0x0100	/* trace state of TTY control bits */
1358 #define TRACE_ICALLS	0x0200	/* trace internal/nested calls */
1359 #define TRACE_CCALLS	0x0400	/* trace per-character calls */
1360 #define TRACE_DATABASE	0x0800	/* trace read/write of terminfo/termcap data */
1361 #define TRACE_ATTRS	0x1000	/* trace attribute updates */
1362 #define TRACE_MAXIMUM	0xffff	/* maximum trace level */
1363 
1364 #if defined(TRACE) || defined(NCURSES_TEST)
1365 extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable;		/* enable optimizations */
1366 extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
1367 #define OPTIMIZE_MVCUR		0x01	/* cursor movement optimization */
1368 #define OPTIMIZE_HASHMAP	0x02	/* diff hashing to detect scrolls */
1369 #define OPTIMIZE_SCROLL		0x04	/* scroll optimization */
1370 #define OPTIMIZE_ALL		0xff	/* enable all optimizations (dflt) */
1371 #endif
1372 
1373 #ifdef __cplusplus
1374 
1375 /* these names conflict with STL */
1376 #undef box
1377 #undef clear
1378 #undef erase
1379 #undef move
1380 #undef refresh
1381 
1382 }
1383 #endif
1384 
1385 #endif /* __NCURSES_H */
1386