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