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