Print this page
1059 curses.h conflicts with stdbool.h
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libxcurses2/h/curses.h
+++ new/usr/src/lib/libxcurses2/h/curses.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 1996-2003 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 #ifndef _CURSES_H
28 28 #define _CURSES_H
29 29
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 30 /*
33 31 * curses.h
34 32 *
35 33 * XCurses Library
36 34 *
37 35 * Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
38 36 *
39 37 */
40 38
41 39 #include <sys/isa_defs.h>
42 40 #include <stdio.h>
43 41 #include <term.h>
44 42 #include <wchar.h>
45 43
46 44 #ifdef __cplusplus
47 45 extern "C" {
48 46 #endif
49 47
50 48 #define _XOPEN_CURSES
51 49
52 50 #ifndef EOF
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
53 51 #define EOF (-1)
54 52 #endif
55 53
56 54 #ifndef WEOF
57 55 #define WEOF ((wint_t)(-1))
58 56 #endif
59 57
60 58 #define ERR EOF
61 59 #define OK 0
62 60
63 -#if !(defined(__cplusplus) && defined(_BOOL))
61 +#if !(defined(__cplusplus) && defined(bool))
64 62 #ifndef _BOOL_DEFINED
65 63 typedef short bool;
66 64 #define _BOOL_DEFINED
67 65 #endif
68 66 #endif
69 67
70 68 #define TRUE 1
71 69 #define FALSE 0
72 70
73 71 typedef unsigned short attr_t;
74 72
75 73 /*
76 74 * These attributes and masks can be applied to an attr_t.
77 75 * These are ordered according to the <no_color_video> mask,
78 76 * which has been extended to include additional attributes.
79 77 */
80 78 #define WA_NORMAL 0x0
81 79 #define WA_STANDOUT 0x0001
82 80 #define WA_UNDERLINE 0x0002
83 81 #define WA_REVERSE 0x0004
84 82 #define WA_BLINK 0x0008
85 83 #define WA_DIM 0x0010
86 84 #define WA_BOLD 0x0020
87 85 #define WA_INVIS 0x0040
88 86 #define WA_PROTECT 0x0080
89 87 #define WA_ALTCHARSET 0x0100
90 88 #define WA_HORIZONTAL 0x0200
91 89 #define WA_LEFT 0x0400
92 90 #define WA_LOW 0x0800
93 91 #define WA_RIGHT 0x1000
94 92 #define WA_TOP 0x2000
95 93 #define WA_VERTICAL 0x4000
96 94
97 95 #define WA_SGR_MASK 0x01ff /* Historical attribute set. */
98 96 #define WA_SGR1_MASK 0x7e00 /* Extended attribute set. */
99 97
100 98 /*
101 99 * Internal attribute used to support <ceol_standout_glitch>.
102 100 */
103 101 #define WA_COOKIE 0x8000
104 102
105 103 /*
106 104 * Color names.
107 105 */
108 106 #define COLOR_BLACK 0
109 107 #define COLOR_RED 1
110 108 #define COLOR_GREEN 2
111 109 #define COLOR_YELLOW 3
112 110 #define COLOR_BLUE 4
113 111 #define COLOR_MAGENTA 5
114 112 #define COLOR_CYAN 6
115 113 #define COLOR_WHITE 7
116 114
117 115 /*
118 116 * A cchar_t details the attributes, color, and a string of wide characters
119 117 * composing a complex character (p12). The wide character string consists
120 118 * of a spacing character (wcwidth() > 0) and zero or more non-spacing
121 119 * characters. Xcurses (p17) states that the minimum number of non-spacing
122 120 * characters associated with a spacing character must be at least 5, if a
123 121 * limit is imposed.
124 122 */
125 123 #define _M_CCHAR_MAX 6
126 124
127 125 /*
128 126 * Opaque data type.
129 127 */
130 128 typedef struct {
131 129 short _f; /* True if start of character. */
132 130 short _n; /* Number of elements in wc[]. */
133 131 short _co; /* Color pair number. */
134 132 attr_t _at; /* Attribute flags. */
135 133 wchar_t _wc[_M_CCHAR_MAX]; /* Complex spacing character. */
136 134 } cchar_t;
137 135
138 136 /*
139 137 * Opaque data type.
140 138 */
141 139 typedef struct window_t {
142 140 cchar_t _bg; /* Background. */
143 141 cchar_t _fg; /* Foreground, ignore character. */
144 142 short _cury, _curx; /* Curent cursor position in window. */
145 143 short _begy, _begx; /* Upper-left origin on screen. */
146 144 short _maxy, _maxx; /* Window dimensions. */
147 145 short _top, _bottom; /* Window's software scroll region. */
148 146 short _refy, _refx; /* Pad origin of last refresh. */
149 147 short _sminy, _sminx; /* T-L screen corner of last refresh. */
150 148 short _smaxy, _smaxx; /* B-R screen corner of last refresh. */
151 149 short _vmin, _vtime; /* wtimeout() control. */
152 150 short *_first, *_last; /* Dirty region for each screen line. */
153 151 unsigned short _flags; /* Internal flags for the window. */
154 152 unsigned short _scroll; /* Internal for scroll optimization. */
155 153 cchar_t **_line;
156 154 cchar_t *_base; /* Block of M*N screen cells. */
157 155 struct window_t *_parent; /* Parent of sub-window. */
158 156 } WINDOW;
159 157
160 158 /*
161 159 * Opaque data type.
162 160 */
163 161 typedef struct {
164 162 int _kfd; /* typeahead() file descriptor. */
165 163 FILE *_if, *_of; /* I/O file pointers. */
166 164 TERMINAL *_term; /* Associated terminfo entry. */
167 165 WINDOW *_newscr; /* New screen image built by wnoutrefresh(). */
168 166 WINDOW *_curscr; /* Current screen image after doupdate(). */
169 167 mbstate_t _state; /* Current multibyte state of _of. */
170 168 #if defined(_LP64)
171 169 unsigned int *_hash; /* Hash values for curscr's screen lines. */
172 170 #else
173 171 unsigned long *_hash; /* Hash values for curscr's screen lines. */
174 172 #endif /* defined(_LP64) */
175 173 unsigned short _flags; /* Assorted flags. */
176 174 void *_decode; /* Function key decode tree. */
177 175 void *_in; /* Wide I/O object. */
178 176 struct {
179 177 int _size; /* Allocated size of the input stack. */
180 178 int _count; /* Number of entries on the input stack. */
181 179 int *_stack; /* Buffer used for the input stack. */
182 180 } _unget;
183 181 struct {
184 182 WINDOW *_w; /* Exists on if emulating soft label keys. */
185 183 char *_labels[8]; /* Soft label key strings. */
186 184 short _justify[8]; /* Justification for label. */
187 185 char *_saved[8]; /* exact representation of label */
188 186 } _slk;
189 187 } SCREEN;
190 188
191 189
192 190 /*
193 191 * Backwards compatiblity with historical Curses applications.
194 192 */
195 193 #ifndef _CHTYPE
196 194 #define _CHTYPE
197 195 #if defined(_LP64)
198 196 typedef unsigned int chtype;
199 197 #else
200 198 typedef unsigned long chtype;
201 199 #endif
202 200 #endif
203 201
204 202 /*
205 203 * These attributes and masks can be applied to a chtype.
206 204 * They are order according to the <no_color_video> mask.
207 205 */
208 206 #if defined(_LP64)
209 207 #define A_NORMAL 0x00000000U
210 208 #define A_ATTRIBUTES 0xffff0000U /* Color/Attribute mask */
211 209 #define A_CHARTEXT 0x0000ffffU /* 16-bit character mask */
212 210 #define A_STANDOUT 0x00010000U
213 211 #define A_UNDERLINE 0x00020000U
214 212 #define A_REVERSE 0x00040000U
215 213 #define A_BLINK 0x00080000U
216 214 #define A_DIM 0x00100000U
217 215 #define A_BOLD 0x00200000U
218 216 #define A_INVIS 0x00400000U
219 217 #define A_PROTECT 0x00800000U
220 218 #define A_ALTCHARSET 0x01000000U
221 219 #define A_COLOR 0xfe000000U /* Color mask */
222 220 #else /* defined(_LP64) */
223 221 #define A_NORMAL 0x00000000UL
224 222 #define A_ATTRIBUTES 0xffff0000UL /* Color/Attribute mask */
225 223 #define A_CHARTEXT 0x0000ffffUL /* 16-bit character mask */
226 224 #define A_STANDOUT 0x00010000UL
227 225 #define A_UNDERLINE 0x00020000UL
228 226 #define A_REVERSE 0x00040000UL
229 227 #define A_BLINK 0x00080000UL
230 228 #define A_DIM 0x00100000UL
231 229 #define A_BOLD 0x00200000UL
232 230 #define A_INVIS 0x00400000UL
233 231 #define A_PROTECT 0x00800000UL
234 232 #define A_ALTCHARSET 0x01000000UL
235 233 #define A_COLOR 0xfe000000UL /* Color mask */
236 234 #endif /* defined(_LP64) */
237 235
238 236 /*
239 237 * Color atttribute support for chtype.
240 238 */
241 239 #define __COLOR_SHIFT 26
242 240
243 241 /*
244 242 * Characters constants used with a chtype.
245 243 * Mapping defined in Xcurses Section 6.2.12 (p260).
246 244 */
247 245 #define ACS_VLINE (A_ALTCHARSET | 'x')
248 246 #define ACS_HLINE (A_ALTCHARSET | 'q')
249 247 #define ACS_ULCORNER (A_ALTCHARSET | 'l')
250 248 #define ACS_URCORNER (A_ALTCHARSET | 'k')
251 249 #define ACS_LLCORNER (A_ALTCHARSET | 'm')
252 250 #define ACS_LRCORNER (A_ALTCHARSET | 'j')
253 251 #define ACS_RTEE (A_ALTCHARSET | 'u')
254 252 #define ACS_LTEE (A_ALTCHARSET | 't')
255 253 #define ACS_BTEE (A_ALTCHARSET | 'v')
256 254 #define ACS_TTEE (A_ALTCHARSET | 'w')
257 255 #define ACS_PLUS (A_ALTCHARSET | 'n')
258 256 #define ACS_S1 (A_ALTCHARSET | 'o')
259 257 #define ACS_S9 (A_ALTCHARSET | 's')
260 258 #define ACS_DIAMOND (A_ALTCHARSET | '`')
261 259 #define ACS_CKBOARD (A_ALTCHARSET | 'a')
262 260 #define ACS_DEGREE (A_ALTCHARSET | 'f')
263 261 #define ACS_PLMINUS (A_ALTCHARSET | 'g')
264 262 #define ACS_BULLET (A_ALTCHARSET | '~')
265 263 #define ACS_LARROW (A_ALTCHARSET | ',')
266 264 #define ACS_RARROW (A_ALTCHARSET | '+')
267 265 #define ACS_DARROW (A_ALTCHARSET | '.')
268 266 #define ACS_UARROW (A_ALTCHARSET | '-')
269 267 #define ACS_BOARD (A_ALTCHARSET | 'h')
270 268 #define ACS_LANTERN (A_ALTCHARSET | 'i')
271 269 #define ACS_BLOCK (A_ALTCHARSET | '0')
272 270
273 271 /*
274 272 * Wide characters constants for a cchar_t.
275 273 */
276 274 extern const cchar_t __WACS_VLINE;
277 275 extern const cchar_t __WACS_HLINE;
278 276 extern const cchar_t __WACS_ULCORNER;
279 277 extern const cchar_t __WACS_URCORNER;
280 278 extern const cchar_t __WACS_LLCORNER;
281 279 extern const cchar_t __WACS_LRCORNER;
282 280 extern const cchar_t __WACS_RTEE;
283 281 extern const cchar_t __WACS_LTEE;
284 282 extern const cchar_t __WACS_BTEE;
285 283 extern const cchar_t __WACS_TTEE;
286 284 extern const cchar_t __WACS_PLUS;
287 285 extern const cchar_t __WACS_S1;
288 286 extern const cchar_t __WACS_S9;
289 287 extern const cchar_t __WACS_DIAMOND;
290 288 extern const cchar_t __WACS_CKBOARD;
291 289 extern const cchar_t __WACS_DEGREE;
292 290 extern const cchar_t __WACS_PLMINUS;
293 291 extern const cchar_t __WACS_BULLET;
294 292 extern const cchar_t __WACS_LARROW;
295 293 extern const cchar_t __WACS_RARROW;
296 294 extern const cchar_t __WACS_DARROW;
297 295 extern const cchar_t __WACS_UARROW;
298 296 extern const cchar_t __WACS_BOARD;
299 297 extern const cchar_t __WACS_LANTERN;
300 298 extern const cchar_t __WACS_BLOCK;
301 299
302 300 #define WACS_VLINE &__WACS_VLINE
303 301 #define WACS_HLINE &__WACS_HLINE
304 302 #define WACS_ULCORNER &__WACS_ULCORNER
305 303 #define WACS_URCORNER &__WACS_URCORNER
306 304 #define WACS_LLCORNER &__WACS_LLCORNER
307 305 #define WACS_LRCORNER &__WACS_LRCORNER
308 306 #define WACS_RTEE &__WACS_RTEE
309 307 #define WACS_LTEE &__WACS_LTEE
310 308 #define WACS_BTEE &__WACS_BTEE
311 309 #define WACS_TTEE &__WACS_TTEE
312 310 #define WACS_PLUS &__WACS_PLUS
313 311 #define WACS_S1 &__WACS_S1
314 312 #define WACS_S9 &__WACS_S9
315 313 #define WACS_DIAMOND &__WACS_DIAMOND
316 314 #define WACS_CKBOARD &__WACS_CKBOARD
317 315 #define WACS_DEGREE &__WACS_DEGREE
318 316 #define WACS_PLMINUS &__WACS_PLMINUS
319 317 #define WACS_BULLET &__WACS_BULLET
320 318 #define WACS_LARROW &__WACS_LARROW
321 319 #define WACS_RARROW &__WACS_RARROW
322 320 #define WACS_DARROW &__WACS_DARROW
323 321 #define WACS_UARROW &__WACS_UARROW
324 322 #define WACS_BOARD &__WACS_BOARD
325 323 #define WACS_LANTERN &__WACS_LANTERN
326 324 #define WACS_BLOCK &__WACS_BLOCK
327 325
328 326
329 327 /*
330 328 * Internal macros.
331 329 */
332 330 #define __m_getpary(w) ((w)->_parent == (WINDOW *) 0 ? -1 \
333 331 : (w)->_begy - (w)->_parent->_begy)
334 332 #define __m_getparx(w) ((w)->_parent == (WINDOW *) 0 ? -1 \
335 333 : (w)->_begx - (w)->_parent->_begx)
336 334
337 335 /*
338 336 * Global Window Macros
339 337 */
340 338 #define getyx(w, y, x) (y = (w)->_cury, x = (w)->_curx)
341 339 #define getbegyx(w, y, x) (y = (w)->_begy, x = (w)->_begx)
342 340 #define getmaxyx(w, y, x) (y = (w)->_maxy, x = (w)->_maxx)
343 341 #define getparyx(w, y, x) (y = __m_getpary(w), x = __m_getparx(w))
344 342
345 343 /*
346 344 * Global variables
347 345 */
348 346 extern int LINES, COLS;
349 347 extern WINDOW *curscr, *stdscr;
350 348 extern int COLORS, COLOR_PAIRS;
351 349
352 350 extern int addch(chtype);
353 351 extern int addchnstr(const chtype *, int);
354 352 extern int addchstr(const chtype *);
355 353 extern int addnstr(const char *, int);
356 354 extern int addnwstr(const wchar_t *, int);
357 355 extern int addstr(const char *);
358 356 extern int add_wch(const cchar_t *);
359 357 extern int add_wchnstr(const cchar_t *, int);
360 358 extern int add_wchstr(const cchar_t *);
361 359 extern int addwstr(const wchar_t *);
362 360 extern int attroff(int);
363 361 extern int attron(int);
364 362 extern int attrset(int);
365 363 extern int attr_get(attr_t *, short *, void *);
366 364 extern int attr_off(attr_t, void *);
367 365 extern int attr_on(attr_t, void *);
368 366 extern int attr_set(attr_t, short, void *);
369 367 extern int baudrate(void);
370 368 extern int beep(void);
371 369 extern int bkgd(chtype);
372 370 extern void bkgdset(chtype);
373 371 extern int bkgrnd(const cchar_t *);
374 372 extern void bkgrndset(const cchar_t *);
375 373 extern int border(
376 374 chtype, chtype, chtype, chtype,
377 375 chtype, chtype, chtype, chtype);
378 376 extern int border_set(
379 377 const cchar_t *, const cchar_t *,
380 378 const cchar_t *, const cchar_t *,
381 379 const cchar_t *, const cchar_t *,
382 380 const cchar_t *, const cchar_t *);
383 381 extern int box(WINDOW *, chtype, chtype);
384 382 extern int box_set(WINDOW *, const cchar_t *, const cchar_t *);
385 383 extern bool can_change_color(void);
386 384 extern int cbreak(void);
387 385 extern int chgat(int, attr_t, short, const void *);
388 386 extern int clearok(WINDOW *, bool);
389 387 extern int clear(void);
390 388 extern int clrtobot(void);
391 389 extern int clrtoeol(void);
392 390 extern int color_content(short, short *, short *, short *);
393 391 extern int COLOR_PAIR(int);
394 392 extern int color_set(short, void *);
395 393 extern int copywin(const WINDOW *, WINDOW *,
396 394 int, int, int, int, int, int, int);
397 395 extern int curs_set(int);
398 396 extern int def_prog_mode(void);
399 397 extern int def_shell_mode(void);
400 398 extern int delay_output(int);
401 399 extern int delch(void);
402 400 extern int deleteln(void);
403 401 extern void delscreen(SCREEN *);
404 402 extern int delwin(WINDOW *);
405 403 extern WINDOW *derwin(WINDOW *, int, int, int, int);
406 404 extern int doupdate(void);
407 405 extern WINDOW *dupwin(WINDOW *);
408 406 extern int echo(void);
409 407 extern int echochar(const chtype);
410 408 extern int echo_wchar(const cchar_t *);
411 409 extern int endwin(void);
412 410 extern char erasechar(void);
413 411 extern int erase(void);
414 412 extern int erasewchar(wchar_t *);
415 413 extern void filter(void);
416 414 extern int flash(void);
417 415 extern int flushinp(void);
418 416 extern chtype getbkgd(WINDOW *);
419 417 extern int getbkgrnd(cchar_t *);
420 418 extern int getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
421 419 extern int getch(void);
422 420 extern int getnstr(char *, int);
423 421 extern int getn_wstr(wint_t *, int);
424 422 extern int getstr(char *);
425 423 extern int get_wch(wint_t *);
426 424 extern WINDOW *getwin(FILE *);
427 425 extern int get_wstr(wint_t *);
428 426 extern int halfdelay(int);
429 427 extern bool has_colors(void);
430 428 extern bool has_ic(void);
431 429 extern bool has_il(void);
432 430 extern int hline(chtype, int);
433 431 extern int hline_set(const cchar_t *, int);
434 432 extern void idcok(WINDOW *, bool);
435 433 extern int idlok(WINDOW *, bool);
436 434 extern void immedok(WINDOW *, bool);
437 435 extern chtype inch(void);
438 436 extern int inchnstr(chtype *, int);
439 437 extern int inchstr(chtype *);
440 438 extern WINDOW *initscr(void);
441 439 extern int init_color(short, short, short, short);
442 440 extern int init_pair(short, short, short);
443 441 extern int innstr(char *, int);
444 442 extern int innwstr(wchar_t *, int);
445 443 extern int insch(chtype);
446 444 extern int insdelln(int);
447 445 extern int insertln(void);
448 446 extern int insnstr(const char *, int);
449 447 extern int ins_nwstr(const wchar_t *, int);
450 448 extern int insstr(const char *);
451 449 extern int instr(char *);
452 450 extern int ins_wch(const cchar_t *);
453 451 extern int ins_wstr(const wchar_t *);
454 452 extern int intrflush(WINDOW *, bool);
455 453 extern int in_wch(cchar_t *);
456 454 extern int in_wchnstr(cchar_t *, int);
457 455 extern int in_wchstr(cchar_t *);
458 456 extern int inwstr(wchar_t *);
459 457 extern bool isendwin(void);
460 458 extern bool is_linetouched(WINDOW *, int);
461 459 extern bool is_wintouched(WINDOW *);
462 460 extern char *keyname(int);
463 461 extern char *key_name(wchar_t);
464 462 extern int keypad(WINDOW *, bool);
465 463 extern char killchar(void);
466 464 extern int killwchar(wchar_t *);
467 465 extern int leaveok(WINDOW *, bool);
468 466 extern char *longname(void);
469 467 extern int meta(WINDOW *, bool);
470 468 extern int move(int, int);
471 469 extern int mvaddch(int, int, chtype);
472 470 extern int mvaddchnstr(int, int, const chtype *, int);
473 471 extern int mvaddchstr(int, int, const chtype *);
474 472 extern int mvaddnstr(int, int, const char *, int);
475 473 extern int mvaddnwstr(int, int, const wchar_t *, int);
476 474 extern int mvaddstr(int, int, const char *);
477 475 extern int mvadd_wch(int, int, const cchar_t *);
478 476 extern int mvadd_wchnstr(int, int, const cchar_t *, int);
479 477 extern int mvadd_wchstr(int, int, const cchar_t *);
480 478 extern int mvaddwstr(int, int, const wchar_t *);
481 479 extern int mvchgat(int, int, int, attr_t, short, const void *);
482 480 extern int mvcur(int, int, int, int);
483 481 extern int mvdelch(int, int);
484 482 extern int mvderwin(WINDOW *, int, int);
485 483 extern int mvgetch(int, int);
486 484 extern int mvgetnstr(int, int, char *, int);
487 485 extern int mvgetn_wstr(int, int, wint_t *, int);
488 486 extern int mvgetstr(int, int, char *);
489 487 extern int mvget_wch(int, int, wint_t *);
490 488 extern int mvget_wstr(int, int, wint_t *);
491 489 extern int mvhline(int, int, chtype, int);
492 490 extern int mvhline_set(int, int, const cchar_t *, int);
493 491 extern chtype mvinch(int, int);
494 492 extern int mvinchnstr(int, int, chtype *, int);
495 493 extern int mvinchstr(int, int, chtype *);
496 494 extern int mvinnstr(int, int, char *, int);
497 495 extern int mvinnwstr(int, int, wchar_t *, int);
498 496 extern int mvinsch(int, int, chtype);
499 497 extern int mvinsnstr(int, int, const char *, int);
500 498 extern int mvins_nwstr(int, int, const wchar_t *, int);
501 499 extern int mvinsstr(int, int, const char *);
502 500 extern int mvinstr(int, int, char *);
503 501 extern int mvins_wch(int, int, const cchar_t *);
504 502 extern int mvins_wstr(int, int, const wchar_t *);
505 503 extern int mvin_wch(int, int, cchar_t *);
506 504 extern int mvin_wchnstr(int, int, cchar_t *, int);
507 505 extern int mvin_wchstr(int, int, cchar_t *);
508 506 extern int mvinwstr(int, int, wchar_t *);
509 507 extern int mvprintw(int, int, char *, ...);
510 508 extern int mvscanw(int, int, char *, ...);
511 509 extern int mvvline(int, int, chtype, int);
512 510 extern int mvvline_set(int, int, const cchar_t *, int);
513 511 extern int mvwaddch(WINDOW *, int, int, chtype);
514 512 extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
515 513 extern int mvwaddchstr(WINDOW *, int, int, const chtype *);
516 514 extern int mvwaddnstr(WINDOW *, int, int, const char *, int);
517 515 extern int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
518 516 extern int mvwaddstr(WINDOW *, int, int, const char *);
519 517 extern int mvwadd_wch(WINDOW *, int, int, const cchar_t *);
520 518 extern int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
521 519 extern int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
522 520 extern int mvwaddwstr(WINDOW *, int, int, const wchar_t *);
523 521 extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
524 522 extern int mvwdelch(WINDOW *, int, int);
525 523 extern int mvwgetch(WINDOW *, int, int);
526 524 extern int mvwgetnstr(WINDOW *, int, int, char *, int);
527 525 extern int mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);
528 526 extern int mvwgetstr(WINDOW *, int, int, char *);
529 527 extern int mvwget_wch(WINDOW *, int, int, wint_t *);
530 528 extern int mvwget_wstr(WINDOW *, int, int, wint_t *);
531 529 extern int mvwhline(WINDOW *, int, int, chtype, int);
532 530 extern int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
533 531 extern int mvwin(WINDOW *, int, int);
534 532 extern chtype mvwinch(WINDOW *, int, int);
535 533 extern int mvwinchnstr(WINDOW *, int, int, chtype *, int);
536 534 extern int mvwinchstr(WINDOW *, int, int, chtype *);
537 535 extern int mvwinnstr(WINDOW *, int, int, char *, int);
538 536 extern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
539 537 extern int mvwinsch(WINDOW *, int, int, chtype);
540 538 extern int mvwinsnstr(WINDOW *, int, int, const char *, int);
541 539 extern int mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
542 540 extern int mvwinsstr(WINDOW *, int, int, const char *);
543 541 extern int mvwinstr(WINDOW *, int, int, char *);
544 542 extern int mvwins_wch(WINDOW *, int, int, const cchar_t *);
545 543 extern int mvwins_wstr(WINDOW *, int, int, const wchar_t *);
546 544 extern int mvwin_wch(WINDOW *, int, int, cchar_t *);
547 545 extern int mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
548 546 extern int mvwin_wchstr(WINDOW *, int, int, cchar_t *);
549 547 extern int mvwinwstr(WINDOW *, int, int, wchar_t *);
550 548 extern int mvwprintw(WINDOW *, int, int, char *, ...);
551 549 extern int mvwscanw(WINDOW *, int, int, char *, ...);
552 550 extern int mvwvline(WINDOW *, int, int, chtype, int);
553 551 extern int mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
554 552 extern int napms(int);
555 553 extern WINDOW *newpad(int, int);
556 554 extern SCREEN *newterm(char *, FILE *, FILE *);
557 555 extern WINDOW *newwin(int, int, int, int);
558 556 extern int nl(void);
559 557 extern int nocbreak(void);
560 558 extern int nodelay(WINDOW *, bool);
561 559 extern int noecho(void);
562 560 extern int nonl(void);
563 561 extern void noqiflush(void);
564 562 extern int noraw(void);
565 563 extern int notimeout(WINDOW *, bool);
566 564 extern int overlay(const WINDOW *, WINDOW *);
567 565 extern int overwrite(const WINDOW *, WINDOW *);
568 566 extern int pair_content(short, short *, short *);
569 567 extern int PAIR_NUMBER(int);
570 568 extern int pechochar(WINDOW *, chtype);
571 569 extern int pecho_wchar(WINDOW *, const cchar_t *);
572 570 extern int pnoutrefresh(WINDOW *, int, int, int, int, int, int);
573 571 extern int prefresh(WINDOW *, int, int, int, int, int, int);
574 572 extern int printw(char *, ...);
575 573 extern int putwin(WINDOW *, FILE *);
576 574 extern void qiflush(void);
577 575 extern int raw(void);
578 576 extern int redrawwin(WINDOW *);
579 577 extern int refresh(void);
580 578 extern int reset_prog_mode(void);
581 579 extern int reset_shell_mode(void);
582 580 extern int resetty(void);
583 581 extern int ripoffline(int, int (*)(WINDOW *, int));
584 582 extern int savetty(void);
585 583 extern int scanw(char *, ...);
586 584 extern int scr_dump(const char *);
587 585 extern int scr_init(const char *);
588 586 extern int scrl(int);
589 587 extern int scroll(WINDOW *);
590 588 extern int scrollok(WINDOW *, bool);
591 589 extern int scr_restore(const char *);
592 590 extern int scr_set(const char *);
593 591 extern int setcchar(cchar_t *, const wchar_t *, const attr_t,
594 592 short, const void *);
595 593 extern int setscrreg(int, int);
596 594 extern SCREEN *set_term(SCREEN *);
597 595 extern int slk_attr_off(const attr_t, void *);
598 596 extern int slk_attroff(const chtype);
599 597 extern int slk_attr_on(const attr_t, void *);
600 598 extern int slk_attron(const chtype);
601 599 extern int slk_attr_set(const attr_t, short, void *);
602 600 extern int slk_attrset(const chtype);
603 601 extern int slk_clear(void);
604 602 extern int slk_color(short);
605 603 extern int slk_init(int);
606 604 extern char *slk_label(int);
607 605 extern int slk_noutrefresh(void);
608 606 extern int slk_refresh(void);
609 607 extern int slk_restore(void);
610 608 extern int slk_set(int, const char *, int);
611 609 extern int slk_touch(void);
612 610 extern int slk_wset(int, const wchar_t *, int);
613 611 extern int standend(void);
614 612 extern int standout(void);
615 613 extern int start_color(void);
616 614 extern WINDOW *subpad(WINDOW *, int, int, int, int);
617 615 extern WINDOW *subwin(WINDOW *, int, int, int, int);
618 616 extern int syncok(WINDOW *, bool);
619 617 extern chtype termattrs(void);
620 618 extern attr_t term_attrs(void);
621 619 extern char *termname(void);
622 620 extern void timeout(int);
623 621 extern int touchline(WINDOW *, int, int);
624 622 extern int touchwin(WINDOW *);
625 623 extern int typeahead(int);
626 624 extern int ungetch(int);
627 625 extern int unget_wch(const wchar_t);
628 626 extern int untouchwin(WINDOW *);
629 627 extern void use_env(bool);
630 628 extern int vid_attr(attr_t, short, void *);
631 629 extern int vidattr(chtype);
632 630 extern int vid_puts(attr_t, short, void *, int (*)(int));
633 631 extern int vidputs(chtype, int (*)(int));
634 632 extern int vline(chtype, int);
635 633 extern int vline_set(const cchar_t *, int);
636 634 extern int vwprintw(WINDOW *, char *, __va_list);
637 635 extern int vw_printw(WINDOW *, char *, __va_list);
638 636 extern int vwscanw(WINDOW *, char *, __va_list);
639 637 extern int vw_scanw(WINDOW *, char *, __va_list);
640 638 extern int waddch(WINDOW *, const chtype);
641 639 extern int waddchnstr(WINDOW *, const chtype *, int);
642 640 extern int waddchstr(WINDOW *, const chtype *);
643 641 extern int waddnstr(WINDOW *, const char *, int);
644 642 extern int waddnwstr(WINDOW *, const wchar_t *, int);
645 643 extern int waddstr(WINDOW *, const char *);
646 644 extern int wadd_wch(WINDOW *, const cchar_t *);
647 645 extern int wadd_wchnstr(WINDOW *, const cchar_t *, int);
648 646 extern int wadd_wchstr(WINDOW *, const cchar_t *);
649 647 extern int waddwstr(WINDOW *, const wchar_t *);
650 648 extern int wattroff(WINDOW *, int);
651 649 extern int wattron(WINDOW *, int);
652 650 extern int wattrset(WINDOW *, int);
653 651 extern int wattr_get(WINDOW *, attr_t *, short *, void *);
654 652 extern int wattr_off(WINDOW *, attr_t, void *);
655 653 extern int wattr_on(WINDOW *, attr_t, void *);
656 654 extern int wattr_set(WINDOW *, attr_t, short, void *);
657 655 extern int wbkgd(WINDOW *, chtype);
658 656 extern void wbkgdset(WINDOW *, chtype);
659 657 extern int wbkgrnd(WINDOW *, const cchar_t *);
660 658 extern void wbkgrndset(WINDOW *, const cchar_t *);
661 659 extern int wborder(WINDOW *,
662 660 chtype, chtype, chtype, chtype,
663 661 chtype, chtype, chtype, chtype);
664 662 extern int wborder_set(WINDOW *,
665 663 const cchar_t *, const cchar_t *,
666 664 const cchar_t *, const cchar_t *,
667 665 const cchar_t *, const cchar_t *,
668 666 const cchar_t *, const cchar_t *);
669 667 extern int wchgat(WINDOW *, int, attr_t, short, const void *);
670 668 extern int wclear(WINDOW *);
671 669 extern int wclrtobot(WINDOW *);
672 670 extern int wclrtoeol(WINDOW *);
673 671 extern void wcursyncup(WINDOW *);
674 672 extern int wcolor_set(WINDOW *, short, void *);
675 673 extern int wdelch(WINDOW *);
676 674 extern int wdeleteln(WINDOW *);
677 675 extern int wechochar(WINDOW *, const chtype);
678 676 extern int wecho_wchar(WINDOW *, const cchar_t *);
679 677 extern int werase(WINDOW *);
680 678 extern int wgetbkgrnd(WINDOW *, cchar_t *);
681 679 extern int wgetch(WINDOW *);
682 680 extern int wgetnstr(WINDOW *, char *, int);
683 681 extern int wgetn_wstr(WINDOW *, wint_t *, int);
684 682 extern int wgetstr(WINDOW *, char *);
685 683 extern int wget_wch(WINDOW *, wint_t *);
686 684 extern int wget_wstr(WINDOW *, wint_t *);
687 685 extern int whline(WINDOW *, chtype, int);
688 686 extern int whline_set(WINDOW *, const cchar_t *, int);
689 687 extern chtype winch(WINDOW *);
690 688 extern int winchnstr(WINDOW *, chtype *, int);
691 689 extern int winchstr(WINDOW *, chtype *);
692 690 extern int winnstr(WINDOW *, char *, int);
693 691 extern int winnwstr(WINDOW *, wchar_t *, int);
694 692 extern int winsch(WINDOW *, chtype);
695 693 extern int winsdelln(WINDOW *, int);
696 694 extern int winsertln(WINDOW *);
697 695 extern int winsnstr(WINDOW *, const char *, int);
698 696 extern int wins_nwstr(WINDOW *, const wchar_t *, int);
699 697 extern int winsstr(WINDOW *, const char *);
700 698 extern int winstr(WINDOW *, char *);
701 699 extern int wins_wch(WINDOW *, const cchar_t *);
702 700 extern int wins_wstr(WINDOW *, const wchar_t *);
703 701 extern int win_wch(WINDOW *, cchar_t *);
704 702 extern int win_wchnstr(WINDOW *, cchar_t *, int);
705 703 extern int win_wchstr(WINDOW *, cchar_t *);
706 704 extern int winwstr(WINDOW *, wchar_t *);
707 705 extern int wmove(WINDOW *, int, int);
708 706 extern int wnoutrefresh(WINDOW *);
709 707 extern int wprintw(WINDOW *, char *, ...);
710 708 extern int wredrawln(WINDOW *, int, int);
711 709 extern int wrefresh(WINDOW *);
712 710 extern int wscanw(WINDOW *, char *, ...);
713 711 extern int wscrl(WINDOW *, int);
714 712 extern int wsetscrreg(WINDOW *, int, int);
715 713 extern int wstandend(WINDOW *);
716 714 extern int wstandout(WINDOW *);
717 715 extern void wsyncup(WINDOW *);
718 716 extern void wsyncdown(WINDOW *);
719 717 extern void wtimeout(WINDOW *, int);
720 718 extern int wtouchln(WINDOW *, int, int, int);
721 719 extern wchar_t *wunctrl(cchar_t *);
722 720 extern int wvline(WINDOW *, chtype, int);
723 721 extern int wvline_set(WINDOW *, const cchar_t *, int);
724 722
725 723 #if !defined(__lint)
726 724 /*
727 725 * These macros can improve speed and size of an application.
728 726 */
729 727 extern WINDOW *__w1;
730 728 extern chtype __cht1;
731 729 extern chtype __cht2;
732 730 extern cchar_t *__pcht1;
733 731 extern cchar_t *__pcht2;
734 732
735 733 #define addch(ch) waddch(stdscr, ch)
736 734 #define mvaddch(y, x, ch) (move(y, x) ? ((ch), ERR) : addch(ch))
737 735 #define mvwaddch(w, y, x, ch) \
738 736 (wmove(__w1 = (w), y, x) ? ((ch), ERR) : waddch(__w1, ch))
739 737
740 738 #define add_wch(cp) wadd_wch(stdscr, cp)
741 739 #define mvadd_wch(y, x, cp) (move(y, x) ? ((cp), ERR) : add_wch(cp))
742 740 #define mvwadd_wch(w, y, x, cp) \
743 741 (wmove(__w1 = (w), y, x) ? ((cp), ERR) : wadd_wch(__w1, cp))
744 742
745 743 #define addchnstr(chs, n) waddchnstr(stdscr, chs, n)
746 744 #define addchstr(chs) waddchstr(stdscr, chs)
747 745 #define mvaddchnstr(y, x, chs, n) \
748 746 (move(y, x) ? ((chs), (n), ERR) : addchnstr(chs, n))
749 747
750 748 #define mvaddchstr(y, x, chs) \
751 749 (move(y, x) ? ((chs), ERR) : addchstr(chs))
752 750
753 751 #define mvwaddchnstr(w, y, x, chs, n) \
754 752 (wmove(__w1 = (w), y, x) ? ((chs), (n), ERR) :\
755 753 waddchnstr(__w1, chs, n))
756 754
757 755 #define mvwaddchstr(w, y, x, chs) \
758 756 (wmove(__w1 = (w), y, x) ? ((chs), ERR) : waddchstr(__w1, chs))
759 757
760 758 #define waddchstr(w, chs) waddchnstr(w, chs, -1)
761 759
762 760 #define add_wchnstr(cp, n) wadd_wchnstr(stdscr, cp, n)
763 761 #define add_wchstr(cp) wadd_wchstr(stdscr, cp)
764 762 #define mvadd_wchnstr(y, x, cp, n) \
765 763 (move(y, x) ? ((cp), (n), ERR) : add_wchnstr(cp, n))
766 764
767 765 #define mvadd_wchstr(y, x, cp) \
768 766 (move(y, x) ? ((cp), ERR) : add_wchstr(cp))
769 767
770 768 #define mvwadd_wchnstr(w, y, x, cp, n) \
771 769 (wmove(__w1 = (w), y, x) ? ((cp), (n), ERR) :\
772 770 wadd_wchnstr(__w1, cp, n))
773 771
774 772 #define mvwadd_wchstr(w, y, x, cp) \
775 773 (wmove(__w1 = (w), y, x) ? ((cp), ERR) :\
776 774 wadd_wchstr(__w1, cp))
777 775
778 776 #define wadd_wchstr(w, cp) wadd_wchnstr(w, cp, -1)
779 777 #define addnstr(s, n) waddnstr(stdscr, s, n)
780 778 #define addstr(s) waddstr(stdscr, s)
781 779 #define mvaddnstr(y, x, s, n) \
782 780 (move(y, x) ? (s, n, ERR) : addnstr(s, n))
783 781
784 782 #define mvaddstr(y, x, s) \
785 783 (move(y, x) ? (s, ERR) : addstr(s))
786 784
787 785 #define mvwaddnstr(w, y, x, s, n) \
788 786 (wmove(__w1 = (w), y, x) ? (s, n, ERR) : waddnstr(__w1, s, n))
789 787
790 788 #define mvwaddstr(w, y, x, s) \
791 789 (wmove(__w1 = (w), y, x) ? (s, ERR) : waddstr(__w1, s))
792 790
793 791 #define waddstr(w, wcs) waddnstr(w, wcs, -1)
794 792 #define addnwstr(wcs, n) waddnwstr(stdscr, wcs, n)
795 793 #define addwstr(wcs) waddwstr(stdscr, wcs)
796 794 #define mvaddnwstr(y, x, wcs, n) \
797 795 (move(y, x) ? (wcs, n, ERR) : addnwstr(wcs, n))
798 796
799 797 #define mvaddwstr(y, x, wcs) \
800 798 (move(y, x) ? (wcs, ERR) : addwstr(wcs))
801 799
802 800 #define mvwaddnwstr(w, y, x, wcs, n) \
803 801 (wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
804 802 waddnwstr(__w1, wcs, n))
805 803
806 804 #define mvwaddwstr(w, y, x, wcs) \
807 805 (wmove(__w1 = (w), y, x) ? (wcs, ERR) : waddwstr(__w1, wcs))
808 806
809 807 #define waddwstr(w, wcs) waddnwstr(w, wcs, -1)
810 808 #define attr_get(a, c, o) wattr_get(stdscr, a, c, o)
811 809 #define attr_off(a, o) wattr_off(stdscr, a, o)
812 810 #define attr_on(a, o) wattr_on(stdscr, a, o)
813 811 #define attr_set(a, c, o) wattr_set(stdscr, a, c, o)
814 812
815 813 #define COLOR_PAIR(n) ((chtype)(n) << __COLOR_SHIFT)
816 814 #define PAIR_NUMBER(a) (((chtype)(a) & A_COLOR) >> __COLOR_SHIFT)
817 815
818 816 #define bkgd(ch) wbkgd(stdscr, ch)
819 817 #define bkgdset(ch) wbkgdset(stdscr, ch)
820 818
821 819 #define bkgrnd(b) wbkgrnd(stdscr, b)
822 820 #define bkgrndset(b) wbkgrndset(stdscr, b)
823 821 #define getbkgrnd(b) wgetbkgrnd(stdscr, b)
824 822 #define wgetbkgrnd(w, b) (*(b) = (w)->_bg, OK)
825 823
826 824 #define border(ls, rs, ts, bs, tl, tr, bl, br) \
827 825 wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
828 826
829 827 #define border_set(ls, rs, ts, bs, tl, tr, bl, br) \
830 828 wborder_set(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
831 829
832 830 #define box(w, v, h) \
833 831 wborder(w, __cht1 = (v), __cht1, __cht2 = (h), __cht2, 0, 0, 0, 0)
834 832
835 833 #define box_set(w, v, h) \
836 834 wborder_set(w, __pcht1 = (v), __pcht1, __pcht2 = (h), __pcht2,\
837 835 0, 0, 0, 0)
838 836
839 837 #define can_change_color() \
840 838 (2 < max_colors && can_change && initialize_color != NULL)
841 839
842 840 #define has_colors() (0 < max_colors)
843 841
844 842 #define chgat(n, a, co, p) wchgat(stdscr, n, a, co, p)
845 843 #define mvchgat(y, x, n, a, co, p) \
846 844 (move(y, x) ? (n, a, co, p, ERR) : chgat(n, a, co, p))
847 845
848 846 #define mvwchgat(w, y, x, n, a, co, p) \
849 847 (wmove(__w1 = (w), y, x) ? (n, a, co, p, ERR) :\
850 848 wchgat(__w1, n, a, co, p))
851 849
852 850 #define clear() wclear(stdscr)
853 851 #define clrtobot() wclrtobot(stdscr)
854 852 #define clrtoeol() wclrtoeol(stdscr)
855 853 #define erase() werase(stdscr)
856 854 #define wclear(w) \
857 855 (clearok(__w1 = (w), 1) ? ERR : werase(__w1))
858 856
859 857 #define werase(w) \
860 858 (wmove(__w1 = (w), 0, 0) ? ERR : wclrtobot(__w1))
861 859
862 860 #define delch() wdelch(stdscr)
863 861 #define mvdelch(y, x) (move(y, x) ? ERR : delch())
864 862 #define mvwdelch(w, y, x) \
865 863 (wmove(__w1 = (w), y, x) ? ERR : wdelch(__w1))
866 864
867 865 #define deleteln() wdeleteln(stdscr)
868 866 #define insdelln(n) winsdelln(stdscr, n)
869 867 #define insertln() winsertln(stdscr)
870 868 #define wdeleteln(w) winsdelln(w, -1)
871 869 #define winsertln(w) winsdelln(w, 1)
872 870 #define refresh() wrefresh(stdscr)
873 871 #define echochar(ch) wechochar(stdscr, ch)
874 872 #define echo_wchar(cp) wecho_wchar(stdscr, cp)
875 873 #define wechochar(w, ch) \
876 874 (waddch(__w1 = (w), ch) ? (wrefresh(__w1), ERR) :\
877 875 wrefresh(__w1))
878 876
879 877 #define wecho_wchar(w, cp) \
880 878 (wadd_wch(__w1 = (w), cp) ? (wrefresh(__w1), ERR) :\
881 879 wrefresh(__w1))
882 880
883 881 #define getch() wgetch(stdscr)
884 882 #define mvgetch(y, x) (move(y, x) ? ERR : getch())
885 883 #define mvwgetch(w, y, x) \
886 884 (wmove(__w1 = (w), y, x) ? ERR : wgetch(__w1))
887 885
888 886 #define get_wch(wcp) wget_wch(stdscr, wcp)
889 887 #define mvget_wch(y, x, wcp) \
890 888 (move(y, x) ? (wcp, ERR) : get_wch(wcp))
891 889
892 890 #define mvwget_wch(w, y, x, wcp) \
893 891 (wmove(__w1 = (w), y, x) ? (wcp, ERR) : wget_wch(__w1, wcp))
894 892
895 893 #define getnstr(s, n) wgetnstr(stdscr, s, n)
896 894 #define getstr(s) wgetstr(stdscr, s)
897 895 #define mvgetnstr(y, x, s, n) \
898 896 (move(y, x) ? (s, n, ERR) : getnstr(s, n))
899 897
900 898 #define mvgetstr(y, x, s) \
901 899 (move(y, x) ? (s, ERR) : getstr(s))
902 900
903 901 #define mvwgetnstr(w, y, x, s, n) \
904 902 (wmove(__w1 = (w), y, x) ? (s, n, ERR) : wgetnstr(__w1, s, n))
905 903
906 904 #define mvwgetstr(w, y, x, s) \
907 905 (wmove(__w1 = (w), y, x) ? (s, ERR) : wgetstr(__w1, s))
908 906
909 907 #define wgetstr(w, s) wgetnstr(w, s, -1)
910 908 #define getn_wstr(wcs, n) wgetn_wstr(stdscr, wcs, n)
911 909 #define get_wstr(wcs) wget_wstr(stdscr, wcs)
912 910 #define mvgetn_wstr(y, x, wcs, n) \
913 911 (move(y, x) ? (wcs, n, ERR) : getn_wstr(wcs, n))
914 912
915 913 #define mvget_wstr(y, x, wcs) \
916 914 (move(y, x) ? (wcs, ERR) : get_wstr(wcs))
917 915
918 916 #define mvwgetn_wstr(w, y, x, wcs, n) \
919 917 (wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
920 918 wgetn_wstr(__w1, wcs, n))
921 919
922 920 #define mvwget_wstr(w, y, x, wcs) \
923 921 (wmove(__w1 = (w), y, x) ? (wcs, ERR) : wget_wstr(__w1, wcs))
924 922
925 923 #define wget_wstr(w, wcs) wgetn_wstr(w, wcs, -1)
926 924
927 925 #define has_ic() \
928 926 (((insert_character != NULL || parm_ich != NULL) && \
929 927 (delete_character != NULL || parm_dch != NULL)) || \
930 928 (enter_insert_mode != NULL && exit_insert_mode))
931 929
932 930 #define has_il() \
933 931 (((insert_line != NULL || parm_insert_line != NULL) && \
934 932 (delete_line != NULL || parm_delete_line != NULL)) || \
935 933 change_scroll_region != NULL)
936 934
937 935 #define hline(ch, n) whline(stdscr, ch, n)
938 936 #define vline(ch, n) wvline(stdscr, ch, n)
939 937 #define mvhline(y, x, ch, n) \
940 938 (move(y, x) ? (ch, n, ERR) : hline(ch, n))
941 939
942 940 #define mvvline(y, x, ch, n) \
943 941 (move(y, x) ? (ch, n, ERR) : vline(ch, n))
944 942
945 943 #define mvwhline(w, y, x, ch, n) \
946 944 (wmove(__w1 = (w), y, x) ? (ch, n, ERR) : whline(__w1, ch, n))
947 945
948 946 #define mvwvline(w, y, x, ch, n) \
949 947 (wmove(__w1 = (w), y, x) ? (ch, n, ERR) : wvline(__w1, ch, n))
950 948
951 949 #define hline_set(cp, n) whline_set(stdscr, cp, n)
952 950 #define vline_set(cp, n) wvline_set(stdscr, cp, n)
953 951 #define mvhline_set(y, x, cp, n) \
954 952 (move(y, x) ? (cp, n, ERR) : hline_set(cp, n))
955 953
956 954 #define mvvline_set(y, x, cp, n) \
957 955 (move(y, x) ? (cp, n, ERR) : vline_set(cp, n))
958 956
959 957 #define mvwhline_set(w, y, x, cp, n) \
960 958 (wmove(__w1 = (w), y, x) ? (cp, n, ERR) : whline_set(__w1, cp, n))
961 959
962 960 #define mvwvline_set(w, y, x, cp, n) \
963 961 (wmove(__w1 = (w), y, x) ? (cp, n, ERR) : wvline_set(__w1, cp, n))
964 962
965 963 #define inch() winch(stdscr)
966 964 #define mvinch(y, x) (move(y, x) ? ERR : inch())
967 965 #define mvwinch(w, y, x) \
968 966 (wmove(__w1 = (w), y, x) ? ERR : winch(__w1))
969 967
970 968 #define in_wch(cp) win_wch(stdscr, cp)
971 969 #define mvin_wch(y, x, cp) \
972 970 (move(y, x) ? (cp, ERR) : in_wch(cp))
973 971
974 972 #define mvwin_wch(w, y, x, cp) \
975 973 (wmove(__w1 = (w), y, x) ? (cp, ERR) : win_wch(__w1, cp))
976 974
977 975 #define inchnstr(chs, n) winchnstr(stdscr, chs, n)
978 976 #define inchstr(chs) winchstr(stdscr, chs)
979 977 #define mvinchnstr(y, x, chs, n) \
980 978 (move(y, x) ? (chs, n, ERR) : inchnstr(chs, n))
981 979
982 980 #define mvinchstr(y, x, chs) \
983 981 (move(y, x) ? (chs, ERR) : inchstr(chs))
984 982
985 983 #define mvwinchnstr(w, y, x, chs, n) \
986 984 (wmove(__w1 = (w), y, x) ? (chs, n, ERR) : winchnstr(__w1, chs, n))
987 985
988 986 #define mvwinchstr(w, y, x, chs) \
989 987 (wmove(__w1 = (w), y, x) ? (chs, ERR) : winchstr(__w1, chs))
990 988
991 989 #define winchstr(w, chs) winchnstr(w, chs, -1)
992 990 #define in_wchnstr(cp, n) win_wchnstr(stdscr, cp, n)
993 991 #define in_wchstr(cp) win_wchstr(stdscr, cp)
994 992 #define mvin_wchnstr(y, x, cp, n) \
995 993 (move(y, x) ? (cp, n, ERR) : in_wchnstr(cp, n))
996 994
997 995 #define mvin_wchstr(y, x, cp) \
998 996 (move(y, x) ? (cp, ERR) : in_wchstr(cp))
999 997
1000 998 #define mvwin_wchnstr(w, y, x, cp, n) \
1001 999 (wmove(__w1 = (w), y, x) ? (cp, n, ERR) :\
1002 1000 win_wchnstr(__w1, cp, n))
1003 1001
1004 1002 #define mvwin_wchstr(w, y, x, cp) \
1005 1003 (wmove(__w1 = (w), y, x) ? (cp, ERR) : win_wchstr(__w1, cp))
1006 1004
1007 1005 #define win_wchstr(w, cp) win_wchnstr(w, cp, -1)
1008 1006 #define innstr(s, n) winnstr(stdscr, s, n)
1009 1007 #define instr(s) winstr(stdscr, s)
1010 1008 #define mvinnstr(y, x, s, n) \
1011 1009 (move(y, x) ? (s, n, ERR) : innstr(s, n))
1012 1010
1013 1011 #define mvinstr(y, x, s) \
1014 1012 (move(y, x) ? (s, ERR) : instr(s))
1015 1013
1016 1014 #define mvwinnstr(w, y, x, s, n) \
1017 1015 (wmove(__w1 = (w), y, x) ? (s, n, ERR) : winnstr(__w1, s, n))
1018 1016
1019 1017 #define mvwinstr(w, y, x, s) \
1020 1018 (wmove(__w1 = (w), y, x) ? (s, ERR) : winstr(__w1, s))
1021 1019
1022 1020 #define winstr(w, s) (winnstr(w, s, -1), OK)
1023 1021 #define innwstr(wcs, n) winnwstr(stdscr, wcs, n)
1024 1022 #define inwstr(wcs) winwstr(stdscr, wcs)
1025 1023 #define mvinnwstr(y, x, wcs, n) \
1026 1024 (move(y, x) ? (wcs, n, ERR) : innwstr(wcs, n))
1027 1025
1028 1026 #define mvinwstr(y, x, wcs) \
1029 1027 (move(y, x) ? (wcs, ERR) : inwstr(wcs))
1030 1028
1031 1029 #define mvwinnwstr(w, y, x, wcs, n) \
1032 1030 (wmove(__w1 = (w), y, x) ? (wcs, n, ERR) :\
1033 1031 winnwstr(__w1, wcs, n))
1034 1032
1035 1033 #define mvwinwstr(w, y, x, wcs) \
1036 1034 (wmove(__w1 = (w), y, x) ? (wcs, ERR) : winwstr(__w1, wcs))
1037 1035
1038 1036 #define winwstr(w, wcs) (winnwstr(w, wcs, -1), OK)
1039 1037 #define insch(ch) winsch(stdscr, ch)
1040 1038 #define mvinsch(y, x, ch) (move(y, x) ? (ch, ERR) : insch(ch))
1041 1039 #define mvwinsch(w, y, x, ch) \
1042 1040 (wmove(__w1 = (w), y, x) ? (ch, ERR) : winsch(__w1, ch))
1043 1041
1044 1042 #define ins_wch(cp) wins_wch(stdscr, cp)
1045 1043 #define mvins_wch(y, x, cp) (move(y, x) ? (cp, ERR) : ins_wch(cp))
1046 1044 #define mvwins_wch(w, y, x, cp) \
1047 1045 (wmove(__w1 = (w), y, x) ? (cp, ERR) : wins_wch(__w1, cp))
1048 1046
1049 1047 #define insnstr(s, n) winsnstr(stdscr, s, n)
1050 1048 #define insstr(s) winsstr(stdscr, s)
1051 1049 #define mvinsnstr(y, x, s, n) (move(y, x) ? (s, n, ERR) : insnstr(s, n))
1052 1050 #define mvinsstr(y, x, s) (move(y, x) ? (s, ERR) : insstr(s))
1053 1051 #define mvwinsnstr(w, y, x, s, n) \
1054 1052 (wmove(__w1 = (w), y, x) ? (s, n, ERR) : winsnstr(__w1, s, n))
1055 1053
1056 1054 #define mvwinsstr(w, y, x, s) \
1057 1055 (wmove(__w1 = (w), y, x) ? (s, ERR) : winsstr(__w1, s))
1058 1056
1059 1057 #define winsstr(w, s) winsnstr(w, s, -1)
1060 1058 #define ins_nwstr(wcs, n) wins_nwstr(stdscr, wcs, n)
1061 1059 #define ins_wstr(wcs) wins_wstr(stdscr, wcs)
1062 1060 #define mvins_nwstr(y, x, wcs, n) \
1063 1061 (move(y, x) ? (wcs, n, ERR) : ins_nwstr(wcs, n))
1064 1062
1065 1063 #define mvins_wstr(y, x, wcs) (move(y, x) ? (wcs, ERR) : ins_wstr(wcs))
1066 1064 #define mvwins_nwstr(w, y, x, wcs, n) \
1067 1065 (wmove(__w1 = (w), y, x) ? (wcs, n, ERR) : wins_nwstr(__w1, wcs, n))
1068 1066
1069 1067 #define mvwins_wstr(w, y, x, wcs) \
1070 1068 (wmove(__w1 = (w), y, x) ? (wcs, ERR) : wins_wstr(__w1, wcs))
1071 1069
1072 1070 #define wins_wstr(w, wcs) wins_nwstr(w, wcs, -1)
1073 1071 #define is_linetouched(w, y) (0 <= (w)->_last[y])
1074 1072 #define move(y, x) wmove(stdscr, y, x)
1075 1073 #define subpad(par, ny, nx, by, bx) subwin(par, ny, nx, by, bx)
1076 1074 #define nodelay(w, bf) (wtimeout(w, (bf) ? 0: -1), OK)
1077 1075 #define timeout(n) wtimeout(stdscr, n)
1078 1076 #define qiflush() ((void) intrflush(NULL, 1))
1079 1077 #define noqiflush() ((void) intrflush(NULL, 0))
1080 1078 #define redrawwin(w) wredrawln(__w1 = (w), 0, (__w1)->_maxy)
1081 1079 #define scrl(n) wscrl(stdscr, n)
1082 1080 #define setscrreg(t, b) wsetscrreg(stdscr, t, b)
1083 1081 #define standend() wstandend(stdscr)
1084 1082 #define standout() wstandout(stdscr)
1085 1083 #define touchline(w, y, n) wtouchln(w, y, n, 1)
1086 1084 #define touchwin(w) wtouchln(__w1 = (w), 0, __w1->_maxy, 1)
1087 1085 #define untouchwin(w) wtouchln(__w1 = (w), 0, __w1->_maxy, 0)
1088 1086 #define termname() (cur_term->_term)
1089 1087
1090 1088 #endif /* !defined(__lint) */
1091 1089
1092 1090 /*
1093 1091 * Special Keys
1094 1092 *
1095 1093 * Keypad layout
1096 1094 * A1 up A3
1097 1095 * left B2 right
1098 1096 * C1 down C3
1099 1097 *
1100 1098 * Chossing negative values for KEY_ constants means that they can
1101 1099 * be safely returned in either an int or long type.
1102 1100 */
1103 1101 #define __KEY_BASE (-2)
1104 1102 #define __KEY_MAX __KEY_BASE
1105 1103
1106 1104 #define KEY_CODE_YES (__KEY_BASE-1) /* Special indicator. */
1107 1105 #define KEY_BREAK (__KEY_BASE-2) /* Break key (unreliable) */
1108 1106 #define KEY_DOWN (__KEY_BASE-3) /* The four arrow keys ... */
1109 1107 #define KEY_UP (__KEY_BASE-4)
1110 1108 #define KEY_LEFT (__KEY_BASE-5)
1111 1109 #define KEY_RIGHT (__KEY_BASE-6)
1112 1110 #define KEY_HOME (__KEY_BASE-7) /* Move to upper-left corner. */
1113 1111 #define KEY_BACKSPACE (__KEY_BASE-8) /* Backspace */
1114 1112 #define KEY_F0 (__KEY_BASE-9) /* Function keys. Space for */
1115 1113 #define KEY_F(n) (KEY_F0-(n)) /* 64 keys is reserved. */
1116 1114 #define KEY_DL (__KEY_BASE-73) /* Delete line */
1117 1115 #define KEY_IL (__KEY_BASE-74) /* Insert line */
1118 1116 #define KEY_DC (__KEY_BASE-75) /* Delete character */
1119 1117 #define KEY_IC (__KEY_BASE-76) /* Ins char / enter ins mode */
1120 1118 #define KEY_EIC (__KEY_BASE-77) /* Exit insert char mode */
1121 1119 #define KEY_CLEAR (__KEY_BASE-78) /* Clear screen */
1122 1120 #define KEY_EOS (__KEY_BASE-79) /* Clear to end of screen */
1123 1121 #define KEY_EOL (__KEY_BASE-80) /* Clear to end of line */
1124 1122 #define KEY_SF (__KEY_BASE-81) /* Scroll 1 line forward */
1125 1123 #define KEY_SR (__KEY_BASE-82) /* Scroll 1 line backwards */
1126 1124 #define KEY_NPAGE (__KEY_BASE-83) /* Next page */
1127 1125 #define KEY_PPAGE (__KEY_BASE-84) /* Previous page */
1128 1126 #define KEY_STAB (__KEY_BASE-85) /* Set tab */
1129 1127 #define KEY_CTAB (__KEY_BASE-86) /* Clear tab */
1130 1128 #define KEY_CATAB (__KEY_BASE-87) /* Clear all tabs */
1131 1129 #define KEY_ENTER (__KEY_BASE-88) /* Enter or send */
1132 1130 #define KEY_SRESET (__KEY_BASE-89) /* Soft (partial) reset */
1133 1131 #define KEY_RESET (__KEY_BASE-90) /* Hard reset */
1134 1132 #define KEY_PRINT (__KEY_BASE-91) /* Print or copy */
1135 1133 #define KEY_LL (__KEY_BASE-92) /* Move to lower left corner. */
1136 1134 #define KEY_A1 (__KEY_BASE-93) /* Upper left of keypad */
1137 1135 #define KEY_A3 (__KEY_BASE-94) /* Upper rght of keypad */
1138 1136 #define KEY_B2 (__KEY_BASE-95) /* Center of keypad */
1139 1137 #define KEY_C1 (__KEY_BASE-96) /* Lower left of keypad */
1140 1138 #define KEY_C3 (__KEY_BASE-97) /* Lower right of keypad */
1141 1139 #define KEY_BTAB (__KEY_BASE-98) /* Back Tab */
1142 1140 #define KEY_BEG (__KEY_BASE-99) /* Beginning */
1143 1141 #define KEY_CANCEL (__KEY_BASE-100)
1144 1142 #define KEY_CLOSE (__KEY_BASE-101)
1145 1143 #define KEY_COMMAND (__KEY_BASE-102)
1146 1144 #define KEY_COPY (__KEY_BASE-103)
1147 1145 #define KEY_CREATE (__KEY_BASE-104)
1148 1146 #define KEY_END (__KEY_BASE-105)
1149 1147 #define KEY_EXIT (__KEY_BASE-106)
1150 1148 #define KEY_FIND (__KEY_BASE-107)
1151 1149 #define KEY_HELP (__KEY_BASE-108)
1152 1150 #define KEY_MARK (__KEY_BASE-109)
1153 1151 #define KEY_MESSAGE (__KEY_BASE-110)
1154 1152 #define KEY_MOUSE (__KEY_BASE-111) /* Mouse event occured */
1155 1153 #define KEY_MOVE (__KEY_BASE-112)
1156 1154 #define KEY_NEXT (__KEY_BASE-113) /* Next object */
1157 1155 #define KEY_OPEN (__KEY_BASE-114)
1158 1156 #define KEY_OPTIONS (__KEY_BASE-115)
1159 1157 #define KEY_PREVIOUS (__KEY_BASE-116) /* Previous object */
1160 1158 #define KEY_REDO (__KEY_BASE-117)
1161 1159 #define KEY_REFERENCE (__KEY_BASE-118)
1162 1160 #define KEY_REFRESH (__KEY_BASE-119)
1163 1161 #define KEY_REPLACE (__KEY_BASE-120)
1164 1162 #define KEY_RESTART (__KEY_BASE-121)
1165 1163 #define KEY_RESUME (__KEY_BASE-122)
1166 1164 #define KEY_SAVE (__KEY_BASE-123)
1167 1165 #define KEY_SBEG (__KEY_BASE-124) /* Shifted keys */
1168 1166 #define KEY_SCANCEL (__KEY_BASE-125)
1169 1167 #define KEY_SCOMMAND (__KEY_BASE-126)
1170 1168 #define KEY_SCOPY (__KEY_BASE-127)
1171 1169 #define KEY_SCREATE (__KEY_BASE-128)
1172 1170 #define KEY_SDC (__KEY_BASE-129)
1173 1171 #define KEY_SDL (__KEY_BASE-130)
1174 1172 #define KEY_SELECT (__KEY_BASE-131) /* Select */
1175 1173 #define KEY_SEND (__KEY_BASE-132) /* Shifted end key */
1176 1174 #define KEY_SEOL (__KEY_BASE-133)
1177 1175 #define KEY_SEXIT (__KEY_BASE-134)
1178 1176 #define KEY_SFIND (__KEY_BASE-135)
1179 1177 #define KEY_SHELP (__KEY_BASE-136)
1180 1178 #define KEY_SHOME (__KEY_BASE-137)
1181 1179 #define KEY_SIC (__KEY_BASE-138)
1182 1180 #define KEY_SLEFT (__KEY_BASE-139)
1183 1181 #define KEY_SMESSAGE (__KEY_BASE-140)
1184 1182 #define KEY_SMOVE (__KEY_BASE-141)
1185 1183 #define KEY_SNEXT (__KEY_BASE-142)
1186 1184 #define KEY_SOPTIONS (__KEY_BASE-143)
1187 1185 #define KEY_SPREVIOUS (__KEY_BASE-144)
1188 1186 #define KEY_SPRINT (__KEY_BASE-145)
1189 1187 #define KEY_SREDO (__KEY_BASE-146)
1190 1188 #define KEY_SREPLACE (__KEY_BASE-147)
1191 1189 #define KEY_SRIGHT (__KEY_BASE-148)
1192 1190 #define KEY_SRSUME (__KEY_BASE-149)
1193 1191 #define KEY_SSAVE (__KEY_BASE-150)
1194 1192 #define KEY_SSUSPEND (__KEY_BASE-151)
1195 1193 #define KEY_SUNDO (__KEY_BASE-152)
1196 1194 #define KEY_SUSPEND (__KEY_BASE-153)
1197 1195 #define KEY_UNDO (__KEY_BASE-154)
1198 1196
1199 1197 #define __KEY_MIN (__KEY_BASE-155)
1200 1198
1201 1199 #ifdef __cplusplus
1202 1200 }
1203 1201 #endif
1204 1202
1205 1203 #endif /* _CURSES_H */
↓ open down ↓ |
1132 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX