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