curses.h revision 1.125 1 /* $NetBSD: curses.h,v 1.125 2019/09/03 10:36:17 roy 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. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * @(#)curses.h 8.5 (Berkeley) 4/29/95
32 *
33 * Modified by Ruibiao Qiu <ruibiao (at) arl.wustl.edu,ruibiao (at) gmail.com> 2005
34 * to add wide-character support
35 * - Add complex character structure (cchar_t)
36 * - Add definitions of wide-character routines
37 * - Add KEY_CODE_YES
38 */
39
40 #ifndef _CURSES_H_
41 #define _CURSES_H_
42
43 #include <sys/types.h>
44 #include <sys/cdefs.h>
45 #include <wchar.h>
46
47 #include <stdio.h>
48 #include <stdbool.h>
49
50 /*
51 * #define __NetBSD_Curses_Version__ MMmmrrpp00
52 *
53 * M = major version
54 * m = minor version; a minor number of 99 indicates current
55 * r = 0 (*)
56 * p = patchlevel
57 *
58 * This is similar to __NetBSD_Version__ as found in sys/param.h
59 * It is maintained seperately and has no correlation to it or the
60 * ELF symver libcurses is built as.
61 */
62 #define __NetBSD_Curses_Version__ 0200000000 /* NetBSD-Curses 2.0.0 */
63
64 #define __NetBSD_Curses_Prereq__(M,m,p) (((((M) * 100000000) + \
65 (m) * 1000000) + (p) * 100) <= __NetBSD_Curses_Version__)
66
67 /*
68 * attr_t must be the same size as wchar_t (see <wchar.h>) to avoid padding
69 * in __LDATA.
70 */
71 typedef wchar_t chtype;
72 typedef wchar_t attr_t;
73
74 #if !defined(HAVE_WCHAR) && !defined(DISABLE_WCHAR)
75 #define HAVE_WCHAR 1
76 #endif
77
78 #ifdef HAVE_WCHAR
79 /*
80 * The complex character structure required by the X/Open reference and used
81 * in * functions such as in_wchstr(). It includes a string of up to 8 wide
82 * characters and its length, an attribute, and a color-pair.
83 */
84 #define CURSES_CCHAR_MAX 8
85 #define CCHARW_MAX 5
86 typedef struct {
87 attr_t attributes; /* character attributes */
88 unsigned elements; /* number of wide char in
89 vals[] */
90 wchar_t vals[CURSES_CCHAR_MAX]; /* wide chars including
91 non-spacing */
92 } cchar_t;
93 #else
94 typedef chtype cchar_t;
95 #endif /* HAVE_WCHAR */
96
97 #ifndef TRUE
98 #define TRUE (/*CONSTCOND*/1)
99 #endif
100 #ifndef FALSE
101 #define FALSE (/*CONSTCOND*/0)
102 #endif
103
104 #ifndef _CURSES_PRIVATE
105
106 #define _puts(s) tputs(s, 0, __cputchar)
107 #define _putchar(c) __cputchar(c)
108
109 /* Old-style terminal modes access. */
110 #define crmode() cbreak()
111 #define nocrmode() nocbreak()
112 #endif /* _CURSES_PRIVATE */
113
114
115 /* symbols for values returned by getch in keypad mode */
116 #define KEY_MIN 0x101 /* minimum extended key value */
117 #define KEY_BREAK 0x101 /* break key */
118 #define KEY_DOWN 0x102 /* down arrow */
119 #define KEY_UP 0x103 /* up arrow */
120 #define KEY_LEFT 0x104 /* left arrow */
121 #define KEY_RIGHT 0x105 /* right arrow*/
122 #define KEY_HOME 0x106 /* home key */
123 #define KEY_BACKSPACE 0x107 /* Backspace */
124
125 /* First function key (block of 64 follow) */
126 #define KEY_F0 0x108
127 /* Function defining other function key values*/
128 #define KEY_F(n) (KEY_F0+(n))
129
130 #define KEY_DL 0x148 /* Delete Line */
131 #define KEY_IL 0x149 /* Insert Line*/
132 #define KEY_DC 0x14A /* Delete Character */
133 #define KEY_IC 0x14B /* Insert Character */
134 #define KEY_EIC 0x14C /* Exit Insert Char mode */
135 #define KEY_CLEAR 0x14D /* Clear screen */
136 #define KEY_EOS 0x14E /* Clear to end of screen */
137 #define KEY_EOL 0x14F /* Clear to end of line */
138 #define KEY_SF 0x150 /* Scroll one line forward */
139 #define KEY_SR 0x151 /* Scroll one line back */
140 #define KEY_NPAGE 0x152 /* Next Page */
141 #define KEY_PPAGE 0x153 /* Prev Page */
142 #define KEY_STAB 0x154 /* Set Tab */
143 #define KEY_CTAB 0x155 /* Clear Tab */
144 #define KEY_CATAB 0x156 /* Clear All Tabs */
145 #define KEY_ENTER 0x157 /* Enter or Send */
146 #define KEY_SRESET 0x158 /* Soft Reset */
147 #define KEY_RESET 0x159 /* Hard Reset */
148 #define KEY_PRINT 0x15A /* Print */
149 #define KEY_LL 0x15B /* Home Down */
150
151 /*
152 * "Keypad" keys arranged like this:
153 *
154 * A1 up A3
155 * left B2 right
156 * C1 down C3
157 *
158 */
159 #define KEY_A1 0x15C /* Keypad upper left */
160 #define KEY_A3 0x15D /* Keypad upper right */
161 #define KEY_B2 0x15E /* Keypad centre key */
162 #define KEY_C1 0x15F /* Keypad lower left */
163 #define KEY_C3 0x160 /* Keypad lower right */
164
165 #define KEY_BTAB 0x161 /* Back Tab */
166 #define KEY_BEG 0x162 /* Begin key */
167 #define KEY_CANCEL 0x163 /* Cancel key */
168 #define KEY_CLOSE 0x164 /* Close Key */
169 #define KEY_COMMAND 0x165 /* Command Key */
170 #define KEY_COPY 0x166 /* Copy key */
171 #define KEY_CREATE 0x167 /* Create key */
172 #define KEY_END 0x168 /* End key */
173 #define KEY_EXIT 0x169 /* Exit key */
174 #define KEY_FIND 0x16A /* Find key */
175 #define KEY_HELP 0x16B /* Help key */
176 #define KEY_MARK 0x16C /* Mark key */
177 #define KEY_MESSAGE 0x16D /* Message key */
178 #define KEY_MOVE 0x16E /* Move key */
179 #define KEY_NEXT 0x16F /* Next Object key */
180 #define KEY_OPEN 0x170 /* Open key */
181 #define KEY_OPTIONS 0x171 /* Options key */
182 #define KEY_PREVIOUS 0x172 /* Previous Object key */
183 #define KEY_REDO 0x173 /* Redo key */
184 #define KEY_REFERENCE 0x174 /* Ref Key */
185 #define KEY_REFRESH 0x175 /* Refresh key */
186 #define KEY_REPLACE 0x176 /* Replace key */
187 #define KEY_RESTART 0x177 /* Restart key */
188 #define KEY_RESUME 0x178 /* Resume key */
189 #define KEY_SAVE 0x179 /* Save key */
190 #define KEY_SBEG 0x17A /* Shift begin key */
191 #define KEY_SCANCEL 0x17B /* Shift Cancel key */
192 #define KEY_SCOMMAND 0x17C /* Shift Command key */
193 #define KEY_SCOPY 0x17D /* Shift Copy key */
194 #define KEY_SCREATE 0x17E /* Shift Create key */
195 #define KEY_SDC 0x17F /* Shift Delete Character */
196 #define KEY_SDL 0x180 /* Shift Delete Line */
197 #define KEY_SELECT 0x181 /* Select key */
198 #define KEY_SEND 0x182 /* Send key */
199 #define KEY_SEOL 0x183 /* Shift Clear Line key */
200 #define KEY_SEXIT 0x184 /* Shift Exit key */
201 #define KEY_SFIND 0x185 /* Shift Find key */
202 #define KEY_SHELP 0x186 /* Shift Help key */
203 #define KEY_SHOME 0x187 /* Shift Home key */
204 #define KEY_SIC 0x188 /* Shift Input key */
205 #define KEY_SLEFT 0x189 /* Shift Left Arrow key */
206 #define KEY_SMESSAGE 0x18A /* Shift Message key */
207 #define KEY_SMOVE 0x18B /* Shift Move key */
208 #define KEY_SNEXT 0x18C /* Shift Next key */
209 #define KEY_SOPTIONS 0x18D /* Shift Options key */
210 #define KEY_SPREVIOUS 0x18E /* Shift Previous key */
211 #define KEY_SPRINT 0x18F /* Shift Print key */
212 #define KEY_SREDO 0x190 /* Shift Redo key */
213 #define KEY_SREPLACE 0x191 /* Shift Replace key */
214 #define KEY_SRIGHT 0x192 /* Shift Right Arrow key */
215 #define KEY_SRSUME 0x193 /* Shift Resume key */
216 #define KEY_SSAVE 0x194 /* Shift Save key */
217 #define KEY_SSUSPEND 0x195 /* Shift Suspend key */
218 #define KEY_SUNDO 0x196 /* Shift Undo key */
219 #define KEY_SUSPEND 0x197 /* Suspend key */
220 #define KEY_UNDO 0x198 /* Undo key */
221 #define KEY_MOUSE 0x199 /* Mouse event has occurred */
222 #define KEY_RESIZE 0x200 /* Resize event has occurred */
223 #define KEY_MAX 0x240 /* maximum extended key value */
224 #define KEY_CODE_YES 0x241 /* A function key pressed */
225
226 #include <unctrl.h>
227
228 /*
229 * A window an array of __LINE structures pointed to by the 'lines' pointer.
230 * A line is an array of __LDATA structures pointed to by the 'line' pointer.
231 */
232
233 /*
234 * Definitions for characters and attributes in __LDATA
235 */
236 #define __CHARTEXT 0x000000ff /* bits for 8-bit characters */
237 #define __NORMAL 0x00000000 /* Added characters are normal. */
238 #define __STANDOUT 0x00000100 /* Added characters are standout. */
239 #define __UNDERSCORE 0x00000200 /* Added characters are underscored. */
240 #define __REVERSE 0x00000400 /* Added characters are reverse
241 video. */
242 #define __BLINK 0x00000800 /* Added characters are blinking. */
243 #define __DIM 0x00001000 /* Added characters are dim. */
244 #define __BOLD 0x00002000 /* Added characters are bold. */
245 #define __BLANK 0x00004000 /* Added characters are blanked. */
246 #define __PROTECT 0x00008000 /* Added characters are protected. */
247 #define __ALTCHARSET 0x00010000 /* Added characters are ACS */
248 #define __COLOR 0x03fe0000 /* Color bits */
249 #define __ATTRIBUTES 0x03ffff00 /* All 8-bit attribute bits */
250 #ifdef HAVE_WCHAR
251 #define __ACS_IS_WACS 0x04000000 /* internal: use wacs table for ACS char */
252 #endif
253
254 typedef struct __ldata __LDATA;
255 typedef struct __line __LINE;
256 typedef struct __window WINDOW;
257 typedef struct __screen SCREEN;
258
259 /*
260 * Attribute definitions
261 */
262 #define A_NORMAL __NORMAL
263 #define A_STANDOUT __STANDOUT
264 #define A_UNDERLINE __UNDERSCORE
265 #define A_REVERSE __REVERSE
266 #define A_BLINK __BLINK
267 #define A_DIM __DIM
268 #define A_BOLD __BOLD
269 #define A_BLANK __BLANK
270 #define A_INVIS __BLANK
271 #define A_PROTECT __PROTECT
272 #define A_ALTCHARSET __ALTCHARSET
273 #define A_ATTRIBUTES __ATTRIBUTES
274 #define A_CHARTEXT __CHARTEXT
275 #define A_COLOR __COLOR
276
277 #ifdef HAVE_WCHAR
278 #define WA_ATTRIBUTES 0x03ffffff /* Wide character attributes mask */
279 #define WA_NORMAL __NORMAL
280 #define WA_STANDOUT __STANDOUT /* Best highlighting mode */
281 #define WA_UNDERLINE __UNDERSCORE /* Underlining */
282 #define WA_REVERSE __REVERSE /* Reverse video */
283 #define WA_BLINK __BLINK /* Blinking */
284 #define WA_DIM __DIM /* Half bright */
285 #define WA_BOLD __BOLD /* Extra bright or bold */
286 #define WA_INVIS __BLANK /* Invisible */
287 #define WA_PROTECT __PROTECT /* Protected */
288 #define WA_ALTCHARSET __ALTCHARSET /* Alternate character set */
289 #define WA_LOW 0x00000002 /* Low highlight */
290 #define WA_TOP 0x00000004 /* Top highlight */
291 #define WA_HORIZONTAL 0x00000008 /* Horizontal highlight */
292 #define WA_VERTICAL 0x00000010 /* Vertical highlight */
293 #define WA_LEFT 0x00000020 /* Left highlight */
294 #define WA_RIGHT 0x00000040 /* Right highlight */
295 #endif /* HAVE_WCHAR */
296
297 /*
298 * Alternate character set definitions
299 */
300
301 #define NUM_ACS 128
302
303 __BEGIN_DECLS
304 extern chtype _acs_char[NUM_ACS];
305 __END_DECLS
306 #ifdef __cplusplus
307 #define __UC_CAST(a) static_cast<unsigned char>(a)
308 #else
309 #define __UC_CAST(a) (unsigned char)(a)
310 #endif
311
312 /* Standard definitions */
313 #define ACS_RARROW _acs_char[__UC_CAST('+')]
314 #define ACS_LARROW _acs_char[__UC_CAST(',')]
315 #define ACS_UARROW _acs_char[__UC_CAST('-')]
316 #define ACS_DARROW _acs_char[__UC_CAST('.')]
317 #define ACS_BLOCK _acs_char[__UC_CAST('0')]
318 #define ACS_DIAMOND _acs_char[__UC_CAST('`')]
319 #define ACS_CKBOARD _acs_char[__UC_CAST('a')]
320 #define ACS_DEGREE _acs_char[__UC_CAST('f')]
321 #define ACS_PLMINUS _acs_char[__UC_CAST('g')]
322 #define ACS_BOARD _acs_char[__UC_CAST('h')]
323 #define ACS_LANTERN _acs_char[__UC_CAST('i')]
324 #define ACS_LRCORNER _acs_char[__UC_CAST('j')]
325 #define ACS_URCORNER _acs_char[__UC_CAST('k')]
326 #define ACS_ULCORNER _acs_char[__UC_CAST('l')]
327 #define ACS_LLCORNER _acs_char[__UC_CAST('m')]
328 #define ACS_PLUS _acs_char[__UC_CAST('n')]
329 #define ACS_HLINE _acs_char[__UC_CAST('q')]
330 #define ACS_S1 _acs_char[__UC_CAST('o')]
331 #define ACS_S9 _acs_char[__UC_CAST('s')]
332 #define ACS_LTEE _acs_char[__UC_CAST('t')]
333 #define ACS_RTEE _acs_char[__UC_CAST('u')]
334 #define ACS_BTEE _acs_char[__UC_CAST('v')]
335 #define ACS_TTEE _acs_char[__UC_CAST('w')]
336 #define ACS_VLINE _acs_char[__UC_CAST('x')]
337 #define ACS_BULLET _acs_char[__UC_CAST('~')]
338
339 /* Extensions */
340 #define ACS_S3 _acs_char[__UC_CAST('p')]
341 #define ACS_S7 _acs_char[__UC_CAST('r')]
342 #define ACS_LEQUAL _acs_char[__UC_CAST('y')]
343 #define ACS_GEQUAL _acs_char[__UC_CAST('z')]
344 #define ACS_PI _acs_char[__UC_CAST('{')]
345 #define ACS_NEQUAL _acs_char[__UC_CAST('|')]
346 #define ACS_STERLING _acs_char[__UC_CAST('}')]
347
348 #ifdef HAVE_WCHAR
349 __BEGIN_DECLS
350 extern cchar_t _wacs_char[NUM_ACS];
351 __END_DECLS
352
353 #define WACS_RARROW (&_wacs_char[(unsigned char)'+'])
354 #define WACS_LARROW (&_wacs_char[(unsigned char)','])
355 #define WACS_UARROW (&_wacs_char[(unsigned char)'-'])
356 #define WACS_DARROW (&_wacs_char[(unsigned char)'.'])
357 #define WACS_BLOCK (&_wacs_char[(unsigned char)'0'])
358 #define WACS_DIAMOND (&_wacs_char[(unsigned char)'`'])
359 #define WACS_CKBOARD (&_wacs_char[(unsigned char)'a'])
360 #define WACS_DEGREE (&_wacs_char[(unsigned char)'f'])
361 #define WACS_PLMINUS (&_wacs_char[(unsigned char)'g'])
362 #define WACS_BOARD (&_wacs_char[(unsigned char)'h'])
363 #define WACS_LANTERN (&_wacs_char[(unsigned char)'i'])
364 #define WACS_LRCORNER (&_wacs_char[(unsigned char)'j'])
365 #define WACS_URCORNER (&_wacs_char[(unsigned char)'k'])
366 #define WACS_ULCORNER (&_wacs_char[(unsigned char)'l'])
367 #define WACS_LLCORNER (&_wacs_char[(unsigned char)'m'])
368 #define WACS_PLUS (&_wacs_char[(unsigned char)'n'])
369 #define WACS_HLINE (&_wacs_char[(unsigned char)'q'])
370 #define WACS_S1 (&_wacs_char[(unsigned char)'o'])
371 #define WACS_S9 (&_wacs_char[(unsigned char)'s'])
372 #define WACS_LTEE (&_wacs_char[(unsigned char)'t'])
373 #define WACS_RTEE (&_wacs_char[(unsigned char)'u'])
374 #define WACS_BTEE (&_wacs_char[(unsigned char)'v'])
375 #define WACS_TTEE (&_wacs_char[(unsigned char)'w'])
376 #define WACS_VLINE (&_wacs_char[(unsigned char)'x'])
377 #define WACS_BULLET (&_wacs_char[(unsigned char)'~'])
378 #define WACS_S3 (&_wacs_char[(unsigned char)'p'])
379 #define WACS_S7 (&_wacs_char[(unsigned char)'r'])
380 #define WACS_LEQUAL (&_wacs_char[(unsigned char)'y'])
381 #define WACS_GEQUAL (&_wacs_char[(unsigned char)'z'])
382 #define WACS_PI (&_wacs_char[(unsigned char)'{'])
383 #define WACS_NEQUAL (&_wacs_char[(unsigned char)'|'])
384 #define WACS_STERLING (&_wacs_char[(unsigned char)'}'])
385 #endif /* HAVE_WCHAR */
386
387 /* System V compatibility */
388 #define ACS_SBBS ACS_LRCORNER
389 #define ACS_BBSS ACS_URCORNER
390 #define ACS_BSSB ACS_ULCORNER
391 #define ACS_SSBB ACS_LLCORNER
392 #define ACS_SSSS ACS_PLUS
393 #define ACS_BSBS ACS_HLINE
394 #define ACS_SSSB ACS_LTEE
395 #define ACS_SBSS ACS_RTEE
396 #define ACS_SSBS ACS_BTEE
397 #define ACS_BSSS ACS_TTEE
398 #define ACS_SBSB ACS_VLINE
399 #define _acs_map _acs_char
400
401 /*
402 * Color definitions (ANSI color numbers)
403 */
404
405 #define COLOR_BLACK 0x00
406 #define COLOR_RED 0x01
407 #define COLOR_GREEN 0x02
408 #define COLOR_YELLOW 0x03
409 #define COLOR_BLUE 0x04
410 #define COLOR_MAGENTA 0x05
411 #define COLOR_CYAN 0x06
412 #define COLOR_WHITE 0x07
413
414 #ifdef __cplusplus
415 #define __UINT32_CAST(a) static_cast<uint32_t>(a)
416 #else
417 #define __UINT32_CAST(a) (uint32_t)(a)
418 #endif
419 #define COLOR_PAIR(n) (((__UINT32_CAST(n)) << 17) & A_COLOR)
420 #define PAIR_NUMBER(n) (((__UINT32_CAST(n)) & A_COLOR) >> 17)
421
422 /* Curses external declarations. */
423 __BEGIN_DECLS
424 extern WINDOW *curscr; /* Current screen. */
425 extern WINDOW *stdscr; /* Standard screen. */
426
427 extern int __tcaction; /* If terminal hardware set. */
428
429 extern int COLS; /* Columns on the screen. */
430 extern int LINES; /* Lines on the screen. */
431 extern int COLORS; /* Max colors on the screen. */
432 extern int COLOR_PAIRS; /* Max color pairs on the screen. */
433
434 extern int ESCDELAY; /* Delay between keys in esc seq's. */
435 extern int TABSIZE; /* Size of a tab. */
436 __END_DECLS
437
438 #ifndef OK
439 #define ERR (-1) /* Error return. */
440 #define OK (0) /* Success return. */
441 #endif
442
443 /*
444 * The following have, traditionally, been macros but X/Open say they
445 * need to be functions. Keep the old macros for debugging.
446 */
447 #ifdef _CURSES_USE_MACROS
448 /* Standard screen pseudo functions. */
449 #define addbytes(s, n) __waddbytes(stdscr, s, n, 0)
450 #define addch(ch) waddch(stdscr, ch)
451 #define addchnstr(s, n) waddchnstr(stdscr, s, n)
452 #define addchstr(s) waddchnstr(stdscr, s, -1)
453 #define addnstr(s, n) waddnstr(stdscr, s, n)
454 #define addstr(s) waddnstr(stdscr, s, -1)
455 #define attr_get(a, p, o) wattr_get(stdscr, a, p, o)
456 #define attr_off(a, o) wattr_off(stdscr, a, o)
457 #define attr_on(a, o) wattr_on(stdscr, a, o)
458 #define attr_set(a, p, o) wattr_set(stdscr, a, p, o)
459 #define attroff(attr) wattroff(stdscr, attr)
460 #define attron(attr) wattron(stdscr, attr)
461 #define attrset(attr) wattrset(stdscr, attr)
462 #define bkgd(ch) wbkgd(stdscr, ch)
463 #define bkgdset(ch) wbkgdset(stdscr, ch)
464 #define border(l, r, t, b, tl, tr, bl, br) \
465 wborder(stdscr, l, r, t, b, tl, tr, bl, br)
466 #define clear() wclear(stdscr)
467 #define clrtobot() wclrtobot(stdscr)
468 #define clrtoeol() wclrtoeol(stdscr)
469 #define color_set(c, o) wcolor_set(stdscr, c, o)
470 #define delch() wdelch(stdscr)
471 #define deleteln() wdeleteln(stdscr)
472 #define echochar(c) wechochar(stdscr, c)
473 #define erase() werase(stdscr)
474 #define getch() wgetch(stdscr)
475 #define getnstr(s, n) wgetnstr(stdscr, s, n)
476 #define getstr(s) wgetstr(stdscr, s)
477 #define inch() winch(stdscr)
478 #define inchnstr(c) winchnstr(stdscr, c)
479 #define inchstr(c) winchstr(stdscr, c)
480 #define innstr(s, n) winnstr(stdscr, s, n)
481 #define insch(ch) winsch(stdscr, ch)
482 #define insdelln(n) winsdelln(stdscr, n)
483 #define insertln() winsertln(stdscr)
484 #define instr(s) winstr(stdscr, s)
485 #define move(y, x) wmove(stdscr, y, x)
486 #define refresh() wrefresh(stdscr)
487 #define scrl(n) wscrl(stdscr, n)
488 #define setscrreg(t, b) wsetscrreg(stdscr, t, b)
489 #define standend() wstandend(stdscr)
490 #define standout() wstandout(stdscr)
491 #define timeout(delay) wtimeout(stdscr, delay)
492 #define underscore() wunderscore(stdscr)
493 #define underend() wunderend(stdscr)
494 #define waddbytes(w, s, n) __waddbytes(w, s, n, 0)
495 #define waddstr(w, s) waddnstr(w, s, -1)
496
497 /* Standard screen plus movement pseudo functions. */
498 #define mvaddbytes(y, x, s, n) mvwaddbytes(stdscr, y, x, s, n)
499 #define mvaddch(y, x, ch) mvwaddch(stdscr, y, x, ch)
500 #define mvaddchnstr(y, x, s, n) mvwaddchnstr(stdscr, y, x, s, n)
501 #define mvaddchstr(y, x, s) mvwaddchstr(stdscr, y, x, s)
502 #define mvaddnstr(y, x, s, n) mvwaddnstr(stdscr, y, x, s, n)
503 #define mvaddstr(y, x, s) mvwaddstr(stdscr, y, x, s)
504 #define mvdelch(y, x) mvwdelch(stdscr, y, x)
505 #define mvgetch(y, x) mvwgetch(stdscr, y, x)
506 #define mvgetnstr(y, x, s, n) mvwgetnstr(stdscr, y, x, s, n)
507 #define mvgetstr(y, x, s) mvwgetstr(stdscr, y, x, s)
508 #define mvinch(y, x) mvwinch(stdscr, y, x)
509 #define mvinchnstr(y, x, c, n) mvwinchnstr(stdscr, y, x, c, n)
510 #define mvinchstr(y, x, c) mvwinchstr(stdscr, y, x, c)
511 #define mvinnstr(y, x, s, n) mvwinnstr(stdscr, y, x, s, n)
512 #define mvinsch(y, x, c) mvwinsch(stdscr, y, x, c)
513 #define mvinstr(y, x, s) mvwinstr(stdscr, y, x, s)
514 #define mvwaddbytes(w, y, x, s, n) \
515 (wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, n, 0))
516 #define mvwaddch(w, y, x, ch) \
517 (wmove(w, y, x) == ERR ? ERR : waddch(w, ch))
518 #define mvwaddchnstr(w, y, x, s, n) \
519 (wmove(w, y, x) == ERR ? ERR : waddchnstr(w, s, n))
520 #define mvwaddchstr(w, y, x, s) \
521 (wmove(w, y, x) == ERR ? ERR : waddchnstr(w, s, -1))
522 #define mvwaddnstr(w, y, x, s, n) \
523 (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, n))
524 #define mvwaddstr(w, y, x, s) \
525 (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, -1))
526 #define mvwdelch(w, y, x) \
527 (wmove(w, y, x) == ERR ? ERR : wdelch(w))
528 #define mvwgetch(w, y, x) \
529 (wmove(w, y, x) == ERR ? ERR : wgetch(w))
530 #define mvwgetnstr(w, y, x, s, n) \
531 (wmove(w, y, x) == ERR ? ERR : wgetnstr(w, s, n))
532 #define mvwgetstr(w, y, x, s) \
533 (wmove(w, y, x) == ERR ? ERR : wgetstr(w, s))
534 #define mvwinch(w, y, x) \
535 (wmove(w, y, x) == ERR ? ERR : winch(w))
536 #define mvwinchnstr(w, y, x, c, n) \
537 (wmove(w, y, x) == ERR ? ERR : winchnstr(w, c, n))
538 #define mvwinchstr(w, y, x, s) \
539 (wmove(w, y, x) == ERR ? ERR : winchstr(w, c))
540 #define mvwinnstr(w, y, x, s, n) \
541 (wmove(w, y, x) == ERR ? ERR : winnstr(w, s, n))
542 #define mvwinsch(w, y, x, c) \
543 (wmove(w, y, x) == ERR ? ERR : winsch(w, c))
544 #define mvwinstr(w, y, x, s) \
545 (wmove(w, y, x) == ERR ? ERR : winstr(w, s))
546
547 /* Miscellaneous. */
548 #define noqiflush() intrflush(stdscr, FALSE)
549 #define qiflush() intrflush(stdscr, TRUE)
550
551 #else
552 /* Use functions not macros... */
553 __BEGIN_DECLS
554 int addbytes(const char *, int);
555 int addch(chtype);
556 int addchnstr(const chtype *, int);
557 int addchstr(const chtype *);
558 int addnstr(const char *, int);
559 int addstr(const char *);
560 int attr_get(attr_t *, short *, void *);
561 int attr_off(attr_t, void *);
562 int attr_on(attr_t, void *);
563 int attr_set(attr_t, short, void *);
564 int attroff(int);
565 int attron(int);
566 int attrset(int);
567 int bkgd(chtype);
568 void bkgdset(chtype);
569 int border(chtype, chtype, chtype, chtype,
570 chtype, chtype, chtype, chtype);
571 int clear(void);
572 int clrtobot(void);
573 int clrtoeol(void);
574 int color_set(short, void *);
575 int delch(void);
576 int deleteln(void);
577 int echochar(const chtype);
578 int erase(void);
579 int getch(void);
580 int getnstr(char *, int);
581 int getstr(char *);
582 chtype inch(void);
583 int inchnstr(chtype *, int);
584 int inchstr(chtype *);
585 int innstr(char *, int);
586 int insch(chtype);
587 int insdelln(int);
588 int insertln(void);
589 int instr(char *);
590 int move(int, int);
591 int refresh(void);
592 int scrl(int);
593 int setscrreg(int, int);
594 int standend(void);
595 int standout(void);
596 void timeout(int);
597 int underscore(void);
598 int underend(void);
599 int waddbytes(WINDOW *, const char *, int);
600 int waddstr(WINDOW *, const char *);
601
602 /* Standard screen plus movement functions. */
603 int mvaddbytes(int, int, const char *, int);
604 int mvaddch(int, int, chtype);
605 int mvaddchnstr(int, int, const chtype *, int);
606 int mvaddchstr(int, int, const chtype *);
607 int mvaddnstr(int, int, const char *, int);
608 int mvaddstr(int, int, const char *);
609 int mvdelch(int, int);
610 int mvgetch(int, int);
611 int mvgetnstr(int, int, char *, int);
612 int mvgetstr(int, int, char *);
613 chtype mvinch(int, int);
614 int mvinchnstr(int, int, chtype *, int);
615 int mvinchstr(int, int, chtype *);
616 int mvinnstr(int, int, char *, int);
617 int mvinsch(int, int, chtype);
618 int mvinstr(int, int, char *);
619
620 int mvwaddbytes(WINDOW *, int, int, const char *, int);
621 int mvwaddch(WINDOW *, int, int, chtype);
622 int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
623 int mvwaddchstr(WINDOW *, int, int, const chtype *);
624 int mvwaddnstr(WINDOW *, int, int, const char *, int);
625 int mvwaddstr(WINDOW *, int, int, const char *);
626 int mvwdelch(WINDOW *, int, int);
627 int mvwgetch(WINDOW *, int, int);
628 int mvwgetnstr(WINDOW *, int, int, char *, int);
629 int mvwgetstr(WINDOW *, int, int, char *);
630 chtype mvwinch(WINDOW *, int, int);
631 int mvwinsch(WINDOW *, int, int, chtype);
632 __END_DECLS
633 #endif /* _CURSES_USE_MACROS */
634
635 #define getyx(w, y, x) (y) = getcury(w), (x) = getcurx(w)
636 #define getbegyx(w, y, x) (y) = getbegy(w), (x) = getbegx(w)
637 #define getmaxyx(w, y, x) (y) = getmaxy(w), (x) = getmaxx(w)
638 #define getparyx(w, y, x) (y) = getpary(w), (x) = getparx(w)
639
640 #define getsyx(y, x) \
641 do { \
642 if (is_leaveok(curscr)) \
643 (y) = (x) = -1; \
644 else \
645 getyx(curscr,(y), (x)); \
646 } while(0 /* CONSTCOND */)
647 #define setsyx(y, x) \
648 do { \
649 if ((y) == -1 && (x) == -1) \
650 leaveok(curscr, TRUE); \
651 else { \
652 leaveok(curscr, FALSE); \
653 wmove(curscr, (y), (x)); \
654 } \
655 } while(0 /* CONSTCOND */)
656
657
658 /* Public function prototypes. */
659 __BEGIN_DECLS
660 int assume_default_colors(short, short);
661 int baudrate(void);
662 int beep(void);
663 int box(WINDOW *, chtype, chtype);
664 bool can_change_color(void);
665 int cbreak(void);
666 int clearok(WINDOW *, bool);
667 int color_content(short, short *, short *, short *);
668 int copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, int);
669 int curs_set(int);
670 int def_prog_mode(void);
671 int def_shell_mode(void);
672 int define_key(char *, int);
673 int delay_output(int);
674 void delscreen(SCREEN *);
675 int delwin(WINDOW *);
676 WINDOW *derwin(WINDOW *, int, int, int, int);
677 WINDOW *dupwin(WINDOW *);
678 int doupdate(void);
679 int echo(void);
680 int endwin(void);
681 char erasechar(void);
682 void filter(void);
683 int flash(void);
684 int flushinp(void);
685 int flushok(WINDOW *, bool);
686 char *fullname(const char *, char *);
687 chtype getattrs(WINDOW *);
688 chtype getbkgd(WINDOW *);
689 int getcury(WINDOW *);
690 int getcurx(WINDOW *);
691 int getbegy(WINDOW *);
692 int getbegx(WINDOW *);
693 int getmaxy(WINDOW *);
694 int getmaxx(WINDOW *);
695 int getpary(WINDOW *);
696 int getparx(WINDOW *);
697 int gettmode(void);
698 WINDOW *getwin(FILE *);
699 int halfdelay(int);
700 bool has_colors(void);
701 bool has_ic(void);
702 bool has_il(void);
703 int has_key(int);
704 int hline(chtype, int);
705 int idcok(WINDOW *, bool);
706 int idlok(WINDOW *, bool);
707 int immedok(WINDOW *, bool);
708 int init_color(short, short, short, short);
709 int init_pair(short, short, short);
710 WINDOW *initscr(void);
711 int intrflush(WINDOW *, bool);
712 bool isendwin(void);
713 bool is_linetouched(WINDOW *, int);
714 bool is_wintouched(WINDOW *);
715 bool is_term_resized(int, int);
716 int keyok(int, bool);
717 int keypad(WINDOW *, bool);
718 char *keyname(int);
719 char killchar(void);
720 int leaveok(WINDOW *, bool);
721 int meta(WINDOW *, bool);
722 int mvcur(int, int, int, int);
723 int mvderwin(WINDOW *, int, int);
724 int mvhline(int, int, chtype, int);
725 int mvprintw(int, int, const char *, ...) __printflike(3, 4);
726 int mvscanw(int, int, const char *, ...) __scanflike(3, 4);
727 int mvvline(int, int, chtype, int);
728 int mvwhline(WINDOW *, int, int, chtype, int);
729 int mvwvline(WINDOW *, int, int, chtype, int);
730 int mvwin(WINDOW *, int, int);
731 int mvwinchnstr(WINDOW *, int, int, chtype *, int);
732 int mvwinchstr(WINDOW *, int, int, chtype *);
733 int mvwinnstr(WINDOW *, int, int, char *, int);
734 int mvwinstr(WINDOW *, int, int, char *);
735 int mvwprintw(WINDOW *, int, int, const char *, ...) __printflike(4, 5);
736 int mvwscanw(WINDOW *, int, int, const char *, ...) __scanflike(4, 5);
737 int napms(int);
738 WINDOW *newpad(int, int);
739 SCREEN *newterm(char *, FILE *, FILE *);
740 WINDOW *newwin(int, int, int, int);
741 int nl(void);
742 attr_t no_color_attributes(void);
743 int nocbreak(void);
744 int nodelay(WINDOW *, bool);
745 int noecho(void);
746 int nonl(void);
747 void noqiflush(void);
748 int noraw(void);
749 int notimeout(WINDOW *, bool);
750 int overlay(const WINDOW *, WINDOW *);
751 int overwrite(const WINDOW *, WINDOW *);
752 int pair_content(short, short *, short *);
753 int pechochar(WINDOW *, const chtype);
754 int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
755 int prefresh(WINDOW *, int, int, int, int, int, int);
756 int printw(const char *, ...) __printflike(1, 2);
757 int putwin(WINDOW *, FILE *);
758 void qiflush(void);
759 int raw(void);
760 int redrawwin(WINDOW *);
761 int reset_prog_mode(void);
762 int reset_shell_mode(void);
763 int resetty(void);
764 int resizeterm(int, int);
765 int resize_term(int, int);
766 int ripoffline(int, int (*)(WINDOW *, int));
767 int savetty(void);
768 int scanw(const char *, ...) __scanflike(1, 2);
769 int scroll(WINDOW *);
770 int scrollok(WINDOW *, bool);
771 int setterm(char *);
772 int set_escdelay(int);
773 int set_tabsize(int);
774 SCREEN *set_term(SCREEN *);
775 int start_color(void);
776 WINDOW *subpad(WINDOW *, int, int, int, int);
777 WINDOW *subwin(WINDOW *, int, int, int, int);
778 int syncok(WINDOW *, bool);
779 chtype termattrs(void);
780 attr_t term_attrs(void);
781 int touchline(WINDOW *, int, int);
782 int touchoverlap(WINDOW *, WINDOW *);
783 int touchwin(WINDOW *);
784 int typeahead(int);
785 int ungetch(int);
786 int untouchwin(WINDOW *);
787 int use_default_colors(void);
788 void use_env(bool);
789 int vline(chtype, int);
790 int vw_printw(WINDOW *, const char *, __va_list) __printflike(2, 0);
791 int vw_scanw(WINDOW *, const char *, __va_list) __scanflike(2, 0);
792 int vwprintw(WINDOW *, const char *, __va_list) __printflike(2, 0);
793 int vwscanw(WINDOW *, const char *, __va_list) __scanflike(2, 0);
794 int waddch(WINDOW *, chtype);
795 int waddchnstr(WINDOW *, const chtype *, int);
796 int waddchstr(WINDOW *, const chtype *);
797 int waddnstr(WINDOW *, const char *, int);
798 int wattr_get(WINDOW *, attr_t *, short *, void *);
799 int wattr_off(WINDOW *, attr_t, void *);
800 int wattr_on(WINDOW *, attr_t, void *);
801 int wattr_set(WINDOW *, attr_t, short, void *);
802 int wattroff(WINDOW *, int);
803 int wattron(WINDOW *, int);
804 int wattrset(WINDOW *, int);
805 int wbkgd(WINDOW *, chtype);
806 void wbkgdset(WINDOW *, chtype);
807 int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype,
808 chtype, chtype);
809 int wclear(WINDOW *);
810 int wclrtobot(WINDOW *);
811 int wclrtoeol(WINDOW *);
812 int wcolor_set(WINDOW *, short, void *);
813 void wcursyncup(WINDOW *);
814 int wdelch(WINDOW *);
815 int wdeleteln(WINDOW *);
816 int wechochar(WINDOW *, const chtype);
817 int werase(WINDOW *);
818 int wgetch(WINDOW *);
819 int wgetnstr(WINDOW *, char *, int);
820 int wgetstr(WINDOW *, char *);
821 int whline(WINDOW *, chtype, int);
822 chtype winch(WINDOW *);
823 int winchnstr(WINDOW *, chtype *, int);
824 int winchstr(WINDOW *, chtype *);
825 int winnstr(WINDOW *, char *, int);
826 int winsch(WINDOW *, chtype);
827 int winsdelln(WINDOW *, int);
828 int winsertln(WINDOW *);
829 int winstr(WINDOW *, char *);
830 int wmove(WINDOW *, int, int);
831 int wnoutrefresh(WINDOW *);
832 int wprintw(WINDOW *, const char *, ...) __printflike(2, 3);
833 int wredrawln(WINDOW *, int, int);
834 int wrefresh(WINDOW *);
835 int wresize(WINDOW *, int, int);
836 int wscanw(WINDOW *, const char *, ...) __scanflike(2, 3);
837 int wscrl(WINDOW *, int);
838 int wsetscrreg(WINDOW *, int, int);
839 int wstandend(WINDOW *);
840 int wstandout(WINDOW *);
841 void wsyncdown(WINDOW *);
842 void wsyncup(WINDOW *);
843 void wtimeout(WINDOW *, int);
844 int wtouchln(WINDOW *, int, int, int);
845 int wunderend(WINDOW *);
846 int wunderscore(WINDOW *);
847 int wvline(WINDOW *, chtype, int);
848
849 int insnstr(const char *, int);
850 int insstr(const char *);
851 int mvinsnstr(int, int, const char *, int);
852 int mvinsstr(int, int, const char *);
853 int mvwinsnstr(WINDOW *, int, int, const char *, int);
854 int mvwinsstr(WINDOW *, int, int, const char *);
855 int winsnstr(WINDOW *, const char *, int);
856 int winsstr(WINDOW *, const char *);
857
858 int chgat(int, attr_t, short, const void *);
859 int wchgat(WINDOW *, int, attr_t, short, const void *);
860 int mvchgat(int, int, int, attr_t, short, const void *);
861 int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
862
863 /* Soft Label Keys. */
864 int slk_attroff(const chtype);
865 int slk_attr_off(const attr_t, void *);
866 int slk_attron(const chtype);
867 int slk_attr_on(const attr_t, void *);
868 int slk_attrset(const chtype);
869 int slk_attr_set(const attr_t, short, void *);
870 int slk_clear(void);
871 int slk_color(short);
872 int slk_init(int);
873 char *slk_label(int);
874 int slk_noutrefresh(void);
875 int slk_refresh(void);
876 int slk_restore(void);
877 int slk_set(int, const char *, int);
878 int slk_touch(void);
879 int slk_wset(int, const wchar_t *, int);
880
881 /* wide-character support routines */
882 /* return ERR when HAVE_WCHAR is not defined */
883 /* add */
884 int add_wch(const cchar_t *);
885 int wadd_wch(WINDOW *, const cchar_t *);
886 int mvadd_wch(int, int, const cchar_t *);
887 int mvwadd_wch(WINDOW *, int, int, const cchar_t *);
888
889 int add_wchnstr(const cchar_t *, int);
890 int add_wchstr(const cchar_t *);
891 int wadd_wchnstr(WINDOW *, const cchar_t *, int);
892 int wadd_wchstr(WINDOW *, const cchar_t *);
893 int mvadd_wchnstr(int, int, const cchar_t *, int);
894 int mvadd_wchstr(int, int, const cchar_t *);
895 int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
896 int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
897
898 int addnwstr(const wchar_t *, int);
899 int addwstr(const wchar_t *);
900 int mvaddnwstr(int, int x, const wchar_t *, int);
901 int mvaddwstr(int, int x, const wchar_t *);
902 int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
903 int mvwaddwstr(WINDOW *, int, int, const wchar_t *);
904 int waddnwstr(WINDOW *, const wchar_t *, int);
905 int waddwstr(WINDOW *, const wchar_t *);
906
907 int echo_wchar(const cchar_t *);
908 int wecho_wchar(WINDOW *, const cchar_t *);
909 int pecho_wchar(WINDOW *, const cchar_t *);
910
911 /* insert */
912 int ins_wch(const cchar_t *);
913 int wins_wch(WINDOW *, const cchar_t *);
914 int mvins_wch(int, int, const cchar_t *);
915 int mvwins_wch(WINDOW *, int, int, const cchar_t *);
916
917 int ins_nwstr(const wchar_t *, int);
918 int ins_wstr(const wchar_t *);
919 int mvins_nwstr(int, int, const wchar_t *, int);
920 int mvins_wstr(int, int, const wchar_t *);
921 int mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
922 int mvwins_wstr(WINDOW *, int, int, const wchar_t *);
923 int wins_nwstr(WINDOW *, const wchar_t *, int);
924 int wins_wstr(WINDOW *, const wchar_t *);
925
926 /* input */
927 int get_wch(wint_t *);
928 int unget_wch(const wchar_t);
929 int mvget_wch(int, int, wint_t *);
930 int mvwget_wch(WINDOW *, int, int, wint_t *);
931 int wget_wch(WINDOW *, wint_t *);
932
933 int getn_wstr(wchar_t *, int);
934 int get_wstr(wchar_t *);
935 int mvgetn_wstr(int, int, wchar_t *, int);
936 int mvget_wstr(int, int, wchar_t *);
937 int mvwgetn_wstr(WINDOW *, int, int, wchar_t *, int);
938 int mvwget_wstr(WINDOW *, int, int, wchar_t *);
939 int wgetn_wstr(WINDOW *, wchar_t *, int);
940 int wget_wstr(WINDOW *, wchar_t *);
941
942 int in_wch(cchar_t *);
943 int mvin_wch(int, int, cchar_t *);
944 int mvwin_wch(WINDOW *, int, int, cchar_t *);
945 int win_wch(WINDOW *, cchar_t *);
946
947 int in_wchnstr(cchar_t *, int);
948 int in_wchstr(cchar_t *);
949 int mvin_wchnstr(int, int, cchar_t *, int);
950 int mvin_wchstr(int, int, cchar_t *);
951 int mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
952 int mvwin_wchstr(WINDOW *, int, int, cchar_t *);
953 int win_wchnstr(WINDOW *, cchar_t *, int);
954 int win_wchstr(WINDOW *, cchar_t *);
955
956 int innwstr(wchar_t *, int);
957 int inwstr(wchar_t *);
958 int mvinnwstr(int, int, wchar_t *, int);
959 int mvinwstr(int, int, wchar_t *);
960 int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
961 int mvwinwstr(WINDOW *, int, int, wchar_t *);
962 int winnwstr(WINDOW *, wchar_t *, int);
963 int winwstr(WINDOW *, wchar_t *);
964
965 /* cchar handling */
966 int setcchar(cchar_t *, const wchar_t *, const attr_t, short, const void *);
967 int getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
968
969 /* misc */
970 char *key_name( wchar_t );
971 int border_set(const cchar_t *, const cchar_t *, const cchar_t *,
972 const cchar_t *, const cchar_t *, const cchar_t *,
973 const cchar_t *, const cchar_t *);
974 int wborder_set(WINDOW *, const cchar_t *, const cchar_t *,
975 const cchar_t *, const cchar_t *, const cchar_t *,
976 const cchar_t *, const cchar_t *, const cchar_t *);
977 int box_set(WINDOW *, const cchar_t *, const cchar_t *);
978 int erasewchar(wchar_t *);
979 int killwchar(wchar_t *);
980 int hline_set(const cchar_t *, int);
981 int mvhline_set(int, int, const cchar_t *, int);
982 int mvvline_set(int, int, const cchar_t *, int);
983 int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
984 int mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
985 int vline_set(const cchar_t *, int);
986 int whline_set(WINDOW *, const cchar_t *, int);
987 int wvline_set(WINDOW *, const cchar_t *, int);
988 int bkgrnd(const cchar_t *);
989 void bkgrndset(const cchar_t *);
990 int getbkgrnd(cchar_t *);
991 int wbkgrnd(WINDOW *, const cchar_t *);
992 void wbkgrndset(WINDOW *, const cchar_t *);
993 int wgetbkgrnd(WINDOW *, cchar_t *);
994
995 /* ncurses window tests */
996 bool is_keypad(const WINDOW *);
997 bool is_leaveok(const WINDOW *);
998 bool is_pad(const WINDOW *);
999
1000 /* ncurses version for compat */
1001 const char *curses_version(void);
1002
1003 /* Private functions that are needed for user programs prototypes. */
1004 int __cputchar(int);
1005 int __waddbytes(WINDOW *, const char *, int, attr_t);
1006 #ifdef HAVE_WCHAR
1007 int __cputwchar( wchar_t );
1008 #endif /* HAVE_WCHAR */
1009 __END_DECLS
1010
1011 #endif /* !_CURSES_H_ */
1012