diff options
author | peter <peter@FreeBSD.org> | 2000-07-03 09:24:12 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-07-03 09:24:12 +0000 |
commit | cc6a5cc05f3c2cde24338d35c9714f1e7ebf032e (patch) | |
tree | 27e79485df3c9195e6fe58960df47f675f41f1e9 /contrib/ncurses/include | |
parent | b22d00e9129b5cb2fee8da1592ca70eff2222f7e (diff) | |
download | FreeBSD-src-cc6a5cc05f3c2cde24338d35c9714f1e7ebf032e.zip FreeBSD-src-cc6a5cc05f3c2cde24338d35c9714f1e7ebf032e.tar.gz |
Import the most recent ncurses 5.1 prerelease (20000701).
Mostly this is intended to resolve the trace() badness once and for all.
Obtained from: ftp://dickey.his.com/ncurses/
Diffstat (limited to 'contrib/ncurses/include')
-rw-r--r-- | contrib/ncurses/include/Caps | 4 | ||||
-rw-r--r-- | contrib/ncurses/include/MKterm.h.awk.in | 9 | ||||
-rw-r--r-- | contrib/ncurses/include/Makefile.in | 3 | ||||
-rw-r--r-- | contrib/ncurses/include/capdefaults.c | 93 | ||||
-rw-r--r-- | contrib/ncurses/include/curses.h.in | 55 | ||||
-rw-r--r-- | contrib/ncurses/include/nc_alloc.h | 13 | ||||
-rw-r--r-- | contrib/ncurses/include/term_entry.h | 12 | ||||
-rw-r--r-- | contrib/ncurses/include/tic.h | 21 |
8 files changed, 131 insertions, 79 deletions
diff --git a/contrib/ncurses/include/Caps b/contrib/ncurses/include/Caps index 7c10212..8e4435c 100644 --- a/contrib/ncurses/include/Caps +++ b/contrib/ncurses/include/Caps @@ -29,7 +29,7 @@ # Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 # and: Eric S. Raymond <esr@snark.thyrsus.com> # -# $Id: Caps,v 1.24 1999/01/17 02:01:44 tom Exp $ +# $Id: Caps,v 1.25 1999/11/27 20:13:55 tom Exp $ # # This is the master termcap/terminfo capability table. # @@ -215,7 +215,7 @@ eat_newline_glitch xenl bool xn YBCGE newline ignored after 80 cols (concept) erase_overstrike eo bool eo YBCG- can erase overstrikes with a blank generic_type gn bool gn YB-G- generic line type hard_copy hc bool hc YBCG- hardcopy terminal -has_meta_key km bool km YB-GE Has a meta key (shift, sets parity bit) +has_meta_key km bool km YB-GE Has a meta key (i.e., sets 8th-bit) has_status_line hs bool hs YB-G- has extra status line insert_null_glitch in bool in YBCGE insert mode distinguishes nulls memory_above da bool da YBCG- display may be retained above the screen diff --git a/contrib/ncurses/include/MKterm.h.awk.in b/contrib/ncurses/include/MKterm.h.awk.in index 6f66b21..e839cf4 100644 --- a/contrib/ncurses/include/MKterm.h.awk.in +++ b/contrib/ncurses/include/MKterm.h.awk.in @@ -1,7 +1,7 @@ BEGIN { print "/****************************************************************************" - print " * Copyright (c) 1998 Free Software Foundation, Inc. *" + print " * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *" print " * *" print " * Permission is hereby granted, free of charge, to any person obtaining a *" print " * copy of this software and associated documentation files (the *" @@ -33,7 +33,7 @@ BEGIN { print "/* and: Eric S. Raymond <esr@snark.thyrsus.com> */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.36 1999/09/01 22:36:52 Peter.Wemm Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.37 2000/03/12 02:40:07 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -174,6 +174,8 @@ $2 == "%%-STOP-HERE-%%" { /^#/ {next;} +$1 == "acs_chars" {acsindex = StringCount} + $3 == "bool" { printf "#define %-30s CUR Booleans[%d]\n", $1, BoolCount++ } @@ -197,6 +199,9 @@ END { printf "#define NUMCOUNT %d\n", NumberCount printf "#define STRCOUNT %d\n", StringCount print "" + print "/* used by code for comparing entries */" + print "#define acs_chars_index ", acsindex + print "" print "typedef struct termtype { /* in-core form of terminfo data */" print " char *term_names; /* str_table offset of term names */" print " char *str_table; /* pointer to string table */" diff --git a/contrib/ncurses/include/Makefile.in b/contrib/ncurses/include/Makefile.in index 724be6d..29c0d7c 100644 --- a/contrib/ncurses/include/Makefile.in +++ b/contrib/ncurses/include/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.22 1998/02/11 12:13:46 tom Exp $ +# $Id: Makefile.in,v 1.23 2000/05/28 01:33:52 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -71,6 +71,7 @@ AUTO_SRC = \ ################################################################################ all \ +libs \ sources \ install :: $(AUTO_SRC) diff --git a/contrib/ncurses/include/capdefaults.c b/contrib/ncurses/include/capdefaults.c index af1193c..071f9e1 100644 --- a/contrib/ncurses/include/capdefaults.c +++ b/contrib/ncurses/include/capdefaults.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,57 +31,54 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $Id: capdefaults.c,v 1.8 1998/07/04 22:31:04 tom Exp $ */ +/* $Id: capdefaults.c,v 1.12 2000/01/02 02:34:56 tom Exp $ */ - /* - * Compute obsolete capabilities. The reason this is an include file - * is that the two places where it's needed want the macros to - * generate offsets to different structures. See the file Caps for - * explanations of these conversions. - * - * Note: This code is the functional inverse of the first part - * of postprocess_entry(). - */ - { - char *sp; - int capval; + /* + * Compute obsolete capabilities. The reason this is an include file is + * that the two places where it's needed want the macros to generate + * offsets to different structures. See the file Caps for explanations of + * these conversions. + * + * Note: This code is the functional inverse of the first part of + * postprocess_termcap(). + */ +{ + char *sp; + int capval; #define EXTRACT_DELAY(str) (sp = strchr(str, '*'), sp ? atoi(sp+1) : 0) - /* current (4.4BSD) capabilities marked obsolete */ - if (VALID_STRING(carriage_return) - && (capval = EXTRACT_DELAY(carriage_return))) - carriage_return_delay = capval; - if (VALID_STRING(newline) && (capval = EXTRACT_DELAY(newline))) - new_line_delay = capval; + /* current (4.4BSD) capabilities marked obsolete */ + if (VALID_STRING(carriage_return) + && (capval = EXTRACT_DELAY(carriage_return))) + carriage_return_delay = capval; + if (VALID_STRING(newline) && (capval = EXTRACT_DELAY(newline))) + new_line_delay = capval; - /* current (4.4BSD) capabilities not obsolete */ - if (!VALID_STRING(termcap_init2) && VALID_STRING(init_3string)) - { - termcap_init2 = init_3string; - init_3string = (char *)0; - } - if (VALID_STRING(reset_1string) - && !VALID_STRING(reset_2string) - && VALID_STRING(reset_3string)) - { - termcap_reset = reset_2string; - reset_2string = (char *)0; - } -#if USE_XMC_SUPPORT - if (magic_cookie_glitch_ul < 0 && magic_cookie_glitch && VALID_STRING(enter_underline_mode)) - magic_cookie_glitch_ul = magic_cookie_glitch; -#else - magic_cookie_glitch_ul = -1; -#endif + /* current (4.4BSD) capabilities not obsolete */ + if (!VALID_STRING(termcap_init2) && VALID_STRING(init_3string)) { + termcap_init2 = init_3string; + init_3string = ABSENT_STRING; + } + if (!VALID_STRING(termcap_reset) + && VALID_STRING(reset_2string) + && !VALID_STRING(reset_1string) + && !VALID_STRING(reset_3string)) { + termcap_reset = reset_2string; + reset_2string = ABSENT_STRING; + } + if (magic_cookie_glitch_ul == ABSENT_NUMERIC + && magic_cookie_glitch != ABSENT_NUMERIC + && VALID_STRING(enter_underline_mode)) + magic_cookie_glitch_ul = magic_cookie_glitch; - /* totally obsolete capabilities */ - linefeed_is_newline = VALID_STRING(newline) - && (strcmp("\n", newline) == 0); - if (VALID_STRING(cursor_left) - && (capval = EXTRACT_DELAY(cursor_left))) - backspace_delay = capval; - if (VALID_STRING(tab) && (capval = EXTRACT_DELAY(tab))) - horizontal_tab_delay = capval; + /* totally obsolete capabilities */ + linefeed_is_newline = VALID_STRING(newline) + && (strcmp("\n", newline) == 0); + if (VALID_STRING(cursor_left) + && (capval = EXTRACT_DELAY(cursor_left))) + backspace_delay = capval; + if (VALID_STRING(tab) && (capval = EXTRACT_DELAY(tab))) + horizontal_tab_delay = capval; #undef EXTRACT_DELAY - } +} diff --git a/contrib/ncurses/include/curses.h.in b/contrib/ncurses/include/curses.h.in index 3e52e40..4810087 100644 --- a/contrib/ncurses/include/curses.h.in +++ b/contrib/ncurses/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $Id: curses.h.in,v 1.85 1999/10/23 12:33:54 tom Exp $ */ +/* $Id: curses.h.in,v 1.92 2000/04/29 18:52:53 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -65,6 +65,12 @@ #undef NCURSES_CONST #define NCURSES_CONST @NCURSES_CONST@ +#undef NCURSES_COLOR_T +#define NCURSES_COLOR_T short + +#undef NCURSES_SIZE_T +#define NCURSES_SIZE_T short + typedef unsigned @cf_cv_typeof_chtype@ chtype; #include <stdio.h> @@ -245,18 +251,18 @@ cchar_t; struct ldat { chtype *text; /* text of the line */ - short firstchar; /* first changed character in the line */ - short lastchar; /* last changed character in the line */ - short oldindex; /* index of the line at last update */ + NCURSES_SIZE_T firstchar; /* first changed character in the line */ + NCURSES_SIZE_T lastchar; /* last changed character in the line */ + NCURSES_SIZE_T oldindex; /* index of the line at last update */ }; struct _win_st { - short _cury, _curx; /* current cursor position */ + NCURSES_SIZE_T _cury, _curx; /* current cursor position */ /* window location and size */ - short _maxy, _maxx; /* maximums of x and y, NOT window size */ - short _begy, _begx; /* screen coords of upper-left-hand corner */ + NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */ + NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */ short _flags; /* window state flags */ @@ -279,8 +285,8 @@ struct _win_st struct ldat *_line; /* the actual line data */ /* global screen state */ - short _regtop; /* top line of scrolling region */ - short _regbottom; /* bottom line of scrolling region */ + NCURSES_SIZE_T _regtop; /* top line of scrolling region */ + NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */ /* these are used only if this is a sub-window */ int _parx; /* x coordinate of this window in parent */ @@ -290,12 +296,12 @@ struct _win_st /* these are used only if this is a pad */ struct pdat { - short _pad_y, _pad_x; - short _pad_top, _pad_left; - short _pad_bottom, _pad_right; + NCURSES_SIZE_T _pad_y, _pad_x; + NCURSES_SIZE_T _pad_top, _pad_left; + NCURSES_SIZE_T _pad_bottom, _pad_right; } _pad; - short _yoffset; /* real begy is _begy + _yoffset */ + NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ }; extern WINDOW *stdscr; @@ -311,8 +317,14 @@ extern int TABSIZE; */ extern int ESCDELAY; /* ESC expire time in milliseconds */ +extern char ttytype[]; /* needed for backward compatibility */ + +/* + * These functions are extensions - not in XSI Curses. + */ extern char *keybound (int, int); extern const char *curses_version (void); +extern int assume_default_colors (int, int); extern int define_key (char *, int); extern int keyok (int, bool); extern int resizeterm (int, int); @@ -320,8 +332,6 @@ extern int use_default_colors (void); extern int use_extended_names (bool); extern int wresize (WINDOW *, int, int); -extern char ttytype[]; /* needed for backward compatibility */ - /* * GCC (and some other compilers) define '__attribute__'; we're using this * macro to alert the compiler to flag inconsistencies in printf/scanf-like @@ -433,6 +443,7 @@ extern int doupdate(void); /* implemented */ extern WINDOW *dupwin(WINDOW *); /* implemented */ extern int echo(void); /* implemented */ extern int echochar(const chtype); /* generated */ +extern int erase(void); /* generated */ #ifdef _XOPEN_SOURCE_EXTENDED extern int echo_wchar(const cchar_t *); /* missing */ extern int erasewchar(wchar_t*); /* missing */ @@ -945,7 +956,7 @@ extern bool mouse_trafo(int*, int*, bool); /* generated */ #define winchstr(w, s) winchnstr(w, s, -1) #define winsstr(w, s) winsnstr(w, s, -1) -#define redrawwin(w) wredrawln(w, 0, w->_maxy+1) +#define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1) #define waddstr(win,str) waddnstr(win,str,-1) #define waddchstr(win,str) waddchnstr(win,str,-1) @@ -1313,7 +1324,6 @@ extern char *_tracechar(const unsigned char); extern char *_tracechtype(chtype); extern char *_tracechtype2(int, chtype); extern char *_tracemouse(const MEVENT *); -#define trace _nc_trace extern void trace(const unsigned int); /* trace masks */ @@ -1330,6 +1340,7 @@ extern void trace(const unsigned int); #define TRACE_BITS 0x0100 /* trace state of TTY control bits */ #define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ #define TRACE_CCALLS 0x0400 /* trace per-character calls */ +#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ #define TRACE_MAXIMUM 0xffff /* maximum trace level */ #if defined(TRACE) || defined(NCURSES_TEST) @@ -1342,6 +1353,14 @@ extern const char *_nc_visbuf(const char *); #endif #ifdef __cplusplus + +/* these names conflict with STL */ +#undef box +#undef clear +#undef erase +#undef move +#undef refresh + } #endif diff --git a/contrib/ncurses/include/nc_alloc.h b/contrib/ncurses/include/nc_alloc.h index 1e23a97..5ac5a78 100644 --- a/contrib/ncurses/include/nc_alloc.h +++ b/contrib/ncurses/include/nc_alloc.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 * ****************************************************************************/ -/* $Id: nc_alloc.h,v 1.7 1999/04/03 23:15:13 tom Exp $ */ +/* $Id: nc_alloc.h,v 1.8 2000/04/08 23:42:57 tom Exp $ */ #ifndef NC_ALLOC_included #define NC_ALLOC_included 1 @@ -69,4 +69,15 @@ extern void _nc_leaks_dump_entry(void); #define ExitProgram(code) return code #endif +/* doalloc.c */ +extern void *_nc_doalloc(void *, size_t); +#if !HAVE_STRDUP +#define strdup _nc_strdup +extern char *_nc_strdup(const char *); +#endif + +#define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type)) +#define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type)) +#define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type)) + #endif /* NC_ALLOC_included */ diff --git a/contrib/ncurses/include/term_entry.h b/contrib/ncurses/include/term_entry.h index a19b601..7d9f77b 100644 --- a/contrib/ncurses/include/term_entry.h +++ b/contrib/ncurses/include/term_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,6 +31,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ +/* $Id: term_entry.h,v 1.29 2000/03/19 02:04:15 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code @@ -46,16 +47,20 @@ extern "C" { #include <term.h> #define MAX_USES 32 +#define MAX_CROSSLINKS 16 typedef struct entry { TERMTYPE tterm; int nuses; struct { - void *parent; /* (char *) or (ENTRY *) */ + char *name; + struct entry *link; long line; } uses[MAX_USES]; + int ncrosslinks; + struct entry *crosslinks[MAX_CROSSLINKS]; long cstart, cend; long startline; struct entry *next; @@ -130,6 +135,7 @@ extern void _nc_init_acs(void); /* corresponds to traditional 'init_acs()' */ /* parse_entry.c: entry-parsing code */ #if NCURSES_XNAMES extern bool _nc_user_definable; +extern bool _nc_disable_period; #endif extern int _nc_parse_entry(ENTRY *, int, bool); extern int _nc_capcmp(const char *, const char *); @@ -141,7 +147,7 @@ extern void _nc_write_entry(TERMTYPE *const); /* comp_parse.c: entry list handling */ extern void _nc_read_entry_source(FILE*, char*, int, bool, bool (*)(ENTRY*)); extern bool _nc_entry_match(char *, char *); -extern int _nc_resolve_uses(void); +extern int _nc_resolve_uses(bool); extern void _nc_free_entries(ENTRY *); extern void (*_nc_check_termtype)(TERMTYPE *); diff --git a/contrib/ncurses/include/tic.h b/contrib/ncurses/include/tic.h index 0a85054..24f12bc 100644 --- a/contrib/ncurses/include/tic.h +++ b/contrib/ncurses/include/tic.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -97,8 +97,21 @@ extern "C" { /* location of user's personal info directory */ #define PRIVATE_INFO "%s/.terminfo" /* plug getenv("HOME") into %s */ +/* + * Some traces are designed to be used via tic's verbose option (and similar in + * infocmp and toe) rather than the 'trace()' function. So we use the bits + * above the normal trace() parameter as a debug-level. + */ + +#define MAX_DEBUG_LEVEL 15 +#define DEBUG_LEVEL(n) ((n) << 12) /* see TRACE_MAXIMUM */ + +#define set_trace_level(n) \ + _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL), \ + _nc_tracing |= DEBUG_LEVEL(n) + #ifdef TRACE -#define DEBUG(n, a) if (_nc_tracing & (1 << (n - 1))) _tracef a +#define DEBUG(n, a) if (_nc_tracing >= DEBUG_LEVEL(n)) _tracef a #else #define DEBUG(n, a) /*nothing*/ #endif @@ -157,7 +170,7 @@ struct tinfo_fkeys { chtype code; }; -#ifdef BROKEN_LINKER +#if BROKEN_LINKER #define _nc_tinfo_fkeys _nc_tinfo_fkeysf() extern struct tinfo_fkeys *_nc_tinfo_fkeysf(void); @@ -258,7 +271,7 @@ extern bool _nc_suppress_warnings; extern char *_nc_tic_expand(const char *, bool, int); /* comp_scan.c: decode string from readable form */ -extern char _nc_trans_string(char *); +extern char _nc_trans_string(char *, char *); /* captoinfo.c: capability conversion */ extern char *_nc_captoinfo(const char *, const char *, int const); |