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