curses.h revision 1.33 1 /* $NetBSD: curses.h,v 1.33 2000/04/15 13:17:03 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 typedef char bool;
55
56 #ifndef TRUE
57 #define TRUE (/*CONSTCOND*/1)
58 #endif
59 #ifndef FALSE
60 #define FALSE (/*CONSTCOND*/0)
61 #endif
62
63 /*
64 * The following #defines and #includes are present for backward
65 * compatibility only. They should not be used in future code.
66 *
67 * START BACKWARD COMPATIBILITY ONLY.
68 */
69 #ifndef _CURSES_PRIVATE
70
71 #define _puts(s) tputs(s, 0, __cputchar)
72 #define _putchar(c) __cputchar(c)
73
74 /* Old-style terminal modes access. */
75 #define baudrate() (cfgetospeed(&__baset))
76 #define crmode() cbreak()
77 #define erasechar() (__baset.c_cc[VERASE])
78 #define killchar() (__baset.c_cc[VKILL])
79 #define nocrmode() nocbreak()
80 #define ospeed (cfgetospeed(&__baset))
81 #endif /* _CURSES_PRIVATE */
82
83 extern char GT; /* Gtty indicates tabs. */
84 extern char NONL; /* Term can't hack LF doing a CR. */
85 extern char UPPERCASE; /* Terminal is uppercase only. */
86
87 extern int My_term; /* Use Def_term regardless. */
88 extern char *Def_term; /* Default terminal type. */
89
90 /* Termcap capabilities. */
91 extern char AM, BE, BS, CA, CC, DA, EO, HC, HL, IN, MI, MS, NC, NS,
92 OS, PC, UL, XB, XN, XT, XS, XX;
93 extern int PA, cO, nc;
94 extern char *AC, *AE, *AL, *AS, *BC, *BL, *BT, *CD, *CE, *CL, *CM,
95 *CR, *CS, *DC, *DL, *DM, *DO, *Ea, *ED, *EI, *K0, *K1,
96 *K2, *K3, *K4, *K5, *K6, *K7, *K8, *K9, *HO, *IC, *IM,
97 *IP, *KD, *KE, *KH, *KL, *KR, *KS, *KU, *LL, *MA, *MB,
98 *MD, *ME, *MH, *MK, *MP, *MR, *ND, *NL, *OC, *OP, *RC,
99 *SC, *SE, *SF, *SO, *SP, *SR, *TA, *TE, *TI, *UC, *UE,
100 *UP, *US, *VB, *VS, *VE, *ab, *af, *al, *dl, *iC, *iP,
101 *sB, *sF, *sf, *sr, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
102 *LEFT_PARM, *RIGHT_PARM;
103
104 /* END BACKWARD COMPATIBILITY ONLY. */
105
106 /* symbols for values returned by getch in keypad mode */
107 #define KEY_MIN 0x101 /* minimum extended key value */
108 #define KEY_BREAK 0x101 /* break key */
109 #define KEY_DOWN 0x102 /* down arrow */
110 #define KEY_UP 0x103 /* up arrow */
111 #define KEY_LEFT 0x104 /* left arrow */
112 #define KEY_RIGHT 0x105 /* right arrow*/
113 #define KEY_HOME 0x106 /* home key */
114 #define KEY_BACKSPACE 0x107 /* Backspace */
115
116 /* First function key (block of 64 follow) */
117 #define KEY_F0 0x108
118 /* Function defining other function key values*/
119 #define KEY_F(n) (KEY_F0+(n))
120
121 #define KEY_DL 0x148 /* Delete Line */
122 #define KEY_IL 0x149 /* Insert Line*/
123 #define KEY_DC 0x14A /* Delete Character */
124 #define KEY_IC 0x14B /* Insert Character */
125 #define KEY_EIC 0x14C /* Exit Insert Char mode */
126 #define KEY_CLEAR 0x14D /* Clear screen */
127 #define KEY_EOS 0x14E /* Clear to end of screen */
128 #define KEY_EOL 0x14F /* Clear to end of line */
129 #define KEY_SF 0x150 /* Scroll one line forward */
130 #define KEY_SR 0x151 /* Scroll one line back */
131 #define KEY_NPAGE 0x152 /* Next Page */
132 #define KEY_PPAGE 0x153 /* Prev Page */
133 #define KEY_STAB 0x154 /* Set Tab */
134 #define KEY_CTAB 0x155 /* Clear Tab */
135 #define KEY_CATAB 0x156 /* Clear All Tabs */
136 #define KEY_ENTER 0x157 /* Enter or Send */
137 #define KEY_SRESET 0x158 /* Soft Reset */
138 #define KEY_RESET 0x159 /* Hard Reset */
139 #define KEY_PRINT 0x15A /* Print */
140 #define KEY_LL 0x15B /* Home Down */
141
142 /*
143 * "Keypad" keys arranged like this:
144 *
145 * A1 up A3
146 * left B2 right
147 * C1 down C3
148 *
149 */
150 #define KEY_A1 0x15C /* Keypad upper left */
151 #define KEY_A3 0x15D /* Keypad upper right */
152 #define KEY_B2 0x15E /* Keypad centre key */
153 #define KEY_C1 0x15F /* Keypad lower left */
154 #define KEY_C3 0x160 /* Keypad lower right */
155
156 #define KEY_BTAB 0x161 /* Back Tab */
157 #define KEY_BEG 0x162 /* Begin key */
158 #define KEY_CANCEL 0x163 /* Cancel key */
159 #define KEY_CLOSE 0x164 /* Close Key */
160 #define KEY_COMMAND 0x165 /* Command Key */
161 #define KEY_COPY 0x166 /* Copy key */
162 #define KEY_CREATE 0x167 /* Create key */
163 #define KEY_END 0x168 /* End key */
164 #define KEY_EXIT 0x169 /* Exit key */
165 #define KEY_FIND 0x16A /* Find key */
166 #define KEY_HELP 0x16B /* Help key */
167 #define KEY_MARK 0x16C /* Mark key */
168 #define KEY_MESSAGE 0x16D /* Message key */
169 #define KEY_MOVE 0x16E /* Move key */
170 #define KEY_NEXT 0x16F /* Next Object key */
171 #define KEY_OPEN 0x170 /* Open key */
172 #define KEY_OPTIONS 0x171 /* Options key */
173 #define KEY_PREVIOUS 0x172 /* Previous Object key */
174 #define KEY_REDO 0x173 /* Redo key */
175 #define KEY_REFERENCE 0x174 /* Ref Key */
176 #define KEY_REFRESH 0x175 /* Refresh key */
177 #define KEY_REPLACE 0x176 /* Replace key */
178 #define KEY_RESTART 0x177 /* Restart key */
179 #define KEY_RESUME 0x178 /* Resume key */
180 #define KEY_SAVE 0x179 /* Save key */
181 #define KEY_SBEG 0x17A /* Shift begin key */
182 #define KEY_SCANCEL 0x17B /* Shift Cancel key */
183 #define KEY_SCOMMAND 0x17C /* Shift Command key */
184 #define KEY_SCOPY 0x17D /* Shift Copy key */
185 #define KEY_SCREATE 0x17E /* Shift Create key */
186 #define KEY_SDC 0x17F /* Shift Delete Character */
187 #define KEY_SDL 0x180 /* Shift Delete Line */
188 #define KEY_SELECT 0x181 /* Select key */
189 #define KEY_SEND 0x182 /* Send key */
190 #define KEY_SEOL 0x183 /* Shift Clear Line key */
191 #define KEY_SEXIT 0x184 /* Shift Exit key */
192 #define KEY_SFIND 0x185 /* Shift Find key */
193 #define KEY_SHELP 0x186 /* Shift Help key */
194 #define KEY_SHOME 0x187 /* Shift Home key */
195 #define KEY_SIC 0x188 /* Shift Input key */
196 #define KEY_SLEFT 0x189 /* Shift Left Arrow key */
197 #define KEY_SMESSAGE 0x18A /* Shift Message key */
198 #define KEY_SMOVE 0x18B /* Shift Move key */
199 #define KEY_SNEXT 0x18C /* Shift Next key */
200 #define KEY_SOPTIONS 0x18D /* Shift Options key */
201 #define KEY_SPREVIOUS 0x18E /* Shift Previous key */
202 #define KEY_SPRINT 0x18F /* Shift Print key */
203 #define KEY_SREDO 0x190 /* Shift Redo key */
204 #define KEY_SREPLACE 0x191 /* Shift Replace key */
205 #define KEY_SRIGHT 0x192 /* Shift Right Arrow key */
206 #define KEY_SRESUME 0x193 /* Shift Resume key */
207 #define KEY_SSAVE 0x194 /* Shift Save key */
208 #define KEY_SSUSPEND 0x195 /* Shift Suspend key */
209 #define KEY_SUNDO 0x196 /* Shift Undo key */
210 #define KEY_SUSPEND 0x197 /* Suspend key */
211 #define KEY_UNDO 0x198 /* Undo key */
212 #define KEY_MAX 0x198 /* maximum extended key value */
213
214 /* 8-bit ASCII characters. */
215 #define unctrl(c) __unctrl[((unsigned)c) & 0xff]
216 #define unctrllen(ch) __unctrllen[((unsigned)ch) & 0xff]
217
218 extern char *__unctrl[256]; /* Control strings. */
219 extern char __unctrllen[256]; /* Control strings length. */
220
221 /*
222 * A window an array of __LINE structures pointed to by the 'lines' pointer.
223 * A line is an array of __LDATA structures pointed to by the 'line' pointer.
224 */
225
226 /*
227 * Definitions for characters and attributes in __LDATA
228 */
229 #define __CHARTEXT 0x000000ff /* bits for 8-bit characters */
230 #define __NORMAL 0x00000000 /* Added characters are normal. */
231 #define __STANDOUT 0x00010000 /* Added characters are standout. */
232 #define __UNDERSCORE 0x00020000 /* Added characters are underscored. */
233 #define __REVERSE 0x00040000 /* Added characters are reverse
234 video. */
235 #define __BLINK 0x00080000 /* Added characters are blinking. */
236 #define __DIM 0x00100000 /* Added characters are dim. */
237 #define __BOLD 0x00200000 /* Added characters are bold. */
238 #define __BLANK 0x00400000 /* Added characters are blanked. */
239 #define __PROTECT 0x00800000 /* Added characters are protected. */
240 #define __ALTCHARSET 0x01000000 /* Added characters are ACS */
241 #define __COLOR 0xee000000 /* Color bits */
242 #define __ATTRIBUTES 0xefff0000 /* All 8-bit attribute bits */
243
244 typedef struct __ldata __LDATA;
245 typedef struct __line __LINE;
246 typedef struct __window WINDOW;
247
248 /*
249 * Attribute definitions
250 */
251 #define A_NORMAL __NORMAL
252 #define A_STANDOUT __STANDOUT
253 #define A_UNDERLINE __UNDERSCORE
254 #define A_REVERSE __REVERSE
255 #define A_BLINK __BLINK
256 #define A_DIM __DIM
257 #define A_BOLD __BOLD
258 #define A_BLANK __BLANK
259 #define A_PROTECT __PROTECT
260 #define A_ALTCHARSET __ALTCHARSET
261 #define A_ATTRIBUTES __ATTRIBUTES
262 #define A_CHARTEXT __CHARTEXT
263 #define A_COLOR __COLOR
264
265 /*
266 * Alternate character set definitions
267 */
268
269 #define NUM_ACS 128
270
271 extern chtype _acs_char[NUM_ACS];
272
273 #define ACS_RARROW _acs_char['+']
274 #define ACS_LARROW _acs_char[',']
275 #define ACS_UARROW _acs_char['-']
276 #define ACS_DARROW _acs_char['.']
277 #define ACS_BLOCK _acs_char['0']
278 #define ACS_DIAMOND _acs_char['`']
279 #define ACS_CKBOARD _acs_char['a']
280 #define ACS_DEGREE _acs_char['f']
281 #define ACS_PLMINUS _acs_char['g']
282 #define ACS_BOARD _acs_char['h']
283 #define ACS_LANTERN _acs_char['i']
284 #define ACS_LRCORNER _acs_char['j']
285 #define ACS_URCORNER _acs_char['k']
286 #define ACS_ULCORNER _acs_char['l']
287 #define ACS_LLCORNER _acs_char['m']
288 #define ACS_PLUS _acs_char['n']
289 #define ACS_HLINE _acs_char['q']
290 #define ACS_S1 _acs_char['o']
291 #define ACS_S9 _acs_char['s']
292 #define ACS_LTEE _acs_char['t']
293 #define ACS_RTEE _acs_char['u']
294 #define ACS_BTEE _acs_char['v']
295 #define ACS_TTEE _acs_char['w']
296 #define ACS_VLINE _acs_char['x']
297 #define ACS_BULLET _acs_char['~']
298
299 /* System V compatability */
300 #define ACS_SBBS ACS_LRCORNER
301 #define ACS_BBSS ACS_URCORNER
302 #define ACS_BSSB ACS_ULCORNER
303 #define ACS_SSBB ACS_LLCORNER
304 #define ACS_SSSS ACS_PLUS
305 #define ACS_BSBS ACS_HLINE
306 #define ACS_SSSB ACS_LTEE
307 #define ACS_SBSS ACS_RTEE
308 #define ACS_SSBS ACS_BTEE
309 #define ACS_BSSS ACS_TTEE
310 #define ACS_SBSB ACS_VLINE
311 #define _acs_map _acs_char
312
313 /*
314 * Colour definitions (ANSI colour numbers)
315 */
316
317 #define COLOR_BLACK 0x00
318 #define COLOR_RED 0x01
319 #define COLOR_GREEN 0x02
320 #define COLOR_YELLOW 0x03
321 #define COLOR_BLUE 0x04
322 #define COLOR_MAGENTA 0x05
323 #define COLOR_CYAN 0x06
324 #define COLOR_WHITE 0x07
325
326 #define COLOR_PAIR(n) (((n) << 25) & A_COLOR)
327 #define PAIR_NUMBER(n) (((n) & A_COLOR) >> 25)
328
329 /* Curses external declarations. */
330 extern WINDOW *curscr; /* Current screen. */
331 extern WINDOW *stdscr; /* Standard screen. */
332
333 extern struct termios __orig_termios; /* Terminal state before curses */
334 extern struct termios __baset; /* Our base terminal state */
335 extern int __tcaction; /* If terminal hardware set. */
336
337 extern int COLS; /* Columns on the screen. */
338 extern int LINES; /* Lines on the screen. */
339 extern int COLORS; /* Max colours on the screen. */
340 extern int COLOR_PAIRS; /* Max colour pairs on the screen. */
341
342 extern char *ttytype; /* Full name of current terminal. */
343
344 #define ERR (0) /* Error return. */
345 #define OK (1) /* Success return. */
346
347 /*
348 * The following have, traditionally, been macros but X/Open say they
349 * need to be functions. Keep the old macros for debugging.
350 */
351 #ifdef _CURSES_USE_MACROS
352 /* Standard screen pseudo functions. */
353 #define addbytes(s, n) __waddbytes(stdscr, s, n, 0)
354 #define addch(ch) waddch(stdscr, ch)
355 #define addnstr(s, n) waddnstr(stdscr, s, n)
356 #define addstr(s) waddnstr(stdscr, s, -1)
357 #define bkgd(ch) wbkgd(stdscr, ch)
358 #define bkgdset(ch) wbkgdset(stdscr, ch)
359 #define border(l, r, t, b, tl, tr, bl, br) \
360 wborder(stdscr, l, r, t, b, tl, tr, bl, br)
361 #define clear() wclear(stdscr)
362 #define clrtobot() wclrtobot(stdscr)
363 #define clrtoeol() wclrtoeol(stdscr)
364 #define delch() wdelch(stdscr)
365 #define deleteln() wdeleteln(stdscr)
366 #define erase() werase(stdscr)
367 #define getch() wgetch(stdscr)
368 #define getstr(s) wgetstr(stdscr, s)
369 #define inch() winch(stdscr)
370 #define insch(ch) winsch(stdscr, ch)
371 #define insdelln(n) winsdelln(stdscr, n)
372 #define insertln() winsertln(stdscr)
373 #define move(y, x) wmove(stdscr, y, x)
374 #define refresh() wrefresh(stdscr)
375 #define scrl(n) wscrl(stdscr, n)
376 #define standend() wstandend(stdscr)
377 #define standout() wstandout(stdscr)
378 #define timeout(delay) wtimeout(stdscr, delay)
379 #define underscore() wunderscore(stdscr)
380 #define underend() wunderend(stdscr)
381 #define attron(attr) wattron(stdscr, attr)
382 #define attroff(attr) wattroff(stdscr, attr)
383 #define attrset(attr) wattrset(stdscr, attr)
384 #define waddbytes(w, s, n) __waddbytes(w, s, n, 0)
385 #define waddstr(w, s) waddnstr(w, s, -1)
386
387 /* Standard screen plus movement pseudo functions. */
388 #define mvaddbytes(y, x, s, n) mvwaddbytes(stdscr, y, x, s, n)
389 #define mvaddch(y, x, ch) mvwaddch(stdscr, y, x, ch)
390 #define mvaddnstr(y, x, s, n) mvwaddnstr(stdscr, y, x, s, n)
391 #define mvaddstr(y, x, s) mvwaddstr(stdscr, y, x, s)
392 #define mvdelch(y, x) mvwdelch(stdscr, y, x)
393 #define mvgetch(y, x) mvwgetch(stdscr, y, x)
394 #define mvgetstr(y, x, s) mvwgetstr(stdscr, y, x, s)
395 #define mvinch(y, x) mvwinch(stdscr, y, x)
396 #define mvinsch(y, x, c) mvwinsch(stdscr, y, x, c)
397 #define mvwaddbytes(w, y, x, s, n) \
398 (wmove(w, y, x) == ERR ? ERR : __waddbytes(w, s, n, 0))
399 #define mvwaddch(w, y, x, ch) \
400 (wmove(w, y, x) == ERR ? ERR : waddch(w, ch))
401 #define mvwaddnstr(w, y, x, s, n) \
402 (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, n))
403 #define mvwaddstr(w, y, x, s) \
404 (wmove(w, y, x) == ERR ? ERR : waddnstr(w, s, -1))
405 #define mvwdelch(w, y, x) \
406 (wmove(w, y, x) == ERR ? ERR : wdelch(w))
407 #define mvwgetch(w, y, x) \
408 (wmove(w, y, x) == ERR ? ERR : wgetch(w))
409 #define mvwgetstr(w, y, x, s) \
410 (wmove(w, y, x) == ERR ? ERR : wgetstr(w, s))
411 #define mvwinch(w, y, x) \
412 (wmove(w, y, x) == ERR ? ERR : winch(w))
413 #define mvwinsch(w, y, x, c) \
414 (wmove(w, y, x) == ERR ? ERR : winsch(w, c))
415
416 #define getyx(w, y, x) (y) = getcury(w), (x) = getcurx(w)
417 #define getbegyx(w, y, x) (y) = getbegy(w), (x) = getbegx(w)
418 #define getmaxyx(w, y, x) (y) = getmaxy(w), (x) = getmaxx(w)
419
420 #else
421 /* Use functions not macros... */
422 int addbytes(const char *bytes, int count);
423 int addch(chtype ch);
424 int addnstr(const char *str, int n);
425 int addstr(const char *str);
426 int border(chtype left, chtype right, chtype top, chtype bottom,
427 chtype topleft, chtype topright, chtype botleft, chtype botright);
428 int clear(void);
429 int clrtobot(void);
430 int clrtoeol(void);
431 int delch(void);
432 int deleteln(void);
433 int erase(void);
434 int getch(void);
435 int getstr(char *str);
436 chtype inch(void);
437 int insch(chtype ch);
438 int insdelln(int lines);
439 int insertln(void);
440 int move(int y, int x);
441 int refresh(void);
442 int scrl(int lines);
443 int standend(void);
444 int standout(void);
445 void timeout(int delay);
446 int underscore(void);
447 int attron(int attr);
448 int attroff(int attr);
449 int attrset(int attr);
450 int waddbytes(WINDOW *win, const char *bytes, int count);
451
452 /* Standard screen plus movement functions. */
453 int mvaddbytes(int y, int x, const char *bytes, int count);
454 int mvaddch(int y, int x, chtype ch);
455 int mvaddnstr(int y, int x, const char *str, int count);
456 int mvaddstr(int y, int x, const char *str);
457 int mvdelch(int y, int x);
458 int mvgetch(int y, int x);
459 int mvgetstr(int y, int x, char *str);
460 chtype mvinch(int y, int x);
461 int mvinsch(int y, int x, chtype ch);
462
463
464 int mvwaddbytes(WINDOW *win, int y, int x, const char *bytes, int count);
465 int mvwaddch(WINDOW *win, int y, int x, chtype ch);
466 int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int count);
467 int mvwaddstr(WINDOW *win, int y, int x, const char *str);
468 int mvwdelch(WINDOW *win, int y, int x);
469 int mvwgetch(WINDOW *win, int y, int x);
470 int mvwgetstr(WINDOW *win, int y, int x, char *str);
471 chtype mvwinch(WINDOW *win, int y, int x);
472 int mvwinsch(WINDOW *win, int y, int x, chtype ch);
473
474 #define getyx(w, y, x) (y) = getcury(w), (x) = getcurx(w)
475
476 #endif /* _CURSES_USE_MACROS */
477
478 #define getbegyx(w, y, x) (y) = getbegy(w), (x) = getbegx(w)
479 #define getmaxyx(w, y, x) (y) = getmaxy(w), (x) = getmaxx(w)
480
481 /* Public function prototypes. */
482 __BEGIN_DECLS
483 int beep(void);
484 int box(WINDOW *win, chtype vert, chtype horiz);
485 int cbreak(void);
486 int clearok(WINDOW *win, bool flag);
487 bool can_change_colors(void);
488 int color_content(short colour, short *redp, short *greenp, short *bluep);
489 int def_prog_mode(void);
490 int def_shell_mode(void);
491 int delwin(WINDOW *win);
492 int echo(void);
493 int endwin(void);
494 int flash(void);
495 int flushinp(void);
496 int flushok(WINDOW *win, bool bf);
497 char *fullname(const char *bp, char *def);
498 chtype getbkgd(WINDOW *win);
499 char *getcap(char *name);
500 int getcury(WINDOW *win);
501 int getcurx(WINDOW *win);
502 int getbegy(WINDOW *win);
503 int getbegx(WINDOW *win);
504 int getmaxy(WINDOW *win);
505 int getmaxx(WINDOW *win);
506 int gettmode(void);
507 bool has_colors(void);
508 int idlok(WINDOW *win, bool bf);
509 int init_color(short colour, short red, short green, short blue);
510 int init_pair(short pair, short fore, short back);
511 WINDOW *initscr(void);
512 int intrflush(WINDOW *win, bool bf);
513 bool isendwin(void);
514 void keypad(WINDOW *win, bool bf);
515 int leaveok(WINDOW *win, bool bf);
516 char *longname(void);
517 int mvcur(int ly, int lx, int y, int x);
518 int mvprintw(int y, int x, const char *fmt, ...);
519 int mvscanw(int y, int x, const char *fmt, ...);
520 int mvwin(WINDOW *win, int y, int x);
521 int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);
522 int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...);
523 WINDOW *newwin(int nl, int nc, int by, int bx);
524 int nl(void);
525 int nocbreak(void);
526 void nodelay(WINDOW *win, bool bf);
527 int noecho(void);
528 int nonl(void);
529 int noraw(void);
530 int notimeout(WINDOW *win, bool bf);
531 int overlay(const WINDOW *win1, WINDOW *win2);
532 int overwrite(const WINDOW *win1, WINDOW *win2);
533 int pair_content(short pair, short *forep, short *backp);
534 int printw(const char *, ...);
535 int raw(void);
536 int reset_prog_mode(void);
537 int reset_shell_mode(void);
538 int resetty(void);
539 int savetty(void);
540 int scanw(const char *, ...);
541 int scroll(WINDOW *win);
542 int scrollok(WINDOW *win, bool bf);
543 int setterm(char *);
544 WINDOW *subwin(WINDOW *orig, int nl, int nc, int by, int bx);
545 int touchline(WINDOW *win, int start, int count);
546 int touchoverlap(WINDOW *win1, WINDOW *win2);
547 int touchwin(WINDOW *win);
548 int vwprintw(WINDOW *win, const char *fmt, _BSD_VA_LIST_);
549 int vwscanw(WINDOW *win, const char *fmt, _BSD_VA_LIST_);
550 int waddch(WINDOW *win, chtype ch);
551 int waddnstr(WINDOW *win, const char *s, int n);
552 int wattron(WINDOW *win, int attr);
553 int wattroff(WINDOW *win, int attr);
554 int wattrset(WINDOW *win, int attr);
555 int wbkgd(WINDOW *win, chtype ch);
556 void wbkgdset(WINDOW *win, chtype ch);
557 int wborder(WINDOW *win, chtype left, chtype right, chtype top,
558 chtype bottom, chtype topleft, chtype topright,
559 chtype botleft, chtype botright);
560 int wclear(WINDOW *win);
561 int wclrtobot(WINDOW *win);
562 int wclrtoeol(WINDOW *win);
563 int wdelch(WINDOW *win);
564 int wdeleteln(WINDOW *win);
565 int werase(WINDOW *win);
566 int wgetch(WINDOW *win);
567 int wgetstr(WINDOW *win, char *str);
568 chtype winch(WINDOW *win);
569 int winsch(WINDOW *win, chtype ch);
570 int winsdelln(WINDOW *win, int lines);
571 int winsertln(WINDOW *win);
572 int wmove(WINDOW *win, int y, int x);
573 int wprintw(WINDOW *win, const char *fmt, ...);
574 int wrefresh(WINDOW *win);
575 int wscanw(WINDOW *win, const char *fmt, ...);
576 int wscrl(WINDOW *win, int lines);
577 int wstandend(WINDOW *win);
578 int wstandout(WINDOW *win);
579 void wtimeout(WINDOW *win, int delay);
580 int wunderend(WINDOW *win);
581 int wunderscore(WINDOW *win);
582
583 /* Private functions that are needed for user programs prototypes. */
584 int __cputchar(int);
585 int __waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr);
586 __END_DECLS
587
588 #endif /* !_CURSES_H_ */
589