xref: /netbsd/lib/libcurses/curses.h (revision c4a72b64)
1 /*	$NetBSD: curses.h,v 1.69 2002/10/22 12:07:20 blymn 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 #include <wchar.h>
44 
45 #include <stdio.h>
46 #include <termcap.h>
47 
48 /*
49  * attr_t must be the same size as wchar_t (see <wchar.h>) to avoid padding
50  * in __LDATA.
51  */
52 typedef wchar_t	chtype;
53 typedef wchar_t	attr_t;
54 
55 /* C++ already defines bool. */
56 #ifndef __cplusplus
57 typedef	char	bool;
58 #endif
59 
60 #ifndef TRUE
61 #define	TRUE	(/*CONSTCOND*/1)
62 #endif
63 #ifndef FALSE
64 #define	FALSE	(/*CONSTCOND*/0)
65 #endif
66 
67 #ifndef _CURSES_PRIVATE
68 
69 #define _puts(s)        tputs(s, 0, __cputchar)
70 #define _putchar(c)     __cputchar(c)
71 
72 /* Old-style terminal modes access. */
73 #define crmode()        cbreak()
74 #define nocrmode()      nocbreak()
75 #define ospeed          baudrate()
76 #endif /* _CURSES_PRIVATE */
77 
78 
79 /* symbols for values returned by getch in keypad mode */
80 #define    KEY_MIN        0x101    /* minimum extended key value */
81 #define    KEY_BREAK      0x101    /* break key */
82 #define    KEY_DOWN       0x102    /* down arrow */
83 #define    KEY_UP         0x103    /* up arrow */
84 #define    KEY_LEFT       0x104    /* left arrow */
85 #define    KEY_RIGHT      0x105    /* right arrow*/
86 #define    KEY_HOME       0x106    /* home key */
87 #define    KEY_BACKSPACE  0x107    /* Backspace */
88 
89 /* First function key (block of 64 follow) */
90 #define    KEY_F0         0x108
91 /* Function defining other function key values*/
92 #define    KEY_F(n)       (KEY_F0+(n))
93 
94 #define    KEY_DL         0x148    /* Delete Line */
95 #define    KEY_IL         0x149    /* Insert Line*/
96 #define    KEY_DC         0x14A    /* Delete Character */
97 #define    KEY_IC         0x14B    /* Insert Character */
98 #define    KEY_EIC        0x14C    /* Exit Insert Char mode */
99 #define    KEY_CLEAR      0x14D    /* Clear screen */
100 #define    KEY_EOS        0x14E    /* Clear to end of screen */
101 #define    KEY_EOL        0x14F    /* Clear to end of line */
102 #define    KEY_SF         0x150    /* Scroll one line forward */
103 #define    KEY_SR         0x151    /* Scroll one line back */
104 #define    KEY_NPAGE      0x152    /* Next Page */
105 #define    KEY_PPAGE      0x153    /* Prev Page */
106 #define    KEY_STAB       0x154    /* Set Tab */
107 #define    KEY_CTAB       0x155    /* Clear Tab */
108 #define    KEY_CATAB      0x156    /* Clear All Tabs */
109 #define    KEY_ENTER      0x157    /* Enter or Send */
110 #define    KEY_SRESET     0x158    /* Soft Reset */
111 #define    KEY_RESET      0x159    /* Hard Reset */
112 #define    KEY_PRINT      0x15A    /* Print */
113 #define    KEY_LL         0x15B    /* Home Down */
114 
115 /*
116  * "Keypad" keys arranged like this:
117  *
118  *  A1   up  A3
119  * left  B2 right
120  *  C1  down C3
121  *
122  */
123 #define    KEY_A1         0x15C    /* Keypad upper left */
124 #define    KEY_A3         0x15D    /* Keypad upper right */
125 #define    KEY_B2         0x15E    /* Keypad centre key */
126 #define    KEY_C1         0x15F    /* Keypad lower left */
127 #define    KEY_C3         0x160    /* Keypad lower right */
128 
129 #define    KEY_BTAB       0x161    /* Back Tab */
130 #define    KEY_BEG        0x162    /* Begin key */
131 #define    KEY_CANCEL     0x163    /* Cancel key */
132 #define    KEY_CLOSE      0x164    /* Close Key */
133 #define    KEY_COMMAND    0x165    /* Command Key */
134 #define    KEY_COPY       0x166    /* Copy key */
135 #define    KEY_CREATE     0x167    /* Create key */
136 #define    KEY_END        0x168    /* End key */
137 #define    KEY_EXIT       0x169    /* Exit key */
138 #define    KEY_FIND       0x16A    /* Find key */
139 #define    KEY_HELP       0x16B    /* Help key */
140 #define    KEY_MARK       0x16C    /* Mark key */
141 #define    KEY_MESSAGE    0x16D    /* Message key */
142 #define    KEY_MOVE       0x16E    /* Move key */
143 #define    KEY_NEXT       0x16F    /* Next Object key */
144 #define    KEY_OPEN       0x170    /* Open key */
145 #define    KEY_OPTIONS    0x171    /* Options key */
146 #define    KEY_PREVIOUS   0x172    /* Previous Object key */
147 #define    KEY_REDO       0x173    /* Redo key */
148 #define    KEY_REFERENCE  0x174    /* Ref Key */
149 #define    KEY_REFRESH    0x175    /* Refresh key */
150 #define    KEY_REPLACE    0x176    /* Replace key */
151 #define    KEY_RESTART    0x177    /* Restart key */
152 #define    KEY_RESUME     0x178    /* Resume key */
153 #define    KEY_SAVE       0x179    /* Save key */
154 #define    KEY_SBEG       0x17A    /* Shift begin key */
155 #define    KEY_SCANCEL    0x17B    /* Shift Cancel key */
156 #define    KEY_SCOMMAND   0x17C    /* Shift Command key */
157 #define    KEY_SCOPY      0x17D    /* Shift Copy key */
158 #define    KEY_SCREATE    0x17E    /* Shift Create key */
159 #define    KEY_SDC        0x17F    /* Shift Delete Character */
160 #define    KEY_SDL        0x180    /* Shift Delete Line */
161 #define    KEY_SELECT     0x181    /* Select key */
162 #define    KEY_SEND       0x182    /* Send key */
163 #define    KEY_SEOL       0x183    /* Shift Clear Line key */
164 #define    KEY_SEXIT      0x184    /* Shift Exit key */
165 #define    KEY_SFIND      0x185    /* Shift Find key */
166 #define    KEY_SHELP      0x186    /* Shift Help key */
167 #define    KEY_SHOME      0x187    /* Shift Home key */
168 #define    KEY_SIC        0x188    /* Shift Input key */
169 #define    KEY_SLEFT      0x189    /* Shift Left Arrow key */
170 #define    KEY_SMESSAGE   0x18A    /* Shift Message key */
171 #define    KEY_SMOVE      0x18B    /* Shift Move key */
172 #define    KEY_SNEXT      0x18C    /* Shift Next key */
173 #define    KEY_SOPTIONS   0x18D    /* Shift Options key */
174 #define    KEY_SPREVIOUS  0x18E    /* Shift Previous key */
175 #define    KEY_SPRINT     0x18F    /* Shift Print key */
176 #define    KEY_SREDO      0x190    /* Shift Redo key */
177 #define    KEY_SREPLACE   0x191    /* Shift Replace key */
178 #define    KEY_SRIGHT     0x192    /* Shift Right Arrow key */
179 #define    KEY_SRSUME     0x193    /* Shift Resume key */
180 #define    KEY_SSAVE      0x194    /* Shift Save key */
181 #define    KEY_SSUSPEND   0x195    /* Shift Suspend key */
182 #define    KEY_SUNDO      0x196    /* Shift Undo key */
183 #define    KEY_SUSPEND    0x197    /* Suspend key */
184 #define    KEY_UNDO       0x198    /* Undo key */
185 #define    KEY_MOUSE      0x199    /* Mouse event has occurred */
186 #define    KEY_MAX        0x199    /* maximum extended key value */
187 
188 /* 8-bit ASCII characters. */
189 #define	unctrl(c)		__unctrl[((unsigned)c) & 0xff]
190 #define	unctrllen(ch)		__unctrllen[((unsigned)ch) & 0xff]
191 
192 extern char	 *__unctrl[256];	/* Control strings. */
193 extern char	 __unctrllen[256];	/* Control strings length. */
194 
195 /*
196  * A window an array of __LINE structures pointed to by the 'lines' pointer.
197  * A line is an array of __LDATA structures pointed to by the 'line' pointer.
198  */
199 
200 /*
201  * Definitions for characters and attributes in __LDATA
202  */
203 #define __CHARTEXT	0x000000ff	/* bits for 8-bit characters */
204 #define __NORMAL	0x00000000	/* Added characters are normal. */
205 #define __STANDOUT	0x00010000	/* Added characters are standout. */
206 #define __UNDERSCORE	0x00020000	/* Added characters are underscored. */
207 #define __REVERSE	0x00040000	/* Added characters are reverse
208 					   video. */
209 #define __BLINK		0x00080000	/* Added characters are blinking. */
210 #define __DIM		0x00100000	/* Added characters are dim. */
211 #define __BOLD		0x00200000	/* Added characters are bold. */
212 #define __BLANK		0x00400000	/* Added characters are blanked. */
213 #define __PROTECT	0x00800000	/* Added characters are protected. */
214 #define __ALTCHARSET	0x01000000	/* Added characters are ACS */
215 #define __COLOR		0x7e000000	/* Color bits */
216 #define __ATTRIBUTES	0x7fff0000	/* All 8-bit attribute bits */
217 
218 typedef struct __ldata __LDATA;
219 typedef struct __line  __LINE;
220 typedef struct __window  WINDOW;
221 typedef struct __screen SCREEN;
222 
223 /*
224  * Attribute definitions
225  */
226 #define	A_NORMAL	__NORMAL
227 #define	A_STANDOUT	__STANDOUT
228 #define	A_UNDERLINE	__UNDERSCORE
229 #define	A_REVERSE	__REVERSE
230 #define	A_BLINK		__BLINK
231 #define	A_DIM		__DIM
232 #define	A_BOLD		__BOLD
233 #define	A_BLANK		__BLANK
234 #define	A_PROTECT	__PROTECT
235 #define	A_ALTCHARSET	__ALTCHARSET
236 #define	A_ATTRIBUTES	__ATTRIBUTES
237 #define	A_CHARTEXT	__CHARTEXT
238 #define	A_COLOR		__COLOR
239 
240 /*
241  * Alternate character set definitions
242  */
243 
244 #define	NUM_ACS	128
245 
246 extern chtype _acs_char[NUM_ACS];
247 
248 #define	ACS_RARROW	_acs_char['+']
249 #define	ACS_LARROW	_acs_char[',']
250 #define	ACS_UARROW	_acs_char['-']
251 #define	ACS_DARROW	_acs_char['.']
252 #define	ACS_BLOCK	_acs_char['0']
253 #define	ACS_DIAMOND	_acs_char['`']
254 #define	ACS_CKBOARD	_acs_char['a']
255 #define	ACS_DEGREE	_acs_char['f']
256 #define	ACS_PLMINUS	_acs_char['g']
257 #define	ACS_BOARD	_acs_char['h']
258 #define	ACS_LANTERN	_acs_char['i']
259 #define	ACS_LRCORNER	_acs_char['j']
260 #define	ACS_URCORNER	_acs_char['k']
261 #define	ACS_ULCORNER	_acs_char['l']
262 #define	ACS_LLCORNER	_acs_char['m']
263 #define	ACS_PLUS	_acs_char['n']
264 #define	ACS_HLINE	_acs_char['q']
265 #define	ACS_S1		_acs_char['o']
266 #define	ACS_S9		_acs_char['s']
267 #define	ACS_LTEE	_acs_char['t']
268 #define	ACS_RTEE	_acs_char['u']
269 #define	ACS_BTEE	_acs_char['v']
270 #define	ACS_TTEE	_acs_char['w']
271 #define	ACS_VLINE	_acs_char['x']
272 #define	ACS_BULLET	_acs_char['~']
273 
274 /* System V compatibility */
275 #define	ACS_SBBS	ACS_LRCORNER
276 #define	ACS_BBSS	ACS_URCORNER
277 #define	ACS_BSSB	ACS_ULCORNER
278 #define	ACS_SSBB	ACS_LLCORNER
279 #define	ACS_SSSS	ACS_PLUS
280 #define	ACS_BSBS	ACS_HLINE
281 #define	ACS_SSSB	ACS_LTEE
282 #define	ACS_SBSS	ACS_RTEE
283 #define	ACS_SSBS	ACS_BTEE
284 #define	ACS_BSSS	ACS_TTEE
285 #define	ACS_SBSB	ACS_VLINE
286 #define	_acs_map	_acs_char
287 
288 /*
289  * Colour definitions (ANSI colour numbers)
290  */
291 
292 #define	COLOR_BLACK	0x00
293 #define	COLOR_RED	0x01
294 #define	COLOR_GREEN	0x02
295 #define	COLOR_YELLOW	0x03
296 #define	COLOR_BLUE	0x04
297 #define	COLOR_MAGENTA	0x05
298 #define	COLOR_CYAN	0x06
299 #define	COLOR_WHITE	0x07
300 
301 #define	COLOR_PAIR(n)	((((u_int32_t)n) << 25) & A_COLOR)
302 #define	PAIR_NUMBER(n)	((((u_int32_t)n) & A_COLOR) >> 25)
303 
304 /* Curses external declarations. */
305 extern WINDOW	*curscr;		/* Current screen. */
306 extern WINDOW	*stdscr;		/* Standard screen. */
307 
308 extern int	__tcaction;		/* If terminal hardware set. */
309 
310 extern int	 COLS;			/* Columns on the screen. */
311 extern int	 LINES;			/* Lines on the screen. */
312 extern int	 COLORS;		/* Max colours on the screen. */
313 extern int	 COLOR_PAIRS;		/* Max colour pairs on the screen. */
314 
315 #define	ERR	(0)			/* Error return. */
316 #define	OK	(1)			/* Success return. */
317 
318 /*
319  * The following have, traditionally, been macros but X/Open say they
320  * need to be functions.  Keep the old macros for debugging.
321  */
322 #ifdef _CURSES_USE_MACROS
323 /* Standard screen pseudo functions. */
324 #define	addbytes(s, n)			__waddbytes(stdscr, s, n, 0)
325 #define	addch(ch)			waddch(stdscr, ch)
326 #define	addnstr(s, n)			waddnstr(stdscr, s, n)
327 #define	addstr(s)			waddnstr(stdscr, s, -1)
328 #define	attroff(attr)			wattroff(stdscr, attr)
329 #define	attron(attr)			wattron(stdscr, attr)
330 #define	attrset(attr)			wattrset(stdscr, attr)
331 #define bkgd(ch)			wbkgd(stdscr, ch)
332 #define bkgdset(ch)			wbkgdset(stdscr, ch)
333 #define	border(l, r, t, b, tl, tr, bl, br) \
334 	wborder(stdscr, l, r, t, b, tl, tr, bl, br)
335 #define	clear()				wclear(stdscr)
336 #define	clrtobot()			wclrtobot(stdscr)
337 #define	clrtoeol()			wclrtoeol(stdscr)
338 #define	delch()				wdelch(stdscr)
339 #define	deleteln()			wdeleteln(stdscr)
340 #define	erase()				werase(stdscr)
341 #define	getch()				wgetch(stdscr)
342 #define	getnstr(s, n)			wgetnstr(stdscr, s, n)
343 #define	getstr(s)			wgetstr(stdscr, s)
344 #define	inch()				winch(stdscr)
345 #define	inchnstr(c)			winchnstr(stdscr, c)
346 #define	inchstr(c)			winchstr(stdscr, c)
347 #define	innstr(s, n)			winnstr(stdscr, s, n)
348 #define	insch(ch)			winsch(stdscr, ch)
349 #define	insdelln(n)			winsdelln(stdscr, n)
350 #define	insertln()			winsertln(stdscr)
351 #define	instr(s)			winstr(stdscr, s)
352 #define	move(y, x)			wmove(stdscr, y, x)
353 #define	refresh()			wrefresh(stdscr)
354 #define	scrl(n)				wscrl(stdscr, n)
355 #define	setscrreg(t, b)			wsetscrreg(stdscr, t, b)
356 #define	standend()			wstandend(stdscr)
357 #define	standout()			wstandout(stdscr)
358 #define	timeout(delay)			wtimeout(stdscr, delay)
359 #define	underscore()			wunderscore(stdscr)
360 #define	underend()			wunderend(stdscr)
361 #define	waddbytes(w, s, n)		__waddbytes(w, s, n, 0)
362 #define	waddstr(w, s)			waddnstr(w, s, -1)
363 
364 /* Standard screen plus movement pseudo functions. */
365 #define	mvaddbytes(y, x, s, n)		mvwaddbytes(stdscr, y, x, s, n)
366 #define	mvaddch(y, x, ch)		mvwaddch(stdscr, y, x, ch)
367 #define	mvaddnstr(y, x, s, n)		mvwaddnstr(stdscr, y, x, s, n)
368 #define	mvaddstr(y, x, s)		mvwaddstr(stdscr, y, x, s)
369 #define	mvdelch(y, x)			mvwdelch(stdscr, y, x)
370 #define	mvgetch(y, x)			mvwgetch(stdscr, y, x)
371 #define	mvgetnstr(y, x, s)		mvwgetnstr(stdscr, y, x, s, n)
372 #define	mvgetstr(y, x, s)		mvwgetstr(stdscr, y, x, s)
373 #define	mvinch(y, x)			mvwinch(stdscr, y, x)
374 #define	mvinchnstr(y, x, c, n)		mvwinchnstr(stdscr, y, x, c, n)
375 #define	mvinchstr(y, x, c)		mvwinchstr(stdscr, y, x, c)
376 #define	mvinnstr(y, x, s, n)		mvwinnstr(stdscr, y, x, s, n)
377 #define	mvinsch(y, x, c)		mvwinsch(stdscr, y, x, c)
378 #define	mvinstr(y, x, s)		mvwinstr(stdscr, y, x, s)
379 #define	mvwaddbytes(w, y, x, s, n) \
380 	(wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, n, 0))
381 #define	mvwaddch(w, y, x, ch) \
382 	(wmove(w, y, x) == ERR ? ERR : waddch(w, ch))
383 #define	mvwaddnstr(w, y, x, s, n) \
384 	(wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, n))
385 #define	mvwaddstr(w, y, x, s) \
386 	(wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, -1))
387 #define	mvwdelch(w, y, x) \
388 	(wmove(w, y, x) == ERR ? ERR : wdelch(w))
389 #define	mvwgetch(w, y, x) \
390 	(wmove(w, y, x) == ERR ? ERR : wgetch(w))
391 #define	mvwgetnstr(w, y, x, s, n) \
392 	(wmove(w, y, x) == ERR ? ERR : wgetnstr(w, s, n))
393 #define	mvwgetstr(w, y, x, s) \
394 	(wmove(w, y, x) == ERR ? ERR : wgetstr(w, s))
395 #define	mvwinch(w, y, x) \
396 	(wmove(w, y, x) == ERR ? ERR : winch(w))
397 #define	mvwinchnstr(w, y, x, c, n) \
398 	(wmove(w, y, x) == ERR ? ERR : winchnstr(w, c, n))
399 #define	mvwinchstr(w, y, x, s) \
400 	(wmove(w, y, x) == ERR ? ERR : winchstr(w, c))
401 #define	mvwinnstr(w, y, x, s, n) \
402 	(wmove(w, y, x) == ERR ? ERR : winnstr(w, s, n))
403 #define	mvwinsch(w, y, x, c) \
404 	(wmove(w, y, x) == ERR ? ERR : winsch(w, c))
405 #define	mvwinstr(w, y, x, s) \
406 	(wmove(w, y, x) == ERR ? ERR : winstr(w, s))
407 
408 #else
409 /* Use functions not macros... */
410 __BEGIN_DECLS
411 int	 addbytes(const char *, int);
412 int	 addch(chtype);
413 int	 addnstr(const char *, int);
414 int	 addstr(const char *);
415 int	 attroff(int);
416 int	 attron(int);
417 int	 attrset(int);
418 int	 bkgd(chtype);
419 void	 bkgdset(chtype);
420 int	 border(chtype, chtype, chtype, chtype,
421 	   chtype, chtype, chtype, chtype);
422 int	 clear(void);
423 int	 clrtobot(void);
424 int	 clrtoeol(void);
425 int	 delch(void);
426 int	 deleteln(void);
427 int	 erase(void);
428 int	 getch(void);
429 int	 getnstr(char *, int);
430 int	 getstr(char *);
431 chtype	 inch(void);
432 int	 inchnstr(chtype *, int);
433 int	 inchstr(chtype *);
434 int	 innstr(char *, int);
435 int	 insch(chtype);
436 int	 insdelln(int);
437 int	 insertln(void);
438 int	 instr(char *);
439 int	 move(int, int);
440 int	 refresh(void);
441 int	 scrl(int);
442 int	 setscrreg(int, int);
443 int	 standend(void);
444 int	 standout(void);
445 void	 timeout(int);
446 int	 underscore(void);
447 int	 underend(void);
448 int	 waddbytes(WINDOW *, const char *, int);
449 int	 waddstr(WINDOW *, const char *);
450 
451 /* Standard screen plus movement functions. */
452 int	 mvaddbytes(int, int, const char *, int);
453 int	 mvaddch(int, int, chtype);
454 int	 mvaddnstr(int, int, const char *, int);
455 int	 mvaddstr(int, int, const char *);
456 int	 mvdelch(int, int);
457 int	 mvgetch(int, int);
458 int	 mvgetnstr(int, int, char *, int);
459 int	 mvgetstr(int, int, char *);
460 chtype	 mvinch(int, int);
461 int	 mvinchnstr(int, int, chtype *, int);
462 int	 mvinchstr(int, int, chtype *);
463 int	 mvinnstr(int, int, char *, int);
464 int	 mvinsch(int, int, chtype);
465 int	 mvinstr(int, int, char *);
466 
467 int	 mvwaddbytes(WINDOW *, int, int, const char *, int);
468 int	 mvwaddch(WINDOW *, int, int, chtype);
469 int	 mvwaddnstr(WINDOW *, int, int, const char *, int);
470 int	 mvwaddstr(WINDOW *, int, int, const char *);
471 int	 mvwdelch(WINDOW *, int, int);
472 int	 mvwgetch(WINDOW *, int, int);
473 int	 mvwgetnstr(WINDOW *, int, int, char *, int);
474 int	 mvwgetstr(WINDOW *, int, int, char *);
475 chtype	 mvwinch(WINDOW *, int, int);
476 int	 mvwinsch(WINDOW *, int, int, chtype);
477 __END_DECLS
478 #endif /* _CURSES_USE_MACROS */
479 
480 #define	getyx(w, y, x)		(y) = getcury(w), (x) = getcurx(w)
481 #define	getbegyx(w, y, x)	(y) = getbegy(w), (x) = getbegx(w)
482 #define	getmaxyx(w, y, x)	(y) = getmaxy(w), (x) = getmaxx(w)
483 #define	getparyx(w, y, x)	(y) = getpary(w), (x) = getparx(w)
484 
485 /* Public function prototypes. */
486 __BEGIN_DECLS
487 int	 assume_default_colors(short, short);
488 int	 baudrate(void);
489 int	 beep(void);
490 int	 box(WINDOW *, chtype, chtype);
491 bool	 can_change_colors(void);
492 int	 cbreak(void);
493 int	 clearok(WINDOW *, bool);
494 int	 color_content(short, short *, short *, short *);
495 int	 copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, int);
496 int	 curs_set(int);
497 int	 def_prog_mode(void);
498 int	 def_shell_mode(void);
499 int      define_key(char *, int);
500 int	 delay_output(int);
501 void     delscreen(SCREEN *);
502 int	 delwin(WINDOW *);
503 WINDOW	*derwin(WINDOW *, int, int, int, int);
504 WINDOW	*dupwin(WINDOW *);
505 int	 doupdate(void);
506 int	 echo(void);
507 int	 endwin(void);
508 char     erasechar(void);
509 int	 flash(void);
510 int	 flushinp(void);
511 int	 flushok(WINDOW *, bool);
512 char	*fullname(const char *, char *);
513 chtype	 getattrs(WINDOW *);
514 chtype	 getbkgd(WINDOW *);
515 char	*getcap(char *);
516 int	 getcury(WINDOW *);
517 int	 getcurx(WINDOW *);
518 int	 getbegy(WINDOW *);
519 int	 getbegx(WINDOW *);
520 int	 getmaxy(WINDOW *);
521 int	 getmaxx(WINDOW *);
522 int	 getpary(WINDOW *);
523 int	 getparx(WINDOW *);
524 int	 gettmode(void);
525 bool	 has_colors(void);
526 bool	 has_ic(void);
527 bool	 has_il(void);
528 int	 hline(chtype, int);
529 int	 idcok(WINDOW *, bool);
530 int	 idlok(WINDOW *, bool);
531 int	 init_color(short, short, short, short);
532 int	 init_pair(short, short, short);
533 WINDOW	*initscr(void);
534 int	 intrflush(WINDOW *, bool);
535 bool	 isendwin(void);
536 bool	 is_linetouched(WINDOW *, int);
537 bool	 is_wintouched(WINDOW *);
538 int      keyok(int, bool);
539 void	 keypad(WINDOW *, bool);
540 char     killchar(void);
541 int	 leaveok(WINDOW *, bool);
542 char	*longname(void);
543 int	 meta(WINDOW *, bool);
544 int	 mvcur(int, int, int, int);
545 int      mvderwin(WINDOW *, int, int);
546 int	 mvhline(int, int, chtype, int);
547 int	 mvprintw(int, int, const char *, ...)
548 		__attribute__((__format__(__printf__, 3, 4)));
549 int	 mvscanw(int, int, const char *, ...)
550 		__attribute__((__format__(__scanf__, 3, 4)));
551 int	 mvvline(int, int, chtype, int);
552 int	 mvwhline(WINDOW *, int, int, chtype, int);
553 int	 mvwvline(WINDOW *, int, int, chtype, int);
554 int	 mvwin(WINDOW *, int, int);
555 int	 mvwinchnstr(WINDOW *, int, int, chtype *, int);
556 int	 mvwinchstr(WINDOW *, int, int, chtype *);
557 int	 mvwinnstr(WINDOW *, int, int, char *, int);
558 int	 mvwinstr(WINDOW *, int, int, char *);
559 int	 mvwprintw(WINDOW *, int, int, const char *, ...)
560 		__attribute__((__format__(__printf__, 4, 5)));
561 int	 mvwscanw(WINDOW *, int, int, const char *, ...)
562 		__attribute__((__format__(__scanf__, 4, 5)));
563 int	 napms(int);
564 SCREEN  *newterm(char *, FILE *, FILE *);
565 WINDOW	*newwin(int, int, int, int);
566 int	 nl(void);
567 int	 nocbreak(void);
568 void	 nodelay(WINDOW *, bool);
569 int	 noecho(void);
570 int	 nonl(void);
571 int	 noraw(void);
572 int	 notimeout(WINDOW *, bool);
573 int	 overlay(const WINDOW *, WINDOW *);
574 int	 overwrite(const WINDOW *, WINDOW *);
575 int	 pair_content(short, short *, short *);
576 int	 printw(const char *, ...)
577 		__attribute__((__format__(__printf__, 1, 2)));
578 int	 raw(void);
579 int	 reset_prog_mode(void);
580 int	 reset_shell_mode(void);
581 int	 resetty(void);
582 int      resizeterm(int, int);
583 int	 savetty(void);
584 int	 scanw(const char *, ...)
585 		__attribute__((__format__(__scanf__, 1, 2)));
586 int	 scroll(WINDOW *);
587 int	 scrollok(WINDOW *, bool);
588 int	 setterm(char *);
589 SCREEN  *set_term(SCREEN *);
590 int	 start_color(void);
591 WINDOW	*subwin(WINDOW *, int, int, int, int);
592 int	 touchline(WINDOW *, int, int);
593 int	 touchoverlap(WINDOW *, WINDOW *);
594 int	 touchwin(WINDOW *);
595 int	 ungetch(int);
596 int	 untouchwin(WINDOW *);
597 int	 use_default_colors(void);
598 int	 vline(chtype, int);
599 int	 vwprintw(WINDOW *, const char *, _BSD_VA_LIST_)
600 		__attribute__((__format__(__printf__, 2, 0)));
601 int	 vwscanw(WINDOW *, const char *, _BSD_VA_LIST_)
602 		__attribute__((__format__(__scanf__, 2, 0)));
603 int	 waddch(WINDOW *, chtype);
604 int	 waddnstr(WINDOW *, const char *, int);
605 int	 wattroff(WINDOW *, int);
606 int	 wattron(WINDOW *, int);
607 int	 wattrset(WINDOW *, int);
608 int	 wbkgd(WINDOW *, chtype);
609 void	 wbkgdset(WINDOW *, chtype);
610 int	 wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype,
611 		chtype, chtype);
612 int	 wclear(WINDOW *);
613 int	 wclrtobot(WINDOW *);
614 int	 wclrtoeol(WINDOW *);
615 int	 wdelch(WINDOW *);
616 int	 wdeleteln(WINDOW *);
617 int	 werase(WINDOW *);
618 int	 wgetch(WINDOW *);
619 int	 wgetnstr(WINDOW *, char *, int);
620 int	 wgetstr(WINDOW *, char *);
621 int	 whline(WINDOW *, chtype, int);
622 chtype	 winch(WINDOW *);
623 int	 winchnstr(WINDOW *, chtype *, int);
624 int	 winchstr(WINDOW *, chtype *);
625 int	 winnstr(WINDOW *, char *, int);
626 int	 winsch(WINDOW *, chtype);
627 int	 winsdelln(WINDOW *, int);
628 int	 winsertln(WINDOW *);
629 int	 winstr(WINDOW *, char *);
630 int	 wmove(WINDOW *, int, int);
631 int	 wnoutrefresh(WINDOW *);
632 int	 wprintw(WINDOW *, const char *, ...)
633 		__attribute__((__format__(__printf__, 2, 3)));
634 int	 wrefresh(WINDOW *);
635 int      wresize(WINDOW *, int, int);
636 int	 wscanw(WINDOW *, const char *, ...)
637 		__attribute__((__format__(__scanf__, 2, 3)));
638 int	 wscrl(WINDOW *, int);
639 int	 wsetscrreg(WINDOW *, int, int);
640 int	 wstandend(WINDOW *);
641 int	 wstandout(WINDOW *);
642 void	 wtimeout(WINDOW *, int);
643 int	 wtouchln(WINDOW *, int, int, int);
644 int	 wunderend(WINDOW *);
645 int	 wunderscore(WINDOW *);
646 int	 wvline(WINDOW *, chtype, int);
647 
648 /* Private functions that are needed for user programs prototypes. */
649 int	 __cputchar(int);
650 int	 __waddbytes(WINDOW *, const char *, int, attr_t);
651 __END_DECLS
652 
653 #endif /* !_CURSES_H_ */
654