1 /****************************************************************************
2 * Copyright (c) 1998 Free Software Foundation, Inc. *
4 * Permission is hereby granted, free of charge, to any person obtaining a *
5 * copy of this software and associated documentation files (the *
6 * "Software"), to deal in the Software without restriction, including *
7 * without limitation the rights to use, copy, modify, merge, publish, *
8 * distribute, distribute with modifications, sublicense, and/or sell *
9 * copies of the Software, and to permit persons to whom the Software is *
10 * furnished to do so, subject to the following conditions: *
12 * The above copyright notice and this permission notice shall be included *
13 * in all copies or substantial portions of the Software. *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * Except as contained in this notice, the name(s) of the above copyright *
24 * holders shall not be used in advertising or otherwise to promote the *
25 * sale, use or other dealings in this Software without prior written *
27 ****************************************************************************/
29 /****************************************************************************
30 * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
31 * and: Eric S. Raymond <esr@snark.thyrsus.com> *
32 ****************************************************************************/
36 * $Id: curses.priv.h,v 1.144 1999/10/22 23:15:37 tom Exp $
40 * Header file for curses library objects which are private to
46 #define CURSES_PRIV_H 1
52 #include <ncurses_cfg.h>
55 #define MODULE_ID(id) static const char Ident[] = id;
57 #define MODULE_ID(id) /*nothing*/
62 #include <sys/types.h>
68 #if HAVE_SYS_BSDTYPES_H
69 #include <sys/bsdtypes.h> /* needed for ISC */
74 #elif HAVE_SYS_PARAM_H
75 # include <sys/param.h>
79 # if defined(_POSIX_PATH_MAX)
80 # define PATH_MAX _POSIX_PATH_MAX
81 # elif defined(MAXPATHLEN)
82 # define PATH_MAX MAXPATHLEN
84 # define PATH_MAX 255 /* the Posix minimum path-size */
99 /* Some systems have a broken 'select()', but workable 'poll()'. Use that */
100 #if HAVE_POLL && HAVE_SYS_STROPTS_H && HAVE_POLL_H
101 #define USE_FUNC_POLL 1
103 #define USE_FUNC_POLL 0
106 /* Alessandro Rubini's GPM (general-purpose mouse) */
107 #if HAVE_LIBGPM && HAVE_GPM_H
108 #define USE_GPM_SUPPORT 1
110 #define USE_GPM_SUPPORT 0
113 /* QNX mouse support */
114 #if defined(__QNX__) && !defined(__QNXNTO__)
115 #define USE_QNX_MOUSE 1
117 #define USE_QNX_MOUSE 0
120 /* EMX mouse support */
122 #define USE_EMX_MOUSE
125 #define DEFAULT_MAXCLICK 166
126 #define EV_MAX 8 /* size of mouse circular event queue */
129 * If we don't have signals to support it, don't add a sigwinch handler.
130 * In any case, resizing is an extended feature. Use it if we've got it.
132 #ifndef NCURSES_EXT_FUNCS
133 #undef HAVE_SIZECHANGE
137 #define USE_SIZECHANGE 1
143 * Not all platforms have memmove; some have an equivalent bcopy. (Some may
147 #define memmove(d,s,n) bcopy(s,d,n)
149 #define memmove(d,s,n) _nc_memmove(d,s,n)
150 extern void * _nc_memmove(void *, const void *, size_t);
154 * Scroll hints are useless when hashmap is used
156 #if !USE_SCROLL_HINTS
158 #define USE_SCROLL_HINTS 1
160 #define USE_SCROLL_HINTS 0
165 #define if_USE_SCROLL_HINTS(stmt) stmt
167 #define if_USE_SCROLL_HINTS(stmt) /*nothing*/
171 * Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only
172 * when we're throwing control codes at the screen at high volume. To see
173 * this, re-enable USE_HARD_TABS and run worm for a while. Other systems
174 * probably don't want to define this either due to uncertainties about tab
175 * delays and expansion in raw mode.
179 struct tries *child; /* ptr to child. NULL if none */
180 struct tries *sibling; /* ptr to sibling. NULL if none */
181 unsigned char ch; /* character at this node */
182 unsigned short value; /* code of string so far. 0 if none. */
186 * Definitions for color pairs
188 #define C_SHIFT 8 /* we need more bits than there are colors */
189 #define C_MASK ((1 << C_SHIFT) - 1)
191 #define PAIR_OF(fg, bg) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
194 * Common/troublesome character definitions
201 * Structure for palette tables
206 short red, green, blue;
210 #define MAXCOLUMNS 135
212 #define FIFO_SIZE MAXCOLUMNS+2 /* for nocbreak mode input */
216 #define WINDOWLIST struct _win_list
218 #include <curses.h> /* we'll use -Ipath directive to get the right one! */
221 * Structure for soft labels.
226 char *text; /* text for the label */
227 char *form_text; /* formatted text (left/center/...) */
228 int x; /* x coordinate of this field */
229 char dirty; /* this label has changed */
230 char visible; /* field is visible */
234 char dirty; /* all labels have changed */
235 char hidden; /* soft labels are hidden */
238 char* buffer; /* buffer for labels */
239 short maxlab; /* number of available labels */
240 short labcnt; /* number of allocated labels */
241 short maxlen; /* length of labels */
242 chtype attr; /* soft label attribute */
246 int _ifd; /* input file ptr for screen */
247 FILE *_ofp; /* output file ptr for screen */
248 char *_setbuf; /* buffered I/O for output */
249 int _buffered; /* setvbuf uses _setbuf data */
250 int _checkfd; /* filedesc for typeahead check */
251 struct term *_term; /* terminal type information */
252 short _lines; /* screen lines */
253 short _columns; /* screen columns */
254 short _lines_avail; /* lines available for stdscr */
255 short _topstolen; /* lines stolen from top */
257 WINDOW *_curscr; /* current screen */
258 WINDOW *_newscr; /* virtual screen to be updated to */
259 WINDOW *_stdscr; /* screen's full-window context */
261 struct tries *_keytry; /* "Try" for use with keypad mode */
262 struct tries *_key_ok; /* Disabled keys via keyok(,FALSE) */
263 int _tried; /* keypad mode was initialized */
265 unsigned int _fifo[FIFO_SIZE]; /* input push-back buffer */
266 short _fifohead, /* head of fifo queue */
267 _fifotail, /* tail of fifo queue */
268 _fifopeek, /* where to peek for next char */
269 _fifohold; /* set if breakout marked */
271 int _endwin; /* are we out of window mode? */
272 unsigned long _current_attr; /* terminal attribute current set */
273 int _coloron; /* is color enabled? */
274 int _cursor; /* visibility of the cursor */
275 int _cursrow; /* physical cursor row */
276 int _curscol; /* physical cursor column */
277 int _nl; /* True if NL -> CR/NL is on */
278 int _raw; /* True if in raw mode */
279 int _cbreak; /* 1 if in cbreak mode */
280 /* > 1 if in halfdelay mode */
281 int _echo; /* True if echo on */
282 int _use_meta; /* use the meta key? */
283 SLK *_slk; /* ptr to soft key struct / NULL */
284 int slk_format; /* selected format for this screen */
285 /* cursor movement costs; units are 10ths of milliseconds */
286 #ifdef NCURSES_NO_PADDING
287 int _no_padding; /* flag to set if padding disabled */
289 int _char_padding; /* cost of character put */
290 int _cr_cost; /* cost of (carriage_return) */
291 int _cup_cost; /* cost of (cursor_address) */
292 int _home_cost; /* cost of (cursor_home) */
293 int _ll_cost; /* cost of (cursor_to_ll) */
295 int _ht_cost; /* cost of (tab) */
296 int _cbt_cost; /* cost of (backtab) */
297 #endif /* USE_HARD_TABS */
298 int _cub1_cost; /* cost of (cursor_left) */
299 int _cuf1_cost; /* cost of (cursor_right) */
300 int _cud1_cost; /* cost of (cursor_down) */
301 int _cuu1_cost; /* cost of (cursor_up) */
302 int _cub_cost; /* cost of (parm_cursor_left) */
303 int _cuf_cost; /* cost of (parm_cursor_right) */
304 int _cud_cost; /* cost of (parm_cursor_down) */
305 int _cuu_cost; /* cost of (parm_cursor_up) */
306 int _hpa_cost; /* cost of (column_address) */
307 int _vpa_cost; /* cost of (row_address) */
308 /* used in lib_doupdate.c, must be chars */
309 int _ed_cost; /* cost of (clr_eos) */
310 int _el_cost; /* cost of (clr_eol) */
311 int _el1_cost; /* cost of (clr_bol) */
312 int _dch1_cost; /* cost of (delete_character) */
313 int _ich1_cost; /* cost of (insert_character) */
314 int _dch_cost; /* cost of (parm_dch) */
315 int _ich_cost; /* cost of (parm_ich) */
316 int _ech_cost; /* cost of (erase_chars) */
317 int _rep_cost; /* cost of (repeat_char) */
318 int _hpa_ch_cost; /* cost of (column_address) */
319 int _cup_ch_cost; /* cost of (cursor_address) */
320 int _smir_cost; /* cost of (enter_insert_mode) */
321 int _rmir_cost; /* cost of (exit_insert_mode) */
322 int _ip_cost; /* cost of (insert_padding) */
323 /* used in lib_mvcur.c */
324 char * _address_cursor;
325 int _carriage_return_length;
326 int _cursor_home_length;
327 int _cursor_to_ll_length;
328 int _scrolling; /* 1 if terminal's smart enough to */
330 /* used in lib_color.c */
331 color_t *_color_table; /* screen's color palette */
332 int _color_count; /* count of colors in palette */
333 unsigned short *_color_pairs; /* screen's color pair list */
334 int _pair_count; /* count of color pairs */
335 int _default_color; /* use default colors */
336 chtype _xmc_suppress; /* attributes to suppress if xmc */
337 chtype _xmc_triggers; /* attributes to process if xmc */
338 chtype _acs_map[ACS_LEN];
340 /* used in lib_vidattr.c */
341 bool _use_rmso; /* true if we may use 'rmso' */
342 bool _use_rmul; /* true if we may use 'rmul' */
345 * These data correspond to the state of the idcok() and idlok()
346 * functions. A caveat is in order here: the XSI and SVr4
347 * documentation specify that these functions apply to the window which
348 * is given as an argument. However, ncurses implements this logic
349 * only for the newscr/curscr update process, _not_ per-window.
353 #define _nc_idlok SP->_nc_sp_idlok
354 #define _nc_idcok SP->_nc_sp_idcok
357 * These are the data that support the mouse interface.
360 bool (*_mouse_event) (SCREEN *);
361 bool (*_mouse_inline)(SCREEN *);
362 bool (*_mouse_parse) (int);
363 void (*_mouse_resume)(SCREEN *);
364 void (*_mouse_wrap) (SCREEN *);
365 int _mouse_fd; /* file-descriptor, if any */
368 * This supports automatic resizing
371 int (*_resize)(int,int);
375 * These are data that support the proper handling of the panel stack on an
378 struct panelhook _panelHook;
380 * Linked-list of all windows, to support '_nc_resizeall()' and
383 WINDOWLIST *_nc_sp_windows;
384 #define _nc_windows SP->_nc_sp_windows
387 SCREEN *_next_screen;
389 /* hashes for old and new lines */
390 unsigned long *oldhash, *newhash;
392 bool _cleanup; /* cleanup after int/quit signal */
395 extern SCREEN *_nc_screen_chain;
397 #ifdef NCURSES_NOMACROS
398 #include <nomacros.h>
407 int line; /* lines to take, < 0 => from bottom*/
408 int (*hook)(struct _win_st *, int); /* callback for user */
409 struct _win_st *w; /* maybe we need this for cleanup */
412 /* The terminfo source is assumed to be 7-bit ASCII */
413 #define is7bits(c) ((unsigned)(c) < 128)
416 #define min(a,b) ((a) > (b) ? (b) : (a))
420 #define max(a,b) ((a) < (b) ? (b) : (a))
423 /* usually in <unistd.h> */
425 #define STDIN_FILENO 0
428 #ifndef STDOUT_FILENO
429 #define STDOUT_FILENO 1
432 #ifndef STDERR_FILENO
433 #define STDERR_FILENO 2
437 #define EXIT_SUCCESS 0
441 #define EXIT_FAILURE 1
445 #define R_OK 4 /* Test for read permission. */
448 #define W_OK 2 /* Test for write permission. */
451 #define X_OK 1 /* Test for execute permission. */
454 #define F_OK 0 /* Test for existence. */
457 #define TextOf(c) ((c) & (chtype)A_CHARTEXT)
458 #define AttrOf(c) ((c) & (chtype)A_ATTRIBUTES)
460 #define BLANK (' '|A_NORMAL)
464 #define CHANGED_CELL(line,col) \
465 if (line->firstchar == _NOCHANGE) \
466 line->firstchar = line->lastchar = col; \
467 else if ((col) < line->firstchar) \
468 line->firstchar = col; \
469 else if ((col) > line->lastchar) \
472 #define CHANGED_RANGE(line,start,end) \
473 if (line->firstchar == _NOCHANGE \
474 || line->firstchar > (start)) \
475 line->firstchar = start; \
476 if (line->lastchar == _NOCHANGE \
477 || line->lastchar < (end)) \
480 #define CHANGED_TO_EOL(line,start,end) \
481 if (line->firstchar == _NOCHANGE \
482 || line->firstchar > (start)) \
483 line->firstchar = start; \
486 #define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
487 #define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type))
488 #define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type))
489 #define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type))
490 #define FreeIfNeeded(p) if(p != 0) free(p)
491 #define FreeAndNull(p) free(p); p = 0
493 #include <nc_alloc.h>
496 * Prefixes for call/return points of library function traces. We use these to
497 * instrument the public functions so that the traces can be easily transformed
498 * into regression scripts.
500 #define T_CALLED(fmt) "called " fmt
501 #define T_CREATE(fmt) "create " fmt
502 #define T_RETURN(fmt) "return " fmt
505 #define TR(n, a) if (_nc_tracing & (n)) _tracef a
506 #define T(a) TR(TRACE_CALLS, a)
507 #define TPUTS_TRACE(s) _nc_tputs_trace = s;
508 #define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
509 #define returnAttr(code) TRACE_RETURN(code,attr_t)
510 #define returnCode(code) TRACE_RETURN(code,int)
511 #define returnPtr(code) TRACE_RETURN(code,ptr)
512 #define returnVoid T((T_RETURN(""))); return
513 #define returnWin(code) TRACE_RETURN(code,win)
514 extern WINDOW * _nc_retrace_win(WINDOW *);
515 extern attr_t _nc_retrace_attr_t(attr_t);
516 extern char *_nc_retrace_ptr(char *);
517 extern const char *_nc_tputs_trace;
518 extern int _nc_retrace_int(int);
519 extern long _nc_outchars;
520 extern void _nc_fifo_dump(void);
524 #define TPUTS_TRACE(s)
525 #define returnAttr(code) return code
526 #define returnCode(code) return code
527 #define returnPtr(code) return code
528 #define returnVoid return
529 #define returnWin(code) return code
532 extern unsigned _nc_tracing;
533 extern const char *_nc_visbuf2(int, const char *);
535 #define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch))
537 #define ALL_BUT_COLOR ((chtype)~(A_COLOR))
538 #define IGNORE_COLOR_OFF FALSE
539 #define NONBLANK_ATTR (A_BOLD|A_DIM|A_BLINK)
540 #define XMC_CHANGES(c) ((c) & SP->_xmc_suppress)
543 #define toggle_attr_on(S,at) \
544 if (PAIR_NUMBER(at) > 0)\
545 (S) = ((S) & ALL_BUT_COLOR) | (at);\
548 T(("new attribute is %s", _traceattr((S))))
551 #define toggle_attr_off(S,at) \
552 if (IGNORE_COLOR_OFF == TRUE) {\
553 if (PAIR_NUMBER(at) == 0xff) /* turn off color */\
555 else /* leave color alone */\
556 (S) &= ~((at)&ALL_BUT_COLOR);\
558 if (PAIR_NUMBER(at) > 0x00) /* turn off color */\
559 (S) &= ~(at|A_COLOR);\
560 else /* leave color alone */\
563 T(("new attribute is %s", _traceattr((S))));
565 #define DelCharCost(count) \
568 : ((delete_character != 0) \
569 ? (SP->_dch1_cost * count) \
572 #define InsCharCost(count) \
575 : ((enter_insert_mode && exit_insert_mode) \
576 ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) \
577 : ((insert_character != 0) \
578 ? (SP->_ich1_cost * count) \
582 #define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) { \
583 attr_t chg = SP->_current_attr; \
584 vidattr(AttrOf(c)); \
585 if (magic_cookie_glitch > 0 \
586 && XMC_CHANGES((chg ^ SP->_current_attr))) { \
587 T(("%s @%d before glitch %d,%d", \
588 __FILE__, __LINE__, \
591 _nc_do_xmc_glitch(chg); \
595 #define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) \
600 * Check whether the given character can be output by clearing commands. This
601 * includes test for being a space and not including any 'bad' attributes, such
602 * as A_REVERSE. All attribute flags which don't affect appearance of a space
603 * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded.
605 #define can_clear_with(ch) \
606 ((ch & ~(NONBLANK_ATTR|(back_color_erase ? A_COLOR:0))) == BLANK)
608 #ifdef NCURSES_EXPANDED
610 #undef toggle_attr_on
611 #define toggle_attr_on(S,at) _nc_toggle_attr_on(&(S), at)
612 extern void _nc_toggle_attr_on(attr_t *, attr_t);
614 #undef toggle_attr_off
615 #define toggle_attr_off(S,at) _nc_toggle_attr_off(&(S), at)
616 extern void _nc_toggle_attr_off(attr_t *, attr_t);
618 #undef can_clear_with
619 #define can_clear_with(ch) _nc_can_clear_with(ch)
620 extern int _nc_can_clear_with(chtype);
623 #define DelCharCost(count) _nc_DelCharCost(count)
624 extern int _nc_DelCharCost(int);
627 #define InsCharCost(count) _nc_InsCharCost(count)
628 extern int _nc_InsCharCost(int);
631 #define UpdateAttrs(c) _nc_UpdateAttrs(c)
632 extern void _nc_UpdateAttrs(chtype);
636 extern void _nc_expanded(void);
641 #define getcwd(buf,len) getwd(buf)
645 extern void *_nc_doalloc(void *, size_t);
647 #define strdup _nc_strdup
648 extern char *_nc_strdup(const char *);
653 extern void _nc_do_xmc_glitch(attr_t);
657 #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
658 extern void _nc_linedump(void);
662 extern void _nc_init_acs(void); /* corresponds to traditional 'init_acs()' */
663 extern int _nc_msec_cost(const char *const, int); /* used by 'tack' program */
666 #define INFINITY 1000000 /* cost: too high to use */
668 extern void _nc_mvcur_init(void);
669 extern void _nc_mvcur_resume(void);
670 extern void _nc_mvcur_wrap(void);
672 extern int _nc_scrolln(int, int, int, int);
674 extern void _nc_screen_init(void);
675 extern void _nc_screen_resume(void);
676 extern void _nc_screen_wrap(void);
679 #define strstr _nc_strstr
680 extern char *_nc_strstr(const char *, const char *);
684 extern int _nc_has_mouse(void);
687 extern char * _nc_printf_string(const char *fmt, va_list ap);
690 extern void _nc_add_to_try(struct tries **tree, char *str, unsigned short code);
691 extern char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len);
692 extern int _nc_remove_key(struct tries **tree, unsigned short code);
693 extern int _nc_remove_string(struct tries **tree, char *string);
696 extern WINDOW *_nc_makenew(int, int, int, int, int);
697 extern char *_nc_home_terminfo(void);
698 extern char *_nc_trace_buf(int, size_t);
699 extern chtype _nc_background(WINDOW *);
700 extern chtype _nc_render(WINDOW *, chtype);
701 extern int _nc_access(const char *, int);
702 extern int _nc_baudrate(int);
703 extern int _nc_getenv_num(const char *);
704 extern int _nc_keypad(bool);
705 extern int _nc_ospeed(int);
706 extern int _nc_outch(int);
707 extern int _nc_setupscreen(short, short const, FILE *);
708 extern int _nc_timed_wait(int, int, int *);
709 extern int _nc_waddch_nosync(WINDOW *, const chtype);
710 extern void _nc_do_color(int, bool, int (*)(int));
711 extern void _nc_freeall(void);
712 extern void _nc_freewin(WINDOW *win);
713 extern void _nc_hash_map(void);
714 extern void _nc_init_keytry(void);
715 extern void _nc_keep_tic_dir(const char *);
716 extern void _nc_make_oldhash(int i);
717 extern void _nc_outstr(const char *str);
718 extern void _nc_scroll_oldhash(int n, int top, int bot);
719 extern void _nc_scroll_optimize(void);
720 extern void _nc_scroll_window(WINDOW *, int const, short const, short const, chtype);
721 extern void _nc_set_buffer(FILE *ofp, bool buffered);
722 extern void _nc_signal_handler(bool);
723 extern void _nc_synchook(WINDOW *win);
724 extern void _nc_trace_tries(struct tries *tree);
727 extern void _nc_update_screensize(void);
731 extern int *_nc_oldnums;
733 #define USE_SETBUF_0 0
735 #define NC_BUFFERED(flag) \
736 if ((SP->_buffered != 0) != flag) \
737 _nc_set_buffer(SP->_ofp, flag)
739 #define NC_OUTPUT ((SP != 0) ? SP->_ofp : stdout)
740 #define _nc_flush() (void)fflush(NC_OUTPUT)
743 * On systems with a broken linker, define 'SP' as a function to force the
744 * linker to pull in the data-only module with 'SP'.
746 #ifndef BROKEN_LINKER
747 #define BROKEN_LINKER 0
751 #define SP _nc_screen()
752 extern SCREEN *_nc_screen(void);
753 extern int _nc_alloc_screen(void);
754 extern void _nc_set_screen(SCREEN *);
756 /* current screen is private data; avoid possible linking conflicts too */
758 #define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0)
759 #define _nc_set_screen(sp) SP = sp
763 * We don't want to use the lines or columns capabilities internally,
764 * because if the application is running multiple screens under
765 * X windows, it's quite possible they could all have type xterm
766 * but have different sizes! So...
768 #define screen_lines SP->_lines
769 #define screen_columns SP->_columns
771 extern int _nc_slk_format; /* != 0 if slk_init() called */
772 extern int _nc_slk_initialize(WINDOW *, int);
775 * Some constants related to SLK's
777 #define MAX_SKEY_OLD 8 /* count of soft keys */
778 #define MAX_SKEY_LEN_OLD 8 /* max length of soft key text */
779 #define MAX_SKEY_PC 12 /* This is what most PC's have */
780 #define MAX_SKEY_LEN_PC 5
782 /* Macro to check whether or not we use a standard format */
783 #define SLK_STDFMT(fmt) (fmt < 3)
784 /* Macro to determine height of label window */
785 #define SLK_LINES(fmt) (SLK_STDFMT(fmt) ? 1 : ((fmt) - 2))
787 #define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC)
788 #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC)
790 extern int _nc_ripoffline(int line, int (*init)(WINDOW *,int));
796 #endif /* CURSES_PRIV_H */