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