Home | History | Annotate | Line # | Download | only in libcurses
curses.h revision 1.22
      1 /*	$NetBSD: curses.h,v 1.22 1999/04/13 14:08:17 mrg Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1981, 1993, 1994
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the University of
     18  *	California, Berkeley and its contributors.
     19  * 4. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *	@(#)curses.h	8.5 (Berkeley) 4/29/95
     36  */
     37 
     38 #ifndef _CURSES_H_
     39 #define	_CURSES_H_
     40 
     41 #include <sys/types.h>
     42 #include <sys/cdefs.h>
     43 
     44 #include <stdio.h>
     45 #include <termcap.h>
     46 
     47 /*
     48  * The following #defines and #includes are present for backward
     49  * compatibility only.  They should not be used in future code.
     50  *
     51  * START BACKWARD COMPATIBILITY ONLY.
     52  */
     53 #ifndef _CURSES_PRIVATE
     54 #ifndef __cplusplus
     55 #define	bool	char
     56 #define	reg	register
     57 #endif
     58 
     59 #ifndef TRUE
     60 #define	TRUE	(/*CONSTCOND*/1)
     61 #endif
     62 #ifndef FALSE
     63 #define	FALSE	(/*CONSTCOND*/0)
     64 #endif
     65 
     66 #define	_puts(s)	tputs(s, 0, __cputchar)
     67 #define	_putchar(c)	__cputchar(c)
     68 
     69 /* Old-style terminal modes access. */
     70 #define	baudrate()	(cfgetospeed(&__baset))
     71 #define	crmode()	cbreak()
     72 #define	erasechar()	(__baset.c_cc[VERASE])
     73 #define	killchar()	(__baset.c_cc[VKILL])
     74 #define	nocrmode()	nocbreak()
     75 #define	ospeed		(cfgetospeed(&__baset))
     76 #endif /* _CURSES_PRIVATE */
     77 
     78 extern char	 GT;			/* Gtty indicates tabs. */
     79 extern char	 NONL;			/* Term can't hack LF doing a CR. */
     80 extern char	 UPPERCASE;		/* Terminal is uppercase only. */
     81 
     82 extern int	 My_term;		/* Use Def_term regardless. */
     83 extern char	*Def_term;		/* Default terminal type. */
     84 
     85 /* Termcap capabilities. */
     86 extern char	AM, BS, CA, DA, EO, HC, IN, MI, MS, NC, NS, OS,
     87 		PC, UL, XB, XN, XT, XS, XX;
     88 extern char	*AL, *BC, *BL, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC,
     89 		*DL, *DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5,
     90 		*K6, *K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH,
     91 		*KL, *KR, *KS, *KU, *LL, *MA, *MB, *MD, *ME, *MH, *MK,
     92 		*MP, *MR, *ND, *NL, *RC, *SC, *SE, *SF, *SO, *SR, *TA,
     93 		*TE, *TI, *UC, *UE, *UP, *US, *VB, *VS, *VE, *al, *dl,
     94 		*sf, *sr, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
     95 		*LEFT_PARM, *RIGHT_PARM;
     96 
     97 /* END BACKWARD COMPATIBILITY ONLY. */
     98 
     99 /* symbols for values returned by getch in keypad mode */
    100 #define    KEY_MIN        0x101    /* minimum extended key value */
    101 #define    KEY_BREAK      0x101    /* break key */
    102 #define    KEY_DOWN       0x102    /* down arrow */
    103 #define    KEY_UP         0x103    /* up arrow */
    104 #define    KEY_LEFT       0x104    /* left arrow */
    105 #define    KEY_RIGHT      0x105    /* right arrow*/
    106 #define    KEY_HOME       0x106    /* home key */
    107 #define    KEY_BACKSPACE  0x107    /* Backspace */
    108 
    109 /* First function key (block of 64 follow) */
    110 #define    KEY_F0         0x108
    111 /* Function defining other function key values*/
    112 #define    KEY_F(n)       (KEY_F0+(n))
    113 
    114 #define    KEY_DL         0x148    /* Delete Line */
    115 #define    KEY_IL         0x149    /* Insert Line*/
    116 #define    KEY_DC         0x14A    /* Delete Character */
    117 #define    KEY_IC         0x14B    /* Insert Character */
    118 #define    KEY_EIC        0x14C    /* Exit Insert Char mode */
    119 #define    KEY_CLEAR      0x14D    /* Clear screen */
    120 #define    KEY_EOS        0x14E    /* Clear to end of screen */
    121 #define    KEY_EOL        0x14F    /* Clear to end of line */
    122 #define    KEY_SF         0x150    /* Scroll one line forward */
    123 #define    KEY_SR         0x151    /* Scroll one line back */
    124 #define    KEY_NPAGE      0x152    /* Next Page */
    125 #define    KEY_PPAGE      0x153    /* Prev Page */
    126 #define    KEY_STAB       0x154    /* Set Tab */
    127 #define    KEY_CTAB       0x155    /* Clear Tab */
    128 #define    KEY_CATAB      0x156    /* Clear All Tabs */
    129 #define    KEY_ENTER      0x157    /* Enter or Send */
    130 #define    KEY_SRESET     0x158    /* Soft Reset */
    131 #define    KEY_RESET      0x159    /* Hard Reset */
    132 #define    KEY_PRINT      0x15A    /* Print */
    133 #define    KEY_LL         0x15B    /* Home Down */
    134 
    135 /*
    136  * "Keypad" keys arranged like this:
    137  *
    138  *  A1   up  A3
    139  * left  B2 right
    140  *  C1  down C3
    141  *
    142  */
    143 #define    KEY_A1         0x15C    /* Keypad upper left */
    144 #define    KEY_A3         0x15D    /* Keypad upper right */
    145 #define    KEY_B2         0x15E    /* Keypad centre key */
    146 #define    KEY_C1         0x15F    /* Keypad lower left */
    147 #define    KEY_C3         0x160    /* Keypad lower right */
    148 
    149 #define    KEY_BTAB       0x161    /* Back Tab */
    150 #define    KEY_BEG        0x162    /* Begin key */
    151 #define    KEY_CANCEL     0x163    /* Cancel key */
    152 #define    KEY_CLOSE      0x164    /* Close Key */
    153 #define    KEY_COMMAND    0x165    /* Command Key */
    154 #define    KEY_COPY       0x166    /* Copy key */
    155 #define    KEY_CREATE     0x167    /* Create key */
    156 #define    KEY_END        0x168    /* End key */
    157 #define    KEY_EXIT       0x169    /* Exit key */
    158 #define    KEY_FIND       0x16A    /* Find key */
    159 #define    KEY_HELP       0x16B    /* Help key */
    160 #define    KEY_MARK       0x16C    /* Mark key */
    161 #define    KEY_MESSAGE    0x16D    /* Message key */
    162 #define    KEY_MOVE       0x16E    /* Move key */
    163 #define    KEY_NEXT       0x16F    /* Next Object key */
    164 #define    KEY_OPEN       0x170    /* Open key */
    165 #define    KEY_OPTIONS    0x171    /* Options key */
    166 #define    KEY_PREVIOUS   0x172    /* Previous Object key */
    167 #define    KEY_REDO       0x173    /* Redo key */
    168 #define    KEY_REFERENCE  0x174    /* Ref Key */
    169 #define    KEY_REFRESH    0x175    /* Refresh key */
    170 #define    KEY_REPLACE    0x176    /* Replace key */
    171 #define    KEY_RESTART    0x177    /* Restart key */
    172 #define    KEY_RESUME     0x178    /* Resume key */
    173 #define    KEY_SAVE       0x179    /* Save key */
    174 #define    KEY_SBEG       0x17A    /* Shift begin key */
    175 #define    KEY_SCANCEL    0x17B    /* Shift Cancel key */
    176 #define    KEY_SCOMMAND   0x17C    /* Shift Command key */
    177 #define    KEY_SCOPY      0x17D    /* Shift Copy key */
    178 #define    KEY_SCREATE    0x17E    /* Shift Create key */
    179 #define    KEY_SDC        0x17F    /* Shift Delete Character */
    180 #define    KEY_SDL        0x180    /* Shift Delete Line */
    181 #define    KEY_SELECT     0x181    /* Select key */
    182 #define    KEY_SEND       0x182    /* Send key */
    183 #define    KEY_SEOL       0x183    /* Shift Clear Line key */
    184 #define    KEY_SEXIT      0x184    /* Shift Exit key */
    185 #define    KEY_SFIND      0x185    /* Shift Find key */
    186 #define    KEY_SHELP      0x186    /* Shift Help key */
    187 #define    KEY_SHOME      0x187    /* Shift Home key */
    188 #define    KEY_SIC        0x188    /* Shift Input key */
    189 #define    KEY_SLEFT      0x189    /* Shift Left Arrow key */
    190 #define    KEY_SMESSAGE   0x18A    /* Shift Message key */
    191 #define    KEY_SMOVE      0x18B    /* Shift Move key */
    192 #define    KEY_SNEXT      0x18C    /* Shift Next key */
    193 #define    KEY_SOPTIONS   0x18D    /* Shift Options key */
    194 #define    KEY_SPREVIOUS  0x18E    /* Shift Previous key */
    195 #define    KEY_SPRINT     0x18F    /* Shift Print key */
    196 #define    KEY_SREDO      0x190    /* Shift Redo key */
    197 #define    KEY_SREPLACE   0x191    /* Shift Replace key */
    198 #define    KEY_SRIGHT     0x192    /* Shift Right Arrow key */
    199 #define    KEY_SRESUME    0x193    /* Shift Resume key */
    200 #define    KEY_SSAVE      0x194    /* Shift Save key */
    201 #define    KEY_SSUSPEND   0x195    /* Shift Suspend key */
    202 #define    KEY_SUNDO      0x196    /* Shift Undo key */
    203 #define    KEY_SUSPEND    0x197    /* Suspend key */
    204 #define    KEY_UNDO       0x198    /* Undo key  */
    205 #define    KEY_MAX        0x198    /* maximum extended key value */
    206 
    207 /* 8-bit ASCII characters. */
    208 #define	unctrl(c)		__unctrl[(c) & 0xff]
    209 #define	unctrllen(ch)		__unctrllen[(ch) & 0xff]
    210 
    211 extern char	 *__unctrl[256];	/* Control strings. */
    212 extern char	 __unctrllen[256];	/* Control strings length. */
    213 
    214 /*
    215  * A window an array of __LINE structures pointed to by the 'lines' pointer.
    216  * A line is an array of __LDATA structures pointed to by the 'line' pointer.
    217  *
    218  * IMPORTANT: the __LDATA structure must NOT induce any padding, so if new
    219  * fields are added -- padding fields with *constant values* should ensure
    220  * that the compiler will not generate any padding when storing an array of
    221  *  __LDATA structures.  This is to enable consistent use of memcmp, and memcpy
    222  * for comparing and copying arrays.
    223  */
    224 typedef struct {
    225 	int	ch;			/* the actual character */
    226 
    227 #define	__NORMAL	0x00  		/* Added characters are normal. */
    228 #define	__STANDOUT	0x01  		/* Added characters are standout. */
    229 #define	__UNDERSCORE	0x02  		/* Added characters are underscored. */
    230 #define	__REVERSE	0x04  		/* Added characters are reverse \
    231 						video. */
    232 #define	__BLINK		0x08  		/* Added characters are blinking. */
    233 #define	__DIM		0x10  		/* Added characters are dim. */
    234 #define	__BOLD		0x20  		/* Added characters are bold. */
    235 #define	__BLANK		0x40  		/* Added characters are blanked. */
    236 #define	__PROTECT	0x80  		/* Added characters are protected. */
    237 #define	__ATTRIBUTES	0xfe  		/* All character attributes
    238 						(excluding standout). */
    239 	char	attr;			/* attributes of character */
    240 } __LDATA;
    241 
    242 #define __LDATASIZE	(sizeof(__LDATA))
    243 
    244 typedef struct {
    245 #define	__ISDIRTY	0x01		/* Line is dirty. */
    246 #define __ISPASTEOL	0x02		/* Cursor is past end of line */
    247 #define __FORCEPAINT	0x04		/* Force a repaint of the line */
    248 	unsigned int flags;
    249 	unsigned int hash;		/* Hash value for the line. */
    250 	size_t *firstchp, *lastchp;	/* First and last chngd columns ptrs */
    251 	size_t firstch, lastch;		/* First and last changed columns. */
    252 	__LDATA *line;			/* Pointer to the line text. */
    253 } __LINE;
    254 
    255 typedef struct __window {		/* Window structure. */
    256 	struct __window	*nextp, *orig;	/* Subwindows list and parent. */
    257 	size_t begy, begx;		/* Window home. */
    258 	size_t cury, curx;		/* Current x, y coordinates. */
    259 	size_t maxy, maxx;		/* Maximum values for curx, cury. */
    260 	short ch_off;			/* x offset for firstch/lastch. */
    261 	__LINE **lines;			/* Array of pointers to the lines */
    262 	__LINE  *lspace;		/* line space (for cleanup) */
    263 	__LDATA *wspace;		/* window space (for cleanup) */
    264 	int	delay;			/* delay for getch() */
    265 
    266 #define	__ENDLINE	0x00001		/* End of screen. */
    267 #define	__FLUSH		0x00002		/* Fflush(stdout) after refresh. */
    268 #define	__FULLWIN	0x00004		/* Window is a screen. */
    269 #define	__IDLINE	0x00008		/* Insert/delete sequences. */
    270 #define	__SCROLLWIN	0x00010		/* Last char will scroll window. */
    271 #define	__SCROLLOK	0x00020		/* Scrolling ok. */
    272 #define	__CLEAROK	0x00040		/* Clear on next refresh. */
    273 #define	__WSTANDOUT	0x00080		/* Standout window */
    274 #define	__LEAVEOK	0x00100		/* If curser left */
    275 #define	__WUNDERSCORE	0x00200 	/* Underscored window */
    276 #define	__WREVERSE	0x00400		/* Reverse video window */
    277 #define	__WBLINK	0x00800		/* Blinking window */
    278 #define	__WDIM		0x01000		/* Dim window */
    279 #define	__WBOLD		0x02000		/* Bold window */
    280 #define	__WBLANK	0x04000		/* Blanked window */
    281 #define	__WPROTECT	0x08000		/* Protected window */
    282 #define	__WATTRIBUTES	0x0fc00		/* All character attributes
    283 						(excluding standout). */
    284 #define	__KEYPAD	0x10000		/* If interpreting keypad codes */
    285 #define	__NOTIMEOUT	0x20000		/* Wait indefinitely for func keys */
    286 
    287 	u_int32_t	flags;
    288 } WINDOW;
    289 
    290 /* Curses external declarations. */
    291 extern WINDOW	*curscr;		/* Current screen. */
    292 extern WINDOW	*stdscr;		/* Standard screen. */
    293 
    294 extern struct termios __orig_termios;	/* Terminal state before curses */
    295 extern struct termios __baset;		/* Our base terminal state */
    296 extern int	__tcaction;		/* If terminal hardware set. */
    297 
    298 extern int	 COLS;			/* Columns on the screen. */
    299 extern int	 LINES;			/* Lines on the screen. */
    300 
    301 extern char	*ttytype;		/* Full name of current terminal. */
    302 
    303 #define	ERR	(0)			/* Error return. */
    304 #define	OK	(1)			/* Success return. */
    305 
    306 /* Standard screen pseudo functions. */
    307 #define	addbytes(s, n)			__waddbytes(stdscr, s, n, 0)
    308 #define	addch(ch)			waddch(stdscr, ch)
    309 #define	addnstr(s, n)			waddnstr(stdscr, s, n)
    310 #define	addstr(s)			__waddbytes(stdscr, s, strlen(s), 0)
    311 #define	clear()				wclear(stdscr)
    312 #define	clrtobot()			wclrtobot(stdscr)
    313 #define	clrtoeol()			wclrtoeol(stdscr)
    314 #define	delch()				wdelch(stdscr)
    315 #define	deleteln()			wdeleteln(stdscr)
    316 #define	erase()				werase(stdscr)
    317 #define	getch()				wgetch(stdscr)
    318 #define	getstr(s)			wgetstr(stdscr, s)
    319 #define	inch()				winch(stdscr)
    320 #define	insch(ch)			winsch(stdscr, ch)
    321 #define	insertln()			winsertln(stdscr)
    322 #define	move(y, x)			wmove(stdscr, y, x)
    323 #define	refresh()			wrefresh(stdscr)
    324 #define	standend()			wstandend(stdscr)
    325 #define	standout()			wstandout(stdscr)
    326 #define	timeout(delay)			wtimeout(stdscr, delay)
    327 #define	underscore()			wunderscore(stdscr)
    328 #define	underend()			wunderend(stdscr)
    329 #define	attron(attr)			wattron(stdscr, attr)
    330 #define	attroff(attr)			wattroff(stdscr, attr)
    331 #define	attrset(attr)			wattrset(stdscr, attr)
    332 #define	waddbytes(w, s, n)		__waddbytes(w, s, n, 0)
    333 #define	waddstr(w, s)			__waddbytes(w, s, strlen(s), 0)
    334 
    335 /* Attributes */
    336 #define A_NORMAL	__NORMAL
    337 #define	A_STANDOUT	__UNDERSCORE
    338 #define	A_UNDERLINE	__UNDERSCORE
    339 #define	A_REVERSE	__REVERSE
    340 #define	A_BLINK		__BLINK
    341 #define	A_DIM		__DIM
    342 #define	A_BOLD		__BOLD
    343 #define	A_BLANK		__BLANK
    344 #define	A_PROTECT	__PROTECT
    345 #define A_ATTRIBUTES	__ATTRIBUTES
    346 
    347 /* Standard screen plus movement pseudo functions. */
    348 #define	mvaddbytes(y, x, s, n)		mvwaddbytes(stdscr, y, x, s, n)
    349 #define	mvaddch(y, x, ch)		mvwaddch(stdscr, y, x, ch)
    350 #define	mvaddnstr(y, x, s, n)		mvwaddnstr(stdscr, y, x, s, n)
    351 #define	mvaddstr(y, x, s)		mvwaddstr(stdscr, y, x, s)
    352 #define	mvdelch(y, x)			mvwdelch(stdscr, y, x)
    353 #define	mvgetch(y, x)			mvwgetch(stdscr, y, x)
    354 #define	mvgetstr(y, x, s)		mvwgetstr(stdscr, y, x, s)
    355 #define	mvinch(y, x)			mvwinch(stdscr, y, x)
    356 #define	mvinsch(y, x, c)		mvwinsch(stdscr, y, x, c)
    357 #define	mvwaddbytes(w, y, x, s, n) \
    358 	(wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, n, 0))
    359 #define	mvwaddch(w, y, x, ch) \
    360 	(wmove(w, y, x) == ERR ? ERR : waddch(w, ch))
    361 #define	mvwaddnstr(w, y, x, s, n) \
    362 	(wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, n))
    363 #define	mvwaddstr(w, y, x, s) \
    364 	(wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, strlen(s), 0))
    365 #define	mvwdelch(w, y, x) \
    366 	(wmove(w, y, x) == ERR ? ERR : wdelch(w))
    367 #define	mvwgetch(w, y, x) \
    368 	(wmove(w, y, x) == ERR ? ERR : wgetch(w))
    369 #define	mvwgetstr(w, y, x, s) \
    370 	(wmove(w, y, x) == ERR ? ERR : wgetstr(w, s))
    371 #define	mvwinch(w, y, x) \
    372 	(wmove(w, y, x) == ERR ? ERR : winch(w))
    373 #define	mvwinsch(w, y, x, c) \
    374 	(wmove(w, y, x) == ERR ? ERR : winsch(w, c))
    375 
    376 
    377 /* Psuedo functions. */
    378 #define	clearok(w, bf) \
    379 ((/* CONSTCOND */ bf) ? ((w)->flags |= __CLEAROK) : ((w)->flags &= ~__CLEAROK))
    380 #define	flushok(w, bf) \
    381 	((bf) ? ((w)->flags |= __FLUSH) : ((w)->flags &= ~__FLUSH))
    382 #define	leaveok(w, bf) \
    383 	((bf) ? ((w)->flags |= __LEAVEOK) : ((w)->flags &= ~__LEAVEOK))
    384 #define	scrollok(w, bf) \
    385 	((bf) ? ((w)->flags |= __SCROLLOK) : ((w)->flags &= ~__SCROLLOK))
    386 #define	winch(w) \
    387 	((w)->lines[(w)->cury]->line[(w)->curx].ch & 0177)
    388 
    389 #define	getyx(w, y, x)		(y) = getcury(w), (x) = getcurx(w)
    390 #define getbegyx(w, y, x)	(y) = getbegy(w), (x) = getbegx(w)
    391 #define getmaxyx(w, y, x)	(y) = getmaxy(w), (x) = getmaxx(w)
    392 #define getcury(w)		((w)->cury)
    393 #define getcurx(w)		((w)->curx)
    394 #define getbegy(w)		((w)->begy)
    395 #define getbegx(w)		((w)->begx)
    396 #define getmaxy(w)		((w)->maxy)
    397 #define getmaxx(w)		((w)->maxx)
    398 
    399 /* Public function prototypes. */
    400 __BEGIN_DECLS
    401 int	 beep __P((void));
    402 int	 box __P((WINDOW *, int, int));
    403 int	 cbreak __P((void));
    404 int	 delwin __P((WINDOW *));
    405 int	 echo __P((void));
    406 int	 endwin __P((void));
    407 int	 flash __P((void));
    408 int	 flushinp __P((void));
    409 char	*fullname __P((char *, char *));
    410 char	*getcap __P((char *));
    411 int	 gettmode __P((void));
    412 void	 idlok __P((WINDOW *, int));
    413 WINDOW	*initscr __P((void));
    414 int	 isendwin __P((void));
    415 void	 keypad __P((WINDOW *, int));
    416 char	*longname __P((char *, char *));
    417 int	 mvcur __P((int, int, int, int));
    418 int	 mvprintw __P((int, int, const char *, ...));
    419 int	 mvscanw __P((int, int, const char *, ...));
    420 int	 mvwin __P((WINDOW *, int, int));
    421 int	 mvwprintw __P((WINDOW *, int, int, const char *, ...));
    422 int	 mvwscanw __P((WINDOW *, int, int, const char *, ...));
    423 WINDOW	*newwin __P((int, int, int, int));
    424 int	 nl __P((void));
    425 int	 nocbreak __P((void));
    426 void     nodelay __P((WINDOW *, int));
    427 int	 noecho __P((void));
    428 int	 nonl __P((void));
    429 int	 noraw __P((void));
    430 void     notimeout __P((WINDOW *, int));
    431 int	 overlay __P((WINDOW *, WINDOW *));
    432 int	 overwrite __P((WINDOW *, WINDOW *));
    433 int	 printw __P((const char *, ...));
    434 int	 raw __P((void));
    435 int	 resetty __P((void));
    436 int	 savetty __P((void));
    437 int	 scanw __P((const char *, ...));
    438 int	 scroll __P((WINDOW *));
    439 int	 setterm __P((char *));
    440 int	 sscans __P((WINDOW *, const char *, ...));
    441 WINDOW	*subwin __P((WINDOW *, int, int, int, int));
    442 int	 suspendwin __P((void));
    443 int	 touchline __P((WINDOW *, int, int, int));
    444 int	 touchoverlap __P((WINDOW *, WINDOW *));
    445 int	 touchwin __P((WINDOW *));
    446 int	 vwprintw __P((WINDOW *, const char *, _BSD_VA_LIST_));
    447 int	 vwscanw __P((WINDOW *, const char *, _BSD_VA_LIST_));
    448 int	 waddch __P((WINDOW *, int));
    449 int	 waddnstr __P((WINDOW *, const char *, int));
    450 int	 wattron __P((WINDOW *, int));
    451 int	 wattroff __P((WINDOW *, int));
    452 int	 wattrset __P((WINDOW *, int));
    453 int	 wclear __P((WINDOW *));
    454 int	 wclrtobot __P((WINDOW *));
    455 int	 wclrtoeol __P((WINDOW *));
    456 int	 wdelch __P((WINDOW *));
    457 int	 wdeleteln __P((WINDOW *));
    458 int	 werase __P((WINDOW *));
    459 int	 wgetch __P((WINDOW *));
    460 int	 wgetstr __P((WINDOW *, char *));
    461 int	 winsch __P((WINDOW *, int));
    462 int	 winsertln __P((WINDOW *));
    463 int	 wmove __P((WINDOW *, int, int));
    464 int	 wprintw __P((WINDOW *, const char *, ...));
    465 int	 wrefresh __P((WINDOW *));
    466 int	 wscanw __P((WINDOW *, const char *, ...));
    467 int	 wstandend __P((WINDOW *));
    468 int	 wstandout __P((WINDOW *));
    469 void	 wtimeout __P((WINDOW *, int));
    470 int	 wunderscore __P((WINDOW *));
    471 int	 wunderend __P((WINDOW *));
    472 int	 vwprintw __P((WINDOW *, const char *, _BSD_VA_LIST_));
    473 
    474 /* Private functions that are needed for user programs prototypes. */
    475 void	 __cputchar __P((int));
    476 int	 __waddbytes __P((WINDOW *, const char *, int, int));
    477 __END_DECLS
    478 
    479 /* Private functions. */
    480 #ifdef _CURSES_PRIVATE
    481 void	 __CTRACE __P((const char *, ...));
    482 int	 __delay __P((void));
    483 unsigned int __hash __P((char *, int));
    484 void	 __id_subwins __P((WINDOW *));
    485 void     __init_getch __P((char *));
    486 int	 __mvcur __P((int, int, int, int, int));
    487 int	 __nodelay __P((void));
    488 int	 __notimeout __P((void));
    489 void	 __restore_termios __P((void));
    490 void	 __restore_stophandler __P((void));
    491 void	 __save_termios __P((void));
    492 void	 __set_stophandler __P((void));
    493 void	 __set_subwin __P((WINDOW *, WINDOW *));
    494 void	 __startwin __P((void));
    495 void	 __stop_signal_handler __P((int));
    496 void	 __swflags __P((WINDOW *));
    497 int	 __timeout __P((int));
    498 int	 __touchline __P((WINDOW *, int, int, int, int));
    499 int	 __touchwin __P((WINDOW *));
    500 char	*__tscroll __P((const char *, int, int));
    501 int	 __waddch __P((WINDOW *, __LDATA *));
    502 int	 __stopwin __P((void));
    503 void	 __restartwin __P((void));
    504 
    505 /* Private #defines. */
    506 #define	min(a,b)	(a < b ? a : b)
    507 #define	max(a,b)	(a > b ? a : b)
    508 
    509 /* Private externs. */
    510 extern int	 __echoit;
    511 extern int	 __endwin;
    512 extern int	 __pfast;
    513 extern int	 __rawmode;
    514 extern int	 __noqch;
    515 #endif
    516 
    517 #endif /* !_CURSES_H_ */
    518