From: Thomas E. Dickey Date: Sat, 21 Oct 2000 04:42:11 +0000 (-0400) Subject: ncurses 5.2 X-Git-Tag: v5.2 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=c633e5103a29a38532cf1925257b91cea33fd090;ds=sidebyside ncurses 5.2 --- diff --git a/ANNOUNCE b/ANNOUNCE index 5ef8f3c2..7b5f4efa 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ - Announcing ncurses 5.1 + Announcing ncurses 5.2 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,102 +27,224 @@ Release Notes - This release is designed to be upward compatible from ncurses 5.0; - very few applications will require recompilation, depending on the - platform. These are the highlights from the change-log since ncurses - 5.0 release. + This release is designed to be upward compatible from ncurses 5.0 and + 5.1; very few applications will require recompilation, depending on + the platform. These are the highlights from the change-log since + ncurses 5.1 release. Interface changes: - * made the extended terminal capabilities - (configure --enable-tcap-names) a standard feature (though the - configure script can disable it, it is built by default). - * removed the trace() function and related trace support from the - production library. This is the only interface change that may - cause problems with existing applications linked to shared - libraries, since not all platforms use the minor version number. - * explicitly initialized to zero several data items which were - implicitly initialized, e.g., cur_term. If not explicitly - initialized, their storage type is C (common), and causes problems - linking on some platforms. - * modified curses.h.in, undef'ing some symbols to avoid conflict - with C++ STL. - - New features: - * added a new extension, assume_default_colors() to provide better - control over the use of default colors. This is the principal - visible difference between ncurses 5.1 and preceding versions. The - new extension allows an application to specify what colors pair 0 - uses. - NOTE: Pair 0 defaults to white on black unless you have invoked - use_default_colors() or set it via assume_default_colors(). An - application that calls start_colors() without setting the - background color will consistently have a black background no - matter what color your terminal's background actually is. - * made several fixes to the terminfo-to-termcap conversion, and have - been using the generated termcaps without further hand-tuning. - This builds on the extension use_extended_names() by adding - "obsolete" termcap strings to terminfo.src - + modified tic so that if extended names (i.e., - configure --enable-tcap-names) are active, then tic -x will - also write "obsolete" capabilities that are present in the - terminfo source. - + added screen's AX capability (for ECMA SGR 39 and 49) to - applicable terminfo entries, use presence of this as a check - for a small improvement in setting default colors. - + add -a option to tic and infocmp, which retains commented-out - capabilities during source translation/comparison, e.g., - captoinfo and infotocap. - * implemented limited support for UTF-8, useful with XFree86 xterm: - + if the configure --enable-widec option is given, append 'w' - to names of the generated libraries (e.g., libncursesw.so) to - avoid conflict with existing ncurses libraries. - + add a simple UTF-8 output driver to the experimental - wide-character support. If any of the environment variables - LC_ALL, LC_CTYPE or LANG contain the string "UTF-8", this - driver will be used to translate the output to UTF-8. - + modified view.c to make a rudimentary viewer of UTF-8 text. - * modify raw() and noraw() to clear/restore IEXTEN flag which - affects stty lnext on systems such as FreeBSD - * reordered tests during mouse initialization to allow for gpm to - run in xterm, or for xterm to be used under OS/2 EMX. Also dropped - test for $DISPLAY in favor of the terminfo capability kmous=\E[M - or if $TERM environment variable contains "xterm". - * added configure option --with-manpage-symlinks, which provides for - fully indexing manpage entries by making symbolic links for the - aliases. - * changed unctrl() to render C1 characters (128-159) as ~@, ~A, etc. - * add experimental configure option --enable-colorfgbg to check for - $COLORTERM variable as set by rxvt/aterm/Eterm. - * made the infocmp -F option less verbose. - * dropped support for gnat 3.10 (gnat 3.12 is current). + * change type of ospeed variable back to short to match its use in + legacy applications. It was altered after ncurses 4.2 to speed_t + to repair a type mismatch which was introduced after 1.9.4 in + 1995. The principal users of termcap continued to use short, which + is not the same size. + NOTE: A few applications will have to be recompiled (about 1% of + the programs in a typical Linux distribution, 10% of the programs + that use ncurses). These are easy to identify with nm or strings. + * remove a private function _nc_can_clear_with(), which was built + with the configure --enable-expanded option but not used. + * add several private functions (prefixed with "_nc_") for tracing + chtype values in the debug library, and for better access and + buffer limit checking. + + New features and improvements: + * rewrote tgoto() to make it better support existing termcap + applications which use hardcoded strings rather than obtain all of + their information from the termcap file. If the string does not + appear to be a terminfo string (i.e., does not refer to a "%p" + parameter, or terminfo-style padding), and termcap support is + configured, tgoto() will interpret it as termcap. Otherwise, as + before, it will use tparm(). + * to ensure that the tgoto() changes work properly, added checks to + tic which report capabilities that do not reference the expected + number of parameters. + * new configure script options: + + option --disable-root-environ adds runtime checks which tell + ncurses to disregard $TERMINFO and similar environment + variables if the current user is root, or running + setuid/setgid. + + option --disable-assumed-color allows you to use the pre-5.1 + convention of default colors used for color-pair 0 to be + configured (see assume_default_colors()). + + implement configure script options that transform installed + program names, e.g., --program-prefix, including the manpage + names and cross references. + + option --with-database allows you to specify a different + terminfo source-file to install. On OS/2 EMX, the default is + misc/emx.src, otherwise misc/terminfo.src + + option --with-default-terminfo-dir allows you to specify the + default terminfo database directory. + + option --with-libtool allows you to build with libtool. + NOTE: libtool uses a different notation for numbering shared + library versions from the existing ncurses configuration. + + option --with-manpage-tbl causes the manpages to be + preprocessed by tbl(1) prior to installation, + + option --without-curses-h causes the installation process to + install curses.h as ncurses.h and make appropriate changes to + headers and manpages. + * modified configure script options: + + change symbol used by the --install-prefix configure option + from INSTALL_PREFIX to DESTDIR (the latter has become common + usage although the name is misleading). + + modify ld -rpath options (e.g., Linux, and Solaris) to use an + absolute pathname for the build tree's lib directory, + avoiding confusion with directories relative to the current + one with the installed programs. + + modified misc/run_tic.in to use tic -o, to eliminate + dependency on $TERMINFO variable for installs. + * terminfo database: + + updated xterm terminfo entries to match XFree86 xterm patch + #146. + + added amiga-vnc, Matrix Orbital, and QNX qansi to + misc/terminfo.src. + + added os2 entry to misc/emx.src. + + add S0 and E0 extensions to screen's terminfo entry since + otherwise the FreeBSD port makes it pass termcap equivalents + to tgoto, which would be misinterpreted by older versions of + ncurses. + * improvements to program usability: + + modify programs to use curses_version() string to report the + version of ncurses with which they are compiled rather than + the NCURSES_VERSION string. The function returns the patch + level in addition to the major and minor version numbers. + + modify tput program so it can be renamed or invoked via a + link as 'reset' or 'init', producing the same effect as + tput reset or tput init. + + add error checking to infocmp's -v and -m options to ensure + that the option value is indeed a number. + * improved performance: + + replace a lookup table in lib_vidattr.c used to decode + no_color_video with a logic expression which is faster. Major bug fixes: - * modified infocmp -e, -E options to ensure that generated - fallback.c type for Booleans agrees with term.h - * documented a special case of incompatiblity between ncurses 4.2 - and 5.0, added a section for this in INSTALL. - * corrected tests for file-descriptors in OS/2 EMX mouse support. A - negative value could be used by FD_SET, causing the select() call - to wait indefinitely. - * made 'tput flash' work properly for xterm by flushing output in - delay_output() when using napms(), and modifying xterm's terminfo - to specify no padding character. Otherwise, xterm's reported baud - rate could mislead ncurses into producing too few padding - characters. - * modified lib_addch.c to allow repeated update to the lower-right - corner, rather than displaying only the first character written - until the cursor is moved. Recent versions of SVr4 curses can - update the lower-right corner, and behave this way. - * modified echo() behavior of getch() to match Solaris curses for - carriage return and backspace (reported by Neil Zanella). - * corrected offsets used for subwindows in wresize() - * modified configure script so AC_MSG_ERROR is temporarily defined - to a warning in AC_PROG_CXX to make it recover from a missing C++ - compiler without requiring user to add --without-cxx option - * corrected logic in lib_twait.c as used by lib_mouse.c for GPM - mouse support when poll() is used rather than select(). - * made several fixes for buffer overflows, unchecked recursion, - improvements in performance, etc. See the NEWS file for details. + * correct manlinks.sed script introduced in ncurses 5.1 to avoid + using ERE "\+", which is not understood by standard versions of + sed. This happens to work with GNU sed, but is not portable, and + was the initial motivation for this release. + * remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. + This differed from the "hpux*" case by using reversed symbolic + links, which made the 5.1 version not match the configuration of + 5.0 shared libraries. + * guard against corrupt terminfo data: + + modify tparm() to disallow arithmetic on strings, analyze the + varargs list to read strings as strings and numbers as + numbers. + + modify tparm()'s internal function spop() to treat a null + pointer as an empty string. + + modify parse_format() in lib_tparm.c to ignore precision if + it is longer than 10000. + + rewrote limit checks in lib_mvcur.c using new functions + _nc_safe_strcat(), etc. Made other related changes to check + lengths used for strcat() and strcpy(). + * corrections to screen optimization: + + added special case in lib_vidattr.c to reset underline and + standout for devices that have no sgr0 defined. + + change handling of non_dest_scroll_region in tty_update.c to + clear text after it is shifted in rather than before shifting + out. Also correct row computation. + + modify rs2 capability in xterm-r6 and similar entries where + cursor save/restore bracketed the sequence for resetting + video attributes. The cursor restore would undo that. + * UTF-8 support: + + when checking LC_ALL, LC_CTYPE, and LANG environment + variables for UTF-8 locale, ignore those which are set to an + empty value, as per SUSV2. + + encode 0xFFFD in UTF-8 with 3 bytes, not 2. + + modify _nc_utf8_outch() to avoid sign-extension when checking + for out-of-range value. + * other library fixes: + + added checks for an empty $HOME environment variable, to + avoid retrieving terminfo descriptions from ./.terminfo . + + change functions _nc_parse_entry() and postprocess_termcap() + to avoid using strtok(), because it is non-reentrant. + + initialize fds[] array to 0's in _nc_timed_wait(); apparently + poll() only sets the revents members of that array when there + is activity corresponding to the related file. + + add a check for null pointer in Make_Enum_Type(). + + fix a heap problem with the c++ binding. + + correct missing includes for in several places, + including the C++ binding. This is not noted by gcc unless we + use the -fno-builtin option. + * several fixes for tic: + + add a check for empty buffers returned by fgets() in + comp_scan.c next_char() function, in case tic is run on a + non-text file (fixes a core dump). + + modify tic to verify that its inputs are really files, in + case someone tries to read a directory (or /dev/zero). + + correct an uninitialized parameter to open_tempfile() in + tic.c which made "tic -I" give an ambiguous error message + about tmpnam. + + correct logic in adjust_cancels(), which did not check both + alternatives when reclassifying an extended name between + boolean, number and string, causing an infinite loop in tic. + * using new checks in tic for parameter counts in capability + strings, found/fixed several errors both in the terminfo database + and in the include/Caps file. + + modified several terminfo capability strings, including the + definitions for setaf, setab, in include/Caps to indicate + that the entries are parameterized. This information is used + to tell which strings are translated when converting to + termcap. This fixes a problem where the generated termcap + would contain a spurious "%p1" for the terminfo "%p1%d". + + correct parameter counts in include/Caps for dclk as well as + some printer-specific capabilities: csnm, defc, scs, scsd, + smgtp, smglp. + * various fixes for install scripts used to support configure + --srcdir and --with-install-prefix. + * correct several mismatches between manpage filename and ".TH" + directives, renaming dft_fgbg.3x to default_colors.3x and + menu_attribs.3x to menu_attributes.3x. + + Portability: + * configure script: + + newer config.guess, config.sub, including changes to support + OS/2 EMX. The configure script for OS/2 EMX still relies on a + patch since there is no (working) support for that platform + in the main autoconf distribution. + + make configure script checks on variables $GCC and $GXX + consistently compare against 'yes' rather than test if they + are nonnull, since either may be set to the corresponding + name of the C or C++ compiler. + + change configure script to use AC_CANONICAL_SYSTEM rather + than AC_CANONICAL_HOST, which means that configure --target + will set a default program-prefix. + + modify the check for big-core to force a couple of memory + accesses, which may work as needed for older/less-capable + machines (if not, there's still the explicit configure + option). + + modify configure test for tcgetattr() to allow for old + implementations, e.g., on BeOS, which only defined it as a + macro. + + add configure check for filesystems (such as OS/2 EMX) which + do not distinguish between upper/lowercase filenames, use + this to fix tags rules in makefiles. + + add MKncurses_def.sh to generate fallback definitions for + ncurses_cfg.h, to quiet gcc -Wundef warnings, modified + ifdef's in code to consistently use "#if" rather than + "#ifdef". + + change most remaining unquoted parameters of test in + configure script to use quotes, for instance fixing a problem + in the --disable-database option. + + modify scripts so that "make install.data" works on OS/2 EMX. + + modify scripts and makefiles so the Ada95 directory builds on + OS/2 EMX. + * library: + + replaced case-statement in _nc_tracebits() for CSIZE with a + table to simplify working around implementations that define + random combinations of the related macros to zero. + + improved OS/2 mouse support by retrying as a 2-button mouse + if code fails to set up a 3-button mouse. + + added private entrypoint _nc_basename(), used to consolidate + related code in progs, as well as accommodating OS/2 EMX + pathnames. + + alter definition of NCURSES_CONST to make it non-empty. + + redefine 'TEXT' in menu.h for AMIGA, since it is reported to + have an (unspecified) symbol conflict. + * programs: + + modified progs/tset.c and tack/sysdep.c to build with sgttyb + interface if neither termio or termios is available. Tested + this with FreeBSD 2.1.5 (which does have termios - but the + sgttyb does work). Features of Ncurses @@ -344,7 +466,7 @@ References 5. http://dickey.his.com/ded/ded.html 6. http://dickey.his.com/dialog/dialog.html 7. http://lynx.isc.org/release/ - 8. file://localhost/usr/build/ncurses/ncurses-5.1-20000704/doc/html/www.gnome.org/mc/ + 8. file://localhost/usr/build/ncurses/ncurses-5.2-20001021/doc/html/www.gnome.org/mc/ 9. http://www.mutt.org/ 10. http://www.ncftp.com/ 11. http://www.bostic.com/vi/ diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in index cd538fa1..b1651379 100644 --- a/Ada95/gen/Makefile.in +++ b/Ada95/gen/Makefile.in @@ -29,23 +29,22 @@ # Author: Juergen Pfeifer 1996 # # Version Control -# $Revision: 1.30 $ +# $Revision: 1.34 $ # .SUFFIXES: SHELL = /bin/sh THIS = Makefile +x = @PROG_EXT@ + top_srcdir = @top_srcdir@ +DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ -libdir = @libdir@ -includedir = @includedir@ -datadir = @datadir@ -ticdir = $(datadir)/terminfo -ADA_INCLUDE = @ADA_INCLUDE@ -ADA_OBJECTS = @ADA_OBJECTS@ +ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@ +ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -53,7 +52,7 @@ INSTALL_DATA = @INSTALL_DATA@ AWK = @AWK@ LN_S = @LN_S@ -CC = @CC@ +HOST_CC = @BUILD_CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @ACPPFLAGS@ \ @@ -67,7 +66,7 @@ CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) -LINK = $(CC) +LINK = $(HOST_CC) LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) RANLIB = @RANLIB@ @@ -77,7 +76,7 @@ LIB_CURSES = -L../../lib -lncurses@LIB_SUFFIX@ M4 = m4 M4FLAGS = -GENERATE = ./gen '@DFT_ARG_SUFFIX@' +GENERATE = ./gen$x '@DFT_ARG_SUFFIX@' DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' GNATHTML = `type -p gnathtml || type -p gnathtml.pl` @@ -157,107 +156,107 @@ sources: $(ADA_INCLUDE) \ $(ADA_OBJECTS) : - $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$@ + $(top_srcdir)/mkinstalldirs $@ install \ install.libs :: $(ADA_INCLUDE) - @echo installing package $(ALIB) in $(INSTALL_PREFIX)$(ADA_INCLUDE) - @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(INSTALL_PREFIX)$(ADA_INCLUDE) - @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(INSTALL_PREFIX)$(ADA_INCLUDE) + @echo installing package $(ALIB) in $(ADA_INCLUDE) + @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE) + @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE) install \ install.libs :: $(ADA_OBJECTS) - @echo installing package $(ALIB) in $(INSTALL_PREFIX)$(ADA_OBJECTS) + @echo installing package $(ALIB) in $(ADA_OBJECTS) @chmod a-wx $(ADA_SRCDIR)/*.ali - @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(INSTALL_PREFIX)$(ADA_OBJECTS) + @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS) @chmod u+x $(ADA_SRCDIR)/*.ali uninstall \ uninstall.libs :: - @echo removing package $(ALIB) from $(INSTALL_PREFIX)$(ADA_INCLUDE) - -@cd $(INSTALL_PREFIX)$(ADA_INCLUDE) && rm -f $(ALIB)[-.]* + @echo removing package $(ALIB) from $(ADA_INCLUDE) + -@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]* uninstall \ uninstall.libs :: - @echo removing package $(ALIB) from $(INSTALL_PREFIX)$(ADA_OBJECTS) - -@cd $(INSTALL_PREFIX)$(ADA_OBJECTS) && rm -f $(ALIB)[-.]* + @echo removing package $(ALIB) from $(ADA_OBJECTS) + -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]* -gen: gen.o +gen$x: gen.o @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ $(LIB_CURSES) gen.o: $(srcdir)/gen.c - $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c + $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c -Character_Attribute_Set_Rep: gen +Character_Attribute_Set_Rep: gen$x $(GENERATE) B A >$@ -Base_Defs: gen +Base_Defs: gen$x $(GENERATE) B B >$@ -Color_Defs: gen +Color_Defs: gen$x $(GENERATE) B C >$@ -Key_Definitions: gen +Key_Definitions: gen$x $(GENERATE) B K >$@ -Old_Keys: gen +Old_Keys: gen$x $(GENERATE) B O >$@ -ACS_Map: gen +ACS_Map: gen$x $(GENERATE) B M >$@ -AC_Rep: gen +AC_Rep: gen$x $(GENERATE) B R >$@ -Linker_Options: gen +Linker_Options: gen$x $(GENERATE) B L >$@ -Version_Info: gen +Version_Info: gen$x $(GENERATE) B V >$@ -Window_Offsets: gen +Window_Offsets: gen$x $(GENERATE) B D >$@ -Menu_Opt_Rep: gen +Menu_Opt_Rep: gen$x $(GENERATE) M R >$@ -Menu_Base_Defs: gen +Menu_Base_Defs: gen$x $(GENERATE) M B >$@ -Menu_Linker_Options: gen +Menu_Linker_Options: gen$x $(GENERATE) M L >$@ -Item_Rep: gen +Item_Rep: gen$x $(GENERATE) M I >$@ -Form_Opt_Rep: gen +Form_Opt_Rep: gen$x $(GENERATE) F R >$@ -Form_Base_Defs: gen +Form_Base_Defs: gen$x $(GENERATE) F B >$@ -Form_Linker_Options: gen +Form_Linker_Options: gen$x $(GENERATE) F L >$@ -Field_Rep: gen +Field_Rep: gen$x $(GENERATE) F I >$@ -Mouse_Base_Defs: gen +Mouse_Base_Defs: gen$x $(GENERATE) P B >$@ -Mouse_Event_Rep: gen +Mouse_Event_Rep: gen$x $(GENERATE) P M >$@ -Mouse_Events: gen +Mouse_Events: gen$x $(GENERATE) B E >$@ -Panel_Linker_Options: gen +Panel_Linker_Options: gen$x $(GENERATE) P L >$@ -Chtype_Def: gen +Chtype_Def: gen$x $(GENERATE) E C >$@ -Eti_Defs: gen +Eti_Defs: gen$x $(GENERATE) E E >$@ $(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \ @@ -347,7 +346,7 @@ TAGS: etags *.[ch] mostlyclean :: - -rm -f a.out core gen *.o + -rm -f a.out core gen$x *.o -rm -f $(GEN_FILES1) -rm -f $(GEN_FILES2) -rm -f $(GEN_FILES3) diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 3c1800d3..64e9f912 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -32,7 +32,7 @@ /* Version Control - $Revision: 1.31 $ + $Revision: 1.32 $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -170,7 +170,7 @@ static void gen_chtype_rep(const char *name) chtype_rep("Ch",A_CHARTEXT); chtype_rep("Color",A_COLOR); chtype_rep("Attr",(A_ATTRIBUTES&~A_COLOR)); - printf(" end record;\n for %s'Size use %d;\n",name,8*sizeof(chtype)); + printf(" end record;\n for %s'Size use %ld;\n", name, (long)(8*sizeof(chtype))); printf(" -- Please note: this rep. clause is generated and may be\n"); printf(" -- different on your system.\n"); } @@ -1103,19 +1103,19 @@ eti_gen(char*buf, int code, const char* name, int* etimin, int* etimax) return strlen(buf); } -#define GEN_OFFSET(member,itype) \ - if (sizeof(((WINDOW*)0)->member)==sizeof(itype)) { \ - o = offsetof(WINDOW, member); \ - if ((o%sizeof(itype) == 0)) { \ - printf(" Offset%-*s : constant Natural := %2d; -- %s\n", \ - 8, #member, o/sizeof(itype),#itype); \ - } \ +#define GEN_OFFSET(member,itype) \ + if (sizeof(((WINDOW*)0)->member)==sizeof(itype)) { \ + o = offsetof(WINDOW, member); \ + if ((o%sizeof(itype) == 0)) { \ + printf(" Offset%-*s : constant Natural := %2ld; -- %s\n", \ + 8, #member, o/sizeof(itype),#itype); \ + } \ } static void gen_offsets(void) { - int o; + long o; const char* s_bool = ""; GEN_OFFSET(_maxy,short); @@ -1137,8 +1137,8 @@ gen_offsets(void) GEN_OFFSET(_scroll,int); s_bool = "int"; } - printf(" Sizeof%-*s : constant Natural := %2d; -- %s\n", - 8, "_bool",sizeof(bool),"bool"); + printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n", + 8, "_bool", (long) sizeof(bool),"bool"); /* In ncurses _maxy and _maxx needs an offset for the "public" * value */ diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4 index 840c5f18..f969ce04 100644 --- a/Ada95/gen/terminal_interface-curses-forms.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms.ads.m4 @@ -38,13 +38,12 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.23 $ +-- $Revision: 1.24 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Form_Base_Defs') with System; with Ada.Characters.Latin_1; -with Interfaces.C; package Terminal_Interface.Curses.Forms is pragma Preelaborate (Terminal_Interface.Curses.Forms); diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 index 81a4935c..2bc350a7 100644 --- a/Ada95/gen/terminal_interface-curses-menus.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4 @@ -38,12 +38,11 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.20 $ +-- $Revision: 1.21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Menu_Base_Defs') with System; -with Interfaces.C; with Ada.Characters.Latin_1; package Terminal_Interface.Curses.Menus is diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in index c9582fb7..d9cf0cf7 100644 --- a/Ada95/samples/Makefile.in +++ b/Ada95/samples/Makefile.in @@ -29,13 +29,15 @@ # Author: Juergen Pfeifer 1996 # # Version Control -# $Revision: 1.24 $ +# $Revision: 1.25 $ # .SUFFIXES: SHELL = /bin/sh THIS = Makefile +x = @PROG_EXT@ + srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -96,7 +98,7 @@ TOUR_OBJS = tour.o sample.o sample-curses_demo.o sample-explanation.o \ RAIN_OBJS = rain.o status.o -all :: demo1 rainy_day +all :: tour$x rain$x @ sources : @@ -111,13 +113,13 @@ uninstall \ uninstall.libs :: @ -demo1: explain.msg +tour$x : explain.msg $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) explain.msg: $(srcdir)/explain.txt cp $(srcdir)/explain.txt $@ -rainy_day: +rain$x : $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS) mostlyclean: diff --git a/Ada95/samples/sample-explanation.ads b/Ada95/samples/sample-explanation.ads index 1e20f051..24a0e177 100644 --- a/Ada95/samples/sample-explanation.ads +++ b/Ada95/samples/sample-explanation.ads @@ -35,19 +35,15 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and -- then reads the lines up to the next key. Those lines are presented in -- a window as help or explanation. -- -with Terminal_Interface.Curses; - package Sample.Explanation is - package Curses renames Terminal_Interface.Curses; - procedure Explain (Key : in String); -- Retrieve the text associated with this key and display it. diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb index ed796095..158b9358 100644 --- a/Ada95/samples/sample-text_io_demo.adb +++ b/Ada95/samples/sample-text_io_demo.adb @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Elementary_Functions; @@ -119,7 +119,7 @@ package body Sample.Text_IO_Demo is Default_Labels; Notepad ("TEXTIO-PAD00"); - Set_Echo_Mode (FALSE); + Set_Echo_Mode (False); Set_Meta_Mode; Set_KeyPad_Mode; W := Sub_Window (Standard_Window, Lines - 2, Columns - 2, 1, 1); diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb index 2d96142c..3544b097 100644 --- a/Ada95/samples/sample.adb +++ b/Ada95/samples/sample.adb @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; @@ -195,7 +195,7 @@ package body Sample is Init_Keyboard_Handler; - Set_Echo_Mode (FALSE); + Set_Echo_Mode (False); Set_Raw_Mode; Set_Meta_Mode; Set_KeyPad_Mode; diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in index a3de1954..d0069973 100644 --- a/Ada95/src/Makefile.in +++ b/Ada95/src/Makefile.in @@ -29,7 +29,7 @@ # Author: Juergen Pfeifer 1996 # # Version Control -# $Revision: 1.20 $ +# $Revision: 1.22 $ # .SUFFIXES: @@ -37,13 +37,10 @@ SHELL = /bin/sh THIS = Makefile MODEL = ../../@DFT_OBJ_SUBDIR@ +DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ -libdir = @libdir@ -includedir = @includedir@ -datadir = @datadir@ -ticdir = $(datadir)/terminfo ADA_INCLUDE = @ADA_INCLUDE@ INSTALL = @INSTALL@ @@ -192,7 +189,7 @@ distclean :: clean realclean :: distclean -BASEDEPS=$(ABASE).ads $(srcdir)/$(ABASE)-aux.ads $(srcdir)/$(ABASE).adb +BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(srcdir)/$(ABASE).adb $(ALIB).o: $(srcdir)/$(ALIB).ads $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ALIB).ads diff --git a/Ada95/src/terminal_interface-curses-text_io.adb b/Ada95/src/terminal_interface-curses-text_io.adb index 3d829a57..cf7614b4 100644 --- a/Ada95/src/terminal_interface-curses-text_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io.adb @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO is @@ -135,7 +135,7 @@ package body Terminal_Interface.Curses.Text_IO is if P_Size > 0 and then Line (Win) >= P_Size then New_Page (Win); else - Add (Win, Ascii.LF); + Add (Win, ASCII.LF); end if; end loop; end New_Line; diff --git a/Ada95/src/terminal_interface-curses.adb b/Ada95/src/terminal_interface-curses.adb index 1f536d14..698f1c65 100644 --- a/Ada95/src/terminal_interface-curses.adb +++ b/Ada95/src/terminal_interface-curses.adb @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer 1996 -- Version Control: --- $Revision: 1.25 $ +-- $Revision: 1.26 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; @@ -922,7 +922,7 @@ package body Terminal_Interface.Curses is when Non_Blocking => Time := 0; when Delayed => if Amount = 0 then - raise CONSTRAINT_ERROR; + raise Constraint_Error; end if; Time := C_Int (Amount); end case; diff --git a/INSTALL b/INSTALL index 9058c061..26d57374 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ --- $Id: INSTALL,v 1.38 2000/07/08 22:46:08 tom Exp $ +-- $Id: INSTALL,v 1.46 2000/10/14 17:57:02 Johnny.C.Lam Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -31,6 +31,9 @@ read the USING NCURSES WITH GPM section below. If you are running over the Andrew File System see the note below on USING NCURSES WITH AFS. +If you are cross-compiling, see the note below on BUILDING NCURSES WITH A +CROSS-COMPILER. + If you want to build the Ada95 binding, go to the Ada95 directory and follow the instructions there. The Ada95 binding is not covered below. @@ -101,6 +104,8 @@ INSTALLATION PROCEDURE: libncurses_p.a (profile) + libncurses.la (libtool) + If you do not specify any models, the normal and debug libraries will be configured. Typing `configure' with no arguments is equivalent to: @@ -123,6 +128,13 @@ INSTALLATION PROCEDURE: and SunOS with gcc, but more work needs to be done to make shared libraries work on other systems. + If you have libtool installed, you can type + + ./configure --with-libtool + + to generate the appropriate static and/or shared libraries for your + platform using libtool. + You can make curses and terminfo fall back to an existing file of termcap definitions by configuring with --enable-termcap. If you do this, the library will search /etc/termcap before the terminfo database, and will @@ -173,7 +185,8 @@ INSTALLATION PROCEDURE: The terminfo(5) manual page must be preprocessed with tbl(1) before being formatted by nroff(1). Modern man(1) implementations tend to do this by default, but you may want to look at your version's manual page - to be sure. + to be sure. You may also install the manual pages after preprocessing + with tbl(1) by specifying the configure option --with-manpage-tbl. If the system already has a curses library that you need to keep using for some bizarre binary-compatibility reason, you'll need to distinguish @@ -244,6 +257,15 @@ SUMMARY OF CONFIGURE OPTIONS: The other options are specific to this package. We list them in alphabetic order. + --disable-assumed-color + With ncurses 5.1, we introduced a new function, assume_default_colors() + which allows applications to specify what the default foreground and + background color are assumed to be. Most color applications use + full-screen color; but a few do not color the background. While the + assumed values can be overridden by invoking assume_default_colors(), + you may find it useful to set the assumed values to the pre-5.1 + convention, using this configure option. + --disable-big-core Assume machine has little memory. The configure script attempts to determine if your machine has enough memory (about 6Mb) to compile the @@ -262,6 +284,10 @@ SUMMARY OF CONFIGURE OPTIONS: that are not specified by XSI. See ncurses/modules for the exact list of library modules that would be suppressed. + --disable-hashmap + Compile without hashmap scrolling-optimization code. This algorithm is + the default. + --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. @@ -281,6 +307,12 @@ SUMMARY OF CONFIGURE OPTIONS: rather than the include directory. This makes it simpler to avoid compile-time conflicts with other versions of curses.h + --disable-root-environ + Compile with environment restriction, so certain environment variables + are not available when running as root, or via a setuid/setgid + application. These are (for example $TERMINFO) those that allow the + search path for the terminfo or termcap entry to be customized. + --disable-scroll-hints Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. @@ -367,10 +399,6 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. - --enable-hashmap - Compile with hashmap scrolling-optimization code. This is the default, - replacing an older scrolling-hints algorithm. - --enable-no-padding Compile-in support for the $NCURSES_NO_PADDING environment variable, which allows you to suppress the effect of non-mandatory padding in @@ -378,8 +406,9 @@ SUMMARY OF CONFIGURE OPTIONS: extended functions. --enable-rpath - Use rpath option when generating shared libraries. This applies mainly - to systems using the GNU linker (read the manpage). + Use rpath option when generating shared libraries, and with some + restrictions when linking the corresponding programs. This applies + mainly to systems using the GNU linker (read the manpage). --enable-safe-sprintf Compile with experimental safe-sprintf code. You may consider using @@ -435,6 +464,12 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-database=XXX + Specify the terminfo source file to install. Usually you will wish + to install ncurses' default (misc/terminfo.src). Certain systems + have special requirements, e.g, OS/2 EMX has a customized terminfo + source file. + --with-dbmalloc For testing, compile and link with Conor Cahill's dbmalloc library. @@ -442,6 +477,10 @@ SUMMARY OF CONFIGURE OPTIONS: Generate debug-libraries (default). These are named by adding "_g" to the root, e.g., libncurses_g.a + --with-default-terminfo-dir=XXX + Specify the default terminfo database directory. This is normally + DATADIR/terminfo, e.g., /usr/share/terminfo. + --with-develop Enable experimental/development options. This does not count those that change the interface, such as --enable-widec. @@ -465,6 +504,10 @@ SUMMARY OF CONFIGURE OPTIONS: NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. + --with-libtool + Generate libraries with libtool. If this option is selected, then + it overrides all other library model specifications. + --with-manpage-format=XXX Tell the configure script how you would like to install man-pages. The option value must be one of these: gzip, compress, BSDI, normal, @@ -484,6 +527,11 @@ SUMMARY OF CONFIGURE OPTIONS: this on systems that do not support symbolic links will result in copying the man-page for each alias. + --with-manpage-tbl + Tell the configure script that you with to preprocess the manpages + by running them through tbl to generate tables understandable by + nroff. + --with-normal Generate normal (i.e., static) libraries (default). @@ -516,8 +564,8 @@ SUMMARY OF CONFIGURE OPTIONS: script. --with-terminfo-dirs=XXX - Specify a search-list of terminfo directories which will be compiled into - the ncurses library (default: DATADIR/terminfo) + Specify a search-list of terminfo directories which will be compiled + into the ncurses library (default: DATADIR/terminfo) --with-termlib When building the ncurses library, organize this as two parts: the @@ -529,6 +577,11 @@ SUMMARY OF CONFIGURE OPTIONS: Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. + --without-curses-h + Don't install the ncurses header with the name "curses.h". Rather, + install as "ncurses.h" and modify the installed headers and manpages + accordingly. + --without-cxx XSI curses declares "bool" as part of the interface. C++ also declares "bool". Neither specifies the size and type of booleans, but both @@ -979,11 +1032,28 @@ USING NCURSES WITH GPM: are slow to update this library. Current distributions of gpm can be configured properly using the --without-curses option. +BUILDING NCURSES WITH A CROSS-COMPILER + Ncurses can be built with a cross-compiler. Some parts must be built + with the host's compiler since they are used for building programs + (e.g., ncurses/make_hash and ncurses/make_keys) that generate tables + that are compiled into the ncurses library. You should set the + BUILD_CC environment variable to your host's compiler, and run the + configure script configuring for the cross-compiler. + + Note that all of the generated source-files which are part of ncurses + will be made if you use + + make sources + + This would be useful in porting to an environment which has little + support for the tools used to generate the sources, e.g., sed, awk and + Bourne-shell. + BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to bug-ncurses-request@gnu.org with body that reads: subscribe ncurses - The Hacker's Guide in the misc directory includes some guidelines + The Hacker's Guide in the doc directory includes some guidelines on how to report bugs in ways that will get them fixed most quickly. diff --git a/MANIFEST b/MANIFEST index 0007f2aa..24368e57 100644 --- a/MANIFEST +++ b/MANIFEST @@ -297,8 +297,8 @@ ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html ./doc/html/man/curs_window.3x.html +./doc/html/man/default_colors.3x.html ./doc/html/man/define_key.3x.html -./doc/html/man/dft_fgbg.3x.html ./doc/html/man/form.3x.html ./doc/html/man/form_cursor.3x.html ./doc/html/man/form_data.3x.html @@ -327,7 +327,7 @@ ./doc/html/man/keybound.3x.html ./doc/html/man/keyok.3x.html ./doc/html/man/menu.3x.html -./doc/html/man/menu_attribs.3x.html +./doc/html/man/menu_attributes.3x.html ./doc/html/man/menu_cursor.3x.html ./doc/html/man/menu_driver.3x.html ./doc/html/man/menu_format.3x.html @@ -410,6 +410,7 @@ ./form/modules ./include/Caps ./include/MKhashsize.sh +./include/MKncurses_def.sh ./include/MKparametrized.sh ./include/MKterm.h.awk.in ./include/Makefile.in @@ -420,6 +421,7 @@ ./include/nc_alloc.h ./include/nc_panel.h ./include/ncurses_cfg.hin +./include/ncurses_defs ./include/term_entry.h ./include/termcap.h.in ./include/tic.h @@ -471,8 +473,8 @@ ./man/curs_trace.3x ./man/curs_util.3x ./man/curs_window.3x +./man/default_colors.3x ./man/define_key.3x -./man/dft_fgbg.3x ./man/form.3x ./man/form_cursor.3x ./man/form_data.3x @@ -504,7 +506,7 @@ ./man/man_db.renames ./man/manlinks.sed ./man/menu.3x -./man/menu_attribs.3x +./man/menu_attributes.3x ./man/menu_cursor.3x ./man/menu_driver.3x ./man/menu_format.3x @@ -589,7 +591,7 @@ ./misc/ncurses.ref ./misc/panel.def ./misc/panel.ref -./misc/run_tic.sh +./misc/run_tic.in ./misc/shlib ./misc/tabset/std ./misc/tabset/stdcrt @@ -728,6 +730,7 @@ ./ncurses/tinfo/lib_setup.c ./ncurses/tinfo/lib_termcap.c ./ncurses/tinfo/lib_termname.c +./ncurses/tinfo/lib_tgoto.c ./ncurses/tinfo/lib_ti.c ./ncurses/tinfo/lib_tparm.c ./ncurses/tinfo/lib_tputs.c @@ -738,6 +741,7 @@ ./ncurses/tinfo/read_entry.c ./ncurses/tinfo/read_termcap.c ./ncurses/tinfo/setbuf.c +./ncurses/tinfo/strings.c ./ncurses/tinfo/write_entry.c ./ncurses/trace/README ./ncurses/trace/lib_trace.c diff --git a/Makefile.glibc b/Makefile.glibc index 53b35abb..780650a0 100644 --- a/Makefile.glibc +++ b/Makefile.glibc @@ -198,6 +198,7 @@ libncurses-routines = \ tinfo/lib_setup \ tinfo/lib_termcap \ tinfo/lib_termname \ + tinfo/lib_tgoto \ tinfo/lib_ti \ tinfo/lib_tparm \ tinfo/lib_tputs \ @@ -207,6 +208,7 @@ libncurses-routines = \ tinfo/read_entry \ tinfo/read_termcap \ tinfo/setbuf \ + tinfo/strings \ tinfo/write_entry \ trace/lib_trace \ trace/lib_traceatr \ diff --git a/Makefile.in b/Makefile.in index 381ca9e7..9489e9fe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.18 1998/08/22 23:45:00 tom Exp $ +# $Id: Makefile.in,v 1.20 2000/08/19 19:11:56 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -33,8 +33,8 @@ SHELL = /bin/sh -INSTALL_PREFIX=@INSTALL_PREFIX@ -CF_MFLAGS = @cf_cv_makeflags@ INSTALL_PREFIX="$(INSTALL_PREFIX)" +DESTDIR=@DESTDIR@ +CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" @SET_MAKE@ @@ -46,7 +46,7 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ -datadir = @datadir@ +ticdir = @TERMINFO@ includedir = @includedir@ libdir = @libdir@ mandir = @mandir@ @@ -69,7 +69,7 @@ preinstall : @ echo ' lib directory: '$(libdir) @ echo ' include directory: '$(includedir) @ echo ' man directory: '$(mandir) - @ echo ' terminfo directory: '$(datadir)/terminfo + @ echo ' terminfo directory: '$(ticdir) @ echo '' @ test "$(includedir)" = "$(prefix)/include" || \ echo '** Include-directory is not in a standard location' diff --git a/Makefile.os2 b/Makefile.os2 index 7a6f56da..167ff657 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -1,7 +1,7 @@ ################################################################################ # Wrapper Makefile for ncurses library under OS/2. ################################################################################ -# $Id: Makefile.os2,v 1.8 1998/12/13 02:23:13 tom Exp $ +# $Id: Makefile.os2,v 1.10 2000/10/09 23:53:57 Ilya.Zakharevich Exp $ # # Author: Juan Jose Garcia Ripoll . # Webpage: http://www.arrakis.es/~worm/ @@ -13,8 +13,7 @@ # # touch Makefile # make -f Makefile.os2 config -# make -f Makefile.os2 CC=gcc HOSTCC=gcc -# make -f Makefile.os2 CC=gcc HOSTCC=gcc +# make -f Makefile.os2 CC=gcc HOSTCC=gcc CXX=gcc # # Ignoring the following errors: # Invalid configuration `os2'... @@ -138,7 +137,7 @@ make.dlls : $(DEFS) $(LIBS) $(DLLS) $(LIBS_AOUT) $(DEFS) : make.defs -LIBDIR = $(INSTALL_PREFIX)$(libdir) +LIBDIR = $(DESTDIR)$(libdir) $(LIBDIR) : mkdir -p $@ @@ -188,8 +187,8 @@ realclean :: # This is a simplified version of misc/Makefile # -TICDIR = $(INSTALL_PREFIX)$(datadir)/terminfo -TABSETDIR = $(INSTALL_PREFIX)$(datadir)/tabset +TICDIR = $(DESTDIR)$(datadir)/terminfo +TABSETDIR = $(DESTDIR)$(datadir)/tabset $(TICDIR) : mkdir -p $@ diff --git a/NEWS b/NEWS index 558846f5..796c894d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ --- $Id: NEWS,v 1.577 2000/07/08 20:59:25 tom Exp $ +-- $Id: NEWS,v 1.602 2000/10/21 00:42:11 tom Exp $ This is a log of changes that ncurses has gone through since Zeyd started working with Pavel Curtis' original work, pcurses, in 1992. @@ -6,6 +6,329 @@ working with Pavel Curtis' original work, pcurses, in 1992. Changes through 1.9.9e are recorded by Zeyd M. Ben-Halim. Changes since 1.9.9e are recorded by Thomas Dickey. +20001021 5.2 release for upload to ftp.gnu.org + + update generated html files from manpages. + + modify dist.mk to use edit_man.sh to substitute autoconf'd variables + in html manpages. + + fix an uninitialized pointer in read_termcap.c (report by Todd C + Miller, from report/patch by Philip Guenther ). + + correct help-message and array limit in knight.c (patch by Brian + Raiter ). + > patch by Juergen Pfeifer: + + fix to avoid warning by GNAT-3.13p about use of inconsistent casing + for some identifiers defined in the standard package. + + cosmetic change to forms/fty_enum.c + +20001014 + + correct an off-by-one position in test/railroad.c which could cause + wrapping at the right margin. + + test/repair some issues with libtool configuration. Make + --disable-echo force libtool --silent. (Libtool does not work for + OS/2 EMX, works partly for SCO - libtool is still very specific to + gcc). + + change default of --with-manpage-tbl to "no", since for most of the + platforms which do have tbl installed, the system "man" program + understands how to run tbl automatically. + + minor improvement to force_bar() in comp_parse.c (Bernhard + Rosenkraenzer ). + + modify lib_tparm.c to use get_space() before writing terminating + null character, both for consistency as well as to ensure that if + save_char() was called immediately before, that the allocated memory + is enough (patch by Sergei Ivanov). + + add note about termcap ML capability which is duplicated between two + different capabilities: smgl and smglr (reported by Sergei Ivanov + ). + + correct parameter counts in include/Caps for dclk as well as some + printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. + > patch by Johnny C Lam : + + add support for building with libtool (apparently version 1.3.5, + since old versions do not handle -L../lib), using new configure + option --with-libtool. + + add configure option --with-manpage-tbl, which causes the manpages to + be preprocessed by tbl(1) prior to installation, + + add configure option --without-curses-h, which causes the + installation process to install curses.h as ncurses.h and make + appropriate changes to headers and manpages. + +20001009 + + correct order of options/parameters in run_tic.in invocation of tic, + which did not work with standard getopt() (reported by Ethan + Butterfield ). + + correct logic for 'reverse' variable in lib_vidattr.c, which was + setting it true without checking if newmode had A_REVERSE set, e.g., + using $TERM=ansi on OS/2 EMX (see 20000917). + > patch by Todd Miller: + + add a few missing use_terminfo_vars() and fixes up _nc_tgetent(). + Previously, _nc_cgetset() would still get called on cp so the + simplest thing is to set cp to NULL if !use_terminfo_vars(). + + added checks for an empty $HOME environment variable. + > patches by Ilya Zakharevich for OS/2 EMX: + + modify convert_configure.pl to support INSTALL. Change compiler + options in that script to use multithreading, needed for the mouse. + + modify OS/2 mouse support, retrying as a 2-button mouse if code fails + to set up a 3-button mouse. + + improve code for OS/2 mouse support, using _nc_timed_wait() to + replace select() call. + +20001007 + + change type of ospeed variable back to short to match its use in + legacy applications (reported by Andrey A Chernov). + + add case to configure script for --enable-rpath on IRIX (patch by + Albert Chin-A-Young). + + minor fix to position_check() function, to ensure it gets the whole + cursor report before decoding. + + add configure option --disable-assumed-color, to allow pre-5.1 + convention of default colors used for color-pair 0 to be configured + (see assume_default_colors()). + + rename configure option --enable-hashmap --disable-hashmap, and + reorder the configure options, splitting the experimental and + development + + add configure option --disable-root-environ, which tells ncurses to + disregard $TERMINFO and similar environment variables if the current + user is root, or running setuid/setgid (based on discussion with + several people). + + modified misc/run_tic.in to use tic -o, to eliminate dependency on + $TERMINFO variable for installs. + + add table entry for plab_norm to tput, so it passes in strings + for that capability. + + modify parse_format() in lib_tparm.c to ignore precision if it is + longer than 10000 (report by Jouko Pynnonen). + + rewrote limit checks in lib_mvcur.c using new functions + _nc_safe_strcat(), etc. Made other related changes to check lengths + used for strcat/strcpy (report by Jouko Pynnonen ). + +20000930 + + modify several descriptions, including those for setaf, setab, in + include/Caps to indicate that the entries are parameterized. This + information is used to tell which strings are translated when + converting to termcap. Fixes a problem where the generated termcap + would contain a spurious "%p1" for the terminfo "%p1%d". + + modify ld -rpath options (e.g., Linux, and Solaris) to use an + absolute pathname for the build tree's lib directory (prompted by + discussion with Albert Chin-A-Young). + + modify "make install.man" and "make uninstall.man" to include tack's + man-page. + + various fixes for install scripts used to support configure --srcdir + and --with-install-prefix (reported by Matthew Clarke + ). + + make configure script checks on variables $GCC and $GXX consistently + compare against 'yes' rather than test if they are nonnull, since + either may be set to the corresponding name of the C or C++ compiler + (report/patch by Albert Chin-A-Young). + +20000923 + + modify rs2 capability in xterm-r6 and similar where cursor + save/restore bracketed the sequence for resetting video attributes. + The cursor restore would undo that (from a NetBSD bug report by John + Hawkinson ). + + using parameter check added to tic, corrected 27 typos in + terminfo.src -TD + + modify tic to verify that its inputs are really files, in case + someone tries to read a directory (or /dev/zero). + + add a check for empty buffers returned by fgets() in comp_scan.c + next_char() function, in case tic is run on a non-text file (fixes + a core dump reported by Aaron Campbell ). + + add to railroad.c some code exercising tgoto(), providing an + alternate form of display if the terminal supports cursor addressing. + + split-out tgoto() again, this time into new file lib_tgoto.c, and + implement a conventional BSD-style tgoto() which is used if the + capability string does not contain terminfo-style padding or + parameters (requested by Andrey A Chernov). + + add check to tic which reports capabilities that do not reference + the expected number of parameters. + + add error checking to infocmp's -v and -m options to ensure that + the option value is indeed a number. + +20000917 + + add S0, E0 extensions to screen's terminfo entry, which is another + way to solve the misconfiguration issue -TD + + completed special case for tgoto from 20000916 + +20000916 + + update xterm terminfo entries to match XFree86 xterm patch #146 -TD + + add Matrix Orbital terminfo entries (from Eric Z Ayers + ). + + add special case to lib_tparm.c to allow 'screen' program to use a + termcap-style parameter "%." to tgoto() for switching character sets. + + use LN_S substitution in run_tic.in, to work on OS/2 EMX which has + no symbolic links. + + updated notes in README.emx regarding autoconf patches. + + replace a lookup table in lib_vidattr.c used to decode no_color_video + with a logic expression (suggested by Philippe Blain). + + add a/A toggle to ncurses.c 'b' test, which clears/sets alternate + character set attribute from the displayed text. + + correct inequality in parameter analysis of rewritten lib_tparm.c + which had the effect of ignoring p9 in set_attributes (sgr), breaking + alternate character set (reported by Piotr Majka ). + + correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile + with Sun WorkShop compilers since these tokens were empty (cf: + 20000902, reported by Albert Chin-A-Young). + +20000909 + + correct an uninitialized parameter to open_tempfile() in tic.c which + made "tic -I" give an ambiguous error message about tmpnam. + + add special case in lib_vidattr.c to reset underline and standout for + devices that have no sgr0 defined (patch by Don Lewis + ). Note that this will not work for bold + mode, since there is no exit-bold-mode capability. + + improved patch for Make_Enum_Type (patch by Juergen Pfeifer). + + modify tparm to disallow arithmetic on strings, analyze the varargs + list to read strings as strings and numbers as numbers. + + modify tparm's internal function spop() to treat a null pointer as + an empty string. + + modify tput program so it can be renamed or invoked via a link as + 'reset' or 'init', producing the same effect as 'tput reset' or 'tput + init'. + + add private entrypoint _nc_basename(), use to consolidate related + code in progs, as well as accommodating OS/2 EMX pathnames. + + remove NCURSES_CONST line from edit_cfg.sh to compensate for its + removal (except via AC_SUBST) from configure.in, making --enable-const + work again (reported by Juergen Pfeifer). + + regen'd configure to pick up "hpux*" change from 20000902. + +20000902 + + modify tset.c to check for transformed "reset" program name, if any. + + add a check for null pointer in Make_Enum_Type() (reported by Steven + W Orr ). + + change functions _nc_parse_entry() and postprocess_termcap() to avoid + using strtok(), because it is non-reentrant (reported by Andrey A + Chernov ). + + remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. + This differed from the "hpux*" case by using reversed symbolic + links, which made the 5.1 version not match the configuration of + 5.0 shared libraries (reported by Albert Chin-A-Young). + + correct a dependency in Ada95/src/Makefile.in which prevented + building with configure --srcdir (patch by H Nanosecond + ). + + modify ifdef's in curses.h.in to avoid warning if GCC_PRINTF or + GCC_SCANF was not previously defined (reported by Pavel Roskin + ). + + add MKncurses_def.sh to generate fallback definitions for + ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in + code to consistently use "#if" rather than "#ifdef". + +20000826 + + add QNX qansi entries to terminfo -TD + + add os2 entry to misc/emx.src (). + + add configure option --with-database to allow specifying a different + terminfo source-file to install. On OS/2 EMX, this defaults to + misc/emx.src + + change misc/run_tic.sh to derive it from misc/run_tic.in, to simplify + setting .exe extension on OS/2 EMX. + + add .exe extension in Ada95/gen/Makefile.in, + Ada95/samples/Makefile.in, for OS/2 EMX (reported by + ). + + add configure check for filesystems (such as OS/2 EMX) which do not + distinguish between upper/lowercase filenames, use this to fix tags + rules in makefiles. + + initialize fds[] array to 0's in _nc_timed_wait(); apparently poll() + only sets the revents members of that array when there is activity + corresponding to the related file (report by Glenn Cooper + , using Purify on Solaris 5.6). + + change configure script to use AC_CANONICAL_SYSTEM rather than + AC_CANONICAL_HOST, which means that configure --target will set + a default program-prefix. + + add note on cross-compiling to INSTALL (which does not rely on the + AC_CANONICAL_* macros). + +20000819 + + add cases for EMX OS/2 to config.guess, config.sub + + new version of config.guess, config.sub from lynx 2.8.4dev.7 + + add definitions via transform.h to allow tic and tput to check for + the transformed aliases rather than the original infotocap, etc. + + simplify transform-expressions in progs/Makefile.in, make the + uninstall rule work for transformed program names. + + change symbol used by --install-prefix configure option from + INSTALL_PREFIX to DESTDIR (the latter has become common usage + although the name is misleading). + + modify programs to use curses_version() string to report the version + of ncurses with which they are compiled rather than the + NCURSES_VERSION string. The function returns the patch level in + addition to the major and minor version numbers. + +20000812 + + modify CF_MAN_PAGES configure macro to make transformed program names + a parameter to that macro rather than embedding them in the macro. + + newer config.guess, config.sub (reference version used in lynx + 2.8.4dev.7). + + add configure option --with-default-terminfo-dir=DIR to allow + specifying the default terminfo database directory (request by Albert + Chin-A-Young). + + minor updates for terminfo.src from FreeBSD termcap change-history. + + correct notes in README and INSTALL regarding documentation files + that were moved from misc directory to doc (report by Rich Kulawiec + ). + + change most remaining unquoted parameters of 'test' in configure + script to use quotes, for instance fixing a problem in the + --disable-database option (reported by Christian Mondrup + ). + + minor adjustments to work around some of the incompatibilities/bugs + in autoconf 2.29a alpha. + + add -I/usr/local/include when --with-ncurses option is used in + test/configure script. + + correct logic in adjust_cancels(), which did not check both + alternatives when reclassifying an extended name between boolean, + number and string, causing an infinite loop in tic. + +20000730 + + correct a missing backslash in curses.priv.h + +20000729 + + change handling of non_dest_scroll_region in tty_update.c to clear + text after it is shifted in rather than before shifting out. Also + correct row computation (reported by Ruediger Kuhlmann + ). + + add/use new trace function to display chtype values from winch() and + getbkgd(). + + add trace mask TRACE_ATTRS, alter several existing _tracef calls that + trace attribute changes under TRACE_CALLS to use this. + + modify MKlib_gen.sh so that functions returning chtype will call + returnChar(). + + add returnChar() trace, for functions returning chtype. + + change indent.pro to line up parenthesis. + +20000722 + + fix a heap problem with the c++ binding (report by + , patch by Juergen Pfeifer). + + minor adjustment to ClrToEOL() to handle an out-of-bounds parameter. + + modify the check for big-core to force a couple of memory accesses, + which may work as needed for older/less-capable machines (if not, + there's still the explicit configure option). + > fixes based on diff's for Amiga and BeOS found at + http://www.mathematik.uni-karlsruhe.de/~kuhlmann/cross/ncurses/ + + alter definition of NCURSES_CONST to make it non-empty. + + add amiga-vnc terminfo entry. + + redefine 'TEXT' in menu.h for AMIGA, since it is reported to have + an (unspecified) symbol conflict. + + replaced case-statement in _nc_tracebits() for CSIZE with a table to + simplify working around implementations that define random + combinations of the related macros to zero. + + modify configure test for tcgetattr() to allow for old + implementations, e.g., on BeOS, which only defined it as a macro. + > patches by Bruno Haible: + + when checking LC_ALL/LC_CTYPE/LANG environment variables for UTF-8 + locale, ignore those which are set to an empty value, as per SUSV2. + + encode 0xFFFD in UTF-8 with 3 bytes, not 2. + + modify _nc_utf8_outch() to avoid sign-extension when checking for + out-of-range value. + +20000715 + + correct manlinks.sed script to avoid using ERE "\+", which is not + understood by older versions of sed (patch by Albert Chin-A-Young). + + implement configure script options that transform installed program + names, e.g., --program-prefix, including the manpage names and cross + references (patch by Albert Chin-A-Young ). + + correct several mismatches between manpage filename and ".TH" + directives, renaming dft_fgbg.3x to default_colors.3x and + menu_attribs.3x to menu_attributes.3x (report by Todd C Miller). + + correct missing includes for in several places, including + the C++ binding. This is not noted by gcc unless we use the + -fno-builtin option (reported by Igor Schein ). + + modified progs/tset.c and tack/sysdep.c to build with sgttyb + interface if neither termio or termios is available. Tested this + with FreeBSD 2.1.5 (which does have termios - but the sgttyb does + work). + 20000708 5.1 release for upload to ftp.gnu.org + document configure options in INSTALL. + add man-page for ncurses trace functions. diff --git a/README b/README index 8b8c78ac..c46fc195 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ --- $Id: README,v 1.19 1999/10/23 20:39:24 tom Exp $ +-- $Id: README,v 1.20 2000/08/12 23:31:21 tom Exp $ ------------------------------------------------------------------------------- README file for the ncurses package @@ -10,7 +10,7 @@ See the file TO-DO for things that still need doing, including known bugs. Browse the file misc/ncurses-intro.html for narrative descriptions of how to use ncurses and the panel, menu, and form libraries. -Browse the file misc/hackguide.html for a tour of the package internals. +Browse the file doc/html/hackguide.html for a tour of the package internals. ROADMAP AND PACKAGE OVERVIEW: @@ -96,10 +96,10 @@ descriptions; the next two (clear and tput) are for use in shell scripts. The last (tset) is provided for 4.4BSD compatibility. The source code for all of these lives in the `progs' directory. -Detailed documentation for all libraries and utilities can be found in -the `man' directory. An HTML introduction to ncurses, panels, and -menus programming lives in the `misc' directory. Manpages in HTML format -are under `Ada95/html'. +Detailed documentation for all libraries and utilities can be found in the +`man' and `doc' directories. An HTML introduction to ncurses, panels, and +menus programming lives in the `doc/html' directory. Manpages in HTML format +are under `doc/html/man'. The `test' directory contains programs that can be used to verify or demonstrate the functions of the ncurses libraries. See test/README for @@ -171,5 +171,5 @@ suggesting improvements, and generally whining about ncurses :-) BUGS: See the INSTALL file for bug and developer-list addresses. - The Hacker's Guide in the misc directory includes some guidelines + The Hacker's Guide in the doc directory includes some guidelines on how to report bugs in ways that will get them fixed most quickly. diff --git a/README.emx b/README.emx index 15882d3b..3f3d526a 100644 --- a/README.emx +++ b/README.emx @@ -1,5 +1,5 @@ --- $Id: README.emx,v 1.2 2000/05/06 17:41:56 tom Exp $ --- Author: Thomas Dickey +-- $Id: README.emx,v 1.4 2000/09/16 19:28:28 tom Exp $ +-- Author: Thomas Dickey ------------------------------------------------------------------------------- You can build ncurses on OS/2 in the EMX environment. But you must build and @@ -11,7 +11,7 @@ You can generate a new one if you have autoconf built for EMX. You will need the EMX development tools, of course. Get these programs to start: GNU m4 program (version 1.4) - GNU autoconf (version 2.12). + GNU autoconf (version 2.13). GNU patch (version 2.5) Apply the autoconf patches from @@ -21,11 +21,8 @@ Apply the autoconf patches from These are ordered by date: - autoconf-2.12-970309.patch.gz - autoconf-2.12-970429.patch.gz - autoconf-2.12-971222-emx.patch.gz - autoconf-2.12-971222.patch.gz - autoconf-2.12-971230.patch.gz + autoconf-2.13-20000819.patch.gz + autoconf-2.13-20000819-emx.patch.gz I built my development environment for ncurses using EMX 0.9c at the end of 1997. Much of the EMX patch for autoconf was done originally by J.J.G.Ripoll, diff --git a/aclocal.m4 b/aclocal.m4 index 490bbed7..6782f0fb 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -26,11 +26,13 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl Author: Thomas E. Dickey 1996,1997,1998 +dnl Author: Thomas E. Dickey 1996,1997,1998,1999,2000 dnl -dnl $Id: aclocal.m4,v 1.214 2000/07/07 15:11:34 tom Exp $ +dnl $Id: aclocal.m4,v 1.238 2000/10/20 22:57:49 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl +dnl See http://dickey.his.com/autoconf/ for additional information. +dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl Construct the list of include-options for the C programs in the Ada95 @@ -41,7 +43,7 @@ ACPPFLAGS="$ACPPFLAGS -I. -I../../include" if test "$srcdir" != "."; then ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include" fi -if test -z "$GCC"; then +if test "$GCC" != yes; then ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then @@ -129,7 +131,7 @@ dnl Treat the configuration-variable specially here, since we're directly dnl substituting its value (i.e., 1/0). AC_DEFUN([CF_BOOL_DECL], [ -AC_MSG_CHECKING([for builtin ifelse(AC_LANG,[C],$CC,$CXX) bool type]) +AC_MSG_CHECKING([for builtin bool type]) AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ AC_TRY_COMPILE([ #include @@ -138,7 +140,7 @@ AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ [ifelse($1,,cf_cv_builtin_bool,[$1])=1], [ifelse($1,,cf_cv_builtin_bool,[$1])=0]) ]) -if test $ifelse($1,,cf_cv_builtin_bool,[$1]) = 1 +if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1 then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi @@ -148,13 +150,13 @@ dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type). dnl Don't bother looking for bool.h, since it's been deprecated. AC_DEFUN([CF_BOOL_SIZE], [ -AC_MSG_CHECKING([for size of ifelse(AC_LANG,[C],$CC,$CXX) bool]) +AC_MSG_CHECKING([for size of bool]) AC_CACHE_VAL(cf_cv_type_of_bool,[ rm -f cf_test.out AC_TRY_RUN([ #include #include -#if HAVE_GXX_BUILTIN_H +#ifdef HAVE_GXX_BUILTIN_H #include #elif HAVE_GPP_BUILTIN_H #include @@ -259,18 +261,20 @@ AC_TRY_LINK([ [cf_cv_cgetent=no]) ]) AC_MSG_RESULT($cf_cv_cgetent) -test $cf_cv_cgetent = yes && AC_DEFINE(HAVE_BSD_CGETENT) +test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT) ])dnl dnl --------------------------------------------------------------------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a -dnl better job than uname). +dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow +dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM +dnl which is useful in cross-compiles. AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess ; then - AC_CANONICAL_HOST + ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" @@ -359,7 +363,7 @@ dnl is a late feature for the standard and is not in some recent compilers dnl (1999/9/11). AC_DEFUN([CF_CPP_PARAM_INIT], [ -if test -n "$CXX" ; then +if test "$CXX" = yes ; then AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[ AC_LANG_CPLUSPLUS AC_TRY_RUN([ @@ -456,7 +460,7 @@ int main() { [cf_cv_good_bcopy=unknown]) ]) ],[cf_cv_good_bcopy=no]) - if test $cf_cv_good_bcopy = yes ; then + if test "$cf_cv_good_bcopy" = yes ; then AC_DEFINE(USE_OK_BCOPY) else AC_DEFINE(USE_MY_MEMMOVE) @@ -490,12 +494,39 @@ int main() { test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL) ])dnl dnl --------------------------------------------------------------------------- +dnl Some old/broken variations define tcgetattr() only as a macro in +dnl termio(s).h +AC_DEFUN([CF_FUNC_TERMIOS],[ +AC_REQUIRE([CF_STRUCT_TERMIOS]) +AC_CACHE_CHECK(for tcgetattr, cf_cv_have_tcgetattr,[ +AC_TRY_LINK([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERMIOS_H +#include +#define TTY struct termios +#else +#ifdef HAVE_TERMIO_H +#include +#define TTY struct termio +#endif +#endif +],[ +TTY foo; +tcgetattr(1, &foo);], +[cf_cv_have_tcgetattr=yes], +[cf_cv_have_tcgetattr=no])]) +test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR) +])dnl +dnl --------------------------------------------------------------------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ -if test -n "$GCC" +if test "$GCC" = yes then cat > conftest.i < conftest.i < conftest.$ac_ext <> Makefile <>headers.sh </<\$END\/\$NAME>/" >> \$TMPSED done - rm -f \$TMPSRC - sed -f \$TMPSED \$SRC > \$TMPSRC - eval \$PRG \$TMPSRC \$DST/\$SRC - rm -f \$TMPSRC \$TMPSED ;; *) - eval \$PRG \$SRC \$DST + echo "" >> \$TMPSED ;; esac CF_EOF +else + cat >>headers.sh <//" >> \$TMPSED + NAME=ncurses.h + fi + echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED + done + ;; +*) + echo "s///" >> \$TMPSED + ;; +esac +CF_EOF +fi +cat >>headers.sh < \$TMPSRC +NAME=\`basename \$SRC\` +CF_EOF +if test $WITH_CURSES_H != yes; then + cat >>headers.sh <>headers.sh <>$cf_dir/Makefile <>$cf_dir/Makefile for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"` do - echo " @ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(INSTALL_PREFIX)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile - test $i = curses.h && echo " @ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile + echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile + test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile done cat >>$cf_dir/Makefile <>$cf_dir/Makefile - test $i = curses.h && echo " -@ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile + echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile + test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile done fi done @@ -1030,6 +1108,7 @@ AC_DEFUN([CF_LIB_SUFFIX], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) case $1 in + libtool) $2='.la' ;; normal) $2='.a' ;; debug) $2='_g.a' ;; profile) $2='_p.a' ;; @@ -1049,6 +1128,7 @@ dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_TYPE], [ case $1 in + libtool) $2='' ;; normal) $2='' ;; debug) $2='_g' ;; profile) $2='_p' ;; @@ -1114,7 +1194,7 @@ EOF LIBS="$cf_saveLIBS" ]) AC_MSG_RESULT($cf_cv_link_dataonly) -test $cf_cv_link_dataonly = no && AC_DEFINE(BROKEN_LINKER) +test "$cf_cv_link_dataonly" = no && AC_DEFINE(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- dnl Most Unix systems have both link and symlink, a few don't have symlink. @@ -1161,14 +1241,14 @@ int main() } ],[ cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" - eval 'ac_cv_func_'$cf_func'=yes' - CF_UPPER(cf_FUNC,$cf_func) - AC_DEFINE_UNQUOTED(HAVE_$cf_FUNC)],[ + eval 'ac_cv_func_'$cf_func'=yes'],[ eval 'ac_cv_func_'$cf_func'=no'],[ eval 'ac_cv_func_'$cf_func'=error']) done test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no ]) + test "$ac_cv_func_link" = yes && AC_DEFINE(HAVE_LINK) + test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK) fi ])dnl dnl --------------------------------------------------------------------------- @@ -1208,6 +1288,33 @@ AC_MSG_RESULT($cf_cv_makeflags) AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- +dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have +dnl a monocase filesystem. +AC_DEFUN([CF_MAKE_TAGS],[ +AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) +AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no) + +if test "$cf_cv_mixedcase" = yes ; then + AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +else + MAKE_UPPER_TAGS="#" +fi +AC_SUBST(MAKE_UPPER_TAGS) + +if test "$MAKE_LOWER_TAGS" = yes ; then + MAKE_LOWER_TAGS= +else + MAKE_LOWER_TAGS="#" +fi +AC_SUBST(MAKE_LOWER_TAGS) +])dnl +dnl --------------------------------------------------------------------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases. AC_DEFUN([CF_MANPAGE_FORMAT], @@ -1317,6 +1424,20 @@ AC_ARG_WITH(manpage-symlinks, AC_MSG_RESULT($cf_manpage_symlinks) ])dnl dnl --------------------------------------------------------------------------- +dnl This option causes manpages to be run through tbl(1) to generate tables +dnl correctly. +AC_DEFUN([CF_MANPAGE_TBL], +[ +AC_MSG_CHECKING(for manpage tbl) + +AC_ARG_WITH(manpage-tbl, + [ --with-manpage-tbl specify manpage processing with tbl], + [cf_manpage_tbl=$withval], + [cf_manpage_tbl=no]) + +AC_MSG_RESULT($cf_manpage_tbl) +])dnl +dnl --------------------------------------------------------------------------- dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that dnl will install man-pages. @@ -1326,6 +1447,7 @@ CF_HELP_MESSAGE(Options to Specify How Manpages are Installed:) CF_MANPAGE_FORMAT CF_MANPAGE_RENAMES CF_MANPAGE_SYMLINKS +CF_MANPAGE_TBL if test "$prefix" = "NONE" ; then cf_prefix="$ac_default_prefix" @@ -1351,9 +1473,11 @@ changequote({{,}})dnl # this script is generated by the configure-script prefix="$cf_prefix" datadir="$datadir" +TERMINFO="$TERMINFO" MKDIRS="`cd $srcdir && pwd`/mkinstalldirs" INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" +transform="$program_transform_name" TMP=\${TMPDIR-/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 @@ -1379,16 +1503,52 @@ case \$i in #(vi fi aliases= source=\`basename \$i\` + inalias=\$source + test ! -f \$inalias && inalias="\$srcdir/\$inalias" + if test ! -f \$inalias ; then + echo .. skipped \$source + continue + fi CF_EOF if test "$cf_manpage_symlinks" = yes ; then cat >>man/edit_man.sh <>man/edit_man.sh <\$TMP + # perform program transformations for section 1 man pages + if test \$section = 1 ; then + target=$cf_subdir\${section}/\`echo \$source|sed "\${transform}"\` + else + target=$cf_subdir\${section}/\$source + fi + + # replace variables in man page +CF_EOF + ifelse($1,,,{{ + for cf_name in $1 + do +cat >>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP CF_EOF else cat >>man/edit_man.sh <>man/edit_man.sh <\$TMP CF_EOF fi +if test $cf_manpage_tbl = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $with_curses_h != yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi if test $cf_format = yes ; then cat >>man/edit_man.sh <\$TMP.out @@ -1438,15 +1610,19 @@ CF_EOF ;; esac cat >>man/edit_man.sh <>man/edit_man.sh <conftest + if test -f CONFTEST ; then + cf_cv_mixedcase=no + else + cf_cv_mixedcase=yes + fi + rm -f conftest CONFTEST +]) +test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) +])dnl +dnl --------------------------------------------------------------------------- dnl Compute the object-directory name from the given model name AC_DEFUN([CF_OBJ_SUBDIR], [ case $1 in + libtool) $2='obj_lo' ;; normal) $2='objects' ;; debug) $2='obj_g' ;; profile) $2='obj_p' ;; @@ -1665,7 +1867,7 @@ AC_DEFUN([CF_SHARED_OPTS], # Some less-capable ports of gcc support only -fpic CC_SHARED_OPTS= - if test -n "$GCC" + if test "$GCC" = yes then AC_MSG_CHECKING(which $CC option to use) cf_save_CFLAGS="$CFLAGS" @@ -1682,23 +1884,9 @@ AC_DEFUN([CF_SHARED_OPTS], beos*) MK_SHARED_LIB='$(CC) -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; - hpux10.*) - # (tested with gcc 2.7.2 -- I don't have c89) - if test -n "$GCC"; then - LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)' - else - CC_SHARED_OPTS='+Z' - LD_SHARED_OPTS='-Wl,+b,$(libdir)' - fi - MK_SHARED_LIB='$(LD) +b $(libdir) -b +h `basename $[@]` -o $[@]' - # HP-UX shared libraries must be executable, and should be - # readonly to exploit a quirk in the memory manager. - INSTALL_LIB="-m 555" - cf_cv_do_symlinks=reverse - ;; hpux*) # (tested with gcc 2.7.2 -- I don't have c89) - if test -n "$GCC"; then + if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)' else CC_SHARED_OPTS='+Z' @@ -1710,21 +1898,27 @@ AC_DEFUN([CF_SHARED_OPTS], INSTALL_LIB="-m 555" ;; irix*) + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" + fi # tested with IRIX 5.2 and 'cc'. - if test -z "$GCC"; then + if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $[@]` -o $[@]' cf_cv_rm_so_locs=yes ;; linux*|gnu*) - # tested with Linux 2.0.29 and gcc 2.7.2 (ELF) - test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test $DFT_LWR_MODEL = "shared" ; then - LOCAL_LDFLAGS='-Wl,-rpath,../lib' - LOCAL_LDFLAGS2='-Wl,-rpath,../../lib' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $[@]' ;; openbsd2*) @@ -1734,17 +1928,17 @@ AC_DEFUN([CF_SHARED_OPTS], openbsd*|freebsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='$(LD) -Bshareable -o $[@]' - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; netbsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test $DFT_LWR_MODEL = "shared" && test $cf_cv_ld_rpath = yes ; then - LOCAL_LDFLAGS='-Wl,-rpath,../lib' - LOCAL_LDFLAGS2='-Wl,-rpath,../../lib' + test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' - if test $cf_cv_shlib_version = auto; then + if test "$cf_cv_shlib_version" = auto; then if test ! -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=rel fi @@ -1758,56 +1952,63 @@ AC_DEFUN([CF_SHARED_OPTS], # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $[@]`' - test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-rpath" case $host_os in osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' - if test $DFT_LWR_MODEL = "shared" ; then - LOCAL_LDFLAGS='-Wl,-rpath,../lib' - LOCAL_LDFLAGS2='-Wl,-rpath,../../lib' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-rpath" + # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi cf_cv_rm_so_locs=yes ;; sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 # tested with osr5.0.5 - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o [$]@' - if test $cf_cv_ld_rpath = yes ; then + if test "$cf_cv_ld_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel LINK_PROGS='LD_RUN_PATH=$(libdir)' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -assert pure-text -o $[@]' - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' - if test $cf_cv_ld_rpath = yes ; then + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="-R ../lib:\$(libdir) $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -d y -G -o [$]@' @@ -1835,11 +2036,11 @@ AC_DEFUN([CF_SHARED_OPTS], if test -n "$cf_ld_rpath_opt" ; then AC_MSG_CHECKING(if we need a space after rpath option) cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_ld_rpath_opt}/usr/lib" + LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) LIBS="$cf_save_LIBS" AC_MSG_RESULT($cf_rpath_space) - test $cf_rpath_space = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " + test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)" fi @@ -1858,8 +2059,8 @@ dnl Check for definitions & structures needed for window size-changing dnl FIXME: check that this works with "snake" (HP-UX 10.x) AC_DEFUN([CF_SIZECHANGE], [ -AC_MSG_CHECKING([declaration of size-change]) -AC_CACHE_VAL(cf_cv_sizechange,[ +AC_REQUIRE([CF_STRUCT_TERMIOS]) +AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[ cf_cv_sizechange=unknown cf_save_CFLAGS="$CFLAGS" @@ -1869,14 +2070,14 @@ do CFLAGS="$cf_save_CFLAGS" test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts" AC_TRY_COMPILE([#include -#if HAVE_TERMIOS_H +#ifdef HAVE_TERMIOS_H #include #else -#if HAVE_TERMIO_H +#ifdef HAVE_TERMIO_H #include #endif #endif -#if NEED_PTEM_H +#ifdef NEED_PTEM_H /* This is a workaround for SCO: they neglected to define struct winsize in * termios.h -- it's only in termio.h and ptem.h */ @@ -1907,36 +2108,18 @@ do CFLAGS="$cf_save_CFLAGS" if test "$cf_cv_sizechange" = yes ; then echo "size-change succeeded ($cf_opts)" >&AC_FD_CC - test -n "$cf_opts" && AC_DEFINE_UNQUOTED($cf_opts) + test -n "$cf_opts" && cf_cv_sizechange="$cf_opts" break fi done - ]) -AC_MSG_RESULT($cf_cv_sizechange) -test $cf_cv_sizechange != no && AC_DEFINE(HAVE_SIZECHANGE) -])dnl -dnl --------------------------------------------------------------------------- -dnl Check for datatype 'speed_t', which is normally declared via either -dnl sys/types.h or termios.h -AC_DEFUN([CF_SPEED_TYPE], -[ -AC_MSG_CHECKING(for speed_t) -OSPEED_INCLUDES= -AC_TRY_COMPILE([#include ], - [speed_t some_variable = 0], - [OSPEED_TYPE=speed_t], - [OSPEED_TYPE=unsigned]) -AC_TRY_COMPILE([#include ], - [speed_t some_variable = 0], - [OSPEED_TYPE=speed_t - OSPEED_INCLUDES="#include "],[]) -AC_SUBST(OSPEED_TYPE) -AC_SUBST(OSPEED_INCLUDES) -if test "$OSPEED_TYPE" = "unsigned" ; then - AC_MSG_RESULT(no) - AC_DEFINE(speed_t,unsigned) -else - AC_MSG_RESULT(yes) +]) +if test "$cf_cv_sizechange" != no ; then + AC_DEFINE(HAVE_SIZECHANGE) + case $cf_cv_sizechange in #(vi + NEED*) + AC_DEFINE_UNQUOTED($cf_cv_sizechange ) + ;; + esac fi ])dnl dnl --------------------------------------------------------------------------- @@ -1952,7 +2135,11 @@ AC_MSG_CHECKING(for src modules) # dependencies and linker-arguments for test-programs TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS" -TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" +if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" +else + TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" +fi # dependencies and linker-arguments for utility-programs PROG_ARGS="$TEST_ARGS" @@ -1987,7 +2174,11 @@ do AC_DEFINE_UNQUOTED(HAVE_${cf_have_include}_H) AC_DEFINE_UNQUOTED(HAVE_LIB${cf_have_include}) TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS" - TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS" + if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" + else + TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS" + fi fi fi done @@ -2005,7 +2196,7 @@ do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done SRC_SUBDIRS="$SRC_SUBDIRS misc test" -test $cf_with_cxx_binding != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" +test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then @@ -2052,7 +2243,7 @@ strstreambuf foo(buf, sizeof(buf)) [cf_cv_libstdcpp=no]) LIBS="$cf_save" ]) -test $cf_cv_libstdcpp = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" fi ])dnl dnl --------------------------------------------------------------------------- @@ -2065,7 +2256,7 @@ dnl do this if we've found the sigaction function. dnl dnl If needed, define SVR4_ACTION. AC_DEFUN([CF_STRUCT_SIGACTION],[ -if test $ac_cv_func_sigaction = yes; then +if test "$ac_cv_func_sigaction" = yes; then AC_MSG_CHECKING(whether sigaction needs _POSIX_SOURCE) AC_TRY_COMPILE([ #include @@ -2088,13 +2279,21 @@ dnl --------------------------------------------------------------------------- dnl Some machines require _POSIX_SOURCE to completely define struct termios. dnl If so, define SVR4_TERMIO AC_DEFUN([CF_STRUCT_TERMIOS],[ -if test $ac_cv_header_termios_h = yes ; then +AC_CHECK_HEADERS( \ +termio.h \ +termios.h \ +unistd.h \ +) +if test "$ISC" = yes ; then + AC_CHECK_HEADERS( sys/termio.h ) +fi +if test "$ac_cv_header_termios_h" = yes ; then case "$CFLAGS" in *-D_POSIX_SOURCE*) termios_bad=dunno ;; *) termios_bad=maybe ;; esac - if test $termios_bad = maybe ; then + if test "$termios_bad" = maybe ; then AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE) AC_TRY_COMPILE([#include ], [struct termios foo; int x = foo.c_iflag], @@ -2159,17 +2358,17 @@ AC_MSG_CHECKING(if sys/time.h works with sys/select.h) AC_CACHE_VAL(cf_cv_sys_time_select,[ AC_TRY_COMPILE([ #include -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif ],[],[cf_cv_sys_time_select=yes], [cf_cv_sys_time_select=no]) ]) AC_MSG_RESULT($cf_cv_sys_time_select) -test $cf_cv_sys_time_select = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT) +test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT) ])dnl dnl --------------------------------------------------------------------------- dnl Determine the type we should use for chtype (and attr_t, which is treated @@ -2182,7 +2381,7 @@ AC_REQUIRE([CF_UNSIGNED_LITERALS]) AC_MSG_CHECKING([for type of chtype]) AC_CACHE_VAL(cf_cv_typeof_chtype,[ AC_TRY_RUN([ -#if USE_WIDEC_SUPPORT +#ifdef USE_WIDEC_SUPPORT #include /* we want wchar_t */ #define WANT_BITS 39 #else @@ -2194,7 +2393,7 @@ int main() FILE *fp = fopen("cf_test.out", "w"); if (fp != 0) { char *result = "long"; -#if USE_WIDEC_SUPPORT +#ifdef USE_WIDEC_SUPPORT /* * If wchar_t is smaller than a long, it must be an int or a * short. We prefer not to use a short anyway. @@ -2252,7 +2451,7 @@ AC_CACHE_VAL(cf_cv_type_sigaction,[ [cf_cv_type_sigaction=yes], [cf_cv_type_sigaction=no])]) AC_MSG_RESULT($cf_cv_type_sigaction) -test $cf_cv_type_sigaction = yes && AC_DEFINE(HAVE_TYPE_SIGACTION) +test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION) ])dnl dnl --------------------------------------------------------------------------- dnl Test if the compiler supports 'U' and 'L' suffixes. Only old compilers @@ -2273,7 +2472,7 @@ dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ changequote(,)dnl -$1=`echo $2 | tr '[a-z]' '[A-Z]'` +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` changequote([,])dnl ])dnl dnl --------------------------------------------------------------------------- diff --git a/announce.html.in b/announce.html.in index 936b2053..58be91d0 100644 --- a/announce.html.in +++ b/announce.html.in @@ -1,6 +1,6 @@ @@ -38,136 +38,327 @@ the GNU distribution site

Release Notes

-This release is designed to be upward compatible from ncurses 5.0; very few -applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.0 release. +This release is designed to be upward compatible from ncurses 5.0 and 5.1; +very few applications will require recompilation, depending on the platform. +These are the highlights from the change-log since ncurses 5.1 release.

Interface changes:

    -
  • made the extended terminal capabilities - (configure --enable-tcap-names) - a standard feature (though the configure script can disable it, - it is built by default). - -
  • removed the trace() function and related trace support - from the production library. This is the only interface change that - may cause problems with existing applications linked to shared - libraries, since not all platforms use the minor version number. - -
  • explicitly initialized to zero several data items which were - implicitly initialized, e.g., cur_term. If not explicitly - initialized, their storage type is C (common), and causes problems - linking on some platforms. - -
  • modified curses.h.in, undef'ing some symbols to avoid conflict with - C++ STL. +
  • change type of ospeed variable back to + short to match its use in legacy applications. It was + altered after ncurses 4.2 to speed_t to repair a type + mismatch which was introduced after 1.9.4 in 1995. The principal + users of termcap continued to use short, which is + not the same size. +

    + NOTE: A few applications will have to be recompiled + (about 1% of the programs in a typical Linux distribution, + 10% of the programs that use ncurses). These are easy to + identify with nm or strings. + +

  • remove a private function _nc_can_clear_with(), which + was built with the configure --enable-expanded option but not used. + +
  • add several private functions (prefixed with "_nc_") for tracing + chtype values in the debug library, and for better + access and buffer limit checking.
-New features: +New features and improvements:
    -
  • added a new extension, assume_default_colors() to - provide better control over the use of default colors. This is - the principal visible difference between ncurses 5.1 and preceding - versions. The new extension allows an application to specify what - colors pair 0 uses. -

    - NOTE: Pair 0 defaults to white on black unless - you have invoked use_default_colors() or set it via - assume_default_colors(). An application that calls - start_colors() without setting the background color - will consistently have a black background no matter what color your - terminal's background actually is. - -

  • made several fixes to the terminfo-to-termcap conversion, and - have been using the generated termcaps without further hand-tuning. - This builds on the extension use_extended_names() by - adding "obsolete" termcap strings to terminfo.src +
  • rewrote tgoto() to make it better support existing + termcap applications which use hardcoded strings rather than obtain + all of their information from the termcap file. If the string does + not appear to be a terminfo string (i.e., does not refer to a "%p" + parameter, or terminfo-style padding), and termcap support is configured, tgoto() + will interpret it as termcap. Otherwise, as before, it will use + tparm(). + +
  • to ensure that the tgoto() changes work properly, + added checks to tic which report capabilities that do + not reference the expected number of parameters. + +
  • new configure script options:
      -
    • modified tic so that if extended names (i.e., - configure --enable-tcap-names) are active, then tic -x - will also write "obsolete" capabilities that are present in the - terminfo source. - -
    • added screen's AX capability (for ECMA SGR 39 and 49) to applicable - terminfo entries, use presence of this as a check for a small - improvement in setting default colors. - -
    • add -a option to tic and infocmp, which retains commented-out - capabilities during source translation/comparison, e.g., captoinfo - and infotocap. +
    • option --disable-root-environ adds runtime checks + which tell ncurses to disregard $TERMINFO and similar environment + variables if the current user is root, or running setuid/setgid. + +
    • option --disable-assumed-color allows you to use the + pre-5.1 convention of default colors used for color-pair 0 to be + configured (see assume_default_colors()). + +
    • implement configure script options that transform installed + program names, e.g., --program-prefix, including the + manpage names and cross references. + +
    • option --with-database allows you to specify a + different terminfo source-file to install. On OS/2 EMX, the + default is misc/emx.src, otherwise misc/terminfo.src + +
    • option --with-default-terminfo-dir allows you to + specify the default terminfo database directory. + +
    • option --with-libtool allows you to build with + libtool.

      NOTE: libtool + uses a different notation for numbering shared library versions + from the existing ncurses configuration. + +

    • option --with-manpage-tbl causes the manpages to be + preprocessed by tbl(1) prior to installation, + +
    • option --without-curses-h causes the installation + process to install curses.h as ncurses.h and make appropriate + changes to headers and manpages.
    -
  • implemented limited support for UTF-8, useful with XFree86 xterm: +
  • modified configure script options:
      -
    • if the configure --enable-widec option is - given, append 'w' to names of the generated libraries (e.g., - libncursesw.so) to avoid conflict with existing ncurses libraries. -
    • add a simple UTF-8 output driver to the experimental - wide-character support. If any of the environment variables - LC_ALL, LC_CTYPE or LANG contain the string "UTF-8", this driver - will be used to translate the output to UTF-8. -
    • modified view.c to make a rudimentary viewer of UTF-8 text. +
    • change symbol used by the --install-prefix configure + option from INSTALL_PREFIX to DESTDIR + (the latter has become common usage although the name is + misleading). + +
    • modify ld -rpath options (e.g., Linux, and Solaris) + to use an absolute pathname for the build tree's lib directory, + avoiding confusion with directories relative to the current one + with the installed programs. + +
    • modified misc/run_tic.in to use + tic -o, to eliminate dependency on + $TERMINFO variable for installs.
    -
  • modify raw() and noraw() to clear/restore - IEXTEN flag which affects stty lnext on systems such as FreeBSD +
  • terminfo database: +
      +
    • updated xterm terminfo entries to match XFree86 xterm patch #146. -
    • reordered tests during mouse initialization to allow for gpm to run - in xterm, or for xterm to be used under OS/2 EMX. Also dropped test - for $DISPLAY in favor of the terminfo capability - kmous=\E[M or - if $TERM environment variable contains "xterm". +
    • added amiga-vnc, + Matrix Orbital, and + QNX qansi to misc/terminfo.src. -
    • added configure option --with-manpage-symlinks, which - provides for fully indexing manpage entries by making symbolic links - for the aliases. +
    • added os2 entry to misc/emx.src. -
    • changed unctrl() to render C1 characters (128-159) as - ~@, ~A, etc. +
    • add S0 and E0 extensions to screen's terminfo entry + since otherwise the FreeBSD port makes it pass termcap equivalents + to tgoto, which would be misinterpreted by older + versions of ncurses. +
    + +
  • improvements to program usability: +
      +
    • modify programs to use curses_version() string to + report the version of ncurses with which they are compiled rather + than the NCURSES_VERSION string. The function returns the patch + level in addition to the major and minor version numbers. -
    • add experimental configure option --enable-colorfgbg to check for - $COLORTERM variable as set by rxvt/aterm/Eterm. +
    • modify tput program so it can be renamed or invoked via a link as + 'reset' or 'init', producing the same effect as tput reset or tput init. -
    • made the infocmp -F option less verbose. +
    • add error checking to infocmp's -v and -m options to ensure that + the option value is indeed a number. +
    -
  • dropped support for gnat 3.10 (gnat 3.12 is current). +
  • improved performance: +
      +
    • replace a lookup table in lib_vidattr.c used to decode + no_color_video with a logic expression which is faster. +
Major bug fixes:
    -
  • modified infocmp -e, -E options to ensure that generated fallback.c - type for Booleans agrees with term.h +
  • correct manlinks.sed script introduced in ncurses 5.1 + to avoid using ERE "\+", which is not understood by standard versions + of sed. This happens to work with GNU sed, + but is not portable, and was the initial motivation for this release. + +
  • remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. + This differed from the "hpux*" case by using reversed symbolic + links, which made the 5.1 version not match the configuration of + 5.0 shared libraries. + +
  • guard against corrupt terminfo data: +
      +
    • modify tparm() to disallow arithmetic on strings, + analyze the varargs list to read strings as strings and numbers as + numbers. + +
    • modify tparm()'s internal function + spop() to treat a null pointer as an empty string. + +
    • modify parse_format() in lib_tparm.c to ignore + precision if it is longer than 10000. + +
    • rewrote limit checks in lib_mvcur.c using new functions + _nc_safe_strcat(), etc. Made other related changes to + check lengths used for strcat() and + strcpy(). +
    + +
  • corrections to screen optimization: +
      +
    • added special case in lib_vidattr.c to reset underline and + standout for devices that have no sgr0 defined. + +
    • change handling of non_dest_scroll_region in + tty_update.c to clear text after it is shifted in rather than before + shifting out. Also correct row computation. + +
    • modify rs2 capability in xterm-r6 and similar entries + where cursor save/restore bracketed the sequence for resetting video + attributes. The cursor restore would undo that. +
    + +
  • UTF-8 support: +
      +
    • when checking LC_ALL, LC_CTYPE, and LANG environment variables + for UTF-8 locale, ignore those which are set to an empty value, as + per SUSV2. -
    • documented a special case of incompatiblity between ncurses 4.2 and - 5.0, added a section for this in INSTALL. +
    • encode 0xFFFD in UTF-8 with 3 bytes, not 2. -
    • corrected tests for file-descriptors in OS/2 EMX mouse support. A - negative value could be used by FD_SET, causing the select() call to - wait indefinitely. +
    • modify _nc_utf8_outch() to avoid sign-extension when + checking for out-of-range value. +
    -
  • made 'tput flash' work properly for xterm by flushing output in - delay_output() when using napms(), and modifying xterm's terminfo to - specify no padding character. Otherwise, xterm's reported baud rate - could mislead ncurses into producing too few padding characters. +
  • other library fixes: +
      +
    • added checks for an empty $HOME environment + variable, to avoid retrieving terminfo descriptions from + ./.terminfo . -
    • modified lib_addch.c to allow repeated update to the lower-right - corner, rather than displaying only the first character written until - the cursor is moved. Recent versions of SVr4 curses can update the - lower-right corner, and behave this way. +
    • change functions _nc_parse_entry() and + postprocess_termcap() to avoid using + strtok(), because it is non-reentrant. -
    • modified echo() behavior of getch() to match Solaris curses for - carriage return and backspace (reported by Neil Zanella). +
    • initialize fds[] array to 0's in + _nc_timed_wait(); apparently poll() only + sets the revents members of that array when there is + activity corresponding to the related file. -
    • corrected offsets used for subwindows in wresize() +
    • add a check for null pointer in Make_Enum_Type(). -
    • modified configure script so AC_MSG_ERROR is temporarily defined to - a warning in AC_PROG_CXX to make it recover from a missing C++ - compiler without requiring user to add --without-cxx option +
    • fix a heap problem with the c++ binding. -
    • corrected logic in lib_twait.c as used by lib_mouse.c for GPM mouse - support when poll() is used rather than select(). +
    • correct missing includes for <string.h> in several places, + including the C++ binding. This is not noted by gcc unless we use + the -fno-builtin option. +
    + +
  • several fixes for tic: +
      +
    • add a check for empty buffers returned by fgets() in + comp_scan.c next_char() function, in case + tic is run on a non-text file (fixes a core dump). + +
    • modify tic to verify that its inputs are really files, + in case someone tries to read a directory (or + /dev/zero). + +
    • correct an uninitialized parameter to open_tempfile() + in tic.c which made "tic -I" give an ambiguous error message about + tmpnam. + +
    • correct logic in adjust_cancels(), which did not check + both alternatives when reclassifying an extended name between + boolean, number and string, causing an infinite loop in + tic. +
    + +
  • using new checks in tic for parameter counts in + capability strings, found/fixed several errors both in the + terminfo database and in the include/Caps file. +
      +
    • modified several terminfo capability strings, including the + definitions for setaf, setab, in include/Caps to indicate that the + entries are parameterized. This information is used to tell which + strings are translated when converting to termcap. This fixes a + problem where the generated termcap would contain a spurious "%p1" + for the terminfo "%p1%d". + +
    • correct parameter counts in include/Caps for dclk as well as some + printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. +
    + +
  • various fixes for install scripts used to support configure + --srcdir and --with-install-prefix. + +
  • correct several mismatches between manpage filename and ".TH" + directives, renaming dft_fgbg.3x to default_colors.3x and + menu_attribs.3x to menu_attributes.3x. +
+ +Portability: +
    +
  • configure script: +
      +
    • newer config.guess, config.sub, including changes to support OS/2 + EMX. The configure script for OS/2 EMX still relies on a patch + since there is no (working) support for that platform in the main + autoconf distribution. + +
    • make configure script checks on variables $GCC and + $GXX consistently compare against 'yes' rather than + test if they are nonnull, since either may be set to the + corresponding name of the C or C++ compiler. + +
    • change configure script to use AC_CANONICAL_SYSTEM rather than + AC_CANONICAL_HOST, which means that configure --target + will set a default program-prefix. + +
    • modify the check for big-core to force a couple of memory + accesses, which may work as needed for older/less-capable machines + (if not, there's still the explicit configure option). + +
    • modify configure test for tcgetattr() to allow for + old implementations, e.g., on BeOS, which only defined it as a + macro. + +
    • add configure check for filesystems (such as OS/2 EMX) which do + not distinguish between upper/lowercase filenames, use this to fix + tags rules in makefiles. + +
    • add MKncurses_def.sh to generate fallback definitions for + ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in + code to consistently use "#if" rather than "#ifdef". + +
    • change most remaining unquoted parameters of test in + configure script to use quotes, for instance fixing a problem in the + --disable-database option. + +
    • modify scripts so that "make install.data" works on OS/2 EMX. + +
    • modify scripts and makefiles so the Ada95 directory builds on + OS/2 EMX. +
    + +
  • library: +
      +
    • replaced case-statement in _nc_tracebits() for CSIZE + with a table to simplify working around implementations that define + random combinations of the related macros to zero. + +
    • improved OS/2 mouse support by retrying as a 2-button mouse if code + fails to set up a 3-button mouse. + +
    • added private entrypoint _nc_basename(), used to + consolidate related code in progs, as well as accommodating OS/2 EMX + pathnames. + +
    • alter definition of NCURSES_CONST to make it non-empty. + +
    • redefine 'TEXT' in menu.h for AMIGA, since it is reported to have + an (unspecified) symbol conflict. +
    + +
  • programs: +
      +
    • modified progs/tset.c and tack/sysdep.c to build with sgttyb + interface if neither termio or termios is available. Tested this + with FreeBSD 2.1.5 (which does have termios - but the sgttyb does + work). +
    -
  • made several fixes for buffer overflows, unchecked recursion, - improvements in performance, etc. See the NEWS file for details.

Features of Ncurses

diff --git a/c++/Makefile.in b/c++/Makefile.in index e8079893..63049945 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.52 2000/05/28 01:44:34 tom Exp $ +# $Id: Makefile.in,v 1.56 2000/10/15 00:43:38 tom Exp $ ############################################################################## # Copyright (c) 1998,1999 Free Software Foundation, Inc. # # # @@ -41,13 +41,15 @@ CF_MFLAGS = @cf_cv_makeflags@ x = @PROG_EXT@ MODEL = ../@DFT_OBJ_SUBDIR@ -INSTALL_PREFIX = @INSTALL_PREFIX@ +DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ includedir = @includedir@ +LIBTOOL = @LIBTOOL@ + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -64,6 +66,7 @@ CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) +CFLAGS_LIBTOOL = $(CCFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg @@ -71,25 +74,37 @@ CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) +NCURSES_MAJOR = @NCURSES_MAJOR@ +NCURSES_MINOR = @NCURSES_MINOR@ REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ -LINK = @LINK_PROGS@ $(CXX) @CXXLDFLAGS@ +LINK = @LINK_PROGS@ $(LIBTOOL) $(CXX) @CXXLDFLAGS@ + +LIBROOT = ncurses++ + +LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la +LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a +LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ -LIBROOT = ncurses++@LIB_SUFFIX@ -LIBNAME = @LIB_PREFIX@$(LIBROOT).a +LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) -l$(LIBROOT) -LDFLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) \ - -l$(LIBROOT) \ - @TEST_ARGS@ @LDFLAGS@ \ +LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) ../lib/$(LIBNAME) +LINK_NORMAL = $(LINK_FLAGS) +LINK_DEBUG = $(LINK_FLAGS) +LINK_PROFILE = $(LINK_FLAGS) +LINK_SHARED = $(LINK_FLAGS) + +LDFLAGS = @TEST_ARGS@ @LDFLAGS@ \ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS) +LDFLAGS_LIBTOOL = $(LDFLAGS) LDFLAGS_NORMAL = $(LDFLAGS) LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@ LDFLAGS_PROFILE = $(LDFLAGS) -pg LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@ -LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) +LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@) AUTO_SRC = \ etip.h @@ -114,10 +129,15 @@ LIB_OBJS = \ $(MODEL)/cursesapp.o \ $(MODEL)/cursesmain.o -../lib/$(LIBNAME) : $(LIB_OBJS) +../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) $(AR) $(AR_OPTS) $@ $? $(RANLIB) $@ +../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) + cd ../lib && $(LIBTOOL) $(CXX) -o $(LIBNAME) $(LIB_OBJS:.o=.lo) \ + -rpath $(INSTALL_PREFIX)$(libdir) \ + -version-info $(NCURSES_MAJOR):$(NCURSES_MINOR) + OBJS_DEMO = $(MODEL)/demo.o $(MODEL)/demo.o : $(srcdir)/demo.cc \ @@ -132,22 +152,23 @@ etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh cp $(srcdir)/etip.h.in $@ sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ -$(INSTALL_PREFIX)$(libdir) : +$(DESTDIR)$(libdir) : $(srcdir)/../mkinstalldirs $@ install \ -install.libs:: ../lib/$(LIBNAME) $(INSTALL_PREFIX)$(libdir) - $(INSTALL) ../lib/$(LIBNAME) $(INSTALL_PREFIX)$(libdir)/$(LIBNAME) +install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir) + $(LIBTOOL) $(INSTALL) ../lib/$(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME) uninstall \ uninstall.libs:: - -rm -f $(INSTALL_PREFIX)$(libdir)/$(LIBNAME) + -$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) mostlyclean :: -rm -f core tags TAGS *~ *.ln *.atac trace clean :: mostlyclean - -rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(OBJS_DEMO) + -$(LIBTOOL) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:.o=.lo) $(OBJS_DEMO) + -rm -rf .libs distclean :: clean -rm -f Makefile diff --git a/c++/cursesf.cc b/c++/cursesf.cc index a993322b..a3b066cb 100644 --- a/c++/cursesf.cc +++ b/c++/cursesf.cc @@ -35,7 +35,7 @@ #include "cursesapp.h" #include "internal.h" -MODULE_ID("$Id: cursesf.cc,v 1.10 1999/10/30 23:49:28 tom Exp $") +MODULE_ID("$Id: cursesf.cc,v 1.11 2000/06/09 16:15:40 juergen Exp $") NCursesFormField::~NCursesFormField () { if (field) @@ -48,7 +48,8 @@ NCursesFormField::~NCursesFormField () { FIELD** NCursesForm::mapFields(NCursesFormField* nfields[]) { int fieldCount = 0,lcv; - + FIELD** old_fields; + assert(nfields != 0); for (lcv=0; nfields[lcv]->field; ++lcv) @@ -63,8 +64,10 @@ NCursesForm::mapFields(NCursesFormField* nfields[]) { my_fields = nfields; - if (form) - delete[] ::form_fields(form); + if (form && (old_fields = ::form_fields(form))) { + ::set_form_fields(form,(FIELD**)0); + delete[] old_fields; + } return fields; } diff --git a/c++/cursesf.h b/c++/cursesf.h index 89f0cbe9..40f41461 100644 --- a/c++/cursesf.h +++ b/c++/cursesf.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 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,12 +31,13 @@ * Author: Juergen Pfeifer 1997 * ****************************************************************************/ -// $Id: cursesf.h,v 1.11 1999/10/30 23:59:37 tom Exp $ +// $Id: cursesf.h,v 1.12 2000/07/15 21:08:25 tom Exp $ #ifndef _CURSESF_H #define _CURSESF_H #include +#include extern "C" { # include @@ -91,10 +92,10 @@ protected: if (err != E_OK) THROW(new NCursesFormException (err)); } - + public: // Create a 'Null' field. Can be used to delimit a field list - NCursesFormField() + NCursesFormField() : field((FIELD*)0), ftype((NCursesFieldType*)0) { } @@ -104,14 +105,14 @@ public: int first_row = 0, int first_col = 0, int offscreen_rows = 0, - int additional_buffers = 0) + int additional_buffers = 0) : ftype((NCursesFieldType*)0) { field = ::new_field(rows,cols,first_row,first_col, offscreen_rows, additional_buffers); if (!field) OnError(errno); } - + virtual ~NCursesFormField (); // Duplicate the field at a new position @@ -321,12 +322,12 @@ private: static void frm_term(FORM *); static void fld_init(FORM *); static void fld_term(FORM *); - + // Calculate FIELD* array for the menu FIELD** mapFields(NCursesFormField* nfields[]); -protected: - // internal routines +protected: + // internal routines inline void set_user(void *user) { UserHook* uptr = (UserHook*)::form_userptr (form); assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); @@ -337,8 +338,8 @@ protected: UserHook* uptr = (UserHook*)::form_userptr (form); assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); return uptr->m_user; - } - + } + void InitForm (NCursesFormField* Fields[], bool with_frame, bool autoDeleteFields); @@ -353,14 +354,14 @@ protected: // 'Internal' constructor, builds an object without association to a // field array. - NCursesForm( int lines, - int cols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(lines,cols,begin_y,begin_x), + NCursesForm( int lines, + int cols, + int begin_y = 0, + int begin_x = 0) + : NCursesPanel(lines,cols,begin_y,begin_x), form ((FORM*)0) { } - + public: // Create form for the default panel. NCursesForm (NCursesFormField* Fields[], @@ -372,9 +373,9 @@ public: // Create a form in a panel with the given position and size. NCursesForm (NCursesFormField* Fields[], - int lines, - int cols, - int begin_y, + int lines, + int cols, + int begin_y, int begin_x, bool with_frame=FALSE, // reserve space for a frame? bool autoDelete_Fields=FALSE) // do automatic cleanup? @@ -397,17 +398,17 @@ public: // Set these fields for the form inline void setFields(NCursesFormField* Fields[]) { - OnError(::set_form_fields(form,mapFields(Fields))); + OnError(::set_form_fields(form,mapFields(Fields))); } // Remove the form from the screen - inline void unpost (void) { - OnError (::unpost_form (form)); + inline void unpost (void) { + OnError (::unpost_form (form)); } - + // Post the form to the screen if flag is true, unpost it otherwise inline void post(bool flag = TRUE) { - OnError (flag ? ::post_form(form) : ::unpost_form (form)); + OnError (flag ? ::post_form(form) : ::unpost_form (form)); } // Decorations @@ -424,7 +425,7 @@ public: else OnError(E_SYSTEM_ERROR); } - + inline void label(const char *topLabel, const char *bottomLabel) { if (b_framed) NCursesPanel::label(topLabel,bottomLabel); @@ -578,18 +579,18 @@ template class NCursesUserForm : public NCursesForm protected: // 'Internal' constructor, builds an object without association to a // field array. - NCursesUserForm( int lines, - int cols, - int begin_y = 0, + NCursesUserForm( int lines, + int cols, + int begin_y = 0, int begin_x = 0, - const T* p_UserData = (T*)0) + const T* p_UserData = (T*)0) : NCursesForm(lines,cols,begin_y,begin_x) { if (form) set_user ((void *)p_UserData); } public: - NCursesUserForm (NCursesFormField Fields[], + NCursesUserForm (NCursesFormField Fields[], bool with_frame=FALSE, bool autoDelete_Fields=FALSE) : NCursesForm (Fields, with_frame, autoDelete_Fields) { @@ -603,11 +604,11 @@ public: if (form) set_user ((void *)p_UserData); }; - + NCursesUserForm (NCursesFormField Fields[], - int lines, - int cols, - int begin_y = 0, + int lines, + int cols, + int begin_y = 0, int begin_x = 0, const T* p_UserData = (T*)0, bool with_frame=FALSE, @@ -616,11 +617,11 @@ public: with_frame, autoDelete_Fields) { if (form) set_user ((void *)p_UserData); - }; - + }; + virtual ~NCursesUserForm() { }; - + inline T* UserData (void) const { return (T*)get_user (); }; @@ -645,7 +646,7 @@ private: } public: - Alpha_Field(int width) + Alpha_Field(int width) : NCursesFieldType(TYPE_ALPHA), min_field_width(width) { } @@ -660,7 +661,7 @@ private: } public: - Alphanumeric_Field(int width) + Alphanumeric_Field(int width) : NCursesFieldType(TYPE_ALNUM), min_field_width(width) { } @@ -678,7 +679,7 @@ private: public: Integer_Field(int prec, long low=0L, long high=0L) - : NCursesFieldType(TYPE_INTEGER), + : NCursesFieldType(TYPE_INTEGER), precision(prec), lower_limit(low), upper_limit(high) { } }; @@ -695,7 +696,7 @@ private: public: Numeric_Field(int prec, double low=0.0, double high=0.0) - : NCursesFieldType(TYPE_NUMERIC), + : NCursesFieldType(TYPE_NUMERIC), precision(prec), lower_limit(low), upper_limit(high) { } }; @@ -757,11 +758,11 @@ public: // ------------------------------------------------------------------------- // class UserDefinedFieldType : public NCursesFieldType { - friend class UDF_Init; // Internal helper to set up statics + friend class UDF_Init; // Internal helper to set up statics private: // For all C++ defined fieldtypes we need only one generic lowlevel // FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype; + static FIELDTYPE* generic_fieldtype; protected: // This are the functions required by the low level libforms functions @@ -793,9 +794,9 @@ public: // ------------------------------------------------------------------------- // class UserDefinedFieldType_With_Choice : public UserDefinedFieldType { - friend class UDF_Init; // Internal helper to set up statics + friend class UDF_Init; // Internal helper to set up statics private: - // For all C++ defined fieldtypes with choice functions we need only one + // For all C++ defined fieldtypes with choice functions we need only one // generic lowlevel FIELDTYPE* element. static FIELDTYPE* generic_fieldtype_with_choice; diff --git a/c++/cursesp.cc b/c++/cursesp.cc index 3bcf3d26..50095d3d 100644 --- a/c++/cursesp.cc +++ b/c++/cursesp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 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 * @@ -33,8 +33,9 @@ #include "cursesp.h" #include "internal.h" +#include -MODULE_ID("$Id: cursesp.cc,v 1.15 1999/10/30 23:59:37 tom Exp $") +MODULE_ID("$Id: cursesp.cc,v 1.16 2000/07/15 21:08:13 tom Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -42,13 +43,13 @@ void NCursesPanel::init() { p = ::new_panel(w); if (!p) OnError(ERR); - + UserHook* hook = new UserHook; hook->m_user = NULL; hook->m_back = this; hook->m_owner = p; ::set_panel_userptr(p, (void *)hook); -} +} NCursesPanel::~NCursesPanel() { UserHook* hook = (UserHook*)::panel_userptr(p); @@ -61,7 +62,7 @@ NCursesPanel::~NCursesPanel() { void NCursesPanel::redraw() { PANEL *pan; - + pan = ::panel_above(NULL); while (pan) { ::touchwin(panel_window(pan)); @@ -95,20 +96,20 @@ NCursesPanel::frame(const char *title,const char *btitle) { int err = OK; if (!title && !btitle) { err = box(); - } + } else { err = box(); if (err==OK) - label(title,btitle); + label(title,btitle); } OnError(err); } void NCursesPanel::label(const char *tLabel, const char *bLabel) { - if (tLabel) + if (tLabel) centertext(0,tLabel); - if (bLabel) + if (bLabel) centertext(maxy(),bLabel); } diff --git a/c++/cursesw.cc b/c++/cursesw.cc index baae046e..b61a7056 100644 --- a/c++/cursesw.cc +++ b/c++/cursesw.cc @@ -25,7 +25,7 @@ #include "cursesw.h" #include "internal.h" -MODULE_ID("$Id: cursesw.cc,v 1.16 1999/11/13 23:42:17 tom Exp $") +MODULE_ID("$Id: cursesw.cc,v 1.17 2000/09/02 18:55:31 tom Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -424,7 +424,7 @@ NCursesWindow::setcolor(short pair) return OK; } -#ifdef HAVE_HAS_KEY +#if HAVE_HAS_KEY extern "C" int _nc_has_mouse(void); bool NCursesWindow::has_mouse() const { diff --git a/c++/cursslk.cc b/c++/cursslk.cc index 82ff83e1..236d3a55 100644 --- a/c++/cursslk.cc +++ b/c++/cursslk.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * 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 * @@ -34,8 +34,9 @@ #include "cursslk.h" #include "cursesapp.h" #include "internal.h" +#include -MODULE_ID("$Id: cursslk.cc,v 1.5 1999/05/16 17:31:01 juergen Exp $") +MODULE_ID("$Id: cursslk.cc,v 1.6 2000/07/15 21:07:50 tom Exp $") void Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) { delete[] label; @@ -54,7 +55,7 @@ void Soft_Label_Key_Set::init() { for(int i=0; i < num_labels; i++) { slk_array[i].num = i+1; } - b_attrInit = FALSE; + b_attrInit = FALSE; } Soft_Label_Key_Set::Soft_Label_Key_Set() { diff --git a/c++/internal.h b/c++/internal.h index cdf256cb..67bc3ff2 100644 --- a/c++/internal.h +++ b/c++/internal.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * 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,12 +31,12 @@ * Author: Juergen Pfeifer 1997 * ****************************************************************************/ -// $Id: internal.h,v 1.5 1999/05/16 17:29:25 juergen Exp $ +// $Id: internal.h,v 1.6 2000/09/02 18:22:23 tom Exp $ #ifndef _CPLUS_INTERNAL_H #define _CPLUS_INTERNAL_H 1 -#ifdef USE_RCS_IDS +#if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else #define MODULE_ID(id) /*nothing*/ diff --git a/config.guess b/config.guess index 49949643..b100dbe1 100755 --- a/config.guess +++ b/config.guess @@ -109,6 +109,9 @@ trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + i?86:OS/2:*:*) + echo "i386-unknown-os2" + exit 0;; *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -431,7 +434,7 @@ EOF *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i?86:AIX:*:*) diff --git a/config.sub b/config.sub index 8fa14be2..f8ec622e 100755 --- a/config.sub +++ b/config.sub @@ -3,7 +3,7 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -version='2000-06-13' +version='2000-07-06' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,9 @@ esac ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in + -os2) + basic_machine=`echo $1 | sed -e 's/86-.*/86/'` + ;; -sun*os*) # Prevent following clause from handling this invalid input. ;; @@ -218,8 +221,13 @@ case $basic_machine in | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | fr30 | avr) + | thumb | d10v | d30v | fr30 | avr) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown + os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) ;; @@ -257,7 +265,7 @@ case $basic_machine in | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-*) + | bs2000-* | tic54x-* | c54x-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -793,6 +801,10 @@ case $basic_machine in basic_machine=t3e-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -994,6 +1006,7 @@ case $os in os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -os2 \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; diff --git a/configure b/configure index 51180b9b..c18a988f 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh -# From configure.in Revision: 1.195 +# From configure.in Revision: 1.220 # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13.19990117 +# Generated automatically using autoconf version 2.13.20000819 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -193,18 +193,15 @@ cat <&2; exit 1; } ;; +esac + + # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:646: checking host system type" >&5 +echo "configure:675: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -662,6 +691,47 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:696: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:714: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" @@ -733,7 +803,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location echo $ac_n "checking for prefix""... $ac_c" 1>&6 -echo "configure:737: checking for prefix" >&5 +echo "configure:807: checking for prefix" >&5 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in # non-vendor systems don't have a conflict @@ -748,7 +818,7 @@ echo "$ac_t""$prefix" 1>&6 if test "x$prefix" = "xNONE" ; then echo $ac_n "checking for default include-directory""... $ac_c" 1>&6 -echo "configure:752: checking for default include-directory" >&5 +echo "configure:822: checking for default include-directory" >&5 test -n "$verbose" && echo 1>&6 for cf_symbol in \ $includedir \ @@ -778,7 +848,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:782: checking for $ac_word" >&5 +echo "configure:852: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -808,7 +878,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:812: checking for $ac_word" >&5 +echo "configure:882: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -859,7 +929,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:863: checking for $ac_word" >&5 +echo "configure:933: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -891,7 +961,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:965: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -902,12 +972,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 906 "configure" +#line 976 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -933,12 +1003,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1007: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:942: checking whether we are using GNU C" >&5 +echo "configure:1012: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -947,7 +1017,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -966,7 +1036,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:970: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1040: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -997,18 +1067,18 @@ else fi fi -if test -n "$GCC" ; then -echo $ac_n "checking version of gcc""... $ac_c" 1>&6 -echo "configure:1003: checking version of gcc" >&5 -eval "$CC --version" +if test "$GCC" = yes ; then + echo $ac_n "checking version of gcc""... $ac_c" 1>&6 +echo "configure:1073: checking version of gcc" >&5 + eval "$CC --version" fi -if test $host != $build; then - for ac_prog in $CC gcc cc +if test "$host" != $build; then + for ac_prog in $CC gcc cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1012: checking for $ac_word" >&5 +echo "configure:1082: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1037,9 +1107,12 @@ fi test -n "$BUILD_CC" && break done +else + BUILD_CC="$CC" fi + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1043: checking how to run the C preprocessor" >&5 +echo "configure:1116: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1054,13 +1127,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1071,13 +1144,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1088,13 +1161,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1120,13 +1193,13 @@ echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1124: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1197: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1144,7 +1217,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1166,7 +1239,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1170: checking for POSIXized ISC" >&5 +echo "configure:1243: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1188,7 +1261,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:1192: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:1265: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1212,7 +1285,7 @@ for cf_arg in "-DCC_HAS_PROTOS" \ do CFLAGS="$cf_save_CFLAGS $cf_arg" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ansi_cc="$cf_arg"; break else @@ -1289,7 +1362,7 @@ freebsd*) #(vi # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1293: checking for $ac_word" >&5 +echo "configure:1366: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LDCONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1326,7 +1399,7 @@ esac echo $ac_n "checking if you want to ensure bool is consistent with C++""... $ac_c" 1>&6 -echo "configure:1330: checking if you want to ensure bool is consistent with C++" >&5 +echo "configure:1403: checking if you want to ensure bool is consistent with C++" >&5 # Check whether --with-cxx or --without-cxx was given. if test "${with_cxx+set}" = set; then @@ -1346,7 +1419,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1350: checking for $ac_word" >&5 +echo "configure:1423: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1378,7 +1451,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1382: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1455: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1389,12 +1462,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1393 "configure" +#line 1466 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1420,12 +1493,12 @@ if test $ac_cv_prog_cxx_works = no; then echo "$ac_t""You don't have any C++ compiler, too bad" 1>&6; cf_with_cxx=no; CXX=""; GXX=""; fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1424: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1497: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1429: checking whether we are using GNU C++" >&5 +echo "configure:1502: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1434,7 +1507,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1453,7 +1526,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1457: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1530: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1485,10 +1558,19 @@ else fi fi -if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi + +if test "$GXX" = yes; then + case "`${CXX-g++} --version`" in + 1*|2.[0-6]*) + GXX=""; CXX=""; ac_cv_prog_gxx=no + cf_cxx_library=no + echo No: templates do not work + ;; + esac +fi echo $ac_n "checking if you want to build C++ binding and demo""... $ac_c" 1>&6 -echo "configure:1492: checking if you want to build C++ binding and demo" >&5 +echo "configure:1574: checking if you want to build C++ binding and demo" >&5 # Check whether --with-cxx-binding or --without-cxx-binding was given. if test "${with_cxx_binding+set}" = set; then @@ -1501,7 +1583,7 @@ fi echo "$ac_t""$cf_with_cxx_binding" 1>&6 echo $ac_n "checking if you want to build with Ada95""... $ac_c" 1>&6 -echo "configure:1505: checking if you want to build with Ada95" >&5 +echo "configure:1587: checking if you want to build with Ada95" >&5 # Check whether --with-ada or --without-ada was given. if test "${with_ada+set}" = set; then @@ -1514,7 +1596,7 @@ fi echo "$ac_t""$cf_with_ada" 1>&6 echo $ac_n "checking if you want to build programs such as tic""... $ac_c" 1>&6 -echo "configure:1518: checking if you want to build programs such as tic" >&5 +echo "configure:1600: checking if you want to build programs such as tic" >&5 # Check whether --with-progs or --without-progs was given. if test "${with_progs+set}" = set; then @@ -1526,18 +1608,50 @@ fi echo "$ac_t""$cf_with_progs" 1>&6 +echo $ac_n "checking if you wish to install curses.h""... $ac_c" 1>&6 +echo "configure:1613: checking if you wish to install curses.h" >&5 + +# Check whether --with-curses-h or --without-curses-h was given. +if test "${with_curses_h+set}" = set; then + withval="$with_curses_h" + with_curses_h=$withval +else + with_curses_h=yes +fi + +echo "$ac_t""$with_curses_h" 1>&6 + modules_to_build="ncurses" if test "X$cf_with_progs" != Xno ; then modules_to_build="$modules_to_build progs tack" fi modules_to_build="$modules_to_build panel menu form" +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1541: checking for $ac_word" >&5 +echo "configure:1655: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1567,7 +1681,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1571: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1685: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1605,7 +1719,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1609: checking for a BSD compatible install" >&5 +echo "configure:1723: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1668,7 +1782,7 @@ case $INSTALL in esac echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:1672: checking for long file names" >&5 +echo "configure:1786: checking for long file names" >&5 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1711,8 +1825,32 @@ EOF fi + +echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6 +echo "configure:1831: checking if filesystem supports mixed-case filenames" >&5 +if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + rm -f conftest CONFTEST + echo test >conftest + if test -f CONFTEST ; then + cf_cv_mixedcase=no + else + cf_cv_mixedcase=yes + fi + rm -f conftest CONFTEST + +fi + +echo "$ac_t""$cf_cv_mixedcase" 1>&6 +test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF +#define MIXEDCASE_FILENAMES 1 +EOF + + echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1716: checking whether ln -s works" >&5 +echo "configure:1854: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1735,7 +1873,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1739: checking for $ac_word" >&5 +echo "configure:1877: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1762,12 +1900,94 @@ else echo "$ac_t""no" 1>&6 fi + + +# Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1909: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MAKE_LOWER_TAGS"; then + ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MAKE_LOWER_TAGS="yes" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" +fi +fi +MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS" +if test -n "$MAKE_LOWER_TAGS"; then + echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test "$cf_cv_mixedcase" = yes ; then + # Extract the first word of "etags", so it can be a program name with args. +set dummy etags; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1941: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MAKE_UPPER_TAGS"; then + ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MAKE_UPPER_TAGS="yes" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" +fi +fi +MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS" +if test -n "$MAKE_UPPER_TAGS"; then + echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +else + MAKE_UPPER_TAGS="#" +fi + + +if test "$MAKE_LOWER_TAGS" = yes ; then + MAKE_LOWER_TAGS= +else + MAKE_LOWER_TAGS="#" +fi + + for ac_prog in tdlint lint alint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1771: checking for $ac_word" >&5 +echo "configure:1991: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1801,7 +2021,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1805: checking for $ac_word" >&5 +echo "configure:2025: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1837,7 +2057,7 @@ if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then else echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6 -echo "configure:1841: checking for loader (symbol LD)" >&5 +echo "configure:2061: checking for loader (symbol LD)" >&5 test -z "$LD" && LD=ld echo "$ac_t""$LD" 1>&6 @@ -1851,7 +2071,7 @@ if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then else echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6 -echo "configure:1855: checking for archiver (symbol AR)" >&5 +echo "configure:2075: checking for archiver (symbol AR)" >&5 test -z "$AR" && AR=ar echo "$ac_t""$AR" 1>&6 @@ -1865,7 +2085,7 @@ if eval "test \"`echo '$''{'cf_cv_subst_AR_OPTS'+set}'`\" = set"; then else echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6 -echo "configure:1869: checking for archiver options (symbol AR_OPTS)" >&5 +echo "configure:2089: checking for archiver options (symbol AR_OPTS)" >&5 test -z "$AR_OPTS" && AR_OPTS=rv echo "$ac_t""$AR_OPTS" 1>&6 @@ -1877,7 +2097,7 @@ AR_OPTS=${cf_cv_subst_AR_OPTS} echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6 -echo "configure:1881: checking for makeflags variable" >&5 +echo "configure:2101: checking for makeflags variable" >&5 if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1913,7 +2133,7 @@ echo "$ac_t""$cf_cv_makeflags" 1>&6 echo $ac_n "checking if you have specified an install-prefix""... $ac_c" 1>&6 -echo "configure:1917: checking if you have specified an install-prefix" >&5 +echo "configure:2137: checking if you have specified an install-prefix" >&5 # Check whether --with-install-prefix or --without-install-prefix was given. if test "${with_install_prefix+set}" = set; then @@ -1921,365 +2141,115 @@ if test "${with_install_prefix+set}" = set; then case "$withval" in #(vi yes|no) #(vi ;; - *) INSTALL_PREFIX="$withval" + *) DESTDIR="$withval" ;; esac fi -echo "$ac_t""$INSTALL_PREFIX" 1>&6 +echo "$ac_t""$DESTDIR" 1>&6 ############################################################################### - echo $ac_n "checking format of man-pages""... $ac_c" 1>&6 -echo "configure:1937: checking format of man-pages" >&5 +### Options to allow the user to specify the set of libraries which are used. +### Use "--without-normal --with-shared" to allow the default model to be +### shared, for example. +cf_list_models="" +echo $ac_n "checking if you want to build libraries with libtool""... $ac_c" 1>&6 +echo "configure:2162: checking if you want to build libraries with libtool" >&5 -# Check whether --with-manpage-format or --without-manpage-format was given. -if test "${with_manpage_format+set}" = set; then - withval="$with_manpage_format" - cf_manpage_form=$withval +# Check whether --with-libtool or --without-libtool was given. +if test "${with_libtool+set}" = set; then + withval="$with_libtool" + with_libtool=$withval else - cf_manpage_form=unknown + with_libtool=no fi +echo "$ac_t""$with_libtool" 1>&6 +if test "$with_libtool" = "yes"; then + cf_list_models="$cf_list_models libtool" + test -z "$LIBTOOL" && LIBTOOL=libtool +else + LIBTOOL="" +fi -case ".$cf_manpage_form" in -.gzip|.compress|.BSDI|.normal|.formatted) # (vi - ;; -.unknown|.) # (vi - if test -z "$MANPATH" ; then - MANPATH="/usr/man:/usr/share/man" - fi - # look for the 'date' man-page (it's most likely to be installed!) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - cf_manpage_form=unknown - for cf_dir in $MANPATH; do - test -z "$cf_dir" && cf_dir=/usr/man - for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date - do - cf_test=`echo $cf_name | sed -e 's/*//'` - if test "x$cf_test" = "x$cf_name" ; then - case "$cf_name" in - *.gz) cf_manpage_form=gzip;; - *.Z) cf_manpage_form=compress;; - *.0) cf_manpage_form=BSDI,formatted;; - *) cf_manpage_form=normal;; - esac - break - fi - done - if test "$cf_manpage_form" != "unknown" ; then - break - fi - done - IFS="$ac_save_ifs" - ;; -.*) # (vi - echo "configure: warning: Unexpected manpage-format" 1>&2 - ;; -esac -echo "$ac_t""$cf_manpage_form" 1>&6 +echo $ac_n "checking if you want to build shared libraries""... $ac_c" 1>&6 +echo "configure:2182: checking if you want to build shared libraries" >&5 +# Check whether --with-shared or --without-shared was given. +if test "${with_shared+set}" = set; then + withval="$with_shared" + with_shared=$withval +else + with_shared=no +fi -echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6 -echo "configure:1989: checking for manpage renaming" >&5 +echo "$ac_t""$with_shared" 1>&6 +test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" +echo $ac_n "checking if you want to build static libraries""... $ac_c" 1>&6 +echo "configure:2196: checking if you want to build static libraries" >&5 -# Check whether --with-manpage-renames or --without-manpage-renames was given. -if test "${with_manpage_renames+set}" = set; then - withval="$with_manpage_renames" - cf_manpage_renames=$withval +# Check whether --with-normal or --without-normal was given. +if test "${with_normal+set}" = set; then + withval="$with_normal" + with_normal=$withval else - cf_manpage_renames=yes + with_normal=yes fi +echo "$ac_t""$with_normal" 1>&6 +test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" -case ".$cf_manpage_renames" in #(vi -.no) #(vi - ;; -.|.yes) - # Debian 'man' program? - if test -f /etc/debian_version ; then - cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames - else - cf_manpage_renames=no - fi - ;; -esac - -if test "$cf_manpage_renames" != no ; then - if test ! -f $cf_manpage_renames ; then - { echo "configure: error: not a filename: $cf_manpage_renames" 1>&2; exit 1; } - fi - - test ! -d man && mkdir man +echo $ac_n "checking if you want to build debug libraries""... $ac_c" 1>&6 +echo "configure:2210: checking if you want to build debug libraries" >&5 - # Construct a sed-script to perform renaming within man-pages - if test -n "$cf_manpage_renames" ; then - test ! -d man && mkdir man - $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed - fi +# Check whether --with-debug or --without-debug was given. +if test "${with_debug+set}" = set; then + withval="$with_debug" + with_debug=$withval +else + with_debug=yes fi -echo "$ac_t""$cf_manpage_renames" 1>&6 - - -echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6 -echo "configure:2032: checking for manpage symlinks" >&5 +echo "$ac_t""$with_debug" 1>&6 +test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" +echo $ac_n "checking if you want to build profiling libraries""... $ac_c" 1>&6 +echo "configure:2224: checking if you want to build profiling libraries" >&5 -# Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. -if test "${with_manpage_symlinks+set}" = set; then - withval="$with_manpage_symlinks" - cf_manpage_symlinks=$withval +# Check whether --with-profile or --without-profile was given. +if test "${with_profile+set}" = set; then + withval="$with_profile" + with_profile=$withval else - cf_manpage_symlinks=yes + with_profile=no fi +echo "$ac_t""$with_profile" 1>&6 +test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" -echo "$ac_t""$cf_manpage_symlinks" 1>&6 +############################################################################### - - if test "$prefix" = "NONE" ; then - cf_prefix="$ac_default_prefix" - else - cf_prefix="$prefix" - fi - - case "$cf_manpage_form" in # (vi - *formatted*) # (vi - cf_subdir='$mandir/cat' - cf_format=yes - ;; - *) - cf_subdir='$mandir/man' - cf_format=no - ;; - esac - -test ! -d man && mkdir man -cat >man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP -CF_EOF -else -cat >>man/edit_man.sh <\$TMP -CF_EOF -fi -if test $cf_format = yes ; then -cat >>man/edit_man.sh <\$TMP.out - mv \$TMP.out \$TMP -CF_EOF -fi -case "$cf_manpage_form" in #(vi -*compress*) #(vi -cat >>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <&6 -echo "configure:2213: checking if you want to build shared libraries" >&5 - -# Check whether --with-shared or --without-shared was given. -if test "${with_shared+set}" = set; then - withval="$with_shared" - with_shared=$withval -else - with_shared=no -fi - -echo "$ac_t""$with_shared" 1>&6 -test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" - -echo $ac_n "checking if you want to build static libraries""... $ac_c" 1>&6 -echo "configure:2227: checking if you want to build static libraries" >&5 - -# Check whether --with-normal or --without-normal was given. -if test "${with_normal+set}" = set; then - withval="$with_normal" - with_normal=$withval -else - with_normal=yes -fi - -echo "$ac_t""$with_normal" 1>&6 -test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" - -echo $ac_n "checking if you want to build debug libraries""... $ac_c" 1>&6 -echo "configure:2241: checking if you want to build debug libraries" >&5 - -# Check whether --with-debug or --without-debug was given. -if test "${with_debug+set}" = set; then - withval="$with_debug" - with_debug=$withval -else - with_debug=yes -fi - -echo "$ac_t""$with_debug" 1>&6 -test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" - -echo $ac_n "checking if you want to build profiling libraries""... $ac_c" 1>&6 -echo "configure:2255: checking if you want to build profiling libraries" >&5 - -# Check whether --with-profile or --without-profile was given. -if test "${with_profile+set}" = set; then - withval="$with_profile" - with_profile=$withval -else - with_profile=no -fi - -echo "$ac_t""$with_profile" 1>&6 -test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" - -############################################################################### - -echo $ac_n "checking for specified models""... $ac_c" 1>&6 -echo "configure:2271: checking for specified models" >&5 -test -z "$cf_list_models" && cf_list_models=normal -echo "$ac_t""$cf_list_models" 1>&6 +echo $ac_n "checking for specified models""... $ac_c" 1>&6 +echo "configure:2240: checking for specified models" >&5 +test -z "$cf_list_models" && cf_list_models=normal +test "$with_libtool" = "yes" && cf_list_models=libtool +echo "$ac_t""$cf_list_models" 1>&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. echo $ac_n "checking for default model""... $ac_c" 1>&6 -echo "configure:2278: checking for default model" >&5 +echo "configure:2248: checking for default model" >&5 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'` echo "$ac_t""$DFT_LWR_MODEL" 1>&6 -DFT_UPR_MODEL=`echo $DFT_LWR_MODEL | tr '[a-z]' '[A-Z]'` +DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` TINFO_NAME=tinfo @@ -2306,7 +2276,7 @@ LIB_SUFFIX= ############################################################################### echo $ac_n "checking if you want to build a separate terminfo library""... $ac_c" 1>&6 -echo "configure:2310: checking if you want to build a separate terminfo library" >&5 +echo "configure:2280: checking if you want to build a separate terminfo library" >&5 # Check whether --with-termlib or --without-termlib was given. if test "${with_termlib+set}" = set; then @@ -2320,7 +2290,7 @@ echo "$ac_t""$with_termlib" 1>&6 ### Checks for special libraries, must be done up-front. echo $ac_n "checking if you want to link with dbmalloc for testing""... $ac_c" 1>&6 -echo "configure:2324: checking if you want to link with dbmalloc for testing" >&5 +echo "configure:2294: checking if you want to link with dbmalloc for testing" >&5 # Check whether --with-dbmalloc or --without-dbmalloc was given. if test "${with_dbmalloc+set}" = set; then @@ -2331,9 +2301,9 @@ else fi echo "$ac_t""$with_dbmalloc" 1>&6 -if test $with_dbmalloc = yes ; then +if test "$with_dbmalloc" = yes ; then echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6 -echo "configure:2337: checking for debug_malloc in -ldbmalloc" >&5 +echo "configure:2307: checking for debug_malloc in -ldbmalloc" >&5 ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2341,7 +2311,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldbmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2382,7 +2352,7 @@ fi fi echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6 -echo "configure:2386: checking if you want to link with dmalloc for testing" >&5 +echo "configure:2356: checking if you want to link with dmalloc for testing" >&5 # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then @@ -2393,9 +2363,9 @@ else fi echo "$ac_t""$with_dmalloc" 1>&6 -if test $with_dmalloc = yes ; then +if test "$with_dmalloc" = yes ; then echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6 -echo "configure:2399: checking for dmalloc_debug in -ldmalloc" >&5 +echo "configure:2369: checking for dmalloc_debug in -ldmalloc" >&5 ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2403,7 +2373,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2445,7 +2415,7 @@ fi SHLIB_LIST="" echo $ac_n "checking if you want to link with the gpm mouse library""... $ac_c" 1>&6 -echo "configure:2449: checking if you want to link with the gpm mouse library" >&5 +echo "configure:2419: checking if you want to link with the gpm mouse library" >&5 # Check whether --with-gpm or --without-gpm was given. if test "${with_gpm+set}" = set; then @@ -2456,9 +2426,9 @@ else fi echo "$ac_t""$with_gpm" 1>&6 -if test $with_gpm = yes ; then +if test "$with_gpm" = yes ; then echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:2462: checking for Gpm_Open in -lgpm" >&5 +echo "configure:2432: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2466,7 +2436,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2503,17 +2473,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2507: checking for $ac_hdr" >&5 +echo "configure:2477: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2561,8 +2531,9 @@ fi echo $ac_n "checking for default loader flags""... $ac_c" 1>&6 -echo "configure:2565: checking for default loader flags" >&5 +echo "configure:2535: checking for default loader flags" >&5 case $DFT_LWR_MODEL in +libtool) LD_MODEL='' ;; normal) LD_MODEL='' ;; debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; @@ -2571,7 +2542,7 @@ esac echo "$ac_t""$LD_MODEL" 1>&6 echo $ac_n "checking if rpath option should be used""... $ac_c" 1>&6 -echo "configure:2575: checking if rpath option should be used" >&5 +echo "configure:2546: checking if rpath option should be used" >&5 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then @@ -2593,7 +2564,7 @@ echo "$ac_t""$cf_cv_ld_rpath" 1>&6 cf_cv_do_symlinks=no echo $ac_n "checking if release/abi version should be used for shared libs""... $ac_c" 1>&6 -echo "configure:2597: checking if release/abi version should be used for shared libs" >&5 +echo "configure:2568: checking if release/abi version should be used for shared libs" >&5 # Check whether --with-shlib-version or --without-shlib-version was given. if test "${with_shlib_version+set}" = set; then @@ -2621,23 +2592,23 @@ fi # Some less-capable ports of gcc support only -fpic CC_SHARED_OPTS= - if test -n "$GCC" + if test "$GCC" = yes then echo $ac_n "checking which $CC option to use""... $ac_c" 1>&6 -echo "configure:2628: checking which $CC option to use" >&5 +echo "configure:2599: checking which $CC option to use" >&5 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat > conftest.$ac_ext < int main() { int x = 1 ; return 0; } EOF -if { (eval echo configure:2641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* break else @@ -2654,23 +2625,9 @@ rm -f conftest* beos*) MK_SHARED_LIB='$(CC) -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; - hpux10.*) - # (tested with gcc 2.7.2 -- I don't have c89) - if test -n "$GCC"; then - LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)' - else - CC_SHARED_OPTS='+Z' - LD_SHARED_OPTS='-Wl,+b,$(libdir)' - fi - MK_SHARED_LIB='$(LD) +b $(libdir) -b +h `basename $@` -o $@' - # HP-UX shared libraries must be executable, and should be - # readonly to exploit a quirk in the memory manager. - INSTALL_LIB="-m 555" - cf_cv_do_symlinks=reverse - ;; hpux*) # (tested with gcc 2.7.2 -- I don't have c89) - if test -n "$GCC"; then + if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)' else CC_SHARED_OPTS='+Z' @@ -2682,21 +2639,27 @@ rm -f conftest* INSTALL_LIB="-m 555" ;; irix*) + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" + fi # tested with IRIX 5.2 and 'cc'. - if test -z "$GCC"; then + if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $@` -o $@' cf_cv_rm_so_locs=yes ;; linux*|gnu*) - # tested with Linux 2.0.29 and gcc 2.7.2 (ELF) - test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test $DFT_LWR_MODEL = "shared" ; then - LOCAL_LDFLAGS='-Wl,-rpath,../lib' - LOCAL_LDFLAGS2='-Wl,-rpath,../../lib' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $@' ;; openbsd2*) @@ -2706,17 +2669,17 @@ rm -f conftest* openbsd*|freebsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='$(LD) -Bshareable -o $@' - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; netbsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test $DFT_LWR_MODEL = "shared" && test $cf_cv_ld_rpath = yes ; then - LOCAL_LDFLAGS='-Wl,-rpath,../lib' - LOCAL_LDFLAGS2='-Wl,-rpath,../../lib' + test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' - if test $cf_cv_shlib_version = auto; then + if test "$cf_cv_shlib_version" = auto; then if test ! -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=rel fi @@ -2730,56 +2693,63 @@ rm -f conftest* # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`' - test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-rpath" case $host_os in osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' - if test $DFT_LWR_MODEL = "shared" ; then - LOCAL_LDFLAGS='-Wl,-rpath,../lib' - LOCAL_LDFLAGS2='-Wl,-rpath,../../lib' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-rpath" + # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi cf_cv_rm_so_locs=yes ;; sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 # tested with osr5.0.5 - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' - if test $cf_cv_ld_rpath = yes ; then + if test "$cf_cv_ld_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel LINK_PROGS='LD_RUN_PATH=$(libdir)' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -assert pure-text -o $@' - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' - if test $cf_cv_ld_rpath = yes ; then + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="-R ../lib:\$(libdir) $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi - test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) - if test $ac_cv_prog_gcc != yes; then + if test "$ac_cv_prog_gcc" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -d y -G -o $@' @@ -2806,18 +2776,18 @@ rm -f conftest* if test -n "$cf_ld_rpath_opt" ; then echo $ac_n "checking if we need a space after rpath option""... $ac_c" 1>&6 -echo "configure:2810: checking if we need a space after rpath option" >&5 +echo "configure:2780: checking if we need a space after rpath option" >&5 cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_ld_rpath_opt}/usr/lib" + LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_rpath_space=no else @@ -2829,7 +2799,7 @@ fi rm -f conftest* LIBS="$cf_save_LIBS" echo "$ac_t""$cf_rpath_space" 1>&6 - test $cf_rpath_space = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " + test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)" fi @@ -2856,7 +2826,7 @@ fi ### use option --disable-overwrite to leave out the link to -lcurses echo $ac_n "checking if you wish to install ncurses overwriting curses""... $ac_c" 1>&6 -echo "configure:2860: checking if you wish to install ncurses overwriting curses" >&5 +echo "configure:2830: checking if you wish to install ncurses overwriting curses" >&5 # Check whether --enable-overwrite or --disable-overwrite was given. if test "${enable_overwrite+set}" = set; then @@ -2869,24 +2839,47 @@ fi echo "$ac_t""$with_overwrite" 1>&6 echo $ac_n "checking if external terminfo-database is used""... $ac_c" 1>&6 -echo "configure:2873: checking if external terminfo-database is used" >&5 +echo "configure:2843: checking if external terminfo-database is used" >&5 # Check whether --enable-database or --disable-database was given. if test "${enable_database+set}" = set; then enableval="$enable_database" - with_database=$enableval + use_database=$enableval else - with_database=yes + use_database=yes fi -echo "$ac_t""$with_database" 1>&6 -test $with_database != no && cat >> confdefs.h <<\EOF +echo "$ac_t""$use_database" 1>&6 + +case $host_os in #(vi +os2*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/emx.src' + ;; +*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/terminfo.src' + ;; +esac + + +if test "$use_database" != no ; then + cat >> confdefs.h <<\EOF #define USE_DATABASE 1 EOF + echo $ac_n "checking which terminfo source-file will be installed""... $ac_c" 1>&6 +echo "configure:2871: checking which terminfo source-file will be installed" >&5 + +# Check whether --enable-database or --disable-database was given. +if test "${enable_database+set}" = set; then + enableval="$enable_database" + TERMINFO_SRC=$withval +fi + + echo "$ac_t""$TERMINFO_SRC" 1>&6 +fi echo $ac_n "checking for list of fallback descriptions""... $ac_c" 1>&6 -echo "configure:2890: checking for list of fallback descriptions" >&5 +echo "configure:2883: checking for list of fallback descriptions" >&5 # Check whether --with-fallbacks or --without-fallbacks was given. if test "${with_fallbacks+set}" = set; then @@ -2900,6 +2893,13 @@ echo "$ac_t""$with_fallback" 1>&6 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` +if test "$use_database" = no ; then + if test -z $with_fallback ; then + { echo "configure: error: You have disabled the database w/o specifying fallbacks" 1>&2; exit 1; } + fi + TERMINFO="${datadir}/terminfo" +else + echo $ac_n "checking for list of terminfo directories""... $ac_c" 1>&6 echo "configure:2905: checking for list of terminfo directories" >&5 @@ -2951,16 +2951,54 @@ test -n "$TERMINFO_DIRS" && cat >> confdefs.h <&2; exit 1; } - fi +echo $ac_n "checking for default terminfo directory""... $ac_c" 1>&6 +echo "configure:2956: checking for default terminfo directory" >&5 + +# Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given. +if test "${with_default_terminfo_dir+set}" = set; then + withval="$with_default_terminfo_dir" + : +else + withval="${TERMINFO-${datadir}/terminfo}" +fi + +case ".$withval" in #(vi +./*) #(vi + ;; +.a-zA-Z:\\/*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(vi + eval withval="$withval" + case ".$withval" in #(vi + .NONE/*) + withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + ;; + esac + ;; #(vi +.NONE/*) + withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + ;; +*) + { echo "configure: error: expected a pathname" 1>&2; exit 1; } + ;; +esac + +eval TERMINFO="$withval" + +echo "$ac_t""$TERMINFO" 1>&6 +cat >> confdefs.h <&6 -echo "configure:2964: checking if big-core option selected" >&5 +echo "configure:3002: checking if big-core option selected" >&5 # Check whether --enable-big-core or --disable-big-core was given. if test "${enable_big_core+set}" = set; then @@ -2971,14 +3009,20 @@ else with_big_core=no else cat > conftest.$ac_ext < #include -int main() { exit(malloc(6000000L) == 0); } +int main() { + unsigned long n = 6000000L; + char *s = malloc(n); + if (s != 0) + s[0] = s[n-1] = 0; + exit(s == 0); +} EOF -if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then with_big_core=yes else @@ -3000,7 +3044,7 @@ EOF ### use option --enable-termcap to compile in the termcap fallback support echo $ac_n "checking if you want termcap-fallback support""... $ac_c" 1>&6 -echo "configure:3004: checking if you want termcap-fallback support" >&5 +echo "configure:3048: checking if you want termcap-fallback support" >&5 # Check whether --enable-termcap or --disable-termcap was given. if test "${enable_termcap+set}" = set; then @@ -3021,7 +3065,7 @@ else ### use option --enable-getcap to use a hacked getcap for reading termcaps echo $ac_n "checking if fast termcap-loader is needed""... $ac_c" 1>&6 -echo "configure:3025: checking if fast termcap-loader is needed" >&5 +echo "configure:3069: checking if fast termcap-loader is needed" >&5 # Check whether --enable-getcap or --disable-getcap was given. if test "${enable_getcap+set}" = set; then @@ -3038,7 +3082,7 @@ EOF echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6 -echo "configure:3042: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "configure:3086: checking if translated termcaps will be cached in ~/.terminfo" >&5 # Check whether --enable-getcap-cache or --disable-getcap-cache was given. if test "${enable_getcap_cache+set}" = set; then @@ -3064,12 +3108,12 @@ for ac_func in \ unlink do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3068: checking for $ac_func" >&5 +echo "configure:3112: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3123,12 +3167,12 @@ if test "$ac_cv_prog_cc_cross" = yes ; then symlink do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3127: checking for $ac_func" >&5 +echo "configure:3171: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3177,7 +3221,7 @@ done else echo $ac_n "checking if link/symlink functions work""... $ac_c" 1>&6 -echo "configure:3181: checking if link/symlink functions work" >&5 +echo "configure:3225: checking if link/symlink functions work" >&5 if eval "test \"`echo '$''{'cf_cv_link_funcs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3189,7 +3233,7 @@ else eval 'ac_cv_func_'$cf_func'=error' else cat > conftest.$ac_ext < @@ -3218,18 +3262,11 @@ int main() } EOF -if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" eval 'ac_cv_func_'$cf_func'=yes' - -cf_FUNC=`echo $cf_func | tr '[a-z]' '[A-Z]'` - - cat >> confdefs.h <&5 cat conftest.$ac_ext >&5 @@ -3246,6 +3283,14 @@ fi fi echo "$ac_t""$cf_cv_link_funcs" 1>&6 + test "$ac_cv_func_link" = yes && cat >> confdefs.h <<\EOF +#define HAVE_LINK 1 +EOF + + test "$ac_cv_func_symlink" = yes && cat >> confdefs.h <<\EOF +#define HAVE_SYMLINK 1 +EOF + fi @@ -3254,7 +3299,7 @@ with_symlinks=no if test "$ac_cv_func_link" != yes ; then echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6 -echo "configure:3258: checking if tic should use symbolic links" >&5 +echo "configure:3303: checking if tic should use symbolic links" >&5 if test "$ac_cv_func_symlink" = yes ; then with_symlinks=yes else @@ -3263,7 +3308,7 @@ echo "configure:3258: checking if tic should use symbolic links" >&5 echo "$ac_t""$with_symlinks" 1>&6 elif test "$ac_cv_func_symlink" != yes ; then echo $ac_n "checking if tic should use hard links""... $ac_c" 1>&6 -echo "configure:3267: checking if tic should use hard links" >&5 +echo "configure:3312: checking if tic should use hard links" >&5 if test "$ac_cv_func_link" = yes ; then with_links=yes else @@ -3272,7 +3317,7 @@ echo "configure:3267: checking if tic should use hard links" >&5 echo "$ac_t""$with_links" 1>&6 else echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6 -echo "configure:3276: checking if tic should use symbolic links" >&5 +echo "configure:3321: checking if tic should use symbolic links" >&5 # Check whether --enable-symlinks or --disable-symlinks was given. if test "${enable_symlinks+set}" = set; then @@ -3296,7 +3341,7 @@ EOF ### use option --enable-broken-linker to force on use of broken-linker support echo $ac_n "checking if you want broken-linker support code""... $ac_c" 1>&6 -echo "configure:3300: checking if you want broken-linker support code" >&5 +echo "configure:3345: checking if you want broken-linker support code" >&5 # Check whether --enable-broken_linker or --disable-broken_linker was given. if test "${enable_broken_linker+set}" = set; then @@ -3314,38 +3359,387 @@ EOF ### use option --enable-bsdpad to have tputs process BSD-style prefix padding echo $ac_n "checking if tputs should process BSD-style prefix padding""... $ac_c" 1>&6 -echo "configure:3318: checking if tputs should process BSD-style prefix padding" >&5 +echo "configure:3363: checking if tputs should process BSD-style prefix padding" >&5 # Check whether --enable-bsdpad or --disable-bsdpad was given. if test "${enable_bsdpad+set}" = set; then enableval="$enable_bsdpad" with_bsdpad=$enableval else - with_bsdpad=no + with_bsdpad=no +fi + +echo "$ac_t""$with_bsdpad" 1>&6 +test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF +#define BSD_TPUTS 1 +EOF + + +### Enable compiling-in rcs id's +echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6 +echo "configure:3381: checking if RCS identifiers should be compiled-in" >&5 + +# Check whether --with-rcs-ids or --without-rcs-ids was given. +if test "${with_rcs_ids+set}" = set; then + withval="$with_rcs_ids" + with_rcs_ids=$withval +else + with_rcs_ids=no +fi + +echo "$ac_t""$with_rcs_ids" 1>&6 +test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF +#define USE_RCS_IDS 1 +EOF + + +############################################################################### + + + echo $ac_n "checking format of man-pages""... $ac_c" 1>&6 +echo "configure:3401: checking format of man-pages" >&5 + + +# Check whether --with-manpage-format or --without-manpage-format was given. +if test "${with_manpage_format+set}" = set; then + withval="$with_manpage_format" + cf_manpage_form=$withval +else + cf_manpage_form=unknown +fi + + +case ".$cf_manpage_form" in +.gzip|.compress|.BSDI|.normal|.formatted) # (vi + ;; +.unknown|.) # (vi + if test -z "$MANPATH" ; then + MANPATH="/usr/man:/usr/share/man" + fi + # look for the 'date' man-page (it's most likely to be installed!) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + cf_manpage_form=unknown + for cf_dir in $MANPATH; do + test -z "$cf_dir" && cf_dir=/usr/man + for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date + do + cf_test=`echo $cf_name | sed -e 's/*//'` + if test "x$cf_test" = "x$cf_name" ; then + case "$cf_name" in + *.gz) cf_manpage_form=gzip;; + *.Z) cf_manpage_form=compress;; + *.0) cf_manpage_form=BSDI,formatted;; + *) cf_manpage_form=normal;; + esac + break + fi + done + if test "$cf_manpage_form" != "unknown" ; then + break + fi + done + IFS="$ac_save_ifs" + ;; +.*) # (vi + echo "configure: warning: Unexpected manpage-format" 1>&2 + ;; +esac + +echo "$ac_t""$cf_manpage_form" 1>&6 + + +echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6 +echo "configure:3453: checking for manpage renaming" >&5 + + +# Check whether --with-manpage-renames or --without-manpage-renames was given. +if test "${with_manpage_renames+set}" = set; then + withval="$with_manpage_renames" + cf_manpage_renames=$withval +else + cf_manpage_renames=yes +fi + + +case ".$cf_manpage_renames" in #(vi +.no) #(vi + ;; +.|.yes) + # Debian 'man' program? + if test -f /etc/debian_version ; then + cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames + else + cf_manpage_renames=no + fi + ;; +esac + +if test "$cf_manpage_renames" != no ; then + if test ! -f $cf_manpage_renames ; then + { echo "configure: error: not a filename: $cf_manpage_renames" 1>&2; exit 1; } + fi + + test ! -d man && mkdir man + + # Construct a sed-script to perform renaming within man-pages + if test -n "$cf_manpage_renames" ; then + test ! -d man && mkdir man + $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed + fi +fi + +echo "$ac_t""$cf_manpage_renames" 1>&6 + + +echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6 +echo "configure:3496: checking for manpage symlinks" >&5 + + +# Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. +if test "${with_manpage_symlinks+set}" = set; then + withval="$with_manpage_symlinks" + cf_manpage_symlinks=$withval +else + cf_manpage_symlinks=yes +fi + + +echo "$ac_t""$cf_manpage_symlinks" 1>&6 + + +echo $ac_n "checking for manpage tbl""... $ac_c" 1>&6 +echo "configure:3512: checking for manpage tbl" >&5 + + +# Check whether --with-manpage-tbl or --without-manpage-tbl was given. +if test "${with_manpage_tbl+set}" = set; then + withval="$with_manpage_tbl" + cf_manpage_tbl=$withval +else + cf_manpage_tbl=no +fi + + +echo "$ac_t""$cf_manpage_tbl" 1>&6 + + + if test "$prefix" = "NONE" ; then + cf_prefix="$ac_default_prefix" + else + cf_prefix="$prefix" + fi + + case "$cf_manpage_form" in # (vi + *formatted*) # (vi + cf_subdir='$mandir/cat' + cf_format=yes + ;; + *) + cf_subdir='$mandir/man' + cf_format=no + ;; + esac + +test ! -d man && mkdir man +cat >man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP +CF_EOF +else +cat >>man/edit_man.sh <\$TMP +CF_EOF fi +if test $cf_manpage_tbl = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $with_curses_h != yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +if test $cf_format = yes ; then +cat >>man/edit_man.sh <\$TMP.out + mv \$TMP.out \$TMP +CF_EOF +fi +case "$cf_manpage_form" in #(vi +*compress*) #(vi +cat >>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <&6 -test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF -#define BSD_TPUTS 1 -EOF - - -### Enable compiling-in rcs id's -echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6 -echo "configure:3336: checking if RCS identifiers should be compiled-in" >&5 + if test -f \$cf_alias\${suffix} ; then + if ( cmp -s \$target \$cf_alias\${suffix} ) + then + : + else + echo .. \$verb alias \$cf_alias\${suffix} + rm -f \$cf_alias\${suffix} + $LN_S \$target \$cf_alias\${suffix} + fi + else + echo .. \$verb alias \$cf_alias\${suffix} + rm -f \$cf_alias\${suffix} + $LN_S \$target \$cf_alias\${suffix} + fi + done + ) + ) + elif test \$verb = removing ; then + echo \$verb \$target + rm -f \$target + test -n "\$aliases" && ( + cd $cf_subdir\${section} && ( + for cf_alias in \$aliases + do + if test \$section = 1 ; then + cf_alias=\`echo \$cf_alias|sed "\${transform}"\` + fi -# Check whether --with-rcs-ids or --without-rcs-ids was given. -if test "${with_rcs_ids+set}" = set; then - withval="$with_rcs_ids" - with_rcs_ids=$withval -else - with_rcs_ids=no -fi + echo .. \$verb alias \$cf_alias\${suffix} + rm -f \$cf_alias\${suffix} + done + ) + ) + else +# echo ".hy 0" + cat \$TMP + fi + ;; +esac +done +exit 0 +CF_EOF +chmod 755 man/edit_man.sh -echo "$ac_t""$with_rcs_ids" 1>&6 -test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF -#define USE_RCS_IDS 1 -EOF ############################################################################### @@ -3353,7 +3747,7 @@ EOF ### Note that some functions (such as const) are normally disabled anyway. echo $ac_n "checking if you want to build with function extensions""... $ac_c" 1>&6 -echo "configure:3357: checking if you want to build with function extensions" >&5 +echo "configure:3751: checking if you want to build with function extensions" >&5 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. if test "${enable_ext_funcs+set}" = set; then @@ -3365,6 +3759,10 @@ fi echo "$ac_t""$with_ext_funcs" 1>&6 if test "$with_ext_funcs" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_CURSES_VERSION 1 +EOF + cat >> confdefs.h <<\EOF #define HAVE_HAS_KEY 1 EOF @@ -3389,7 +3787,7 @@ fi ### use option --enable-const to turn on use of const beyond that in XSI. echo $ac_n "checking for extended use of const keyword""... $ac_c" 1>&6 -echo "configure:3393: checking for extended use of const keyword" >&5 +echo "configure:3791: checking for extended use of const keyword" >&5 # Check whether --enable-const or --disable-const was given. if test "${enable_const+set}" = set; then @@ -3400,36 +3798,14 @@ else fi echo "$ac_t""$with_ext_const" 1>&6 -NCURSES_CONST="" +NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then - cat >> confdefs.h <<\EOF -#define NCURSES_CONST const -EOF - NCURSES_CONST=const fi -### use option --enable-hashmap to turn on use of hashmap scrolling logic -echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6 -echo "configure:3416: checking if you want hashmap scrolling-optimization code" >&5 - -# Check whether --enable-hashmap or --disable-hashmap was given. -if test "${enable_hashmap+set}" = set; then - enableval="$enable_hashmap" - with_hashmap=$enableval -else - with_hashmap=yes -fi - -echo "$ac_t""$with_hashmap" 1>&6 -test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF -#define USE_HASHMAP 1 -EOF - - echo $ac_n "checking if you want \$NCURSES_NO_PADDING code""... $ac_c" 1>&6 -echo "configure:3433: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "configure:3809: checking if you want \$NCURSES_NO_PADDING code" >&5 # Check whether --enable-no-padding or --disable-no-padding was given. if test "${enable_no_padding+set}" = set; then @@ -3447,7 +3823,7 @@ EOF ### use option --enable-sigwinch to turn on use of SIGWINCH logic echo $ac_n "checking if you want SIGWINCH handler""... $ac_c" 1>&6 -echo "configure:3451: checking if you want SIGWINCH handler" >&5 +echo "configure:3827: checking if you want SIGWINCH handler" >&5 # Check whether --enable-sigwinch or --disable-sigwinch was given. if test "${enable_sigwinch+set}" = set; then @@ -3465,7 +3841,7 @@ EOF ### use option --enable-tcap-names to allow user to define new capabilities echo $ac_n "checking if you want user-definable terminal capabilities like termcap""... $ac_c" 1>&6 -echo "configure:3469: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "configure:3845: checking if you want user-definable terminal capabilities like termcap" >&5 # Check whether --enable-tcap-names or --disable-tcap-names was given. if test "${enable_tcap_names+set}" = set; then @@ -3481,9 +3857,10 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 ############################################################################### +# These options are relatively safe to experiment with. -echo $ac_n "checking if you want all experimental code""... $ac_c" 1>&6 -echo "configure:3487: checking if you want all experimental code" >&5 +echo $ac_n "checking if you want all development code""... $ac_c" 1>&6 +echo "configure:3864: checking if you want all development code" >&5 # Check whether --with-develop or --without-develop was given. if test "${with_develop+set}" = set; then @@ -3496,8 +3873,8 @@ fi echo "$ac_t""$with_develop" 1>&6 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -echo $ac_n "checking if you want experimental colorfgbg code""... $ac_c" 1>&6 -echo "configure:3501: checking if you want experimental colorfgbg code" >&5 +echo $ac_n "checking if you want colorfgbg code""... $ac_c" 1>&6 +echo "configure:3878: checking if you want colorfgbg code" >&5 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. if test "${enable_hard_tabs+set}" = set; then @@ -3514,8 +3891,8 @@ EOF ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -echo $ac_n "checking if you want experimental hard-tabs code""... $ac_c" 1>&6 -echo "configure:3519: checking if you want experimental hard-tabs code" >&5 +echo $ac_n "checking if you want hard-tabs code""... $ac_c" 1>&6 +echo "configure:3896: checking if you want hard-tabs code" >&5 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. if test "${enable_hard_tabs+set}" = set; then @@ -3531,8 +3908,82 @@ test "$with_hardtabs" = yes && cat >> confdefs.h <<\EOF EOF +echo $ac_n "checking if you want to use restrict environment when running as root""... $ac_c" 1>&6 +echo "configure:3913: checking if you want to use restrict environment when running as root" >&5 + +# Check whether --enable-root-environ or --disable-root-environ was given. +if test "${enable_root_environ+set}" = set; then + enableval="$enable_root_environ" + with_root_environ=$enableval +else + with_root_environ=yes +fi + +echo "$ac_t""$with_root_environ" 1>&6 +test "$with_root_environ" = yes && cat >> confdefs.h <<\EOF +#define USE_ROOT_ENVIRON 1 +EOF + + +### use option --enable-xmc-glitch to turn on use of magic-cookie optimize +echo $ac_n "checking if you want limited support for xmc""... $ac_c" 1>&6 +echo "configure:3931: checking if you want limited support for xmc" >&5 + +# Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. +if test "${enable_xmc_glitch+set}" = set; then + enableval="$enable_xmc_glitch" + with_xmc_glitch=$enableval +else + with_xmc_glitch=$with_develop +fi + +echo "$ac_t""$with_xmc_glitch" 1>&6 +test "$with_xmc_glitch" = yes && cat >> confdefs.h <<\EOF +#define USE_XMC_SUPPORT 1 +EOF + + +############################################################################### +# These are just experimental, probably should not be in a package: + + +echo $ac_n "checking if you do not want to assume colors are white-on-black""... $ac_c" 1>&6 +echo "configure:3952: checking if you do not want to assume colors are white-on-black" >&5 + +# Check whether --enable-assumed-color or --disable-assumed-color was given. +if test "${enable_assumed_color+set}" = set; then + enableval="$enable_assumed_color" + with_assumed_color=$enableval +else + with_assumed_color=yes +fi + +echo "$ac_t""$with_assumed_color" 1>&6 +test "$with_assumed_color" = yes && cat >> confdefs.h <<\EOF +#define USE_ASSUMED_COLOR 1 +EOF + + +### use option --enable-hashmap to turn on use of hashmap scrolling logic +echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6 +echo "configure:3970: checking if you want hashmap scrolling-optimization code" >&5 + +# Check whether --enable-hashmap or --disable-hashmap was given. +if test "${enable_hashmap+set}" = set; then + enableval="$enable_hashmap" + with_hashmap=$enableval +else + with_hashmap=yes +fi + +echo "$ac_t""$with_hashmap" 1>&6 +test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF +#define USE_HASHMAP 1 +EOF + + echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6 -echo "configure:3536: checking if you want experimental safe-sprintf code" >&5 +echo "configure:3987: checking if you want experimental safe-sprintf code" >&5 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given. if test "${enable_safe_sprintf+set}" = set; then @@ -3552,7 +4003,7 @@ EOF # when hashmap is used scroll hints are useless if test "$with_hashmap" = no ; then echo $ac_n "checking if you want to experiment without scrolling-hints code""... $ac_c" 1>&6 -echo "configure:3556: checking if you want to experiment without scrolling-hints code" >&5 +echo "configure:4007: checking if you want to experiment without scrolling-hints code" >&5 # Check whether --enable-scroll-hints or --disable-scroll-hints was given. if test "${enable_scroll_hints+set}" = set; then @@ -3571,7 +4022,7 @@ fi ### use option --enable-widec to turn on use of wide-character support echo $ac_n "checking if you want experimental wide-character code""... $ac_c" 1>&6 -echo "configure:3575: checking if you want experimental wide-character code" >&5 +echo "configure:4026: checking if you want experimental wide-character code" >&5 # Check whether --enable-widec or --disable-widec was given. if test "${enable_widec+set}" = set; then @@ -3590,28 +4041,12 @@ EOF fi -### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -echo $ac_n "checking if you want experimental xmc code""... $ac_c" 1>&6 -echo "configure:3596: checking if you want experimental xmc code" >&5 - -# Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. -if test "${enable_xmc_glitch+set}" = set; then - enableval="$enable_xmc_glitch" - with_xmc_glitch=$enableval -else - with_xmc_glitch=$with_develop -fi - -echo "$ac_t""$with_xmc_glitch" 1>&6 -test "$with_xmc_glitch" = yes && cat >> confdefs.h <<\EOF -#define USE_XMC_SUPPORT 1 -EOF - - ############################################################################### ### use option --disable-echo to suppress full display compiling commands +echo $ac_n "checking if you want to display full commands during build""... $ac_c" 1>&6 +echo "configure:4050: checking if you want to display full commands during build" >&5 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then @@ -3625,10 +4060,14 @@ if test "$with_echo" = yes; then ECHO_LINK= else ECHO_LINK='@ echo linking $@ ... ;' + test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" fi +echo "$ac_t""$with_echo" 1>&6 ### use option --enable-warnings to turn on all gcc warnings +echo $ac_n "checking if you want to see compiler warnings""... $ac_c" 1>&6 +echo "configure:4071: checking if you want to see compiler warnings" >&5 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then @@ -3636,17 +4075,19 @@ if test "${enable_warnings+set}" = set; then with_warnings=$enableval fi +echo "$ac_t""$with_warnings" 1>&6 + if test -n "$with_warnings"; then ADAFLAGS="$ADAFLAGS -gnatg" -if test -n "$GCC" +if test "$GCC" = yes then cat > conftest.$ac_ext <&6 -echo "configure:3650: checking for $CC warning options" >&5 +echo "configure:4091: checking for $CC warning options" >&5 cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-W -Wall" cf_warn_CONST="" @@ -3664,7 +4105,7 @@ echo "configure:3650: checking for $CC warning options" >&5 Wstrict-prototypes $cf_warn_CONST do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES" @@ -3677,7 +4118,7 @@ fi fi -if test -n "$GCC" +if test "$GCC" = yes then cat > conftest.i < conftest.i <&6 -echo "configure:3700: checking for $CC __attribute__ directives" >&5 +echo "configure:4141: checking for $CC __attribute__ directives" >&5 cat > conftest.$ac_ext <&5 @@ -3736,7 +4177,7 @@ EOF EOF ;; esac - if { (eval echo configure:3740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6 cat conftest.h >>confdefs.h # else @@ -3751,6 +4192,8 @@ fi ### use option --enable-assertions to turn on generation of assertion code +echo $ac_n "checking if you want to enable runtime assertions""... $ac_c" 1>&6 +echo "configure:4197: checking if you want to enable runtime assertions" >&5 # Check whether --enable-assertions or --disable-assertions was given. if test "${enable_assertions+set}" = set; then @@ -3760,9 +4203,10 @@ else with_assertions=no fi +echo "$ac_t""$with_assertions" 1>&6 if test -n "$GCC" then - if test $with_assertions = no + if test "$with_assertions" = no then cat >> confdefs.h <<\EOF #define NDEBUG 1 @@ -3779,7 +4223,7 @@ fi # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - test $enableval = no && cat >> confdefs.h <<\EOF + test "$enableval" = no && cat >> confdefs.h <<\EOF #define NO_LEAKS 1 EOF @@ -3795,7 +4239,7 @@ EOF # Check whether --enable-expanded or --disable-expanded was given. if test "${enable_expanded+set}" = set; then enableval="$enable_expanded" - test $enableval = yes && cat >> confdefs.h <<\EOF + test "$enableval" = yes && cat >> confdefs.h <<\EOF #define NCURSES_EXPANDED 1 EOF @@ -3807,7 +4251,7 @@ fi # Check whether --enable-macros or --disable-macros was given. if test "${enable_macros+set}" = set; then enableval="$enable_macros" - test $enableval = no && cat >> confdefs.h <<\EOF + test "$enableval" = no && cat >> confdefs.h <<\EOF #define NCURSES_NOMACROS 1 EOF @@ -3816,12 +4260,12 @@ fi ### Checks for libraries. echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:3820: checking for gettimeofday" >&5 +echo "configure:4264: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else @@ -3867,7 +4311,7 @@ else echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:3871: checking for gettimeofday in -lbsd" >&5 +echo "configure:4315: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3875,7 +4319,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3914,13 +4358,13 @@ fi echo $ac_n "checking if -lm needed for math functions""... $ac_c" 1>&6 -echo "configure:3918: checking if -lm needed for math functions" >&5 +echo "configure:4362: checking if -lm needed for math functions" >&5 if eval "test \"`echo '$''{'cf_cv_need_libm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3930,7 +4374,7 @@ int main() { double x = rand(); printf("result = %g\n", sin(x)) ; return 0; } EOF -if { (eval echo configure:3934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_need_libm=no else @@ -3952,12 +4396,12 @@ fi ### Checks for header files. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3956: checking for ANSI C header files" >&5 +echo "configure:4400: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3965,7 +4409,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3982,7 +4426,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4000,7 +4444,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4021,7 +4465,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4032,7 +4476,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4060,12 +4504,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4064: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4508: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -4073,7 +4517,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4098,7 +4542,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4102: checking for opendir in -ldir" >&5 +echo "configure:4546: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4106,7 +4550,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4139,7 +4583,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4143: checking for opendir in -lx" >&5 +echo "configure:4587: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4147,7 +4591,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4182,13 +4626,13 @@ fi echo $ac_n "checking for regular-expression headers""... $ac_c" 1>&6 -echo "configure:4186: checking for regular-expression headers" >&5 +echo "configure:4630: checking for regular-expression headers" >&5 if eval "test \"`echo '$''{'cf_cv_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4201,7 +4645,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_regex="regex.h" else @@ -4210,7 +4654,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -4220,7 +4664,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_regex="regexp.h" else @@ -4231,7 +4675,7 @@ else cf_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext < int main() { @@ -4241,7 +4685,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_regex="regexpr.h" else @@ -4289,25 +4733,23 @@ sys/poll.h \ sys/select.h \ sys/time.h \ sys/times.h \ -termio.h \ -termios.h \ ttyent.h \ unistd.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4301: checking for $ac_hdr" >&5 +echo "configure:4743: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4338,7 +4780,7 @@ done # Note: even non-Posix ISC needs to declare fd_set if test "$ISC" = yes ; then echo $ac_n "checking for main in -lcposix""... $ac_c" 1>&6 -echo "configure:4342: checking for main in -lcposix" >&5 +echo "configure:4784: checking for main in -lcposix" >&5 ac_lib_var=`echo cposix'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4346,14 +4788,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4381,102 +4823,62 @@ else fi echo $ac_n "checking for bzero in -linet""... $ac_c" 1>&6 -echo "configure:4385: checking for bzero in -linet" >&5 +echo "configure:4827: checking for bzero in -linet" >&5 ac_lib_var=`echo inet'_'bzero | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-linet $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -linet" -else - echo "$ac_t""no" 1>&6 -fi - for ac_hdr in sys/termio.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4427: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char bzero(); + +int main() { +bzero() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:4846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" + fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 fi -done - fi echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6 -echo "configure:4467: checking if sys/time.h works with sys/select.h" >&5 +echo "configure:4869: checking if sys/time.h works with sys/select.h" >&5 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif @@ -4484,7 +4886,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sys_time_select=yes else @@ -4498,7 +4900,7 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_sys_time_select" 1>&6 -test $cf_cv_sys_time_select = yes && cat >> confdefs.h <<\EOF +test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF #define HAVE_SYS_TIME_SELECT 1 EOF @@ -4513,12 +4915,12 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4517: checking for working const" >&5 +echo "configure:4919: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4588,21 +4990,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:4592: checking for inline" >&5 +echo "configure:4994: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -4627,27 +5029,27 @@ EOF ;; esac -test $ac_cv_c_inline != no && cat >> confdefs.h <<\EOF +test "$ac_cv_c_inline" != no && cat >> confdefs.h <<\EOF #define CC_HAS_INLINE_FUNCS 1 EOF echo $ac_n "checking if unsigned literals are legal""... $ac_c" 1>&6 -echo "configure:4638: checking if unsigned literals are legal" >&5 +echo "configure:5040: checking if unsigned literals are legal" >&5 if eval "test \"`echo '$''{'cf_cv_unsigned_literals'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_unsigned_literals=yes else @@ -4665,7 +5067,7 @@ echo "$ac_t""$cf_cv_unsigned_literals" 1>&6 echo $ac_n "checking for type of chtype""... $ac_c" 1>&6 -echo "configure:4669: checking for type of chtype" >&5 +echo "configure:5071: checking for type of chtype" >&5 if eval "test \"`echo '$''{'cf_cv_typeof_chtype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4674,10 +5076,10 @@ else cf_cv_typeof_chtype=long else cat > conftest.$ac_ext < /* we want wchar_t */ #define WANT_BITS 39 #else @@ -4689,7 +5091,7 @@ int main() FILE *fp = fopen("cf_test.out", "w"); if (fp != 0) { char *result = "long"; -#if USE_WIDEC_SUPPORT +#ifdef USE_WIDEC_SUPPORT /* * If wchar_t is smaller than a long, it must be an int or a * short. We prefer not to use a short anyway. @@ -4720,7 +5122,7 @@ int main() } EOF -if { (eval echo configure:4724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_typeof_chtype=`cat cf_test.out` else @@ -4753,7 +5155,7 @@ test "$cf_cv_typeof_chtype" = long && cf_cv_1UL="${cf_cv_1UL}L" echo $ac_n "checking for number of bits in chtype""... $ac_c" 1>&6 -echo "configure:4757: checking for number of bits in chtype" >&5 +echo "configure:5159: checking for number of bits in chtype" >&5 if eval "test \"`echo '$''{'cf_cv_shift_limit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4762,7 +5164,7 @@ else cf_cv_shift_limit=32 else cat > conftest.$ac_ext < @@ -4785,7 +5187,7 @@ int main() } EOF -if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_shift_limit=`cat cf_test.out` else @@ -4805,7 +5207,7 @@ echo "$ac_t""$cf_cv_shift_limit" 1>&6 echo $ac_n "checking for width of character-index""... $ac_c" 1>&6 -echo "configure:4809: checking for width of character-index" >&5 +echo "configure:5211: checking for width of character-index" >&5 if eval "test \"`echo '$''{'cf_cv_widec_shift'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4832,13 +5234,13 @@ echo "$ac_t""$cf_cv_widec_shift" 1>&6 echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6 -echo "configure:4836: checking if external errno is declared" >&5 +echo "configure:5238: checking if external errno is declared" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval 'cf_cv_dcl_'errno'=yes' else @@ -4871,7 +5273,7 @@ echo "$ac_t""$cf_result" 1>&6 if test "$cf_result" = no ; then eval 'cf_result=DECL_'errno -cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'` +cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:4886: checking if external errno exists" >&5 +echo "configure:5288: checking if external errno exists" >&5 if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval 'cf_cv_have_'errno'=yes' else @@ -4917,7 +5319,7 @@ echo "$ac_t""$cf_result" 1>&6 if test "$cf_result" = yes ; then eval 'cf_result=HAVE_'errno -cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'` +cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:4934: checking if data-only library module links" >&5 +echo "configure:5336: checking if data-only library module links" >&5 if eval "test \"`echo '$''{'cf_cv_link_dataonly'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest.a cat >conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; } ; then + if { (eval echo configure:5346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then mv conftest.o data.o && \ ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:5365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then mv conftest.o func.o && \ ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null fi @@ -4971,7 +5373,7 @@ EOF cf_cv_link_dataonly=unknown else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_link_dataonly=yes else @@ -4998,67 +5400,19 @@ fi fi echo "$ac_t""$cf_cv_link_dataonly" 1>&6 -test $cf_cv_link_dataonly = no && cat >> confdefs.h <<\EOF +test "$cf_cv_link_dataonly" = no && cat >> confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF -echo $ac_n "checking for speed_t""... $ac_c" 1>&6 -echo "configure:5009: checking for speed_t" >&5 -OSPEED_INCLUDES= -cat > conftest.$ac_ext < -int main() { -speed_t some_variable = 0 -; return 0; } -EOF -if { (eval echo configure:5019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - OSPEED_TYPE=speed_t -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - OSPEED_TYPE=unsigned -fi -rm -f conftest* -cat > conftest.$ac_ext < -int main() { -speed_t some_variable = 0 -; return 0; } -EOF -if { (eval echo configure:5037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - OSPEED_TYPE=speed_t - OSPEED_INCLUDES="#include " -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - - -if test "$OSPEED_TYPE" = "unsigned" ; then - echo "$ac_t""no" 1>&6 - cat >> confdefs.h <<\EOF -#define speed_t unsigned -EOF - -else - echo "$ac_t""yes" 1>&6 -fi - - ### Checks for library functions. for ac_func in \ getcwd \ +getegid \ +geteuid \ getttynam \ +issetugid \ memccpy \ mkstemp \ nanosleep \ @@ -5072,7 +5426,6 @@ sigaction \ sigvec \ strdup \ strstr \ -tcgetattr \ tcgetpgrp \ times \ vfscanf \ @@ -5081,12 +5434,12 @@ vsscanf \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5085: checking for $ac_func" >&5 +echo "configure:5438: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5136,13 +5489,13 @@ done if test "$with_getcap" = "yes" ; then echo $ac_n "checking for terminal-capability database functions""... $ac_c" 1>&6 -echo "configure:5140: checking for terminal-capability database functions" >&5 +echo "configure:5493: checking for terminal-capability database functions" >&5 if eval "test \"`echo '$''{'cf_cv_cgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5157,7 +5510,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_cgetent=yes else @@ -5171,7 +5524,7 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_cgetent" 1>&6 -test $cf_cv_cgetent = yes && cat >> confdefs.h <<\EOF +test "$cf_cv_cgetent" = yes && cat >> confdefs.h <<\EOF #define HAVE_BSD_CGETENT 1 EOF @@ -5180,20 +5533,20 @@ fi echo $ac_n "checking for isascii""... $ac_c" 1>&6 -echo "configure:5184: checking for isascii" >&5 +echo "configure:5537: checking for isascii" >&5 if eval "test \"`echo '$''{'cf_cv_have_isascii'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int x = isascii(' ') ; return 0; } EOF -if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_have_isascii=yes else @@ -5206,17 +5559,17 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_have_isascii" 1>&6 -test $cf_cv_have_isascii = yes && cat >> confdefs.h <<\EOF +test "$cf_cv_have_isascii" = yes && cat >> confdefs.h <<\EOF #define HAVE_ISASCII 1 EOF -if test $ac_cv_func_sigaction = yes; then +if test "$ac_cv_func_sigaction" = yes; then echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:5218: checking whether sigaction needs _POSIX_SOURCE" >&5 +echo "configure:5571: checking whether sigaction needs _POSIX_SOURCE" >&5 cat > conftest.$ac_ext < @@ -5225,7 +5578,7 @@ int main() { struct sigaction act ; return 0; } EOF -if { (eval echo configure:5229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* sigact_bad=no else @@ -5234,7 +5587,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* sigact_bad=yes cat >> confdefs.h <<\EOF @@ -5264,24 +5617,110 @@ echo "$ac_t""$sigact_bad" 1>&6 fi -if test $ac_cv_header_termios_h = yes ; then +for ac_hdr in \ +termio.h \ +termios.h \ +unistd.h \ + +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5629: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test "$ISC" = yes ; then + for ac_hdr in sys/termio.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5670: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +fi +if test "$ac_cv_header_termios_h" = yes ; then case "$CFLAGS" in *-D_POSIX_SOURCE*) termios_bad=dunno ;; *) termios_bad=maybe ;; esac - if test $termios_bad = maybe ; then + if test "$termios_bad" = maybe ; then echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:5276: checking whether termios.h needs _POSIX_SOURCE" >&5 +echo "configure:5715: checking whether termios.h needs _POSIX_SOURCE" >&5 cat > conftest.$ac_ext < int main() { struct termios foo; int x = foo.c_iflag ; return 0; } EOF -if { (eval echo configure:5285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* termios_bad=no else @@ -5290,7 +5729,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* termios_bad=unknown else @@ -5320,11 +5759,61 @@ rm -f conftest* fi + +echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6 +echo "configure:5765: checking for tcgetattr" >&5 +if eval "test \"`echo '$''{'cf_cv_have_tcgetattr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERMIOS_H +#include +#define TTY struct termios +#else +#ifdef HAVE_TERMIO_H +#include +#define TTY struct termio +#endif +#endif + +int main() { + +TTY foo; +tcgetattr(1, &foo); +; return 0; } +EOF +if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_have_tcgetattr=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_have_tcgetattr=no +fi +rm -f conftest* +fi + +echo "$ac_t""$cf_cv_have_tcgetattr" 1>&6 +test "$cf_cv_have_tcgetattr" = yes && cat >> confdefs.h <<\EOF +#define HAVE_TCGETATTR 1 +EOF + + + if test "$cross_compiling" = yes ; then echo "configure: warning: cross compiling: assume setvbuf params not reversed" 1>&2 else echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -echo "configure:5328: checking whether setvbuf arguments are reversed" >&5 +echo "configure:5817: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5332,7 +5821,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < /* If setvbuf has the reversed format, exit 0. */ @@ -5346,7 +5835,7 @@ main () { exit(0); /* Non-reversed systems segv here. */ } EOF -if { (eval echo configure:5350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes else @@ -5371,12 +5860,12 @@ fi fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5375: checking return type of signal handlers" >&5 +echo "configure:5864: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5393,7 +5882,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5413,13 +5902,13 @@ EOF echo $ac_n "checking for type sigaction_t""... $ac_c" 1>&6 -echo "configure:5417: checking for type sigaction_t" >&5 +echo "configure:5906: checking for type sigaction_t" >&5 if eval "test \"`echo '$''{'cf_cv_type_sigaction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5427,7 +5916,7 @@ int main() { sigaction_t x ; return 0; } EOF -if { (eval echo configure:5431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_type_sigaction=yes else @@ -5440,14 +5929,15 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_type_sigaction" 1>&6 -test $cf_cv_type_sigaction = yes && cat >> confdefs.h <<\EOF +test "$cf_cv_type_sigaction" = yes && cat >> confdefs.h <<\EOF #define HAVE_TYPE_SIGACTION 1 EOF + echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6 -echo "configure:5451: checking declaration of size-change" >&5 +echo "configure:5941: checking declaration of size-change" >&5 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5461,17 +5951,17 @@ do CFLAGS="$cf_save_CFLAGS" test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts" cat > conftest.$ac_ext < -#if HAVE_TERMIOS_H +#ifdef HAVE_TERMIOS_H #include #else -#if HAVE_TERMIO_H +#ifdef HAVE_TERMIO_H #include #endif #endif -#if NEED_PTEM_H +#ifdef NEED_PTEM_H /* This is a workaround for SCO: they neglected to define struct winsize in * termios.h -- it's only in termio.h and ptem.h */ @@ -5500,7 +5990,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sizechange=yes else @@ -5514,30 +6004,37 @@ rm -f conftest* CFLAGS="$cf_save_CFLAGS" if test "$cf_cv_sizechange" = yes ; then echo "size-change succeeded ($cf_opts)" >&5 - test -n "$cf_opts" && cat >> confdefs.h <&6 -test $cf_cv_sizechange != no && cat >> confdefs.h <<\EOF +if test "$cf_cv_sizechange" != no ; then + cat >> confdefs.h <<\EOF #define HAVE_SIZECHANGE 1 EOF + case $cf_cv_sizechange in #(vi + NEED*) + cat >> confdefs.h <&6 -echo "configure:5536: checking for memmove" >&5 +echo "configure:6033: checking for memmove" >&5 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_memmove=yes" else @@ -5579,12 +6076,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for bcopy""... $ac_c" 1>&6 -echo "configure:5583: checking for bcopy" >&5 +echo "configure:6080: checking for bcopy" >&5 if eval "test \"`echo '$''{'ac_cv_func_bcopy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_bcopy=yes" else @@ -5623,7 +6120,7 @@ if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6 -echo "configure:5627: checking if bcopy does overlapping moves" >&5 +echo "configure:6124: checking if bcopy does overlapping moves" >&5 if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5632,7 +6129,7 @@ else cf_cv_good_bcopy=unknown else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_good_bcopy=yes else @@ -5667,7 +6164,7 @@ else cf_cv_good_bcopy=no fi - if test $cf_cv_good_bcopy = yes ; then + if test "$cf_cv_good_bcopy" = yes ; then cat >> confdefs.h <<\EOF #define USE_OK_BCOPY 1 EOF @@ -5683,7 +6180,7 @@ fi echo $ac_n "checking if poll really works""... $ac_c" 1>&6 -echo "configure:5687: checking if poll really works" >&5 +echo "configure:6184: checking if poll really works" >&5 if eval "test \"`echo '$''{'cf_cv_working_poll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5692,7 +6189,7 @@ if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat > conftest.$ac_ext < @@ -5712,7 +6209,7 @@ int main() { exit(ret != 0); } EOF -if { (eval echo configure:5716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_working_poll=yes else @@ -5739,14 +6236,14 @@ if test -z "$cf_user_CFLAGS" ; then fi -echo $ac_n "checking for builtin $CC bool type""... $ac_c" 1>&6 -echo "configure:5744: checking for builtin $CC bool type" >&5 +echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6 +echo "configure:6241: checking for builtin bool type" >&5 if eval "test \"`echo '$''{'cf_cv_cc_bool_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5756,7 +6253,7 @@ int main() { bool x = false ; return 0; } EOF -if { (eval echo configure:5760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_cc_bool_type=1 else @@ -5769,7 +6266,7 @@ rm -f conftest* fi -if test $cf_cv_cc_bool_type = 1 +if test "$cf_cv_cc_bool_type" = 1 then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi @@ -5793,7 +6290,7 @@ os2*) #(vi ;; esac echo $ac_n "checking for library $cf_stdcpp_libname""... $ac_c" 1>&6 -echo "configure:5797: checking for library $cf_stdcpp_libname" >&5 +echo "configure:6294: checking for library $cf_stdcpp_libname" >&5 if eval "test \"`echo '$''{'cf_cv_libstdcpp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5801,7 +6298,7 @@ else cf_save="$LIBS" LIBS="$LIBS -l$cf_stdcpp_libname" cat > conftest.$ac_ext < @@ -5812,7 +6309,7 @@ strstreambuf foo(buf, sizeof(buf)) ; return 0; } EOF -if { (eval echo configure:5816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_libstdcpp=yes else @@ -5827,15 +6324,16 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_libstdcpp" 1>&6 -test $cf_cv_libstdcpp = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" fi - case "`${CXX-g++} --version`" in - 1*|2.0-6*) - cf_cxx_library=yes - ;; - 2.7*) - + if test "$GXX" = yes; then + case "`${CXX-g++} --version`" in + 1*|2.0-6*) + cf_cxx_library=yes + ;; + 2.7*) + cf_cxx_library=unknown case $cf_cv_system_name in #(vi os2*) #(vi @@ -5845,13 +6343,13 @@ os2*) #(vi cf_gpp_libname=g++ ;; esac -if test $ac_cv_prog_gxx = yes; then +if test "$ac_cv_prog_gxx" = yes; then echo $ac_n "checking for lib$cf_gpp_libname""... $ac_c" 1>&6 -echo "configure:5851: checking for lib$cf_gpp_libname" >&5 +echo "configure:6349: checking for lib$cf_gpp_libname" >&5 cf_save="$LIBS" LIBS="$LIBS -l$cf_gpp_libname" cat > conftest.$ac_ext < @@ -5860,7 +6358,7 @@ int main() { two_arg_error_handler_t foo2 = lib_error_handler ; return 0; } EOF -if { (eval echo configure:5864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cxx_library=yes CXXLIBS="$CXXLIBS -l$cf_gpp_libname" @@ -5880,7 +6378,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -5889,7 +6387,7 @@ int main() { two_arg_error_handler_t foo2 = lib_error_handler ; return 0; } EOF -if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cxx_library=yes CXXLIBS="$CXXLIBS -l$cf_gpp_libname" @@ -5910,13 +6408,16 @@ rm -f conftest* echo "$ac_t""$cf_cxx_library" 1>&6 fi - ;; - *) - cf_cxx_library=no - ;; - esac + ;; + *) + cf_cxx_library=no + ;; + esac + else + cf_cxx_library=no + fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:5920: checking how to run the C++ preprocessor" >&5 +echo "configure:6421: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5929,12 +6430,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -5962,17 +6463,17 @@ for ac_hdr in typeinfo do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5966: checking for $ac_hdr" >&5 +echo "configure:6467: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5999,14 +6500,14 @@ fi done -echo $ac_n "checking for builtin $CXX bool type""... $ac_c" 1>&6 -echo "configure:6004: checking for builtin $CXX bool type" >&5 +echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6 +echo "configure:6505: checking for builtin bool type" >&5 if eval "test \"`echo '$''{'cf_cv_builtin_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6016,7 +6517,7 @@ int main() { bool x = false ; return 0; } EOF -if { (eval echo configure:6020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_builtin_bool=1 else @@ -6029,14 +6530,14 @@ rm -f conftest* fi -if test $cf_cv_builtin_bool = 1 +if test "$cf_cv_builtin_bool" = 1 then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for size of $CXX bool""... $ac_c" 1>&6 -echo "configure:6040: checking for size of $CXX bool" >&5 +echo $ac_n "checking for size of bool""... $ac_c" 1>&6 +echo "configure:6541: checking for size of bool" >&5 if eval "test \"`echo '$''{'cf_cv_type_of_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6046,7 +6547,7 @@ else cf_cv_type_of_bool=unknown else cat > conftest.$ac_ext < #include -#if HAVE_GXX_BUILTIN_H +#ifdef HAVE_GXX_BUILTIN_H #include #elif HAVE_GPP_BUILTIN_H #include @@ -6078,7 +6579,7 @@ main() } EOF -if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_type_of_bool=`cat cf_test.out` else @@ -6102,7 +6603,7 @@ fi echo $ac_n "checking for special defines needed for etip.h""... $ac_c" 1>&6 -echo "configure:6106: checking for special defines needed for etip.h" >&5 +echo "configure:6607: checking for special defines needed for etip.h" >&5 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" for cf_math in "" MATH_H @@ -6113,7 +6614,7 @@ do test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" cat > conftest.$ac_ext < @@ -6122,7 +6623,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* test -n "$cf_math" && cat >> confdefs.h <&6 CXXFLAGS="$cf_save_CXXFLAGS" -if test -n "$CXX" ; then +if test "$CXX" = yes ; then echo $ac_n "checking if $CXX accepts parameter initialization""... $ac_c" 1>&6 -echo "configure:6153: checking if $CXX accepts parameter initialization" >&5 +echo "configure:6654: checking if $CXX accepts parameter initialization" >&5 if eval "test \"`echo '$''{'cf_cv_cpp_param_init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6165,7 +6666,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cf_cv_cpp_param_init=unknown else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_cpp_param_init=yes else @@ -6228,7 +6729,7 @@ else # may change. echo $ac_n "checking for fallback type of bool""... $ac_c" 1>&6 -echo "configure:6232: checking for fallback type of bool" >&5 +echo "configure:6733: checking for fallback type of bool" >&5 case "$host_cpu" in #(vi i?86) cf_cv_type_of_bool=char ;; #(vi *) cf_cv_type_of_bool=int ;; @@ -6244,7 +6745,7 @@ cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6248: checking for $ac_word" >&5 +echo "configure:6749: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnat_exists'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6298,40 +6799,40 @@ esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6302: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_m4_exists'+set}'`\" = set"; then +echo "configure:6803: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_M4_exists'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$m4_exists"; then - ac_cv_prog_m4_exists="$m4_exists" # Let the user override the test. + if test -n "$M4_exists"; then + ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_m4_exists="yes" + ac_cv_prog_M4_exists="yes" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_prog_m4_exists" && ac_cv_prog_m4_exists="no" + test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no" fi fi -m4_exists="$ac_cv_prog_m4_exists" -if test -n "$m4_exists"; then - echo "$ac_t""$m4_exists" 1>&6 +M4_exists="$ac_cv_prog_M4_exists" +if test -n "$M4_exists"; then + echo "$ac_t""$M4_exists" 1>&6 else echo "$ac_t""no" 1>&6 fi - if test "$ac_cv_prog_m4_exists" = no; then + if test "$ac_cv_prog_M4_exists" = no; then cf_cv_prog_gnat_correct=no echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then echo $ac_n "checking if GNAT works""... $ac_c" 1>&6 -echo "configure:6335: checking if GNAT works" >&5 +echo "configure:6836: checking if GNAT works" >&5 rm -f conftest* cat >>conftest.ads <&6 -echo "configure:6484: checking for library subsets" >&5 +echo "configure:6980: checking for library subsets" >&5 if test "$with_termlib" = yes ; then LIB_SUBSETS="termlib " else @@ -6503,7 +6999,7 @@ CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then CPPFLAGS="$CPPFLAGS -I\$(srcdir)/../include" fi -if test -z "$GCC"; then +if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\$(includedir)" elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then @@ -6521,7 +7017,7 @@ ACPPFLAGS="$ACPPFLAGS -I. -I../../include" if test "$srcdir" != "."; then ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include" fi -if test -z "$GCC"; then +if test "$GCC" != yes; then ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then @@ -6537,9 +7033,10 @@ fi ### Build up pieces for makefile rules echo $ac_n "checking default library suffix""... $ac_c" 1>&6 -echo "configure:6541: checking default library suffix" >&5 +echo "configure:7037: checking default library suffix" >&5 case $DFT_LWR_MODEL in + libtool) DFT_ARG_SUFFIX='' ;; normal) DFT_ARG_SUFFIX='' ;; debug) DFT_ARG_SUFFIX='_g' ;; profile) DFT_ARG_SUFFIX='_p' ;; @@ -6549,10 +7046,11 @@ echo "configure:6541: checking default library suffix" >&5 echo "$ac_t""$DFT_ARG_SUFFIX" 1>&6 echo $ac_n "checking default library-dependency suffix""... $ac_c" 1>&6 -echo "configure:6553: checking default library-dependency suffix" >&5 +echo "configure:7050: checking default library-dependency suffix" >&5 case $DFT_LWR_MODEL in + libtool) DFT_DEP_SUFFIX='.la' ;; normal) DFT_DEP_SUFFIX='.a' ;; debug) DFT_DEP_SUFFIX='_g.a' ;; profile) DFT_DEP_SUFFIX='_p.a' ;; @@ -6566,9 +7064,10 @@ echo "configure:6553: checking default library-dependency suffix" >&5 echo "$ac_t""$DFT_DEP_SUFFIX" 1>&6 echo $ac_n "checking default object directory""... $ac_c" 1>&6 -echo "configure:6570: checking default object directory" >&5 +echo "configure:7068: checking default object directory" >&5 case $DFT_LWR_MODEL in + libtool) DFT_OBJ_SUBDIR='obj_lo' ;; normal) DFT_OBJ_SUBDIR='objects' ;; debug) DFT_OBJ_SUBDIR='obj_g' ;; profile) DFT_OBJ_SUBDIR='obj_p' ;; @@ -6576,11 +7075,35 @@ echo "configure:6570: checking default object directory" >&5 esac echo "$ac_t""$DFT_OBJ_SUBDIR" 1>&6 +# libtool thinks it can make c++ shared libraries (perhaps only g++) +echo $ac_n "checking c++ library-dependency suffux""... $ac_c" 1>&6 +echo "configure:7081: checking c++ library-dependency suffux" >&5 +if test "$with_libtool" = "yes"; then + CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX +else + + + case normal in + libtool) CXX_LIB_SUFFIX='.la' ;; + normal) CXX_LIB_SUFFIX='.a' ;; + debug) CXX_LIB_SUFFIX='_g.a' ;; + profile) CXX_LIB_SUFFIX='_p.a' ;; + shared) + case $cf_cv_system_name in + hpux*) CXX_LIB_SUFFIX='.sl' ;; + *) CXX_LIB_SUFFIX='.so' ;; + esac + esac + test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" +fi +echo "$ac_t""$CXX_LIB_SUFFIX" 1>&6 + + TINFO_LIST="$SHLIB_LIST" -test $with_termlib = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" +test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" echo $ac_n "checking where we will install curses.h""... $ac_c" 1>&6 -echo "configure:6584: checking where we will install curses.h" >&5 +echo "configure:7107: checking where we will install curses.h" >&5 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='$(prefix)/include/ncurses'${LIB_SUFFIX} @@ -6594,7 +7117,11 @@ echo "$ac_t""$includedir" 1>&6 ### could override this. if test "$with_termlib" = yes ; then TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}" - TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" + if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" + else + TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" + fi fi PROG_DEPS="$TEST_DEPS" PROG_ARGS="$TEST_ARGS" @@ -6604,11 +7131,15 @@ PROG_ARGS="$TEST_ARGS" echo $ac_n "checking for src modules""... $ac_c" 1>&6 -echo "configure:6608: checking for src modules" >&5 +echo "configure:7135: checking for src modules" >&5 # dependencies and linker-arguments for test-programs TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS" -TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" +if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" +else + TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" +fi # dependencies and linker-arguments for utility-programs PROG_ARGS="$TEST_ARGS" @@ -6640,7 +7171,7 @@ do continue elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then -cf_have_include=`echo $cf_dir | tr '[a-z]' '[A-Z]'` +cf_have_include=`echo "$cf_dir" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <> Makefile <>headers.sh </<\$END\/\$NAME>/" >> \$TMPSED + done + ;; +*) + echo "" >> \$TMPSED + ;; +esac +CF_EOF +else + cat >>headers.sh <//" >> \$TMPSED + NAME=ncurses.h + fi echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED done - rm -f \$TMPSRC - sed -f \$TMPSED \$SRC > \$TMPSRC - eval \$PRG \$TMPSRC \$DST/\$SRC - rm -f \$TMPSRC \$TMPSED ;; *) - eval \$PRG \$SRC \$DST + echo "s///" >> \$TMPSED ;; esac CF_EOF +fi +cat >>headers.sh < \$TMPSRC +NAME=\`basename \$SRC\` +CF_EOF +if test $WITH_CURSES_H != yes; then + cat >>headers.sh <>headers.sh <>$cf_dir/Makefile <>$cf_dir/Makefile for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"` do - echo " @ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(INSTALL_PREFIX)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile - test $i = curses.h && echo " @ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile + echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile + test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile done cat >>$cf_dir/Makefile <>$cf_dir/Makefile - test $i = curses.h && echo " -@ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile + echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile + test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile done fi done diff --git a/configure.in b/configure.in index 0cd345e1..a46fbf1d 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998,1999 Free Software Foundation, Inc. * +dnl Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,15 +28,19 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1996,1997 dnl -dnl $Id: configure.in,v 1.195 2000/07/05 22:24:29 tom Exp $ +dnl $Id: configure.in,v 1.220 2000/10/15 00:54:36 tom Exp $ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.12.971230) -AC_REVISION($Revision: 1.195 $) +dnl +dnl See http://dickey.his.com/autoconf/ for additional information. +dnl +dnl --------------------------------------------------------------------------- +AC_PREREQ(2.13.20000819) +AC_REVISION($Revision: 1.220 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) CF_SUBST_NCURSES_VERSION -CF_CHECK_CACHE +CF_CHECK_CACHE([AC_CANONICAL_SYSTEM]) AC_ARG_WITH(system-type, [ --with-system-type=XXX test: override derived host system-type], [AC_MSG_WARN(overriding system type to $withval) @@ -79,13 +83,16 @@ CF_CFG_DEFAULTS ### Checks for programs. AC_PROG_CC -if test -n "$GCC" ; then -AC_MSG_CHECKING(version of gcc) -eval "$CC --version" +if test "$GCC" = yes ; then + AC_MSG_CHECKING(version of gcc) + eval "$CC --version" fi -if test $host != $build; then - AC_CHECK_PROGS(BUILD_CC, $CC gcc cc) +if test "$host" != $build; then + AC_CHECK_PROGS(BUILD_CC, $CC gcc cc) +else + BUILD_CC="$CC" fi +AC_SUBST(BUILD_CC) AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX @@ -121,8 +128,17 @@ else AC_PROG_CXX popdef([AC_MSG_ERROR])dnl fi + changequote(,)dnl -if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi +if test "$GXX" = yes; then + case "`${CXX-g++} --version`" in + 1*|2.[0-6]*) + GXX=""; CXX=""; ac_cv_prog_gxx=no + cf_cxx_library=no + echo No: templates do not work + ;; + esac +fi changequote([,])dnl AC_MSG_CHECKING(if you want to build C++ binding and demo) @@ -146,18 +162,28 @@ AC_ARG_WITH(progs, [cf_with_progs=yes]) AC_MSG_RESULT($cf_with_progs) +AC_MSG_CHECKING(if you wish to install curses.h) +AC_ARG_WITH(curses-h, + [ --without-curses-h install curses.h as ncurses.h only], + [with_curses_h=$withval], + [with_curses_h=yes]) +AC_MSG_RESULT($with_curses_h) + modules_to_build="ncurses" if test "X$cf_with_progs" != Xno ; then modules_to_build="$modules_to_build progs tack" fi modules_to_build="$modules_to_build panel menu form" +AC_ARG_PROGRAM AC_PROG_AWK AC_PROG_MAKE_SET CF_PROG_INSTALL AC_SYS_LONG_FILE_NAMES +CF_MIXEDCASE_FILENAMES AC_PROG_LN_S AC_PROG_RANLIB +CF_MAKE_TAGS AC_CHECK_PROGS(LINT, tdlint lint alint) AC_CHECK_PROGS(MAN, man man_db) AC_SUBST(LINT_OPTS) @@ -178,14 +204,11 @@ AC_ARG_WITH(install-prefix, [case "$withval" in #(vi yes|no) #(vi ;; - *) INSTALL_PREFIX="$withval" + *) DESTDIR="$withval" ;; esac]) -AC_MSG_RESULT($INSTALL_PREFIX) -AC_SUBST(INSTALL_PREFIX) - -############################################################################### -CF_MAN_PAGES +AC_MSG_RESULT($DESTDIR) +AC_SUBST(DESTDIR) ############################################################################### CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) @@ -196,6 +219,20 @@ CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) cf_list_models="" AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug") +AC_MSG_CHECKING(if you want to build libraries with libtool) +AC_ARG_WITH(libtool, + [ --with-libtool generate libraries with libtool], + [with_libtool=$withval], + [with_libtool=no]) +AC_MSG_RESULT($with_libtool) +if test "$with_libtool" = "yes"; then + cf_list_models="$cf_list_models libtool" + test -z "$LIBTOOL" && LIBTOOL=libtool +else + LIBTOOL="" +fi +AC_SUBST(LIBTOOL) + AC_MSG_CHECKING(if you want to build shared libraries) AC_ARG_WITH(shared, [ --with-shared generate shared-libraries], @@ -232,6 +269,9 @@ test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" AC_MSG_CHECKING(for specified models) test -z "$cf_list_models" && cf_list_models=normal +dnl If we use libtool to generate libraries, then it must be the only +dnl specified model. +test "$with_libtool" = "yes" && cf_list_models=libtool AC_MSG_RESULT($cf_list_models) ### Use the first model as the default, and save its suffix for use in building @@ -275,7 +315,7 @@ AC_ARG_WITH(dbmalloc, [with_dbmalloc=$withval], [with_dbmalloc=no]) AC_MSG_RESULT($with_dbmalloc) -if test $with_dbmalloc = yes ; then +if test "$with_dbmalloc" = yes ; then AC_CHECK_LIB(dbmalloc,debug_malloc) fi @@ -285,7 +325,7 @@ AC_ARG_WITH(dmalloc, [with_dmalloc=$withval], [with_dmalloc=no]) AC_MSG_RESULT($with_dmalloc) -if test $with_dmalloc = yes ; then +if test "$with_dmalloc" = yes ; then AC_CHECK_LIB(dmalloc,dmalloc_debug) fi @@ -296,7 +336,7 @@ AC_ARG_WITH(gpm, [with_gpm=$withval], [with_gpm=no]) AC_MSG_RESULT($with_gpm) -if test $with_gpm = yes ; then +if test "$with_gpm" = yes ; then AC_CHECK_LIB(gpm,Gpm_Open,[ EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS" SHLIB_LIST="-lgpm $SHLIB_LIST" @@ -321,6 +361,7 @@ AC_SUBST(CXX_G_OPT) AC_MSG_CHECKING(for default loader flags) case $DFT_LWR_MODEL in +libtool) LD_MODEL='' ;; normal) LD_MODEL='' ;; debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; @@ -359,10 +400,28 @@ AC_MSG_RESULT($with_overwrite) AC_MSG_CHECKING(if external terminfo-database is used) AC_ARG_ENABLE(database, [ --disable-database use only built-in data], - [with_database=$enableval], - [with_database=yes]) -AC_MSG_RESULT($with_database) -test $with_database != no && AC_DEFINE(USE_DATABASE) + [use_database=$enableval], + [use_database=yes]) +AC_MSG_RESULT($use_database) + +case $host_os in #(vi +os2*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/emx.src' + ;; +*) #(vi + TERMINFO_SRC='${top_srcdir}/misc/terminfo.src' + ;; +esac +AC_SUBST(TERMINFO_SRC) + +if test "$use_database" != no ; then + AC_DEFINE(USE_DATABASE) + AC_MSG_CHECKING(which terminfo source-file will be installed) + AC_ARG_ENABLE(database, + [ --with-database=XXX specify terminfo source to install], + [TERMINFO_SRC=$withval]) + AC_MSG_RESULT($TERMINFO_SRC) +fi AC_MSG_CHECKING(for list of fallback descriptions) AC_ARG_WITH(fallbacks, @@ -373,6 +432,13 @@ AC_MSG_RESULT($with_fallback) FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` AC_SUBST(FALLBACK_LIST) +if test "$use_database" = no ; then + if test -z $with_fallback ; then + AC_ERROR(You have disabled the database w/o specifying fallbacks) + fi + TERMINFO="${datadir}/terminfo" +else + AC_MSG_CHECKING(for list of terminfo directories) CF_WITH_PATHLIST(terminfo-dirs, [ --with-terminfo-dirs=XXX specify list of terminfo directories], @@ -382,12 +448,19 @@ CF_WITH_PATHLIST(terminfo-dirs, AC_MSG_RESULT($TERMINFO_DIRS) test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS") -if test $with_database = no ; then - if test -z $with_fallback ; then - AC_ERROR(You have disabled the database w/o specifying fallbacks) - fi +AC_MSG_CHECKING(for default terminfo directory) +CF_WITH_PATH(default-terminfo-dir, + [ --with-default-terminfo-dir=DIR default terminfo directory], + TERMINFO, + DATADIR/terminfo, + ${datadir}/terminfo) +AC_MSG_RESULT($TERMINFO) +AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO") + fi +AC_SUBST(TERMINFO) + ### use option --disable-big-core to make tic run on small machines ### We need 4Mb, check if we can allocate 50% more than that. AC_MSG_CHECKING(if big-core option selected) @@ -397,7 +470,13 @@ AC_ARG_ENABLE(big-core, [AC_TRY_RUN([ #include #include -int main() { exit(malloc(6000000L) == 0); }], +int main() { + unsigned long n = 6000000L; + char *s = malloc(n); + if (s != 0) + s[0] = s[n-1] = 0; + exit(s == 0); +}], [with_big_core=yes], [with_big_core=no], [with_big_core=no])]) @@ -497,6 +576,9 @@ AC_ARG_WITH(rcs-ids, AC_MSG_RESULT($with_rcs_ids) test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) +############################################################################### +CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) + ############################################################################### CF_HELP_MESSAGE(Extensions:) @@ -508,6 +590,7 @@ AC_ARG_ENABLE(ext-funcs, [with_ext_funcs=yes]) AC_MSG_RESULT($with_ext_funcs) if test "$with_ext_funcs" = yes ; then + AC_DEFINE(HAVE_CURSES_VERSION) AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) @@ -522,22 +605,12 @@ AC_ARG_ENABLE(const, [with_ext_const=$enableval], [with_ext_const=no]) AC_MSG_RESULT($with_ext_const) -NCURSES_CONST="" +NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then - AC_DEFINE(NCURSES_CONST,const) NCURSES_CONST=const fi AC_SUBST(NCURSES_CONST) -### use option --enable-hashmap to turn on use of hashmap scrolling logic -AC_MSG_CHECKING(if you want hashmap scrolling-optimization code) -AC_ARG_ENABLE(hashmap, - [ --enable-hashmap compile with hashmap scrolling-optimization code], - [with_hashmap=$enableval], - [with_hashmap=yes]) -AC_MSG_RESULT($with_hashmap) -test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) - AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code) AC_ARG_ENABLE(no-padding, [ --enable-no-padding compile with \$NCURSES_NO_PADDING code], @@ -567,32 +640,71 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 AC_SUBST(NCURSES_XNAMES) ############################################################################### -CF_HELP_MESSAGE(Experimental Code:) -AC_MSG_CHECKING(if you want all experimental code) +# These options are relatively safe to experiment with. +CF_HELP_MESSAGE(Development Code:) +AC_MSG_CHECKING(if you want all development code) AC_ARG_WITH(develop, - [ --with-develop enable all experimental options for testing], + [ --with-develop enable all development options], [with_develop=$withval], [with_develop=no]) AC_MSG_RESULT($with_develop) ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -AC_MSG_CHECKING(if you want experimental colorfgbg code) +AC_MSG_CHECKING(if you want colorfgbg code) AC_ARG_ENABLE(hard-tabs, - [ --enable-colorfgbg compile with experimental \$COLORFGBG code], + [ --enable-colorfgbg compile with \$COLORFGBG code], [with_colorfgbg=$enableval], [with_colorfgbg=$with_develop]) AC_MSG_RESULT($with_colorfgbg) test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -AC_MSG_CHECKING(if you want experimental hard-tabs code) +AC_MSG_CHECKING(if you want hard-tabs code) AC_ARG_ENABLE(hard-tabs, - [ --enable-hard-tabs compile with experimental hard-tabs code], + [ --enable-hard-tabs compile with hard-tabs code], [with_hardtabs=$enableval], [with_hardtabs=$with_develop]) AC_MSG_RESULT($with_hardtabs) test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS) +AC_MSG_CHECKING(if you want to use restrict environment when running as root) +AC_ARG_ENABLE(root-environ, + [ --disable-root-environ limit environment when running as root], + [with_root_environ=$enableval], + [with_root_environ=yes]) +AC_MSG_RESULT($with_root_environ) +test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON) + +### use option --enable-xmc-glitch to turn on use of magic-cookie optimize +AC_MSG_CHECKING(if you want limited support for xmc) +AC_ARG_ENABLE(xmc-glitch, + [ --enable-xmc-glitch compile with limited support for xmc], + [with_xmc_glitch=$enableval], + [with_xmc_glitch=$with_develop]) +AC_MSG_RESULT($with_xmc_glitch) +test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT) + +############################################################################### +# These are just experimental, probably should not be in a package: +CF_HELP_MESSAGE(Experimental Code:) + +AC_MSG_CHECKING(if you do not want to assume colors are white-on-black) +AC_ARG_ENABLE(assumed-color, + [ --disable-assumed-color do not assume anything about default-colors], + [with_assumed_color=$enableval], + [with_assumed_color=yes]) +AC_MSG_RESULT($with_assumed_color) +test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR) + +### use option --enable-hashmap to turn on use of hashmap scrolling logic +AC_MSG_CHECKING(if you want hashmap scrolling-optimization code) +AC_ARG_ENABLE(hashmap, + [ --disable-hashmap compile without hashmap scrolling-optimization], + [with_hashmap=$enableval], + [with_hashmap=yes]) +AC_MSG_RESULT($with_hashmap) +test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) + AC_MSG_CHECKING(if you want experimental safe-sprintf code) AC_ARG_ENABLE(safe-sprintf, [ --enable-safe-sprintf compile with experimental safe-sprintf code], @@ -616,7 +728,7 @@ fi ### use option --enable-widec to turn on use of wide-character support AC_MSG_CHECKING(if you want experimental wide-character code) AC_ARG_ENABLE(widec, - [ --enable-widec compile with experimental wide-char code], + [ --enable-widec compile with experimental wide-char/UTF-8 code], [with_widec=$enableval], [with_widec=no]) AC_MSG_RESULT($with_widec) @@ -625,19 +737,11 @@ if test "$with_widec" = yes ; then AC_DEFINE(USE_WIDEC_SUPPORT) fi -### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -AC_MSG_CHECKING(if you want experimental xmc code) -AC_ARG_ENABLE(xmc-glitch, - [ --enable-xmc-glitch compile with experimental xmc code], - [with_xmc_glitch=$enableval], - [with_xmc_glitch=$with_develop]) -AC_MSG_RESULT($with_xmc_glitch) -test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT) - ############################################################################### CF_HELP_MESSAGE(Testing/development Options:) ### use option --disable-echo to suppress full display compiling commands +AC_MSG_CHECKING(if you want to display full commands during build) AC_ARG_ENABLE(echo, [ --enable-echo build: display "compiling" commands (default)], [with_echo=$enableval], @@ -646,13 +750,18 @@ if test "$with_echo" = yes; then ECHO_LINK= else ECHO_LINK='@ echo linking $@ ... ;' + test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" fi +AC_MSG_RESULT($with_echo) AC_SUBST(ECHO_LINK) ### use option --enable-warnings to turn on all gcc warnings +AC_MSG_CHECKING(if you want to see compiler warnings) AC_ARG_ENABLE(warnings, [ --enable-warnings build: turn on GCC compiler warnings], [with_warnings=$enableval]) +AC_MSG_RESULT($with_warnings) + if test -n "$with_warnings"; then ADAFLAGS="$ADAFLAGS -gnatg" CF_GCC_WARNINGS @@ -660,13 +769,15 @@ fi CF_GCC_ATTRIBUTES ### use option --enable-assertions to turn on generation of assertion code +AC_MSG_CHECKING(if you want to enable runtime assertions) AC_ARG_ENABLE(assertions, [ --enable-assertions test: turn on generation of assertion code], [with_assertions=$enableval], [with_assertions=no]) +AC_MSG_RESULT($with_assertions) if test -n "$GCC" then - if test $with_assertions = no + if test "$with_assertions" = no then AC_DEFINE(NDEBUG) CPPFLAGS="$CPPFLAGS -DNDEBUG" @@ -678,18 +789,18 @@ fi ### use option --disable-leaks to suppress "permanent" leaks, for testing AC_ARG_ENABLE(leaks, [ --disable-leaks test: suppress permanent memory-leaks], - [test $enableval = no && AC_DEFINE(NO_LEAKS)]) + [test "$enableval" = no && AC_DEFINE(NO_LEAKS)]) AC_DEFINE(HAVE_NC_ALLOC_H) ### use option --enable-expanded to generate certain macros as functions AC_ARG_ENABLE(expanded, [ --enable-expanded test: generate functions for certain macros], - [test $enableval = yes && AC_DEFINE(NCURSES_EXPANDED)]) + [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)]) ### use option --disable-macros to suppress macros in favor of functions AC_ARG_ENABLE(macros, [ --disable-macros test: use functions rather than macros], - [test $enableval = no && AC_DEFINE(NCURSES_NOMACROS)]) + [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)]) ### Checks for libraries. AC_CHECK_FUNC(gettimeofday, @@ -722,8 +833,6 @@ sys/poll.h \ sys/select.h \ sys/time.h \ sys/times.h \ -termio.h \ -termios.h \ ttyent.h \ unistd.h \ ) @@ -733,7 +842,6 @@ unistd.h \ if test "$ISC" = yes ; then AC_CHECK_LIB(cposix,main) AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()' - AC_CHECK_HEADERS( sys/termio.h ) fi CF_SYS_TIME_SELECT @@ -742,7 +850,7 @@ CF_SYS_TIME_SELECT AC_LANG_C AC_C_CONST AC_C_INLINE -test $ac_cv_c_inline != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) +test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) CF_TYPEOF_CHTYPE CF_WIDEC_SHIFT @@ -750,12 +858,14 @@ CF_WIDEC_SHIFT ### Checks for external-data CF_ERRNO CF_LINK_DATAONLY -CF_SPEED_TYPE ### Checks for library functions. AC_CHECK_FUNCS( \ getcwd \ +getegid \ +geteuid \ getttynam \ +issetugid \ memccpy \ mkstemp \ nanosleep \ @@ -769,7 +879,6 @@ sigaction \ sigvec \ strdup \ strstr \ -tcgetattr \ tcgetpgrp \ times \ vfscanf \ @@ -782,7 +891,7 @@ fi CF_ISASCII CF_STRUCT_SIGACTION -CF_STRUCT_TERMIOS +CF_FUNC_TERMIOS dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS if test "$cross_compiling" = yes ; then @@ -807,17 +916,21 @@ CF_BOOL_DECL(cf_cv_cc_bool_type) if test -n "$CXX" ; then AC_LANG_CPLUSPLUS CF_STDCPP_LIBRARY - case "`${CXX-g++} --version`" in - 1*|2.[0-6]*) - cf_cxx_library=yes - ;; - 2.7*) - CF_GPP_LIBRARY - ;; - *) - cf_cxx_library=no - ;; - esac + if test "$GXX" = yes; then + case "`${CXX-g++} --version`" in + 1*|2.[0-6]*) + cf_cxx_library=yes + ;; + 2.7*) + CF_GPP_LIBRARY + ;; + *) + cf_cxx_library=no + ;; + esac + else + cf_cxx_library=no + fi AC_CHECK_HEADERS(typeinfo) CF_BOOL_DECL CF_BOOL_SIZE @@ -862,8 +975,8 @@ if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else CF_GNAT_VERSION - AC_CHECK_PROG(m4_exists, m4, yes, no) - if test "$ac_cv_prog_m4_exists" = no; then + AC_CHECK_PROG(M4_exists, m4, yes, no) + if test "$ac_cv_prog_M4_exists" = no; then cf_cv_prog_gnat_correct=no echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi @@ -885,7 +998,7 @@ if test "$cf_cv_prog_gnat_correct" = yes; then ADAFLAGS="-O3 -gnatpn $ADAFLAGS" AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD Specify Ada95 compiler command (default gnatmake)], + [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], [cf_ada_compiler=$withval], [cf_ada_compiler=gnatmake]) @@ -912,11 +1025,6 @@ if test "$cf_cv_prog_gnat_correct" = yes; then [$]prefix/lib/ada/adalib) AC_SUBST(ADA_OBJECTS) -# This has been fixed! -# if test $with_shared = no -# then -# AC_MSG_WARN(Ada95 applications will not link properly with static libraries) -# fi fi fi @@ -924,7 +1032,7 @@ fi ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too ### badly to consider using for development purposes, but 2.5.8 is okay. if test -n "$with_warnings"; then - if test -n "$GCC"; then + if test "$GCC" = yes; then case "`$CC --version`" in 2.6.3) if test "$cf_cv_type_of_bool" != "char"; then @@ -977,8 +1085,18 @@ CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj") AC_MSG_RESULT($DFT_OBJ_SUBDIR) +# libtool thinks it can make c++ shared libraries (perhaps only g++) +AC_MSG_CHECKING(c++ library-dependency suffux) +if test "$with_libtool" = "yes"; then + CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX +else + CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library +fi +AC_MSG_RESULT($CXX_LIB_SUFFIX) +AC_SUBST(CXX_LIB_SUFFIX) + TINFO_LIST="$SHLIB_LIST" -test $with_termlib = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" +test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" AC_MSG_CHECKING(where we will install curses.h) test "$with_overwrite" = no && \ @@ -994,7 +1112,11 @@ AC_SUBST(SHLIB_LIST) ### could override this. if test "$with_termlib" = yes ; then TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}" - TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" + if test "$DFT_LWR_MODEL" = "libtool"; then + TEST_ARGS="${TEST_DEPS}" + else + TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" + fi fi PROG_DEPS="$TEST_DEPS" PROG_ARGS="$TEST_ARGS" @@ -1014,6 +1136,7 @@ AC_OUTPUT( \ include/curses.h \ include/termcap.h \ include/unctrl.h \ + misc/run_tic.sh:misc/run_tic.in \ $SUB_MAKEFILES \ Makefile,[ CF_LIB_RULES @@ -1030,9 +1153,11 @@ LIB_SUFFIX="$LIB_SUFFIX" LIB_SUBSETS="$LIB_SUBSETS" LIB_TRACING="$LIB_TRACING" SRC_SUBDIRS="$SRC_SUBDIRS" +TERMINFO="$TERMINFO" TINFO_NAME="$TINFO_NAME" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" +WITH_CURSES_H="$with_curses_h" cf_cv_abi_version="$cf_cv_abi_version" cf_cv_do_symlinks="$cf_cv_do_symlinks" cf_cv_rel_version="$cf_cv_rel_version" diff --git a/convert_configure.pl b/convert_configure.pl index 9d1026d1..dea92ca5 100644 --- a/convert_configure.pl +++ b/convert_configure.pl @@ -8,47 +8,83 @@ extproc perl -S -w # # run the result like this: # .\configure -; + +# Some frequent manual intervention: +# a) Some makefiles hardwire SHELL = /bin/sh ==> change to: sh +# b) Some makefiles recognize that exe files terminate on .exe +# You need to give this script -no-zexe option... + +shift, $no_zexe = 1 if @ARGV and $ARGV[0] eq '-no-zexe'; mkdir '/tmp', 0777 unless -d '/tmp'; print <) { - if (/for\s+(\w+)\s+in\s*\$PATH\s*;/) { + if (/for\s+(\w+)\s+in\s*\$(PATH|ac_dummy)\s*;/) { $checking_path = 1; $varname = $1; $subst= < $@ -# Note that this rule assumes the manpages were installed - it does not use -# the copies in the build tree except to get the list of names. +MANPROG = tbl | nroff -man + manhtml: MANIFEST @rm -f doc/html/man/*.html @mkdir -p doc/html/man @@ -70,7 +70,7 @@ manhtml: MANIFEST g=$${m}.html ;\ if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\ echo "Converting $$m to HTML" ;\ - man $$f | tr '\255' '-' | $(MAN2HTML) | \ + man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) | \ sed -f subst.sed |\ sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \ > doc/html/man/$$g ;\ diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm index 3296a66e..74d986bf 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm @@ -49,13 +49,13 @@ use type Interfaces.C.int; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Alpha_Field) is C_Alpha_Field_Type : C_Field_Type; pragma Import (C, C_Alpha_Field_Type, "TYPE_ALPHA"); - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_Alpha_Field_Type; Arg1 : C_Int) return C_Int; pragma Import (C, Set_Fld_Type, "set_field_type"); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm index a16a211b..87c2ce06 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm @@ -42,15 +42,15 @@ -- @Revision: 1.9 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -package Terminal_Interface.Curses.Forms.Field_Types.Alpha is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha); +package Terminal_Interface.Curses.Forms.Field_Types.Alpha is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha); type Alpha_Field is new Field_Type with record Minimum_Field_Width : Natural := 0; end record; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Alpha_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm index c7aaa2d1..ffe72eb6 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm @@ -49,13 +49,13 @@ use type Interfaces.C.int; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in AlphaNumeric_Field) is C_AlphaNumeric_Field_Type : C_Field_Type; pragma Import (C, C_AlphaNumeric_Field_Type, "TYPE_ALNUM"); - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_AlphaNumeric_Field_Type; Arg1 : C_Int) return C_Int; pragma Import (C, Set_Fld_Type, "set_field_type"); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm index d1302308..9b3c527e 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm @@ -42,16 +42,16 @@ -- @Revision: 1.9 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is +package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric); + (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric); type AlphaNumeric_Field is new Field_Type with record Minimum_Field_Width : Natural := 0; end record; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in AlphaNumeric_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm index a4307d56..b5b9b02a 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm @@ -74,11 +74,11 @@ return Create (I, True); end Create; - function Value (Fld : Field; - Buf : Buffer_Number := Buffer_Number'First) return T + function Value (Fld : Field; + Buf : Buffer_Number := Buffer_Number'First) return T is begin - return T'Value (Get_Buffer (Fld, Buf)); + return T'Value (Get_Buffer (Fld, Buf)); end Value; end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm index d853ce40..8a667b7c 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm @@ -45,17 +45,17 @@ generic type T is (<>); -package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is +package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); + (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); function Create (Set : Type_Set := Mixed_Case; Case_Sensitive : Boolean := False; Must_Be_Unique : Boolean := False) return Enumeration_Field; - function Value (Fld : Field; - Buf : Buffer_Number := Buffer_Number'First) return T; + function Value (Fld : Field; + Buf : Buffer_Number := Buffer_Number'First) return T; -- Translate the content of the fields buffer - indicated by the -- buffer number - into an enumeration value. If the buffer is empty -- or the content is invalid, a Constraint_Error is raises. diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm index 5096357b..6e4ce430 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm @@ -65,7 +65,7 @@ E.Arr := new chars_ptr_array (size_t (1) .. L); for I in 1 .. Positive (L - 1) loop if Info.Names (I) = null then - raise Form_Exception; + raise Form_Exception; end if; E.Arr (size_t (I)) := New_String (Info.Names (I).all); if Auto_Release_Names then @@ -85,20 +85,20 @@ loop P := Enum.Arr (I); exit when P = Null_Ptr; - Free (P); + Free (P); Enum.Arr (I) := Null_Ptr; I := I + 1; end loop; Enum.Arr := null; end Release; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Enumeration_Field) is C_Enum_Type : C_Field_Type; pragma Import (C, C_Enum_Type, "TYPE_ENUM"); - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_Enum_Type; Arg1 : chars_ptr_array; Arg2 : C_Int; @@ -108,7 +108,7 @@ Res : Eti_Error; begin if Typ.Arr = null then - raise Form_Exception; + raise Form_Exception; end if; Res := Set_Fld_Type (Arg1 => Typ.Arr.all, Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)), diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm index 0cda472c..0aff7745 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm @@ -44,9 +44,9 @@ ------------------------------------------------------------------------------ with Interfaces.C.Strings; -package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is +package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.Enumeration); + (Terminal_Interface.Curses.Forms.Field_Types.Enumeration); type String_Access is access String; @@ -85,7 +85,7 @@ -- The next type defintions are all ncurses extensions. They are typically -- not available in other curses implementations. - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Enumeration_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm index fadb9370..1f98bd71 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm @@ -49,13 +49,13 @@ use type Interfaces.C.int; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Integer_Field) is C_Integer_Field_Type : C_Field_Type; pragma Import (C, C_Integer_Field_Type, "TYPE_INTEGER"); - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_Integer_Field_Type; Arg1 : C_Int; Arg2 : C_Long_Int; diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm index a227bc7b..d72b8b80 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm @@ -42,8 +42,8 @@ -- @Revision: 1.9 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -package Terminal_Interface.Curses.Forms.Field_Types.IntField is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField); +package Terminal_Interface.Curses.Forms.Field_Types.IntField is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField); type Integer_Field is new Field_Type with record @@ -52,7 +52,7 @@ Upper_Limit : Integer; end record; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Integer_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm index 58e84d3a..dc79cc71 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm @@ -49,13 +49,13 @@ use type Interfaces.C.int; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Internet_V4_Address_Field) is C_IPV4_Field_Type : C_Field_Type; pragma Import (C, C_IPV4_Field_Type, "TYPE_IPV4"); - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_IPV4_Field_Type) return C_Int; pragma Import (C, Set_Fld_Type, "set_field_type"); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm index 1954baae..f270ad6e 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm @@ -42,13 +42,13 @@ -- @Revision: 1.9 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is +package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address); + (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address); type Internet_V4_Address_Field is new Field_Type with null record; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Internet_V4_Address_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm index 914c70da..e6d07424 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm @@ -49,7 +49,7 @@ use type Interfaces.C.int; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Numeric_Field) is type Double is new Interfaces.C.double; @@ -57,7 +57,7 @@ C_Numeric_Field_Type : C_Field_Type; pragma Import (C, C_Numeric_Field_Type, "TYPE_NUMERIC"); - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_Numeric_Field_Type; Arg1 : C_Int; Arg2 : Double; diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm index 401fedf5..2f1edfd9 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm @@ -42,8 +42,8 @@ -- @Revision: 1.9 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -package Terminal_Interface.Curses.Forms.Field_Types.Numeric is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric); +package Terminal_Interface.Curses.Forms.Field_Types.Numeric is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric); type Numeric_Field is new Field_Type with record @@ -52,7 +52,7 @@ Upper_Limit : Float; end record; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Numeric_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm index 9c082551..44d88602 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm @@ -47,7 +47,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Regular_Expression_Field) is type Char_Ptr is access all Interfaces.C.char; @@ -55,7 +55,7 @@ C_Regexp_Field_Type : C_Field_Type; pragma Import (C, C_Regexp_Field_Type, "TYPE_REGEXP"); - function Set_Ftyp (F : Field := Fld; + function Set_Ftyp (F : Field := Fld; Cft : C_Field_Type := C_Regexp_Field_Type; Arg1 : Char_Ptr) return C_Int; pragma Import (C, Set_Ftyp, "set_field_type"); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm index b3bcf716..e716502f 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm @@ -42,8 +42,8 @@ -- @Revision: 1.9 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -package Terminal_Interface.Curses.Forms.Field_Types.RegExp is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp); +package Terminal_Interface.Curses.Forms.Field_Types.RegExp is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp); type String_Access is access String; @@ -52,7 +52,7 @@ Regular_Expression : String_Access; end record; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in Regular_Expression_Field); pragma Inline (Set_Field_Type); diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm index da6dca45..d9a59b24 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm @@ -53,7 +53,7 @@ function To_Argument_Access is new Ada.Unchecked_Conversion (System.Address, Argument_Access); - function Generic_Next (Fld : Field; + function Generic_Next (Fld : Field; Usr : System.Address) return C_Int is Result : Boolean; @@ -65,7 +65,7 @@ return C_Int (Boolean'Pos (Result)); end Generic_Next; - function Generic_Prev (Fld : Field; + function Generic_Prev (Fld : Field; Usr : System.Address) return C_Int is Result : Boolean; @@ -88,7 +88,7 @@ T := New_Fieldtype (Generic_Field_Check'Access, Generic_Char_Check'Access); if T = Null_Field_Type then - raise Form_Exception; + raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm index 497eee30..dde056ec 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm @@ -44,9 +44,9 @@ ------------------------------------------------------------------------------ with Interfaces.C; -package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is +package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.User.Choice); + (Terminal_Interface.Curses.Forms.Field_Types.User.Choice); use type Interfaces.C.int; subtype C_Int is Interfaces.C.int; @@ -62,14 +62,14 @@ User_Defined_Field_Type_With_Choice'Class; function Next - (Fld : Field; + (Fld : Field; Typ : User_Defined_Field_Type_With_Choice) return Boolean is abstract; -- If True is returned, the function successfully generated a next -- value into the fields buffer. function Previous - (Fld : Field; + (Fld : Field; Typ : User_Defined_Field_Type_With_Choice) return Boolean is abstract; -- If True is returned, the function successfully generated a previous @@ -83,14 +83,14 @@ function C_Generic_Choice return C_Field_Type; - function Generic_Next (Fld : Field; + function Generic_Next (Fld : Field; Usr : System.Address) return C_Int; pragma Convention (C, Generic_Next); -- This is the generic next Choice_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivates. It routes -- the call to the Next implementation for the type. - function Generic_Prev (Fld : Field; + function Generic_Prev (Fld : Field; Usr : System.Address) return C_Int; pragma Convention (C, Generic_Prev); -- This is the generic prev Choice_Function for the low-level fieldtype diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm index 4e54495c..95dfeda8 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm @@ -50,13 +50,13 @@ use type Interfaces.C.int; - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in User_Defined_Field_Type) is function Allocate_Arg (T : User_Defined_Field_Type'Class) return Argument_Access; - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_Generic_Type; Arg1 : Argument_Access) return C_Int; @@ -84,7 +84,7 @@ function To_Argument_Access is new Ada.Unchecked_Conversion (System.Address, Argument_Access); - function Generic_Field_Check (Fld : Field; + function Generic_Field_Check (Fld : Field; Usr : System.Address) return C_Int is Result : Boolean; @@ -117,7 +117,7 @@ T := New_Fieldtype (Generic_Field_Check'Access, Generic_Char_Check'Access); if T = Null_Field_Type then - raise Form_Exception; + raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm index 77f09bdb..9be4226a 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm @@ -44,8 +44,8 @@ ------------------------------------------------------------------------------ with Interfaces.C; -package Terminal_Interface.Curses.Forms.Field_Types.User is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User); +package Terminal_Interface.Curses.Forms.Field_Types.User is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User); use type Interfaces.C.int; subtype C_Int is Interfaces.C.int; @@ -58,7 +58,7 @@ User_Defined_Field_Type'Class; function Field_Check - (Fld : Field; + (Fld : Field; Typ : User_Defined_Field_Type) return Boolean is abstract; -- If True is returned, the field is considered valid, otherwise it is @@ -71,7 +71,7 @@ -- If True is returned, the character is considered as valid for the -- field, otherwise as invalid. - procedure Set_Field_Type (Fld : in Field; + procedure Set_Field_Type (Fld : in Field; Typ : in User_Defined_Field_Type); -- This should work for all types derived from User_Defined_Field_Type. -- No need to reimplement it for your derived type. @@ -84,7 +84,7 @@ function C_Generic_Type return C_Field_Type; - function Generic_Field_Check (Fld : Field; + function Generic_Field_Check (Fld : Field; Usr : System.Address) return C_Int; pragma Convention (C, Generic_Field_Check); -- This is the generic Field_Check_Function for the low-level fieldtype diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm index b721bc11..48c7ee4d 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm @@ -59,10 +59,10 @@ function To_Argument_Access is new Ada.Unchecked_Conversion (System.Address, Argument_Access); - function Get_Fieldtype (F : Field) return C_Field_Type; + function Get_Fieldtype (F : Field) return C_Field_Type; pragma Import (C, Get_Fieldtype, "field_type"); - function Get_Arg (F : Field) return System.Address; + function Get_Arg (F : Field) return System.Address; pragma Import (C, Get_Arg, "field_arg"); -- | -- |===================================================================== @@ -71,7 +71,7 @@ -- | -- | -- | - function Get_Type (Fld : in Field) return Field_Type_Access + function Get_Type (Fld : in Field) return Field_Type_Access is Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); Arg : Argument_Access; @@ -85,12 +85,12 @@ Low_Level = M_Generic_Choice then Arg := To_Argument_Access (Get_Arg (Fld)); if Arg = null then - raise Form_Exception; + raise Form_Exception; else return Arg.Typ; end if; else - raise Form_Exception; + raise Form_Exception; end if; end if; end Get_Type; @@ -144,7 +144,7 @@ end Free_Arg; - procedure Wrap_Builtin (Fld : Field; + procedure Wrap_Builtin (Fld : Field; Typ : Field_Type'Class; Cft : C_Field_Type := C_Builtin_Router) is @@ -152,7 +152,7 @@ Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); Arg : Argument_Access; Res : Eti_Error; - function Set_Fld_Type (F : Field := Fld; + function Set_Fld_Type (F : Field := Fld; Cf : C_Field_Type := Cft; Arg1 : Argument_Access) return C_Int; pragma Import (C, Set_Fld_Type, "set_field_type"); @@ -160,7 +160,7 @@ begin pragma Assert (Low_Level /= Null_Field_Type); if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then - raise Form_Exception; + raise Form_Exception; else Arg := new Argument'(Usr => System.Null_Address, Typ => new Field_Type'Class'(Typ), @@ -180,7 +180,7 @@ end if; end Wrap_Builtin; - function Field_Check_Router (Fld : Field; + function Field_Check_Router (Fld : Field; Usr : System.Address) return C_Int is Arg : constant Argument_Access := To_Argument_Access (Usr); @@ -208,7 +208,7 @@ end if; end Char_Check_Router; - function Next_Router (Fld : Field; + function Next_Router (Fld : Field; Usr : System.Address) return C_Int is Arg : constant Argument_Access := To_Argument_Access (Usr); @@ -222,7 +222,7 @@ end if; end Next_Router; - function Prev_Router (Fld : Field; + function Prev_Router (Fld : Field; Usr : System.Address) return C_Int is Arg : constant Argument_Access := To_Argument_Access (Usr); @@ -247,7 +247,7 @@ T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then - raise Form_Exception; + raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, @@ -274,7 +274,7 @@ T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then - raise Form_Exception; + raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, diff --git a/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm index 5f35c1be..c5fd816a 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm @@ -55,10 +55,10 @@ -- | use type Interfaces.C.int; - procedure Set_User_Data (Fld : in Field; + procedure Set_User_Data (Fld : in Field; Data : in User_Access) is - function Set_Field_Userptr (Fld : Field; + function Set_Field_Userptr (Fld : Field; Usr : User_Access) return C_Int; pragma Import (C, Set_Field_Userptr, "set_field_userptr"); @@ -71,15 +71,15 @@ -- | -- | -- | - function Get_User_Data (Fld : in Field) return User_Access + function Get_User_Data (Fld : in Field) return User_Access is - function Field_Userptr (Fld : Field) return User_Access; + function Field_Userptr (Fld : Field) return User_Access; pragma Import (C, Field_Userptr, "field_userptr"); begin return Field_Userptr (Fld); end Get_User_Data; - procedure Get_User_Data (Fld : in Field; + procedure Get_User_Data (Fld : in Field; Data : out User_Access) is begin diff --git a/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm index d5ae92d5..07e56436 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm @@ -46,7 +46,7 @@ generic type User is limited private; - type User_Access is access User; + type User_Access is access User; package Terminal_Interface.Curses.Forms.Field_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data); diff --git a/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm index c9c148ce..46d298a5 100644 --- a/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm @@ -56,10 +56,10 @@ -- | -- | -- | - procedure Set_User_Data (Frm : in Form; + procedure Set_User_Data (Frm : in Form; Data : in User_Access) is - function Set_Form_Userptr (Frm : Form; + function Set_Form_Userptr (Frm : Form; Data : User_Access) return C_Int; pragma Import (C, Set_Form_Userptr, "set_form_userptr"); @@ -72,15 +72,15 @@ -- | -- | -- | - function Get_User_Data (Frm : in Form) return User_Access + function Get_User_Data (Frm : in Form) return User_Access is - function Form_Userptr (Frm : Form) return User_Access; + function Form_Userptr (Frm : Form) return User_Access; pragma Import (C, Form_Userptr, "form_userptr"); begin return Form_Userptr (Frm); end Get_User_Data; - procedure Get_User_Data (Frm : in Form; + procedure Get_User_Data (Frm : in Form; Data : out User_Access) is begin diff --git a/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm index 56649622..3f03f43c 100644 --- a/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm @@ -46,7 +46,7 @@ generic type User is limited private; - type User_Access is access User; + type User_Access is access User; package Terminal_Interface.Curses.Forms.Form_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data); diff --git a/doc/html/ada/terminal_interface-curses-forms__adb.htm b/doc/html/ada/terminal_interface-curses-forms__adb.htm index d8848ece..087bf559 100644 --- a/doc/html/ada/terminal_interface-curses-forms__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms__adb.htm @@ -51,13 +51,13 @@ with Terminal_Interface.Curses.Aux; -package body Terminal_Interface.Curses.Forms is +package body Terminal_Interface.Curses.Forms is use Terminal_Interface.Curses.Aux; - type C_Field_Array is array (Natural range <>) of aliased Field; + type C_Field_Array is array (Natural range <>) of aliased Field; package F_Array is new - Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field); + Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field); ------------------------------------------------------------------------------ -- | @@ -66,36 +66,36 @@ -- subtype chars_ptr is Interfaces.C.Strings.chars_ptr; function FOS_2_CInt is new - Ada.Unchecked_Conversion (Field_Option_Set, + Ada.Unchecked_Conversion (Field_Option_Set, C_Int); function CInt_2_FOS is new Ada.Unchecked_Conversion (C_Int, - Field_Option_Set); + Field_Option_Set); function FrmOS_2_CInt is new - Ada.Unchecked_Conversion (Form_Option_Set, + Ada.Unchecked_Conversion (Form_Option_Set, C_Int); function CInt_2_FrmOS is new Ada.Unchecked_Conversion (C_Int, - Form_Option_Set); + Form_Option_Set); - procedure Request_Name (Key : in Form_Request_Code; - Name : out String) + procedure Request_Name (Key : in Form_Request_Code; + Name : out String) is function Form_Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Form_Request_Name, "form_request_name"); begin - Fill_String (Form_Request_Name (C_Int (Key)), Name); + Fill_String (Form_Request_Name (C_Int (Key)), Name); end Request_Name; - function Request_Name (Key : Form_Request_Code) return String + function Request_Name (Key : Form_Request_Code) return String is function Form_Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Form_Request_Name, "form_request_name"); begin - return Fill_String (Form_Request_Name (C_Int (Key))); + return Fill_String (Form_Request_Name (C_Int (Key))); end Request_Name; ------------------------------------------------------------------------------ -- | @@ -108,81 +108,81 @@ -- | -- | -- | - function Create (Height : Line_Count; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0; - More_Buffers : Buffer_Number := Buffer_Number'First) - return Field + function Create (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field is - function Newfield (H, W, T, L, O, M : C_Int) return Field; + function Newfield (H, W, T, L, O, M : C_Int) return Field; pragma Import (C, Newfield, "new_field"); - Fld : constant Field := Newfield (C_Int (Height), C_Int (Width), - C_Int (Top), C_Int (Left), - C_Int (Off_Screen), - C_Int (More_Buffers)); + Fld : constant Field := Newfield (C_Int (Height), C_Int (Width), + C_Int (Top), C_Int (Left), + C_Int (Off_Screen), + C_Int (More_Buffers)); begin - if Fld = Null_Field then - raise Form_Exception; + if Fld = Null_Field then + raise Form_Exception; end if; return Fld; end Create; -- | -- | -- | - procedure Delete (Fld : in out Field) + procedure Delete (Fld : in out Field) is - function Free_Field (Fld : Field) return C_Int; + function Free_Field (Fld : Field) return C_Int; pragma Import (C, Free_Field, "free_field"); Res : Eti_Error; begin - Res := Free_Field (Fld); + Res := Free_Field (Fld); if Res /= E_Ok then Eti_Exception (Res); end if; - Fld := Null_Field; + Fld := Null_Field; end Delete; -- | -- | -- | - function Duplicate (Fld : Field; - Top : Line_Position; - Left : Column_Position) return Field + function Duplicate (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field is - function Dup_Field (Fld : Field; + function Dup_Field (Fld : Field; Top : C_Int; - Left : C_Int) return Field; + Left : C_Int) return Field; pragma Import (C, Dup_Field, "dup_field"); - F : constant Field := Dup_Field (Fld, - C_Int (Top), - C_Int (Left)); + F : constant Field := Dup_Field (Fld, + C_Int (Top), + C_Int (Left)); begin - if F = Null_Field then - raise Form_Exception; + if F = Null_Field then + raise Form_Exception; end if; return F; end Duplicate; -- | -- | -- | - function Link (Fld : Field; - Top : Line_Position; - Left : Column_Position) return Field + function Link (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field is - function Lnk_Field (Fld : Field; + function Lnk_Field (Fld : Field; Top : C_Int; - Left : C_Int) return Field; + Left : C_Int) return Field; pragma Import (C, Lnk_Field, "link_field"); - F : constant Field := Lnk_Field (Fld, - C_Int (Top), - C_Int (Left)); + F : constant Field := Lnk_Field (Fld, + C_Int (Top), + C_Int (Left)); begin - if F = Null_Field then - raise Form_Exception; + if F = Null_Field then + raise Form_Exception; end if; return F; end Link; @@ -193,16 +193,16 @@ -- | -- | -- | - procedure Set_Justification (Fld : in Field; - Just : in Field_Justification := None) + procedure Set_Justification (Fld : in Field; + Just : in Field_Justification := None) is - function Set_Field_Just (Fld : Field; + function Set_Field_Just (Fld : Field; Just : C_Int) return C_Int; pragma Import (C, Set_Field_Just, "set_field_just"); Res : constant Eti_Error := - Set_Field_Just (Fld, - C_Int (Field_Justification'Pos (Just))); + Set_Field_Just (Fld, + C_Int (Field_Justification'Pos (Just))); begin if Res /= E_Ok then Eti_Exception (Res); @@ -211,12 +211,12 @@ -- | -- | -- | - function Get_Justification (Fld : Field) return Field_Justification + function Get_Justification (Fld : Field) return Field_Justification is - function Field_Just (Fld : Field) return C_Int; + function Field_Just (Fld : Field) return C_Int; pragma Import (C, Field_Just, "field_just"); begin - return Field_Justification'Val (Field_Just (Fld)); + return Field_Justification'Val (Field_Just (Fld)); end Get_Justification; -- | -- |===================================================================== @@ -225,24 +225,24 @@ -- | -- | -- | - procedure Set_Buffer - (Fld : in Field; - Buffer : in Buffer_Number := Buffer_Number'First; - Str : in String) + procedure Set_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : in String) is type Char_Ptr is access all Interfaces.C.char; - function Set_Fld_Buffer (Fld : Field; + function Set_Fld_Buffer (Fld : Field; Bufnum : C_Int; S : Char_Ptr) return C_Int; pragma Import (C, Set_Fld_Buffer, "set_field_buffer"); - Txt : char_array (0 .. Str'Length); + Txt : char_array (0 .. Str'Length); Len : size_t; Res : Eti_Error; begin - To_C (Str, Txt, Len); - Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access); + To_C (Str, Txt, Len); + Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access); if Res /= E_Ok then Eti_Exception (Res); end if; @@ -250,53 +250,53 @@ -- | -- | -- | - procedure Get_Buffer - (Fld : in Field; - Buffer : in Buffer_Number := Buffer_Number'First; - Str : out String) + procedure Get_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : out String) is - function Field_Buffer (Fld : Field; + function Field_Buffer (Fld : Field; B : C_Int) return chars_ptr; pragma Import (C, Field_Buffer, "field_buffer"); begin - Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str); + Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str); end Get_Buffer; - function Get_Buffer - (Fld : in Field; - Buffer : in Buffer_Number := Buffer_Number'First) return String + function Get_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First) return String is - function Field_Buffer (Fld : Field; + function Field_Buffer (Fld : Field; B : C_Int) return chars_ptr; pragma Import (C, Field_Buffer, "field_buffer"); begin - return Fill_String (Field_Buffer (Fld, C_Int (Buffer))); + return Fill_String (Field_Buffer (Fld, C_Int (Buffer))); end Get_Buffer; -- | -- | -- | - procedure Set_Status (Fld : in Field; - Status : in Boolean := True) + procedure Set_Status (Fld : in Field; + Status : in Boolean := True) is - function Set_Fld_Status (Fld : Field; + function Set_Fld_Status (Fld : Field; St : C_Int) return C_Int; pragma Import (C, Set_Fld_Status, "set_field_status"); - Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status)); + Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status)); begin if Res /= E_Ok then - raise Form_Exception; + raise Form_Exception; end if; end Set_Status; -- | -- | -- | - function Changed (Fld : Field) return Boolean + function Changed (Fld : Field) return Boolean is - function Field_Status (Fld : Field) return C_Int; + function Field_Status (Fld : Field) return C_Int; pragma Import (C, Field_Status, "field_status"); - Res : constant C_Int := Field_Status (Fld); + Res : constant C_Int := Field_Status (Fld); begin if Res = Curses_False then return False; @@ -307,14 +307,14 @@ -- | -- | -- | - procedure Set_Maximum_Size (Fld : in Field; - Max : in Natural := 0) + procedure Set_Maximum_Size (Fld : in Field; + Max : in Natural := 0) is - function Set_Field_Max (Fld : Field; + function Set_Field_Max (Fld : Field; M : C_Int) return C_Int; pragma Import (C, Set_Field_Max, "set_max_field"); - Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max)); + Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -327,17 +327,17 @@ -- | -- | -- | - procedure Set_Options (Fld : in Field; - Options : in Field_Option_Set) + procedure Set_Options (Fld : in Field; + Options : in Field_Option_Set) is - function Set_Field_Opts (Fld : Field; + function Set_Field_Opts (Fld : Field; Opt : C_Int) return C_Int; pragma Import (C, Set_Field_Opts, "set_field_opts"); - Opt : C_Int := FOS_2_CInt (Options); + Opt : C_Int := FOS_2_CInt (Options); Res : Eti_Error; begin - Res := Set_Field_Opts (Fld, Opt); + Res := Set_Field_Opts (Fld, Opt); if Res /= E_Ok then Eti_Exception (Res); end if; @@ -345,24 +345,24 @@ -- | -- | -- | - procedure Switch_Options (Fld : in Field; - Options : in Field_Option_Set; - On : Boolean := True) + procedure Switch_Options (Fld : in Field; + Options : in Field_Option_Set; + On : Boolean := True) is - function Field_Opts_On (Fld : Field; + function Field_Opts_On (Fld : Field; Opt : C_Int) return C_Int; pragma Import (C, Field_Opts_On, "field_opts_on"); - function Field_Opts_Off (Fld : Field; + function Field_Opts_Off (Fld : Field; Opt : C_Int) return C_Int; pragma Import (C, Field_Opts_Off, "field_opts_off"); Err : Eti_Error; - Opt : C_Int := FOS_2_CInt (Options); + Opt : C_Int := FOS_2_CInt (Options); begin - if On then - Err := Field_Opts_On (Fld, Opt); + if On then + Err := Field_Opts_On (Fld, Opt); else - Err := Field_Opts_Off (Fld, Opt); + Err := Field_Opts_Off (Fld, Opt); end if; if Err /= E_Ok then Eti_Exception (Err); @@ -371,25 +371,25 @@ -- | -- | -- | - procedure Get_Options (Fld : in Field; - Options : out Field_Option_Set) + procedure Get_Options (Fld : in Field; + Options : out Field_Option_Set) is - function Field_Opts (Fld : Field) return C_Int; + function Field_Opts (Fld : Field) return C_Int; pragma Import (C, Field_Opts, "field_opts"); - Res : C_Int := Field_Opts (Fld); + Res : C_Int := Field_Opts (Fld); begin - Options := CInt_2_FOS (Res); + Options := CInt_2_FOS (Res); end Get_Options; -- | -- | -- | - function Get_Options (Fld : Field := Null_Field) - return Field_Option_Set + function Get_Options (Fld : Field := Null_Field) + return Field_Option_Set is - Fos : Field_Option_Set; + Fos : Field_Option_Set; begin - Get_Options (Fld, Fos); + Get_Options (Fld, Fos); return Fos; end Get_Options; -- | @@ -399,20 +399,20 @@ -- | -- | -- | - procedure Set_Foreground - (Fld : in Field; - Fore : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + procedure Set_Foreground + (Fld : in Field; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) is - function Set_Field_Fore (Fld : Field; + function Set_Field_Fore (Fld : Field; Attr : C_Chtype) return C_Int; pragma Import (C, Set_Field_Fore, "set_field_fore"); Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Fore); + Color => Color, + Attr => Fore); Res : constant Eti_Error := - Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch)); + Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -421,42 +421,42 @@ -- | -- | -- | - procedure Foreground (Fld : in Field; - Fore : out Character_Attribute_Set) + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set) is - function Field_Fore (Fld : Field) return C_Chtype; + function Field_Fore (Fld : Field) return C_Chtype; pragma Import (C, Field_Fore, "field_fore"); begin - Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; + Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; end Foreground; - procedure Foreground (Fld : in Field; - Fore : out Character_Attribute_Set; - Color : out Color_Pair) + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set; + Color : out Color_Pair) is - function Field_Fore (Fld : Field) return C_Chtype; + function Field_Fore (Fld : Field) return C_Chtype; pragma Import (C, Field_Fore, "field_fore"); begin - Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; - Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color; + Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; + Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color; end Foreground; -- | -- | -- | - procedure Set_Background - (Fld : in Field; - Back : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + procedure Set_Background + (Fld : in Field; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) is - function Set_Field_Back (Fld : Field; + function Set_Field_Back (Fld : Field; Attr : C_Chtype) return C_Int; pragma Import (C, Set_Field_Back, "set_field_back"); Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Back); + Color => Color, + Attr => Back); Res : constant Eti_Error := - Set_Field_Back (Fld, AttrChar_To_Chtype (Ch)); + Set_Field_Back (Fld, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -465,37 +465,37 @@ -- | -- | -- | - procedure Background (Fld : in Field; - Back : out Character_Attribute_Set) + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set) is - function Field_Back (Fld : Field) return C_Chtype; + function Field_Back (Fld : Field) return C_Chtype; pragma Import (C, Field_Back, "field_back"); begin - Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; + Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; end Background; - procedure Background (Fld : in Field; - Back : out Character_Attribute_Set; - Color : out Color_Pair) + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set; + Color : out Color_Pair) is - function Field_Back (Fld : Field) return C_Chtype; + function Field_Back (Fld : Field) return C_Chtype; pragma Import (C, Field_Back, "field_back"); begin - Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; - Color := Chtype_To_AttrChar (Field_Back (Fld)).Color; + Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; + Color := Chtype_To_AttrChar (Field_Back (Fld)).Color; end Background; -- | -- | -- | - procedure Set_Pad_Character (Fld : in Field; - Pad : in Character := Space) + procedure Set_Pad_Character (Fld : in Field; + Pad : in Character := Space) is - function Set_Field_Pad (Fld : Field; + function Set_Field_Pad (Fld : Field; Ch : C_Int) return C_Int; pragma Import (C, Set_Field_Pad, "set_field_pad"); - Res : constant Eti_Error := Set_Field_Pad (Fld, - C_Int (Character'Pos (Pad))); + Res : constant Eti_Error := Set_Field_Pad (Fld, + C_Int (Character'Pos (Pad))); begin if Res /= E_Ok then Eti_Exception (Res); @@ -504,13 +504,13 @@ -- | -- | -- | - procedure Pad_Character (Fld : in Field; - Pad : out Character) + procedure Pad_Character (Fld : in Field; + Pad : out Character) is - function Field_Pad (Fld : Field) return C_Int; + function Field_Pad (Fld : Field) return C_Int; pragma Import (C, Field_Pad, "field_pad"); begin - Pad := Character'Val (Field_Pad (Fld)); + Pad := Character'Val (Field_Pad (Fld)); end Pad_Character; -- | -- |===================================================================== @@ -519,22 +519,22 @@ -- | -- | -- | - procedure Info (Fld : in Field; - Lines : out Line_Count; - Columns : out Column_Count; - First_Row : out Line_Position; - First_Column : out Column_Position; - Off_Screen : out Natural; - Additional_Buffers : out Buffer_Number) + procedure Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + First_Row : out Line_Position; + First_Column : out Column_Position; + Off_Screen : out Natural; + Additional_Buffers : out Buffer_Number) is type C_Int_Access is access all C_Int; - function Fld_Info (Fld : Field; + function Fld_Info (Fld : Field; L, C, Fr, Fc, Os, Ab : C_Int_Access) return C_Int; pragma Import (C, Fld_Info, "field_info"); L, C, Fr, Fc, Os, Ab : aliased C_Int; - Res : constant Eti_Error := Fld_Info (Fld, + Res : constant Eti_Error := Fld_Info (Fld, L'Access, C'Access, Fr'Access, Fc'Access, Os'Access, Ab'Access); @@ -542,37 +542,37 @@ if Res /= E_Ok then Eti_Exception (Res); else - Lines := Line_Count (L); - Columns := Column_Count (C); - First_Row := Line_Position (Fr); - First_Column := Column_Position (Fc); - Off_Screen := Natural (Os); - Additional_Buffers := Buffer_Number (Ab); + Lines := Line_Count (L); + Columns := Column_Count (C); + First_Row := Line_Position (Fr); + First_Column := Column_Position (Fc); + Off_Screen := Natural (Os); + Additional_Buffers := Buffer_Number (Ab); end if; end Info; -- | -- | -- | - procedure Dynamic_Info (Fld : in Field; - Lines : out Line_Count; - Columns : out Column_Count; - Max : out Natural) + procedure Dynamic_Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + Max : out Natural) is type C_Int_Access is access all C_Int; - function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int; + function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int; pragma Import (C, Dyn_Info, "dynamic_field_info"); L, C, M : aliased C_Int; - Res : constant Eti_Error := Dyn_Info (Fld, + Res : constant Eti_Error := Dyn_Info (Fld, L'Access, C'Access, M'Access); begin if Res /= E_Ok then Eti_Exception (Res); else - Lines := Line_Count (L); - Columns := Column_Count (C); - Max := Natural (M); + Lines := Line_Count (L); + Columns := Column_Count (C); + Max := Natural (M); end if; end Dynamic_Info; -- | @@ -582,14 +582,14 @@ -- | -- | -- | - procedure Set_Window (Frm : in Form; - Win : in Window) + procedure Set_Window (Frm : in Form; + Win : in Window) is - function Set_Form_Win (Frm : Form; + function Set_Form_Win (Frm : Form; Win : Window) return C_Int; pragma Import (C, Set_Form_Win, "set_form_win"); - Res : constant Eti_Error := Set_Form_Win (Frm, Win); + Res : constant Eti_Error := Set_Form_Win (Frm, Win); begin if Res /= E_Ok then Eti_Exception (Res); @@ -598,26 +598,26 @@ -- | -- | -- | - function Get_Window (Frm : Form) return Window + function Get_Window (Frm : Form) return Window is - function Form_Win (Frm : Form) return Window; + function Form_Win (Frm : Form) return Window; pragma Import (C, Form_Win, "form_win"); - W : constant Window := Form_Win (Frm); + W : constant Window := Form_Win (Frm); begin return W; end Get_Window; -- | -- | -- | - procedure Set_Sub_Window (Frm : in Form; - Win : in Window) + procedure Set_Sub_Window (Frm : in Form; + Win : in Window) is - function Set_Form_Sub (Frm : Form; + function Set_Form_Sub (Frm : Form; Win : Window) return C_Int; pragma Import (C, Set_Form_Sub, "set_form_sub"); - Res : constant Eti_Error := Set_Form_Sub (Frm, Win); + Res : constant Eti_Error := Set_Form_Sub (Frm, Win); begin if Res /= E_Ok then Eti_Exception (Res); @@ -626,34 +626,34 @@ -- | -- | -- | - function Get_Sub_Window (Frm : Form) return Window + function Get_Sub_Window (Frm : Form) return Window is - function Form_Sub (Frm : Form) return Window; + function Form_Sub (Frm : Form) return Window; pragma Import (C, Form_Sub, "form_sub"); - W : constant Window := Form_Sub (Frm); + W : constant Window := Form_Sub (Frm); begin return W; end Get_Sub_Window; -- | -- | -- | - procedure Scale (Frm : in Form; - Lines : out Line_Count; - Columns : out Column_Count) + procedure Scale (Frm : in Form; + Lines : out Line_Count; + Columns : out Column_Count) is type C_Int_Access is access all C_Int; - function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int; + function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int; pragma Import (C, M_Scale, "scale_form"); X, Y : aliased C_Int; - Res : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access); + Res : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access); begin if Res /= E_Ok then Eti_Exception (Res); end if; - Lines := Line_Count (Y); - Columns := Column_Count (X); + Lines := Line_Count (Y); + Columns := Column_Count (X); end Scale; -- | -- |===================================================================== @@ -662,14 +662,14 @@ -- | -- | -- | - procedure Set_Field_Init_Hook (Frm : in Form; - Proc : in Form_Hook_Function) + procedure Set_Field_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function) is - function Set_Field_Init (Frm : Form; - Proc : Form_Hook_Function) return C_Int; + function Set_Field_Init (Frm : Form; + Proc : Form_Hook_Function) return C_Int; pragma Import (C, Set_Field_Init, "set_field_init"); - Res : constant Eti_Error := Set_Field_Init (Frm, Proc); + Res : constant Eti_Error := Set_Field_Init (Frm, Proc); begin if Res /= E_Ok then Eti_Exception (Res); @@ -678,14 +678,14 @@ -- | -- | -- | - procedure Set_Field_Term_Hook (Frm : in Form; - Proc : in Form_Hook_Function) + procedure Set_Field_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function) is - function Set_Field_Term (Frm : Form; - Proc : Form_Hook_Function) return C_Int; + function Set_Field_Term (Frm : Form; + Proc : Form_Hook_Function) return C_Int; pragma Import (C, Set_Field_Term, "set_field_term"); - Res : constant Eti_Error := Set_Field_Term (Frm, Proc); + Res : constant Eti_Error := Set_Field_Term (Frm, Proc); begin if Res /= E_Ok then Eti_Exception (Res); @@ -694,14 +694,14 @@ -- | -- | -- | - procedure Set_Form_Init_Hook (Frm : in Form; - Proc : in Form_Hook_Function) + procedure Set_Form_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function) is - function Set_Form_Init (Frm : Form; - Proc : Form_Hook_Function) return C_Int; + function Set_Form_Init (Frm : Form; + Proc : Form_Hook_Function) return C_Int; pragma Import (C, Set_Form_Init, "set_form_init"); - Res : constant Eti_Error := Set_Form_Init (Frm, Proc); + Res : constant Eti_Error := Set_Form_Init (Frm, Proc); begin if Res /= E_Ok then Eti_Exception (Res); @@ -710,14 +710,14 @@ -- | -- | -- | - procedure Set_Form_Term_Hook (Frm : in Form; - Proc : in Form_Hook_Function) + procedure Set_Form_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function) is - function Set_Form_Term (Frm : Form; - Proc : Form_Hook_Function) return C_Int; + function Set_Form_Term (Frm : Form; + Proc : Form_Hook_Function) return C_Int; pragma Import (C, Set_Form_Term, "set_form_term"); - Res : constant Eti_Error := Set_Form_Term (Frm, Proc); + Res : constant Eti_Error := Set_Form_Term (Frm, Proc); begin if Res /= E_Ok then Eti_Exception (Res); @@ -730,20 +730,20 @@ -- | -- | -- | - procedure Redefine (Frm : in Form; - Flds : in Field_Array_Access) + procedure Redefine (Frm : in Form; + Flds : in Field_Array_Access) is - function Set_Frm_Fields (Frm : Form; + function Set_Frm_Fields (Frm : Form; Items : System.Address) return C_Int; pragma Import (C, Set_Frm_Fields, "set_form_fields"); Res : Eti_Error; begin pragma Assert (Flds (Flds'Last) = Null_Field); - if Flds (Flds'Last) /= Null_Field then - raise Form_Exception; + if Flds (Flds'Last) /= Null_Field then + raise Form_Exception; else - Res := Set_Frm_Fields (Frm, Flds (Flds'First)'Address); + Res := Set_Frm_Fields (Frm, Flds (Flds'First)'Address); if Res /= E_Ok then Eti_Exception (Res); end if; @@ -752,44 +752,44 @@ -- | -- | -- | - function Fields (Frm : Form; - Index : Positive) return Field + function Fields (Frm : Form; + Index : Positive) return Field is use F_Array; - function C_Fields (Frm : Form) return Pointer; + function C_Fields (Frm : Form) return Pointer; pragma Import (C, C_Fields, "form_fields"); - P : Pointer := C_Fields (Frm); + P : Pointer := C_Fields (Frm); begin - if P = null or else Index not in 1 .. Field_Count (Frm) then - raise Form_Exception; + if P = null or else Index not in 1 .. Field_Count (Frm) then + raise Form_Exception; else - P := P + ptrdiff_t (C_Int (Index) - 1); + P := P + ptrdiff_t (C_Int (Index) - 1); return P.all; end if; end Fields; -- | -- | -- | - function Field_Count (Frm : Form) return Natural + function Field_Count (Frm : Form) return Natural is - function Count (Frm : Form) return C_Int; + function Count (Frm : Form) return C_Int; pragma Import (C, Count, "field_count"); begin - return Natural (Count (Frm)); + return Natural (Count (Frm)); end Field_Count; -- | -- | -- | - procedure Move (Fld : in Field; - Line : in Line_Position; - Column : in Column_Position) + procedure Move (Fld : in Field; + Line : in Line_Position; + Column : in Column_Position) is - function Move (Fld : Field; L, C : C_Int) return C_Int; + function Move (Fld : Field; L, C : C_Int) return C_Int; pragma Import (C, Move, "move_field"); - Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column)); + Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -802,20 +802,20 @@ -- | -- | -- | - function Create (Fields : Field_Array_Access) return Form + function Create (Fields : Field_Array_Access) return Form is - function NewForm (Fields : System.Address) return Form; + function NewForm (Fields : System.Address) return Form; pragma Import (C, NewForm, "new_form"); - M : Form; + M : Form; begin pragma Assert (Fields (Fields'Last) = Null_Field); - if Fields (Fields'Last) /= Null_Field then - raise Form_Exception; + if Fields (Fields'Last) /= Null_Field then + raise Form_Exception; else - M := NewForm (Fields (Fields'First)'Address); - if M = Null_Form then - raise Form_Exception; + M := NewForm (Fields (Fields'First)'Address); + if M = Null_Form then + raise Form_Exception; end if; return M; end if; @@ -823,17 +823,17 @@ -- | -- | -- | - procedure Delete (Frm : in out Form) + procedure Delete (Frm : in out Form) is - function Free (Frm : Form) return C_Int; + function Free (Frm : Form) return C_Int; pragma Import (C, Free, "free_form"); - Res : constant Eti_Error := Free (Frm); + Res : constant Eti_Error := Free (Frm); begin if Res /= E_Ok then Eti_Exception (Res); end if; - Frm := Null_Form; + Frm := Null_Form; end Delete; -- | -- |===================================================================== @@ -842,17 +842,17 @@ -- | -- | -- | - procedure Set_Options (Frm : in Form; - Options : in Form_Option_Set) + procedure Set_Options (Frm : in Form; + Options : in Form_Option_Set) is - function Set_Form_Opts (Frm : Form; + function Set_Form_Opts (Frm : Form; Opt : C_Int) return C_Int; pragma Import (C, Set_Form_Opts, "set_form_opts"); - Opt : C_Int := FrmOS_2_CInt (Options); + Opt : C_Int := FrmOS_2_CInt (Options); Res : Eti_Error; begin - Res := Set_Form_Opts (Frm, Opt); + Res := Set_Form_Opts (Frm, Opt); if Res /= E_Ok then Eti_Exception (Res); end if; @@ -860,24 +860,24 @@ -- | -- | -- | - procedure Switch_Options (Frm : in Form; - Options : in Form_Option_Set; - On : Boolean := True) + procedure Switch_Options (Frm : in Form; + Options : in Form_Option_Set; + On : Boolean := True) is - function Form_Opts_On (Frm : Form; + function Form_Opts_On (Frm : Form; Opt : C_Int) return C_Int; pragma Import (C, Form_Opts_On, "form_opts_on"); - function Form_Opts_Off (Frm : Form; + function Form_Opts_Off (Frm : Form; Opt : C_Int) return C_Int; pragma Import (C, Form_Opts_Off, "form_opts_off"); Err : Eti_Error; - Opt : C_Int := FrmOS_2_CInt (Options); + Opt : C_Int := FrmOS_2_CInt (Options); begin - if On then - Err := Form_Opts_On (Frm, Opt); + if On then + Err := Form_Opts_On (Frm, Opt); else - Err := Form_Opts_Off (Frm, Opt); + Err := Form_Opts_Off (Frm, Opt); end if; if Err /= E_Ok then Eti_Exception (Err); @@ -886,24 +886,24 @@ -- | -- | -- | - procedure Get_Options (Frm : in Form; - Options : out Form_Option_Set) + procedure Get_Options (Frm : in Form; + Options : out Form_Option_Set) is - function Form_Opts (Frm : Form) return C_Int; + function Form_Opts (Frm : Form) return C_Int; pragma Import (C, Form_Opts, "form_opts"); - Res : C_Int := Form_Opts (Frm); + Res : C_Int := Form_Opts (Frm); begin - Options := CInt_2_FrmOS (Res); + Options := CInt_2_FrmOS (Res); end Get_Options; -- | -- | -- | - function Get_Options (Frm : Form := Null_Form) return Form_Option_Set + function Get_Options (Frm : Form := Null_Form) return Form_Option_Set is - Fos : Form_Option_Set; + Fos : Form_Option_Set; begin - Get_Options (Frm, Fos); + Get_Options (Frm, Fos); return Fos; end Get_Options; -- | @@ -913,20 +913,20 @@ -- | -- | -- | - procedure Post (Frm : in Form; - Post : in Boolean := True) + procedure Post (Frm : in Form; + Post : in Boolean := True) is - function M_Post (Frm : Form) return C_Int; + function M_Post (Frm : Form) return C_Int; pragma Import (C, M_Post, "post_form"); - function M_Unpost (Frm : Form) return C_Int; + function M_Unpost (Frm : Form) return C_Int; pragma Import (C, M_Unpost, "unpost_form"); Res : Eti_Error; begin - if Post then - Res := M_Post (Frm); + if Post then + Res := M_Post (Frm); else - Res := M_Unpost (Frm); + Res := M_Unpost (Frm); end if; if Res /= E_Ok then Eti_Exception (Res); @@ -939,12 +939,12 @@ -- | -- | -- | - procedure Position_Cursor (Frm : Form) + procedure Position_Cursor (Frm : Form) is - function Pos_Form_Cursor (Frm : Form) return C_Int; + function Pos_Form_Cursor (Frm : Form) return C_Int; pragma Import (C, Pos_Form_Cursor, "pos_form_cursor"); - Res : constant Eti_Error := Pos_Form_Cursor (Frm); + Res : constant Eti_Error := Pos_Form_Cursor (Frm); begin if Res /= E_Ok then Eti_Exception (Res); @@ -957,12 +957,12 @@ -- | -- | -- | - function Data_Ahead (Frm : Form) return Boolean + function Data_Ahead (Frm : Form) return Boolean is - function Ahead (Frm : Form) return C_Int; + function Ahead (Frm : Form) return C_Int; pragma Import (C, Ahead, "data_ahead"); - Res : constant C_Int := Ahead (Frm); + Res : constant C_Int := Ahead (Frm); begin if Res = Curses_False then return False; @@ -973,12 +973,12 @@ -- | -- | -- | - function Data_Behind (Frm : Form) return Boolean + function Data_Behind (Frm : Form) return Boolean is - function Behind (Frm : Form) return C_Int; + function Behind (Frm : Form) return C_Int; pragma Import (C, Behind, "data_behind"); - Res : constant C_Int := Behind (Frm); + Res : constant C_Int := Behind (Frm); begin if Res = Curses_False then return False; @@ -993,27 +993,27 @@ -- | -- | -- | - function Driver (Frm : Form; - Key : Key_Code) return Driver_Result + function Driver (Frm : Form; + Key : Key_Code) return Driver_Result is - function Frm_Driver (Frm : Form; Key : C_Int) return C_Int; + function Frm_Driver (Frm : Form; Key : C_Int) return C_Int; pragma Import (C, Frm_Driver, "form_driver"); - R : Eti_Error := Frm_Driver (Frm, C_Int (Key)); + R : Eti_Error := Frm_Driver (Frm, C_Int (Key)); begin if R /= E_Ok then if R = E_Unknown_Command then - return Unknown_Request; + return Unknown_Request; elsif R = E_Invalid_Field then - return Invalid_Field; + return Invalid_Field; elsif R = E_Request_Denied then - return Request_Denied; + return Request_Denied; else Eti_Exception (R); - return Form_Ok; + return Form_Ok; end if; else - return Form_Ok; + return Form_Ok; end if; end Driver; -- | @@ -1023,13 +1023,13 @@ -- | -- | -- | - procedure Set_Current (Frm : in Form; - Fld : in Field) + procedure Set_Current (Frm : in Form; + Fld : in Field) is - function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int; + function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int; pragma Import (C, Set_Current_Fld, "set_current_field"); - Res : constant Eti_Error := Set_Current_Fld (Frm, Fld); + Res : constant Eti_Error := Set_Current_Fld (Frm, Fld); begin if Res /= E_Ok then Eti_Exception (Res); @@ -1038,28 +1038,28 @@ -- | -- | -- | - function Current (Frm : in Form) return Field + function Current (Frm : in Form) return Field is - function Current_Fld (Frm : Form) return Field; + function Current_Fld (Frm : Form) return Field; pragma Import (C, Current_Fld, "current_field"); - Fld : constant Field := Current_Fld (Frm); + Fld : constant Field := Current_Fld (Frm); begin - if Fld = Null_Field then - raise Form_Exception; + if Fld = Null_Field then + raise Form_Exception; end if; return Fld; end Current; -- | -- | -- | - procedure Set_Page (Frm : in Form; - Page : in Page_Number := Page_Number'First) + procedure Set_Page (Frm : in Form; + Page : in Page_Number := Page_Number'First) is - function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int; + function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int; pragma Import (C, Set_Frm_Page, "set_form_page"); - Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page)); + Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -1068,29 +1068,29 @@ -- | -- | -- | - function Page (Frm : Form) return Page_Number + function Page (Frm : Form) return Page_Number is - function Get_Page (Frm : Form) return C_Int; + function Get_Page (Frm : Form) return C_Int; pragma Import (C, Get_Page, "form_page"); - P : constant C_Int := Get_Page (Frm); + P : constant C_Int := Get_Page (Frm); begin if P < 0 then - raise Form_Exception; + raise Form_Exception; else - return Page_Number (P); + return Page_Number (P); end if; end Page; - function Get_Index (Fld : Field) return Positive + function Get_Index (Fld : Field) return Positive is - function Get_Fieldindex (Fld : Field) return C_Int; + function Get_Fieldindex (Fld : Field) return C_Int; pragma Import (C, Get_Fieldindex, "field_index"); - Res : constant C_Int := Get_Fieldindex (Fld); + Res : constant C_Int := Get_Fieldindex (Fld); begin if Res = Curses_Err then - raise Form_Exception; + raise Form_Exception; end if; return Positive (Natural (Res) + Positive'First); end Get_Index; @@ -1102,13 +1102,13 @@ -- | -- | -- | - procedure Set_New_Page (Fld : in Field; - New_Page : in Boolean := True) + procedure Set_New_Page (Fld : in Field; + New_Page : in Boolean := True) is - function Set_Page (Fld : Field; Flg : C_Int) return C_Int; + function Set_Page (Fld : Field; Flg : C_Int) return C_Int; pragma Import (C, Set_Page, "set_new_page"); - Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page)); + Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page)); begin if Res /= E_Ok then Eti_Exception (Res); @@ -1117,12 +1117,12 @@ -- | -- | -- | - function Is_New_Page (Fld : Field) return Boolean + function Is_New_Page (Fld : Field) return Boolean is - function Is_New (Fld : Field) return C_Int; + function Is_New (Fld : Field) return C_Int; pragma Import (C, Is_New, "new_page"); - Res : constant C_Int := Is_New (Fld); + Res : constant C_Int := Is_New (Fld); begin if Res = Curses_False then return False; @@ -1131,34 +1131,34 @@ end if; end Is_New_Page; - procedure Free (FA : in out Field_Array_Access; - Free_Fields : in Boolean := False) + procedure Free (FA : in out Field_Array_Access; + Free_Fields : in Boolean := False) is procedure Release is new Ada.Unchecked_Deallocation - (Field_Array, Field_Array_Access); + (Field_Array, Field_Array_Access); begin - if FA /= null and then Free_Fields then - for I in FA'First .. (FA'Last - 1) loop - if (FA (I) /= Null_Field) then - Delete (FA (I)); + if FA /= null and then Free_Fields then + for I in FA'First .. (FA'Last - 1) loop + if (FA (I) /= Null_Field) then + Delete (FA (I)); end if; end loop; end if; - Release (FA); + Release (FA); end Free; -- |===================================================================== - function Default_Field_Options return Field_Option_Set + function Default_Field_Options return Field_Option_Set is begin - return Get_Options (Null_Field); + return Get_Options (Null_Field); end Default_Field_Options; - function Default_Form_Options return Form_Option_Set + function Default_Form_Options return Form_Option_Set is begin - return Get_Options (Null_Form); + return Get_Options (Null_Form); end Default_Form_Options; end Terminal_Interface.Curses.Forms; diff --git a/doc/html/ada/terminal_interface-curses-forms__ads.htm b/doc/html/ada/terminal_interface-curses-forms__ads.htm index 7ce679c7..a28c4ece 100644 --- a/doc/html/ada/terminal_interface-curses-forms__ads.htm +++ b/doc/html/ada/terminal_interface-curses-forms__ads.htm @@ -40,7 +40,7 @@ ------------------------------------------------------------------------------ -- Author: Jürgen Pfeifer <<juergen.pfeifer@gmx.net>> 1996 -- Version Control: --- @Revision: 1.23 @ +-- @Revision: 1.24 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- form binding. @@ -48,8 +48,7 @@ -- Run the generator instead. -- | with System; -with Ada.Characters.Latin_1; -with Interfaces.C; +with Ada.Characters.Latin_1; package Terminal_Interface.Curses.Forms is pragma Preelaborate (Terminal_Interface.Curses.Forms); @@ -58,10 +57,10 @@ Space : Character renames Ada.Characters.Latin_1.Space; - type Field is private; + type Field is private; type Form is private; - Null_Field : constant Field; + Null_Field : constant Field; Null_Form : constant Form; type Field_Justification is (None, @@ -72,17 +71,17 @@ pragma Warnings (Off); type Field_Option_Set is record - Visible : Boolean; - Active : Boolean; - Public : Boolean; - Edit : Boolean; - Wrap : Boolean; - Blank : Boolean; - Auto_Skip : Boolean; - Null_Ok : Boolean; - Pass_Ok : Boolean; + Visible : Boolean; + Active : Boolean; + Public : Boolean; + Edit : Boolean; + Wrap : Boolean; + Blank : Boolean; + Auto_Skip : Boolean; + Null_Ok : Boolean; + Pass_Ok : Boolean; Static : Boolean; - end record; + end record; pragma Pack (Field_Option_Set); pragma Convention (C, Field_Option_Set); @@ -112,9 +111,9 @@ pragma Warnings (Off); type Form_Option_Set is record - NL_Overload : Boolean; + NL_Overload : Boolean; BS_Overload : Boolean; - end record; + end record; pragma Pack (Form_Option_Set); pragma Convention (C, Form_Option_Set); @@ -140,7 +139,7 @@ type Field_Array_Access is access Field_Array; - procedure Free (FA : in out Field_Array_Access; + procedure Free (FA : in out Field_Array_Access; Free_Fields : in Boolean := False); -- Release the memory for an allocated field array -- If Free_Fields is True, call Delete() for all the fields in @@ -149,139 +148,139 @@ subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57); -- The prefix F_ stands for "Form Request" - F_Next_Page : constant Form_Request_Code := Key_Max + 1; - F_Previous_Page : constant Form_Request_Code := Key_Max + 2; - F_First_Page : constant Form_Request_Code := Key_Max + 3; + F_Next_Page : constant Form_Request_Code := Key_Max + 1; + F_Previous_Page : constant Form_Request_Code := Key_Max + 2; + F_First_Page : constant Form_Request_Code := Key_Max + 3; F_Last_Page : constant Form_Request_Code := Key_Max + 4; - F_Next_Field : constant Form_Request_Code := Key_Max + 5; - F_Previous_Field : constant Form_Request_Code := Key_Max + 6; - F_First_Field : constant Form_Request_Code := Key_Max + 7; - F_Last_Field : constant Form_Request_Code := Key_Max + 8; - F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9; - F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10; - F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11; - F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12; - F_Left_Field : constant Form_Request_Code := Key_Max + 13; - F_Right_Field : constant Form_Request_Code := Key_Max + 14; - F_Up_Field : constant Form_Request_Code := Key_Max + 15; + F_Next_Field : constant Form_Request_Code := Key_Max + 5; + F_Previous_Field : constant Form_Request_Code := Key_Max + 6; + F_First_Field : constant Form_Request_Code := Key_Max + 7; + F_Last_Field : constant Form_Request_Code := Key_Max + 8; + F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9; + F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10; + F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11; + F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12; + F_Left_Field : constant Form_Request_Code := Key_Max + 13; + F_Right_Field : constant Form_Request_Code := Key_Max + 14; + F_Up_Field : constant Form_Request_Code := Key_Max + 15; F_Down_Field : constant Form_Request_Code := Key_Max + 16; - F_Next_Char : constant Form_Request_Code := Key_Max + 17; - F_Previous_Char : constant Form_Request_Code := Key_Max + 18; - F_Next_Line : constant Form_Request_Code := Key_Max + 19; - F_Previous_Line : constant Form_Request_Code := Key_Max + 20; - F_Next_Word : constant Form_Request_Code := Key_Max + 21; - F_Previous_Word : constant Form_Request_Code := Key_Max + 22; - F_Begin_Field : constant Form_Request_Code := Key_Max + 23; - F_End_Field : constant Form_Request_Code := Key_Max + 24; - F_Begin_Line : constant Form_Request_Code := Key_Max + 25; - F_End_Line : constant Form_Request_Code := Key_Max + 26; - F_Left_Char : constant Form_Request_Code := Key_Max + 27; - F_Right_Char : constant Form_Request_Code := Key_Max + 28; - F_Up_Char : constant Form_Request_Code := Key_Max + 29; + F_Next_Char : constant Form_Request_Code := Key_Max + 17; + F_Previous_Char : constant Form_Request_Code := Key_Max + 18; + F_Next_Line : constant Form_Request_Code := Key_Max + 19; + F_Previous_Line : constant Form_Request_Code := Key_Max + 20; + F_Next_Word : constant Form_Request_Code := Key_Max + 21; + F_Previous_Word : constant Form_Request_Code := Key_Max + 22; + F_Begin_Field : constant Form_Request_Code := Key_Max + 23; + F_End_Field : constant Form_Request_Code := Key_Max + 24; + F_Begin_Line : constant Form_Request_Code := Key_Max + 25; + F_End_Line : constant Form_Request_Code := Key_Max + 26; + F_Left_Char : constant Form_Request_Code := Key_Max + 27; + F_Right_Char : constant Form_Request_Code := Key_Max + 28; + F_Up_Char : constant Form_Request_Code := Key_Max + 29; F_Down_Char : constant Form_Request_Code := Key_Max + 30; - F_New_Line : constant Form_Request_Code := Key_Max + 31; - F_Insert_Char : constant Form_Request_Code := Key_Max + 32; - F_Insert_Line : constant Form_Request_Code := Key_Max + 33; - F_Delete_Char : constant Form_Request_Code := Key_Max + 34; - F_Delete_Previous : constant Form_Request_Code := Key_Max + 35; - F_Delete_Line : constant Form_Request_Code := Key_Max + 36; - F_Delete_Word : constant Form_Request_Code := Key_Max + 37; - F_Clear_EOL : constant Form_Request_Code := Key_Max + 38; - F_Clear_EOF : constant Form_Request_Code := Key_Max + 39; - F_Clear_Field : constant Form_Request_Code := Key_Max + 40; - F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41; + F_New_Line : constant Form_Request_Code := Key_Max + 31; + F_Insert_Char : constant Form_Request_Code := Key_Max + 32; + F_Insert_Line : constant Form_Request_Code := Key_Max + 33; + F_Delete_Char : constant Form_Request_Code := Key_Max + 34; + F_Delete_Previous : constant Form_Request_Code := Key_Max + 35; + F_Delete_Line : constant Form_Request_Code := Key_Max + 36; + F_Delete_Word : constant Form_Request_Code := Key_Max + 37; + F_Clear_EOL : constant Form_Request_Code := Key_Max + 38; + F_Clear_EOF : constant Form_Request_Code := Key_Max + 39; + F_Clear_Field : constant Form_Request_Code := Key_Max + 40; + F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41; F_Insert_Mode : constant Form_Request_Code := Key_Max + 42; -- Vertical Scrolling - F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43; - F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44; - F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45; - F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46; - F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47; + F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43; + F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44; + F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45; + F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46; + F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47; F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48; -- Horizontal Scrolling - F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49; - F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50; - F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51; - F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52; - F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53; + F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49; + F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50; + F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51; + F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52; + F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53; F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54; - F_Validate_Field : constant Form_Request_Code := Key_Max + 55; - F_Next_Choice : constant Form_Request_Code := Key_Max + 56; + F_Validate_Field : constant Form_Request_Code := Key_Max + 55; + F_Next_Choice : constant Form_Request_Code := Key_Max + 56; F_Previous_Choice : constant Form_Request_Code := Key_Max + 57; -- For those who like the old 'C' style request names - REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page; - REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page; - REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page; + REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page; + REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page; + REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page; REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page; - REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field; - REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field; - REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field; - REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field; - REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field; - REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field; - REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field; - REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field; - REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field; - REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field; - REQ_UP_FIELD : Form_Request_Code renames F_Up_Field; + REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field; + REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field; + REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field; + REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field; + REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field; + REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field; + REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field; + REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field; + REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field; + REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field; + REQ_UP_FIELD : Form_Request_Code renames F_Up_Field; REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field; - REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char; - REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char; - REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line; - REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line; - REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word; - REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word; - REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field; - REQ_END_FIELD : Form_Request_Code renames F_End_Field; - REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line; - REQ_END_LINE : Form_Request_Code renames F_End_Line; - REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char; - REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char; - REQ_UP_CHAR : Form_Request_Code renames F_Up_Char; + REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char; + REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char; + REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line; + REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line; + REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word; + REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word; + REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field; + REQ_END_FIELD : Form_Request_Code renames F_End_Field; + REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line; + REQ_END_LINE : Form_Request_Code renames F_End_Line; + REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char; + REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char; + REQ_UP_CHAR : Form_Request_Code renames F_Up_Char; REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char; - REQ_NEW_LINE : Form_Request_Code renames F_New_Line; - REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char; - REQ_INS_LINE : Form_Request_Code renames F_Insert_Line; - REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char; - REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous; - REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line; - REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word; - REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL; - REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF; - REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field; - REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode; + REQ_NEW_LINE : Form_Request_Code renames F_New_Line; + REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char; + REQ_INS_LINE : Form_Request_Code renames F_Insert_Line; + REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char; + REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous; + REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line; + REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word; + REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL; + REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF; + REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field; + REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode; REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode; - REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line; - REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line; - REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page; - REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page; - REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage; + REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line; + REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line; + REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page; + REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page; + REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage; REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage; - REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char; - REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char; - REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line; - REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line; - REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine; + REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char; + REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char; + REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line; + REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line; + REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine; REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine; - REQ_VALIDATION : Form_Request_Code renames F_Validate_Field; - REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice; + REQ_VALIDATION : Form_Request_Code renames F_Validate_Field; + REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice; REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice; - procedure Request_Name (Key : in Form_Request_Code; + procedure Request_Name (Key : in Form_Request_Code; Name : out String); function Request_Name (Key : Form_Request_Code) return String; @@ -298,22 +297,22 @@ -- |===================================================================== -- #1A NAME="AFU_1"#2| - function Create (Height : Line_Count; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0; + function Create (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; More_Buffers : Buffer_Number := Buffer_Number'First) return Field; -- AKA: new_field() -- An overloaded Create is defined later. Pragma Inline appears there. -- #1A NAME="AFU_2"#2| - function New_Field (Height : Line_Count; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0; + function New_Field (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; More_Buffers : Buffer_Number := Buffer_Number'First) return Field renames Create; -- AKA: new_field() @@ -326,15 +325,15 @@ -- An overloaded Delete is defined later. Pragma Inline appears there. -- #1A NAME="AFU_4"#2| - function Duplicate (Fld : Field; - Top : Line_Position; + function Duplicate (Fld : Field; + Top : Line_Position; Left : Column_Position) return Field; -- AKA: dup_field() pragma Inline (Duplicate); -- #1A NAME="AFU_5"#2| - function Link (Fld : Field; - Top : Line_Position; + function Link (Fld : Field; + Top : Line_Position; Left : Column_Position) return Field; -- AKA: link_field() pragma Inline (Link); @@ -344,7 +343,7 @@ -- |===================================================================== -- #1A NAME="AFU_6"#2| - procedure Set_Justification (Fld : in Field; + procedure Set_Justification (Fld : in Field; Just : in Field_Justification := None); -- AKA: set_field_just() pragma Inline (Set_Justification); @@ -360,28 +359,28 @@ -- #1A NAME="AFU_8"#2| procedure Set_Buffer - (Fld : in Field; - Buffer : in Buffer_Number := Buffer_Number'First; + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; Str : in String); -- AKA: set_field_buffer() -- Not inlined -- #1A NAME="AFU_9"#2| procedure Get_Buffer - (Fld : in Field; - Buffer : in Buffer_Number := Buffer_Number'First; + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; Str : out String); -- AKA: field_buffer() function Get_Buffer - (Fld : in Field; + (Fld : in Field; Buffer : in Buffer_Number := Buffer_Number'First) return String; -- AKA: field_buffer() -- Same but as function pragma Inline (Get_Buffer); -- #1A NAME="AFU_10"#2| - procedure Set_Status (Fld : in Field; + procedure Set_Status (Fld : in Field; Status : in Boolean := True); -- AKA: set_field_status() pragma Inline (Set_Status); @@ -392,7 +391,7 @@ pragma Inline (Changed); -- #1A NAME="AFU_12"#2| - procedure Set_Maximum_Size (Fld : in Field; + procedure Set_Maximum_Size (Fld : in Field; Max : in Natural := 0); -- AKA: set_field_max() pragma Inline (Set_Maximum_Size); @@ -402,21 +401,21 @@ -- |===================================================================== -- #1A NAME="AFU_13"#2| - procedure Set_Options (Fld : in Field; + procedure Set_Options (Fld : in Field; Options : in Field_Option_Set); -- AKA: set_field_opts() -- An overloaded version is defined later. Pragma Inline appears there -- #1A NAME="AFU_14"#2| - procedure Switch_Options (Fld : in Field; - Options : in Field_Option_Set; + procedure Switch_Options (Fld : in Field; + Options : in Field_Option_Set; On : Boolean := True); -- AKA: field_opts_on() -- AKA: field_opts_off() -- An overloaded version is defined later. Pragma Inline appears there -- #1A NAME="AFU_15"#2| - procedure Get_Options (Fld : in Field; + procedure Get_Options (Fld : in Field; Options : out Field_Option_Set); -- AKA: field_opts() @@ -432,52 +431,52 @@ -- #1A NAME="AFU_17"#2| procedure Set_Foreground - (Fld : in Field; - Fore : in Character_Attribute_Set := Normal_Video; + (Fld : in Field; + Fore : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA: set_field_fore() pragma Inline (Set_Foreground); -- #1A NAME="AFU_18"#2| - procedure Foreground (Fld : in Field; + procedure Foreground (Fld : in Field; Fore : out Character_Attribute_Set); -- AKA: field_fore() -- #1A NAME="AFU_19"#2| - procedure Foreground (Fld : in Field; - Fore : out Character_Attribute_Set; + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set; Color : out Color_Pair); -- AKA: field_fore() pragma Inline (Foreground); -- #1A NAME="AFU_20"#2| procedure Set_Background - (Fld : in Field; - Back : in Character_Attribute_Set := Normal_Video; + (Fld : in Field; + Back : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA: set_field_back() pragma Inline (Set_Background); -- #1A NAME="AFU_21"#2| - procedure Background (Fld : in Field; + procedure Background (Fld : in Field; Back : out Character_Attribute_Set); -- AKA: field_back() -- #1A NAME="AFU_22"#2| - procedure Background (Fld : in Field; - Back : out Character_Attribute_Set; + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set; Color : out Color_Pair); -- AKA: field_back() pragma Inline (Background); -- #1A NAME="AFU_23"#2| - procedure Set_Pad_Character (Fld : in Field; + procedure Set_Pad_Character (Fld : in Field; Pad : in Character := Space); -- AKA: set_field_pad() pragma Inline (Set_Pad_Character); -- #1A NAME="AFU_24"#2| - procedure Pad_Character (Fld : in Field; + procedure Pad_Character (Fld : in Field; Pad : out Character); -- AKA: field_pad() pragma Inline (Pad_Character); @@ -487,20 +486,20 @@ -- |===================================================================== -- #1A NAME="AFU_25"#2| - procedure Info (Fld : in Field; - Lines : out Line_Count; - Columns : out Column_Count; - First_Row : out Line_Position; - First_Column : out Column_Position; - Off_Screen : out Natural; + procedure Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + First_Row : out Line_Position; + First_Column : out Column_Position; + Off_Screen : out Natural; Additional_Buffers : out Buffer_Number); -- AKA: field_info() pragma Inline (Info); -- #1A NAME="AFU_26"#2| - procedure Dynamic_Info (Fld : in Field; - Lines : out Line_Count; - Columns : out Column_Count; + procedure Dynamic_Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; Max : out Natural); -- AKA: dynamic_field_info() pragma Inline (Dynamic_Info); @@ -510,7 +509,7 @@ -- |===================================================================== -- #1A NAME="AFU_27"#2| - procedure Set_Window (Frm : in Form; + procedure Set_Window (Frm : in Form; Win : in Window); -- AKA: set_form_win() pragma Inline (Set_Window); @@ -521,7 +520,7 @@ pragma Inline (Get_Window); -- #1A NAME="AFU_29"#2| - procedure Set_Sub_Window (Frm : in Form; + procedure Set_Sub_Window (Frm : in Form; Win : in Window); -- AKA: set_form_sub() pragma Inline (Set_Sub_Window); @@ -532,8 +531,8 @@ pragma Inline (Get_Sub_Window); -- #1A NAME="AFU_31"#2| - procedure Scale (Frm : in Form; - Lines : out Line_Count; + procedure Scale (Frm : in Form; + Lines : out Line_Count; Columns : out Column_Count); -- AKA: scale_form() pragma Inline (Scale); @@ -546,25 +545,25 @@ pragma Convention (C, Form_Hook_Function); -- #1A NAME="AFU_32"#2| - procedure Set_Field_Init_Hook (Frm : in Form; + procedure Set_Field_Init_Hook (Frm : in Form; Proc : in Form_Hook_Function); -- AKA: set_field_init() pragma Inline (Set_Field_Init_Hook); -- #1A NAME="AFU_33"#2| - procedure Set_Field_Term_Hook (Frm : in Form; + procedure Set_Field_Term_Hook (Frm : in Form; Proc : in Form_Hook_Function); -- AKA: set_field_term() pragma Inline (Set_Field_Term_Hook); -- #1A NAME="AFU_34"#2| - procedure Set_Form_Init_Hook (Frm : in Form; + procedure Set_Form_Init_Hook (Frm : in Form; Proc : in Form_Hook_Function); -- AKA: set_form_init() pragma Inline (Set_Form_Init_Hook); -- #1A NAME="AFU_35"#2| - procedure Set_Form_Term_Hook (Frm : in Form; + procedure Set_Form_Term_Hook (Frm : in Form; Proc : in Form_Hook_Function); -- AKA: set_form_term() pragma Inline (Set_Form_Term_Hook); @@ -594,19 +593,19 @@ -- |===================================================================== -- #1A NAME="AFU_40"#2| - procedure Redefine (Frm : in Form; + procedure Redefine (Frm : in Form; Flds : in Field_Array_Access); -- AKA: set_form_fields() pragma Inline (Redefine); -- #1A NAME="AFU_41"#2| - procedure Set_Fields (Frm : in Form; + procedure Set_Fields (Frm : in Form; Flds : in Field_Array_Access) renames Redefine; -- AKA: set_form_fields() pragma Inline (Set_Fields); -- #1A NAME="AFU_42"#2| - function Fields (Frm : Form; + function Fields (Frm : Form; Index : Positive) return Field; -- AKA: form_fields() pragma Inline (Fields); @@ -617,8 +616,8 @@ pragma Inline (Field_Count); -- #1A NAME="AFU_44"#2| - procedure Move (Fld : in Field; - Line : in Line_Position; + procedure Move (Fld : in Field; + Line : in Line_Position; Column : in Column_Position); -- AKA: move_field() pragma Inline (Move); @@ -649,21 +648,21 @@ -- |===================================================================== -- #1A NAME="AFU_48"#2| - procedure Set_Options (Frm : in Form; + procedure Set_Options (Frm : in Form; Options : in Form_Option_Set); -- AKA: set_form_opts() pragma Inline (Set_Options); -- #1A NAME="AFU_49"#2| - procedure Switch_Options (Frm : in Form; - Options : in Form_Option_Set; + procedure Switch_Options (Frm : in Form; + Options : in Form_Option_Set; On : Boolean := True); -- AKA: form_opts_on() -- AKA: form_opts_off() pragma Inline (Switch_Options); -- #1A NAME="AFU_50"#2| - procedure Get_Options (Frm : in Form; + procedure Get_Options (Frm : in Form; Options : out Form_Option_Set); -- AKA: form_opts() @@ -677,7 +676,7 @@ -- |===================================================================== -- #1A NAME="AFU_52"#2| - procedure Post (Frm : in Form; + procedure Post (Frm : in Form; Post : in Boolean := True); -- AKA: post_form() -- AKA: unpost_form() @@ -710,13 +709,13 @@ -- | Man page form_driver.3x -- |===================================================================== - type Driver_Result is (Form_Ok, - Request_Denied, - Unknown_Request, + type Driver_Result is (Form_Ok, + Request_Denied, + Unknown_Request, Invalid_Field); -- #1A NAME="AFU_56"#2| - function Driver (Frm : Form; + function Driver (Frm : Form; Key : Key_Code) return Driver_Result; -- AKA: form_driver() -- Driver not inlined @@ -728,7 +727,7 @@ type Page_Number is new Natural; -- #1A NAME="AFU_57"#2| - procedure Set_Current (Frm : in Form; + procedure Set_Current (Frm : in Form; Fld : in Field); -- AKA: set_current_field() pragma Inline (Set_Current); @@ -739,7 +738,7 @@ pragma Inline (Current); -- #1A NAME="AFU_59"#2| - procedure Set_Page (Frm : in Form; + procedure Set_Page (Frm : in Form; Page : in Page_Number := Page_Number'First); -- AKA: set_form_page() pragma Inline (Set_Page); @@ -762,7 +761,7 @@ -- |===================================================================== -- #1A NAME="AFU_62"#2| - procedure Set_New_Page (Fld : in Field; + procedure Set_New_Page (Fld : in Field; New_Page : in Boolean := True); -- AKA: set_new_page() pragma Inline (Set_New_Page); @@ -774,10 +773,10 @@ ------------------------------------------------------------------------------ private - type Field is new System.Storage_Elements.Integer_Address; + type Field is new System.Storage_Elements.Integer_Address; type Form is new System.Storage_Elements.Integer_Address; - Null_Field : constant Field := 0; + Null_Field : constant Field := 0; Null_Form : constant Form := 0; end Terminal_Interface.Curses.Forms; diff --git a/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm index c4912b61..fc3aa798 100644 --- a/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm +++ b/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm @@ -49,10 +49,10 @@ use type Interfaces.C.int; - procedure Set_User_Data (Itm : in Item; + procedure Set_User_Data (Itm : in Item; Data : in User_Access) is - function Set_Item_Userptr (Itm : Item; + function Set_Item_Userptr (Itm : Item; Addr : User_Access) return C_Int; pragma Import (C, Set_Item_Userptr, "set_item_userptr"); @@ -63,15 +63,15 @@ end if; end Set_User_Data; - function Get_User_Data (Itm : in Item) return User_Access + function Get_User_Data (Itm : in Item) return User_Access is - function Item_Userptr (Itm : Item) return User_Access; + function Item_Userptr (Itm : Item) return User_Access; pragma Import (C, Item_Userptr, "item_userptr"); begin return Item_Userptr (Itm); end Get_User_Data; - procedure Get_User_Data (Itm : in Item; + procedure Get_User_Data (Itm : in Item; Data : out User_Access) is begin diff --git a/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm index c565bc6f..92499022 100644 --- a/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm +++ b/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm @@ -46,7 +46,7 @@ generic type User is limited private; - type User_Access is access User; + type User_Access is access User; package Terminal_Interface.Curses.Menus.Item_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data); diff --git a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm index e320f420..5bd10d35 100644 --- a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm +++ b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm @@ -48,10 +48,10 @@ use type Interfaces.C.int; - procedure Set_User_Data (Men : in Menu; + procedure Set_User_Data (Men : in Menu; Data : in User_Access) is - function Set_Menu_Userptr (Men : Menu; + function Set_Menu_Userptr (Men : Menu; Data : User_Access) return C_Int; pragma Import (C, Set_Menu_Userptr, "set_menu_userptr"); @@ -62,15 +62,15 @@ end if; end Set_User_Data; - function Get_User_Data (Men : in Menu) return User_Access + function Get_User_Data (Men : in Menu) return User_Access is - function Menu_Userptr (Men : Menu) return User_Access; + function Menu_Userptr (Men : Menu) return User_Access; pragma Import (C, Menu_Userptr, "menu_userptr"); begin return Menu_Userptr (Men); end Get_User_Data; - procedure Get_User_Data (Men : in Menu; + procedure Get_User_Data (Men : in Menu; Data : out User_Access) is begin diff --git a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm index 39a55253..a522b71a 100644 --- a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm +++ b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm @@ -46,7 +46,7 @@ generic type User is limited private; - type User_Access is access User; + type User_Access is access User; package Terminal_Interface.Curses.Menus.Menu_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data); diff --git a/doc/html/ada/terminal_interface-curses-menus__adb.htm b/doc/html/ada/terminal_interface-curses-menus__adb.htm index 1b9c1d01..7bb3b0ee 100644 --- a/doc/html/ada/terminal_interface-curses-menus__adb.htm +++ b/doc/html/ada/terminal_interface-curses-menus__adb.htm @@ -51,127 +51,127 @@ with Ada.Unchecked_Conversion; -package body Terminal_Interface.Curses.Menus is +package body Terminal_Interface.Curses.Menus is - type C_Item_Array is array (Natural range <>) of aliased Item; + type C_Item_Array is array (Natural range <>) of aliased Item; package I_Array is new - Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); + Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); use type System.Bit_Order; subtype chars_ptr is Interfaces.C.Strings.chars_ptr; function MOS_2_CInt is new - Ada.Unchecked_Conversion (Menu_Option_Set, + Ada.Unchecked_Conversion (Menu_Option_Set, C_Int); function CInt_2_MOS is new Ada.Unchecked_Conversion (C_Int, - Menu_Option_Set); + Menu_Option_Set); function IOS_2_CInt is new - Ada.Unchecked_Conversion (Item_Option_Set, + Ada.Unchecked_Conversion (Item_Option_Set, C_Int); function CInt_2_IOS is new Ada.Unchecked_Conversion (C_Int, - Item_Option_Set); + Item_Option_Set); ------------------------------------------------------------------------------ - procedure Request_Name (Key : in Menu_Request_Code; - Name : out String) + procedure Request_Name (Key : in Menu_Request_Code; + Name : out String) is function Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Request_Name, "menu_request_name"); begin - Fill_String (Request_Name (C_Int (Key)), Name); + Fill_String (Request_Name (C_Int (Key)), Name); end Request_Name; - function Request_Name (Key : Menu_Request_Code) return String + function Request_Name (Key : Menu_Request_Code) return String is function Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Request_Name, "menu_request_name"); begin - return Fill_String (Request_Name (C_Int (Key))); + return Fill_String (Request_Name (C_Int (Key))); end Request_Name; - function Create (Name : String; - Description : String := "") return Item + function Create (Name : String; + Description : String := "") return Item is type Char_Ptr is access all Interfaces.C.char; - function Newitem (Name, Desc : Char_Ptr) return Item; + function Newitem (Name, Desc : Char_Ptr) return Item; pragma Import (C, Newitem, "new_item"); - type Name_String is new char_array (0 .. Name'Length); + type Name_String is new char_array (0 .. Name'Length); type Name_String_Ptr is access Name_String; pragma Controlled (Name_String_Ptr); - type Desc_String is new char_array (0 .. Description'Length); + type Desc_String is new char_array (0 .. Description'Length); type Desc_String_Ptr is access Desc_String; pragma Controlled (Desc_String_Ptr); Name_Str : Name_String_Ptr := new Name_String; Desc_Str : Desc_String_Ptr := new Desc_String; Name_Len, Desc_Len : size_t; - Result : Item; + Result : Item; begin - To_C (Name, Name_Str.all, Name_Len); - To_C (Description, Desc_Str.all, Desc_Len); + To_C (Name, Name_Str.all, Name_Len); + To_C (Description, Desc_Str.all, Desc_Len); Result := Newitem (Name_Str.all (Name_Str.all'First)'Access, Desc_Str.all (Desc_Str.all'First)'Access); - if Result = Null_Item then + if Result = Null_Item then raise Eti_System_Error; end if; return Result; end Create; - procedure Delete (Itm : in out Item) + procedure Delete (Itm : in out Item) is - function Descname (Itm : Item) return chars_ptr; + function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); - function Itemname (Itm : Item) return chars_ptr; + function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); - function Freeitem (Itm : Item) return C_Int; + function Freeitem (Itm : Item) return C_Int; pragma Import (C, Freeitem, "free_item"); Res : Eti_Error; Ptr : chars_ptr; begin - Ptr := Descname (Itm); + Ptr := Descname (Itm); if Ptr /= Null_Ptr then Interfaces.C.Strings.Free (Ptr); end if; - Ptr := Itemname (Itm); + Ptr := Itemname (Itm); if Ptr /= Null_Ptr then Interfaces.C.Strings.Free (Ptr); end if; - Res := Freeitem (Itm); + Res := Freeitem (Itm); if Res /= E_Ok then Eti_Exception (Res); end if; - Itm := Null_Item; + Itm := Null_Item; end Delete; ------------------------------------------------------------------------------- - procedure Set_Value (Itm : in Item; - Value : in Boolean := True) + procedure Set_Value (Itm : in Item; + Value : in Boolean := True) is - function Set_Item_Val (Itm : Item; + function Set_Item_Val (Itm : Item; Val : C_Int) return C_Int; pragma Import (C, Set_Item_Val, "set_item_value"); - Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value)); + Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Value; - function Value (Itm : Item) return Boolean + function Value (Itm : Item) return Boolean is - function Item_Val (Itm : Item) return C_Int; + function Item_Val (Itm : Item) return C_Int; pragma Import (C, Item_Val, "item_value"); begin - if Item_Val (Itm) = Curses_False then + if Item_Val (Itm) = Curses_False then return False; else return True; @@ -179,330 +179,330 @@ end Value; ------------------------------------------------------------------------------- - function Visible (Itm : Item) return Boolean + function Visible (Itm : Item) return Boolean is - function Item_Vis (Itm : Item) return C_Int; + function Item_Vis (Itm : Item) return C_Int; pragma Import (C, Item_Vis, "item_visible"); begin - if Item_Vis (Itm) = Curses_False then + if Item_Vis (Itm) = Curses_False then return False; else return True; end if; end Visible; ------------------------------------------------------------------------------- - procedure Set_Options (Itm : in Item; - Options : in Item_Option_Set) + procedure Set_Options (Itm : in Item; + Options : in Item_Option_Set) is - function Set_Item_Opts (Itm : Item; + function Set_Item_Opts (Itm : Item; Opt : C_Int) return C_Int; pragma Import (C, Set_Item_Opts, "set_item_opts"); - Opt : C_Int := IOS_2_CInt (Options); + Opt : C_Int := IOS_2_CInt (Options); Res : Eti_Error; begin - Res := Set_Item_Opts (Itm, Opt); + Res := Set_Item_Opts (Itm, Opt); if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Options; - procedure Switch_Options (Itm : in Item; - Options : in Item_Option_Set; - On : Boolean := True) + procedure Switch_Options (Itm : in Item; + Options : in Item_Option_Set; + On : Boolean := True) is - function Item_Opts_On (Itm : Item; + function Item_Opts_On (Itm : Item; Opt : C_Int) return C_Int; pragma Import (C, Item_Opts_On, "item_opts_on"); - function Item_Opts_Off (Itm : Item; + function Item_Opts_Off (Itm : Item; Opt : C_Int) return C_Int; pragma Import (C, Item_Opts_Off, "item_opts_off"); - Opt : C_Int := IOS_2_CInt (Options); + Opt : C_Int := IOS_2_CInt (Options); Err : Eti_Error; begin - if On then - Err := Item_Opts_On (Itm, Opt); + if On then + Err := Item_Opts_On (Itm, Opt); else - Err := Item_Opts_Off (Itm, Opt); + Err := Item_Opts_Off (Itm, Opt); end if; if Err /= E_Ok then Eti_Exception (Err); end if; end Switch_Options; - procedure Get_Options (Itm : in Item; - Options : out Item_Option_Set) + procedure Get_Options (Itm : in Item; + Options : out Item_Option_Set) is - function Item_Opts (Itm : Item) return C_Int; + function Item_Opts (Itm : Item) return C_Int; pragma Import (C, Item_Opts, "item_opts"); - Res : C_Int := Item_Opts (Itm); + Res : C_Int := Item_Opts (Itm); begin - Options := CInt_2_IOS (Res); + Options := CInt_2_IOS (Res); end Get_Options; - function Get_Options (Itm : Item := Null_Item) return Item_Option_Set + function Get_Options (Itm : Item := Null_Item) return Item_Option_Set is - Ios : Item_Option_Set; + Ios : Item_Option_Set; begin - Get_Options (Itm, Ios); + Get_Options (Itm, Ios); return Ios; end Get_Options; ------------------------------------------------------------------------------- - procedure Name (Itm : in Item; - Name : out String) + procedure Name (Itm : in Item; + Name : out String) is - function Itemname (Itm : Item) return chars_ptr; + function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); begin - Fill_String (Itemname (Itm), Name); + Fill_String (Itemname (Itm), Name); end Name; - function Name (Itm : in Item) return String + function Name (Itm : in Item) return String is - function Itemname (Itm : Item) return chars_ptr; + function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); begin - return Fill_String (Itemname (Itm)); + return Fill_String (Itemname (Itm)); end Name; - procedure Description (Itm : in Item; - Description : out String) + procedure Description (Itm : in Item; + Description : out String) is - function Descname (Itm : Item) return chars_ptr; + function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); begin - Fill_String (Descname (Itm), Description); + Fill_String (Descname (Itm), Description); end Description; - function Description (Itm : in Item) return String + function Description (Itm : in Item) return String is - function Descname (Itm : Item) return chars_ptr; + function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); begin - return Fill_String (Descname (Itm)); + return Fill_String (Descname (Itm)); end Description; ------------------------------------------------------------------------------- - procedure Set_Current (Men : in Menu; - Itm : in Item) + procedure Set_Current (Men : in Menu; + Itm : in Item) is - function Set_Curr_Item (Men : Menu; - Itm : Item) return C_Int; + function Set_Curr_Item (Men : Menu; + Itm : Item) return C_Int; pragma Import (C, Set_Curr_Item, "set_current_item"); - Res : constant Eti_Error := Set_Curr_Item (Men, Itm); + Res : constant Eti_Error := Set_Curr_Item (Men, Itm); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Current; - function Current (Men : Menu) return Item + function Current (Men : Menu) return Item is - function Curr_Item (Men : Menu) return Item; + function Curr_Item (Men : Menu) return Item; pragma Import (C, Curr_Item, "current_item"); - Res : constant Item := Curr_Item (Men); + Res : constant Item := Curr_Item (Men); begin - if Res = Null_Item then - raise Menu_Exception; + if Res = Null_Item then + raise Menu_Exception; end if; return Res; end Current; - procedure Set_Top_Row (Men : in Menu; - Line : in Line_Position) + procedure Set_Top_Row (Men : in Menu; + Line : in Line_Position) is - function Set_Toprow (Men : Menu; + function Set_Toprow (Men : Menu; Line : C_Int) return C_Int; pragma Import (C, Set_Toprow, "set_top_row"); - Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line)); + Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Top_Row; - function Top_Row (Men : Menu) return Line_Position + function Top_Row (Men : Menu) return Line_Position is - function Toprow (Men : Menu) return C_Int; + function Toprow (Men : Menu) return C_Int; pragma Import (C, Toprow, "top_row"); - Res : constant C_Int := Toprow (Men); + Res : constant C_Int := Toprow (Men); begin if Res = Curses_Err then - raise Menu_Exception; + raise Menu_Exception; end if; return Line_Position (Res); end Top_Row; - function Get_Index (Itm : Item) return Positive + function Get_Index (Itm : Item) return Positive is - function Get_Itemindex (Itm : Item) return C_Int; + function Get_Itemindex (Itm : Item) return C_Int; pragma Import (C, Get_Itemindex, "item_index"); - Res : constant C_Int := Get_Itemindex (Itm); + Res : constant C_Int := Get_Itemindex (Itm); begin if Res = Curses_Err then - raise Menu_Exception; + raise Menu_Exception; end if; return Positive (Natural (Res) + Positive'First); end Get_Index; ------------------------------------------------------------------------------- - procedure Post (Men : in Menu; - Post : in Boolean := True) + procedure Post (Men : in Menu; + Post : in Boolean := True) is - function M_Post (Men : Menu) return C_Int; + function M_Post (Men : Menu) return C_Int; pragma Import (C, M_Post, "post_menu"); - function M_Unpost (Men : Menu) return C_Int; + function M_Unpost (Men : Menu) return C_Int; pragma Import (C, M_Unpost, "unpost_menu"); Res : Eti_Error; begin - if Post then - Res := M_Post (Men); + if Post then + Res := M_Post (Men); else - Res := M_Unpost (Men); + Res := M_Unpost (Men); end if; if Res /= E_Ok then Eti_Exception (Res); end if; end Post; ------------------------------------------------------------------------------- - procedure Set_Options (Men : in Menu; - Options : in Menu_Option_Set) + procedure Set_Options (Men : in Menu; + Options : in Menu_Option_Set) is - function Set_Menu_Opts (Men : Menu; + function Set_Menu_Opts (Men : Menu; Opt : C_Int) return C_Int; pragma Import (C, Set_Menu_Opts, "set_menu_opts"); - Opt : C_Int := MOS_2_CInt (Options); + Opt : C_Int := MOS_2_CInt (Options); Res : Eti_Error; begin - Res := Set_Menu_Opts (Men, Opt); + Res := Set_Menu_Opts (Men, Opt); if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Options; - procedure Switch_Options (Men : in Menu; - Options : in Menu_Option_Set; - On : in Boolean := True) + procedure Switch_Options (Men : in Menu; + Options : in Menu_Option_Set; + On : in Boolean := True) is - function Menu_Opts_On (Men : Menu; + function Menu_Opts_On (Men : Menu; Opt : C_Int) return C_Int; pragma Import (C, Menu_Opts_On, "menu_opts_on"); - function Menu_Opts_Off (Men : Menu; + function Menu_Opts_Off (Men : Menu; Opt : C_Int) return C_Int; pragma Import (C, Menu_Opts_Off, "menu_opts_off"); - Opt : C_Int := MOS_2_CInt (Options); + Opt : C_Int := MOS_2_CInt (Options); Err : Eti_Error; begin - if On then - Err := Menu_Opts_On (Men, Opt); + if On then + Err := Menu_Opts_On (Men, Opt); else - Err := Menu_Opts_Off (Men, Opt); + Err := Menu_Opts_Off (Men, Opt); end if; if Err /= E_Ok then Eti_Exception (Err); end if; end Switch_Options; - procedure Get_Options (Men : in Menu; - Options : out Menu_Option_Set) + procedure Get_Options (Men : in Menu; + Options : out Menu_Option_Set) is - function Menu_Opts (Men : Menu) return C_Int; + function Menu_Opts (Men : Menu) return C_Int; pragma Import (C, Menu_Opts, "menu_opts"); - Res : C_Int := Menu_Opts (Men); + Res : C_Int := Menu_Opts (Men); begin - Options := CInt_2_MOS (Res); + Options := CInt_2_MOS (Res); end Get_Options; - function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set + function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set is - Mos : Menu_Option_Set; + Mos : Menu_Option_Set; begin - Get_Options (Men, Mos); + Get_Options (Men, Mos); return Mos; end Get_Options; ------------------------------------------------------------------------------- - procedure Set_Window (Men : in Menu; - Win : in Window) + procedure Set_Window (Men : in Menu; + Win : in Window) is - function Set_Menu_Win (Men : Menu; + function Set_Menu_Win (Men : Menu; Win : Window) return C_Int; pragma Import (C, Set_Menu_Win, "set_menu_win"); - Res : constant Eti_Error := Set_Menu_Win (Men, Win); + Res : constant Eti_Error := Set_Menu_Win (Men, Win); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Window; - function Get_Window (Men : Menu) return Window + function Get_Window (Men : Menu) return Window is - function Menu_Win (Men : Menu) return Window; + function Menu_Win (Men : Menu) return Window; pragma Import (C, Menu_Win, "menu_win"); - W : constant Window := Menu_Win (Men); + W : constant Window := Menu_Win (Men); begin return W; end Get_Window; - procedure Set_Sub_Window (Men : in Menu; - Win : in Window) + procedure Set_Sub_Window (Men : in Menu; + Win : in Window) is - function Set_Menu_Sub (Men : Menu; + function Set_Menu_Sub (Men : Menu; Win : Window) return C_Int; pragma Import (C, Set_Menu_Sub, "set_menu_sub"); - Res : constant Eti_Error := Set_Menu_Sub (Men, Win); + Res : constant Eti_Error := Set_Menu_Sub (Men, Win); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Sub_Window; - function Get_Sub_Window (Men : Menu) return Window + function Get_Sub_Window (Men : Menu) return Window is - function Menu_Sub (Men : Menu) return Window; + function Menu_Sub (Men : Menu) return Window; pragma Import (C, Menu_Sub, "menu_sub"); - W : constant Window := Menu_Sub (Men); + W : constant Window := Menu_Sub (Men); begin return W; end Get_Sub_Window; - procedure Scale (Men : in Menu; - Lines : out Line_Count; - Columns : out Column_Count) + procedure Scale (Men : in Menu; + Lines : out Line_Count; + Columns : out Column_Count) is type C_Int_Access is access all C_Int; - function M_Scale (Men : Menu; + function M_Scale (Men : Menu; Yp, Xp : C_Int_Access) return C_Int; pragma Import (C, M_Scale, "scale_menu"); X, Y : aliased C_Int; - Res : constant Eti_Error := M_Scale (Men, Y'Access, X'Access); + Res : constant Eti_Error := M_Scale (Men, Y'Access, X'Access); begin if Res /= E_Ok then Eti_Exception (Res); end if; - Lines := Line_Count (Y); - Columns := Column_Count (X); + Lines := Line_Count (Y); + Columns := Column_Count (X); end Scale; ------------------------------------------------------------------------------- - procedure Position_Cursor (Men : Menu) + procedure Position_Cursor (Men : Menu) is - function Pos_Menu_Cursor (Men : Menu) return C_Int; + function Pos_Menu_Cursor (Men : Menu) return C_Int; pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor"); - Res : constant Eti_Error := Pos_Menu_Cursor (Men); + Res : constant Eti_Error := Pos_Menu_Cursor (Men); begin if Res /= E_Ok then Eti_Exception (Res); @@ -510,215 +510,215 @@ end Position_Cursor; ------------------------------------------------------------------------------- - procedure Set_Mark (Men : in Menu; - Mark : in String) + procedure Set_Mark (Men : in Menu; + Mark : in String) is type Char_Ptr is access all Interfaces.C.char; - function Set_Mark (Men : Menu; + function Set_Mark (Men : Menu; Mark : Char_Ptr) return C_Int; pragma Import (C, Set_Mark, "set_menu_mark"); - Txt : char_array (0 .. Mark'Length); + Txt : char_array (0 .. Mark'Length); Len : size_t; Res : Eti_Error; begin - To_C (Mark, Txt, Len); - Res := Set_Mark (Men, Txt (Txt'First)'Access); + To_C (Mark, Txt, Len); + Res := Set_Mark (Men, Txt (Txt'First)'Access); if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Mark; - procedure Mark (Men : in Menu; - Mark : out String) + procedure Mark (Men : in Menu; + Mark : out String) is - function Get_Menu_Mark (Men : Menu) return chars_ptr; + function Get_Menu_Mark (Men : Menu) return chars_ptr; pragma Import (C, Get_Menu_Mark, "menu_mark"); begin - Fill_String (Get_Menu_Mark (Men), Mark); + Fill_String (Get_Menu_Mark (Men), Mark); end Mark; - function Mark (Men : Menu) return String + function Mark (Men : Menu) return String is - function Get_Menu_Mark (Men : Menu) return chars_ptr; + function Get_Menu_Mark (Men : Menu) return chars_ptr; pragma Import (C, Get_Menu_Mark, "menu_mark"); begin - return Fill_String (Get_Menu_Mark (Men)); + return Fill_String (Get_Menu_Mark (Men)); end Mark; ------------------------------------------------------------------------------- - procedure Set_Foreground - (Men : in Menu; - Fore : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + procedure Set_Foreground + (Men : in Menu; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) is - function Set_Menu_Fore (Men : Menu; + function Set_Menu_Fore (Men : Menu; Attr : C_Chtype) return C_Int; pragma Import (C, Set_Menu_Fore, "set_menu_fore"); Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Fore); - Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch)); + Color => Color, + Attr => Fore); + Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Foreground; - procedure Foreground (Men : in Menu; - Fore : out Character_Attribute_Set) + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set) is - function Menu_Fore (Men : Menu) return C_Chtype; + function Menu_Fore (Men : Menu) return C_Chtype; pragma Import (C, Menu_Fore, "menu_fore"); begin - Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; + Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; end Foreground; - procedure Foreground (Men : in Menu; - Fore : out Character_Attribute_Set; - Color : out Color_Pair) + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set; + Color : out Color_Pair) is - function Menu_Fore (Men : Menu) return C_Chtype; + function Menu_Fore (Men : Menu) return C_Chtype; pragma Import (C, Menu_Fore, "menu_fore"); begin - Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; - Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color; + Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color; end Foreground; - procedure Set_Background - (Men : in Menu; - Back : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + procedure Set_Background + (Men : in Menu; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) is - function Set_Menu_Back (Men : Menu; + function Set_Menu_Back (Men : Menu; Attr : C_Chtype) return C_Int; pragma Import (C, Set_Menu_Back, "set_menu_back"); Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Back); - Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch)); + Color => Color, + Attr => Back); + Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Background; - procedure Background (Men : in Menu; - Back : out Character_Attribute_Set) + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set) is - function Menu_Back (Men : Menu) return C_Chtype; + function Menu_Back (Men : Menu) return C_Chtype; pragma Import (C, Menu_Back, "menu_back"); begin - Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; + Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; end Background; - procedure Background (Men : in Menu; - Back : out Character_Attribute_Set; - Color : out Color_Pair) + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set; + Color : out Color_Pair) is - function Menu_Back (Men : Menu) return C_Chtype; + function Menu_Back (Men : Menu) return C_Chtype; pragma Import (C, Menu_Back, "menu_back"); begin - Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; - Color := Chtype_To_AttrChar (Menu_Back (Men)).Color; + Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Back (Men)).Color; end Background; - procedure Set_Grey (Men : in Menu; - Grey : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + procedure Set_Grey (Men : in Menu; + Grey : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) is - function Set_Menu_Grey (Men : Menu; + function Set_Menu_Grey (Men : Menu; Attr : C_Chtype) return C_Int; pragma Import (C, Set_Menu_Grey, "set_menu_grey"); Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Grey); + Color => Color, + Attr => Grey); - Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch)); + Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Grey; - procedure Grey (Men : in Menu; - Grey : out Character_Attribute_Set) + procedure Grey (Men : in Menu; + Grey : out Character_Attribute_Set) is - function Menu_Grey (Men : Menu) return C_Chtype; + function Menu_Grey (Men : Menu) return C_Chtype; pragma Import (C, Menu_Grey, "menu_grey"); begin - Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; + Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; end Grey; - procedure Grey (Men : in Menu; - Grey : out Character_Attribute_Set; - Color : out Color_Pair) + procedure Grey (Men : in Menu; + Grey : out Character_Attribute_Set; + Color : out Color_Pair) is - function Menu_Grey (Men : Menu) return C_Chtype; + function Menu_Grey (Men : Menu) return C_Chtype; pragma Import (C, Menu_Grey, "menu_grey"); begin - Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; - Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color; + Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color; end Grey; - procedure Set_Pad_Character (Men : in Menu; - Pad : in Character := Space) + procedure Set_Pad_Character (Men : in Menu; + Pad : in Character := Space) is - function Set_Menu_Pad (Men : Menu; + function Set_Menu_Pad (Men : Menu; Ch : C_Int) return C_Int; pragma Import (C, Set_Menu_Pad, "set_menu_pad"); - Res : constant Eti_Error := Set_Menu_Pad (Men, - C_Int (Character'Pos (Pad))); + Res : constant Eti_Error := Set_Menu_Pad (Men, + C_Int (Character'Pos (Pad))); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Pad_Character; - procedure Pad_Character (Men : in Menu; - Pad : out Character) + procedure Pad_Character (Men : in Menu; + Pad : out Character) is - function Menu_Pad (Men : Menu) return C_Int; + function Menu_Pad (Men : Menu) return C_Int; pragma Import (C, Menu_Pad, "menu_pad"); begin - Pad := Character'Val (Menu_Pad (Men)); + Pad := Character'Val (Menu_Pad (Men)); end Pad_Character; ------------------------------------------------------------------------------- - procedure Set_Spacing (Men : in Menu; - Descr : in Column_Position := 0; - Row : in Line_Position := 0; - Col : in Column_Position := 0) + procedure Set_Spacing (Men : in Menu; + Descr : in Column_Position := 0; + Row : in Line_Position := 0; + Col : in Column_Position := 0) is - function Set_Spacing (Men : Menu; + function Set_Spacing (Men : Menu; D, R, C : C_Int) return C_Int; pragma Import (C, Set_Spacing, "set_menu_spacing"); - Res : constant Eti_Error := Set_Spacing (Men, - C_Int (Descr), - C_Int (Row), - C_Int (Col)); + Res : constant Eti_Error := Set_Spacing (Men, + C_Int (Descr), + C_Int (Row), + C_Int (Col)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Spacing; - procedure Spacing (Men : in Menu; - Descr : out Column_Position; - Row : out Line_Position; - Col : out Column_Position) + procedure Spacing (Men : in Menu; + Descr : out Column_Position; + Row : out Line_Position; + Col : out Column_Position) is type C_Int_Access is access all C_Int; - function Get_Spacing (Men : Menu; + function Get_Spacing (Men : Menu; D, R, C : C_Int_Access) return C_Int; pragma Import (C, Get_Spacing, "menu_spacing"); D, R, C : aliased C_Int; - Res : constant Eti_Error := Get_Spacing (Men, + Res : constant Eti_Error := Get_Spacing (Men, D'Access, R'Access, C'Access); @@ -726,26 +726,26 @@ if Res /= E_Ok then Eti_Exception (Res); else - Descr := Column_Position (D); - Row := Line_Position (R); - Col := Column_Position (C); + Descr := Column_Position (D); + Row := Line_Position (R); + Col := Column_Position (C); end if; end Spacing; ------------------------------------------------------------------------------- - function Set_Pattern (Men : Menu; - Text : String) return Boolean + function Set_Pattern (Men : Menu; + Text : String) return Boolean is type Char_Ptr is access all Interfaces.C.char; - function Set_Pattern (Men : Menu; + function Set_Pattern (Men : Menu; Pattern : Char_Ptr) return C_Int; pragma Import (C, Set_Pattern, "set_menu_pattern"); - S : char_array (0 .. Text'Length); + S : char_array (0 .. Text'Length); L : size_t; Res : Eti_Error; begin - To_C (Text, S, L); - Res := Set_Pattern (Men, S (S'First)'Access); + To_C (Text, S, L); + Res := Set_Pattern (Men, S (S'First)'Access); case Res is when E_No_Match => return False; when E_Ok => return True; @@ -755,270 +755,270 @@ end case; end Set_Pattern; - procedure Pattern (Men : in Menu; - Text : out String) + procedure Pattern (Men : in Menu; + Text : out String) is - function Get_Pattern (Men : Menu) return chars_ptr; + function Get_Pattern (Men : Menu) return chars_ptr; pragma Import (C, Get_Pattern, "menu_pattern"); begin - Fill_String (Get_Pattern (Men), Text); + Fill_String (Get_Pattern (Men), Text); end Pattern; ------------------------------------------------------------------------------- - procedure Set_Format (Men : in Menu; - Lines : in Line_Count; - Columns : in Column_Count) + procedure Set_Format (Men : in Menu; + Lines : in Line_Count; + Columns : in Column_Count) is - function Set_Menu_Fmt (Men : Menu; + function Set_Menu_Fmt (Men : Menu; Lin : C_Int; Col : C_Int) return C_Int; pragma Import (C, Set_Menu_Fmt, "set_menu_format"); - Res : constant Eti_Error := Set_Menu_Fmt (Men, - C_Int (Lines), - C_Int (Columns)); + Res : constant Eti_Error := Set_Menu_Fmt (Men, + C_Int (Lines), + C_Int (Columns)); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Format; - procedure Format (Men : in Menu; - Lines : out Line_Count; - Columns : out Column_Count) + procedure Format (Men : in Menu; + Lines : out Line_Count; + Columns : out Column_Count) is type C_Int_Access is access all C_Int; - function Menu_Fmt (Men : Menu; + function Menu_Fmt (Men : Menu; Y, X : C_Int_Access) return C_Int; pragma Import (C, Menu_Fmt, "menu_format"); L, C : aliased C_Int; - Res : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access); + Res : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access); begin if Res /= E_Ok then Eti_Exception (Res); else - Lines := Line_Count (L); - Columns := Column_Count (C); + Lines := Line_Count (L); + Columns := Column_Count (C); end if; end Format; ------------------------------------------------------------------------------- - procedure Set_Item_Init_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Item_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) is - function Set_Item_Init (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; + function Set_Item_Init (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; pragma Import (C, Set_Item_Init, "set_item_init"); - Res : constant Eti_Error := Set_Item_Init (Men, Proc); + Res : constant Eti_Error := Set_Item_Init (Men, Proc); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Item_Init_Hook; - procedure Set_Item_Term_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Item_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) is - function Set_Item_Term (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; + function Set_Item_Term (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; pragma Import (C, Set_Item_Term, "set_item_term"); - Res : constant Eti_Error := Set_Item_Term (Men, Proc); + Res : constant Eti_Error := Set_Item_Term (Men, Proc); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Item_Term_Hook; - procedure Set_Menu_Init_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Menu_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) is - function Set_Menu_Init (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; + function Set_Menu_Init (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; pragma Import (C, Set_Menu_Init, "set_menu_init"); - Res : constant Eti_Error := Set_Menu_Init (Men, Proc); + Res : constant Eti_Error := Set_Menu_Init (Men, Proc); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Menu_Init_Hook; - procedure Set_Menu_Term_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Menu_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) is - function Set_Menu_Term (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; + function Set_Menu_Term (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; pragma Import (C, Set_Menu_Term, "set_menu_term"); - Res : constant Eti_Error := Set_Menu_Term (Men, Proc); + Res : constant Eti_Error := Set_Menu_Term (Men, Proc); begin if Res /= E_Ok then Eti_Exception (Res); end if; end Set_Menu_Term_Hook; - function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function + function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function is - function Item_Init (Men : Menu) return Menu_Hook_Function; + function Item_Init (Men : Menu) return Menu_Hook_Function; pragma Import (C, Item_Init, "item_init"); begin - return Item_Init (Men); + return Item_Init (Men); end Get_Item_Init_Hook; - function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function + function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function is - function Item_Term (Men : Menu) return Menu_Hook_Function; + function Item_Term (Men : Menu) return Menu_Hook_Function; pragma Import (C, Item_Term, "item_term"); begin - return Item_Term (Men); + return Item_Term (Men); end Get_Item_Term_Hook; - function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function + function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function is - function Menu_Init (Men : Menu) return Menu_Hook_Function; + function Menu_Init (Men : Menu) return Menu_Hook_Function; pragma Import (C, Menu_Init, "menu_init"); begin - return Menu_Init (Men); + return Menu_Init (Men); end Get_Menu_Init_Hook; - function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function + function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function is - function Menu_Term (Men : Menu) return Menu_Hook_Function; + function Menu_Term (Men : Menu) return Menu_Hook_Function; pragma Import (C, Menu_Term, "menu_term"); begin - return Menu_Term (Men); + return Menu_Term (Men); end Get_Menu_Term_Hook; ------------------------------------------------------------------------------- - procedure Redefine (Men : in Menu; - Items : in Item_Array_Access) + procedure Redefine (Men : in Menu; + Items : in Item_Array_Access) is - function Set_Items (Men : Menu; + function Set_Items (Men : Menu; Items : System.Address) return C_Int; pragma Import (C, Set_Items, "set_menu_items"); Res : Eti_Error; begin pragma Assert (Items (Items'Last) = Null_Item); - if Items (Items'Last) /= Null_Item then - raise Menu_Exception; + if Items (Items'Last) /= Null_Item then + raise Menu_Exception; else - Res := Set_Items (Men, Items.all'Address); + Res := Set_Items (Men, Items.all'Address); if Res /= E_Ok then Eti_Exception (Res); end if; end if; end Redefine; - function Item_Count (Men : Menu) return Natural + function Item_Count (Men : Menu) return Natural is - function Count (Men : Menu) return C_Int; + function Count (Men : Menu) return C_Int; pragma Import (C, Count, "item_count"); begin - return Natural (Count (Men)); + return Natural (Count (Men)); end Item_Count; - function Items (Men : Menu; - Index : Positive) return Item + function Items (Men : Menu; + Index : Positive) return Item is use I_Array; - function C_Mitems (Men : Menu) return Pointer; + function C_Mitems (Men : Menu) return Pointer; pragma Import (C, C_Mitems, "menu_items"); - P : Pointer := C_Mitems (Men); + P : Pointer := C_Mitems (Men); begin - if P = null or else Index not in 1 .. Item_Count (Men) then - raise Menu_Exception; + if P = null or else Index not in 1 .. Item_Count (Men) then + raise Menu_Exception; else - P := P + ptrdiff_t (C_Int (Index) - 1); + P := P + ptrdiff_t (C_Int (Index) - 1); return P.all; end if; end Items; ------------------------------------------------------------------------------- - function Create (Items : Item_Array_Access) return Menu + function Create (Items : Item_Array_Access) return Menu is - function Newmenu (Items : System.Address) return Menu; + function Newmenu (Items : System.Address) return Menu; pragma Import (C, Newmenu, "new_menu"); - M : Menu; + M : Menu; begin pragma Assert (Items (Items'Last) = Null_Item); - if Items (Items'Last) /= Null_Item then - raise Menu_Exception; + if Items (Items'Last) /= Null_Item then + raise Menu_Exception; else - M := Newmenu (Items.all'Address); - if M = Null_Menu then - raise Menu_Exception; + M := Newmenu (Items.all'Address); + if M = Null_Menu then + raise Menu_Exception; end if; return M; end if; end Create; - procedure Delete (Men : in out Menu) + procedure Delete (Men : in out Menu) is - function Free (Men : Menu) return C_Int; + function Free (Men : Menu) return C_Int; pragma Import (C, Free, "free_menu"); - Res : constant Eti_Error := Free (Men); + Res : constant Eti_Error := Free (Men); begin if Res /= E_Ok then Eti_Exception (Res); end if; - Men := Null_Menu; + Men := Null_Menu; end Delete; ------------------------------------------------------------------------------ - function Driver (Men : Menu; - Key : Key_Code) return Driver_Result + function Driver (Men : Menu; + Key : Key_Code) return Driver_Result is - function Driver (Men : Menu; + function Driver (Men : Menu; Key : C_Int) return C_Int; pragma Import (C, Driver, "menu_driver"); - R : Eti_Error := Driver (Men, C_Int (Key)); + R : Eti_Error := Driver (Men, C_Int (Key)); begin if R /= E_Ok then case R is - when E_Unknown_Command => return Unknown_Request; - when E_No_Match => return No_Match; + when E_Unknown_Command => return Unknown_Request; + when E_No_Match => return No_Match; when E_Request_Denied | - E_Not_Selectable => return Request_Denied; + E_Not_Selectable => return Request_Denied; when others => Eti_Exception (R); end case; end if; - return Menu_Ok; + return Menu_Ok; end Driver; - procedure Free (IA : in out Item_Array_Access; - Free_Items : in Boolean := False) + procedure Free (IA : in out Item_Array_Access; + Free_Items : in Boolean := False) is procedure Release is new Ada.Unchecked_Deallocation - (Item_Array, Item_Array_Access); + (Item_Array, Item_Array_Access); begin - if IA /= null and then Free_Items then - for I in IA'First .. (IA'Last - 1) loop - if (IA (I) /= Null_Item) then - Delete (IA (I)); + if IA /= null and then Free_Items then + for I in IA'First .. (IA'Last - 1) loop + if (IA (I) /= Null_Item) then + Delete (IA (I)); end if; end loop; end if; - Release (IA); + Release (IA); end Free; ------------------------------------------------------------------------------- - function Default_Menu_Options return Menu_Option_Set + function Default_Menu_Options return Menu_Option_Set is begin - return Get_Options (Null_Menu); + return Get_Options (Null_Menu); end Default_Menu_Options; - function Default_Item_Options return Item_Option_Set + function Default_Item_Options return Item_Option_Set is begin - return Get_Options (Null_Item); + return Get_Options (Null_Item); end Default_Item_Options; ------------------------------------------------------------------------------- diff --git a/doc/html/ada/terminal_interface-curses-menus__ads.htm b/doc/html/ada/terminal_interface-curses-menus__ads.htm index 22584143..5a591dae 100644 --- a/doc/html/ada/terminal_interface-curses-menus__ads.htm +++ b/doc/html/ada/terminal_interface-curses-menus__ads.htm @@ -40,15 +40,14 @@ ------------------------------------------------------------------------------ -- Author: Jürgen Pfeifer <<juergen.pfeifer@gmx.net>> 1996 -- Version Control: --- @Revision: 1.20 @ +-- @Revision: 1.21 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- menu binding. -- This module is generated. Please don't change it manually! -- Run the generator instead. -- | -with System; -with Interfaces.C; +with System; with Ada.Characters.Latin_1; package Terminal_Interface.Curses.Menus is @@ -58,57 +57,57 @@ Space : Character renames Ada.Characters.Latin_1.Space; - type Item is private; + type Item is private; type Menu is private; --------------------------- -- Interface constants -- --------------------------- - Null_Item : constant Item; + Null_Item : constant Item; Null_Menu : constant Menu; subtype Menu_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 17); -- The prefix M_ stands for "Menu Request" - M_Left_Item : constant Menu_Request_Code := Key_Max + 1; - M_Right_Item : constant Menu_Request_Code := Key_Max + 2; - M_Up_Item : constant Menu_Request_Code := Key_Max + 3; - M_Down_Item : constant Menu_Request_Code := Key_Max + 4; - M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5; - M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6; - M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7; - M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8; - M_First_Item : constant Menu_Request_Code := Key_Max + 9; - M_Last_Item : constant Menu_Request_Code := Key_Max + 10; - M_Next_Item : constant Menu_Request_Code := Key_Max + 11; - M_Previous_Item : constant Menu_Request_Code := Key_Max + 12; - M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13; - M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14; - M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15; - M_Next_Match : constant Menu_Request_Code := Key_Max + 16; + M_Left_Item : constant Menu_Request_Code := Key_Max + 1; + M_Right_Item : constant Menu_Request_Code := Key_Max + 2; + M_Up_Item : constant Menu_Request_Code := Key_Max + 3; + M_Down_Item : constant Menu_Request_Code := Key_Max + 4; + M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5; + M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6; + M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7; + M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8; + M_First_Item : constant Menu_Request_Code := Key_Max + 9; + M_Last_Item : constant Menu_Request_Code := Key_Max + 10; + M_Next_Item : constant Menu_Request_Code := Key_Max + 11; + M_Previous_Item : constant Menu_Request_Code := Key_Max + 12; + M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13; + M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14; + M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15; + M_Next_Match : constant Menu_Request_Code := Key_Max + 16; M_Previous_Match : constant Menu_Request_Code := Key_Max + 17; -- For those who like the old 'C' names for the request codes - REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item; - REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item; - REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item; - REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item; - REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line; - REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line; - REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page; - REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page; - REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item; - REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item; - REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item; - REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item; - REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item; - REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern; - REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern; - REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match; + REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item; + REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item; + REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item; + REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item; + REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line; + REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line; + REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page; + REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page; + REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item; + REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item; + REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item; + REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item; + REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item; + REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern; + REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern; + REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match; REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match; - procedure Request_Name (Key : in Menu_Request_Code; + procedure Request_Name (Key : in Menu_Request_Code; Name : out String); function Request_Name (Key : Menu_Request_Code) return String; @@ -125,13 +124,13 @@ pragma Warnings (Off); type Menu_Option_Set is record - One_Valued : Boolean; - Show_Descriptions : Boolean; - Row_Major_Order : Boolean; - Ignore_Case : Boolean; - Show_Matches : Boolean; + One_Valued : Boolean; + Show_Descriptions : Boolean; + Row_Major_Order : Boolean; + Ignore_Case : Boolean; + Show_Matches : Boolean; Non_Cyclic : Boolean; - end record; + end record; pragma Pack (Menu_Option_Set); pragma Convention (C, Menu_Option_Set); @@ -159,7 +158,7 @@ type Item_Option_Set is record Selectable : Boolean; - end record; + end record; pragma Pack (Item_Option_Set); pragma Convention (C, Item_Option_Set); @@ -184,7 +183,7 @@ type Item_Array_Access is access Item_Array; - procedure Free (IA : in out Item_Array_Access; + procedure Free (IA : in out Item_Array_Access; Free_Items : Boolean := False); -- Release the memory for an allocated item array -- If Free_Items is True, call Delete() for all the items in @@ -195,14 +194,14 @@ -- |===================================================================== -- #1A NAME="AFU_1"#2| - function Create (Name : String; + function Create (Name : String; Description : String := "") return Item; -- AKA: new_item() -- Not inlined. -- #1A NAME="AFU_2"#2| - function New_Item (Name : String; - Description : String := "") return Item + function New_Item (Name : String; + Description : String := "") return Item renames Create; -- AKA: new_item() @@ -216,7 +215,7 @@ -- |===================================================================== -- #1A NAME="AFU_4"#2| - procedure Set_Value (Itm : in Item; + procedure Set_Value (Itm : in Item; Value : in Boolean := True); -- AKA: set_item_value() pragma Inline (Set_Value); @@ -240,14 +239,14 @@ -- |===================================================================== -- #1A NAME="AFU_7"#2| - procedure Set_Options (Itm : in Item; + procedure Set_Options (Itm : in Item; Options : in Item_Option_Set); -- AKA: set_item_opts() -- An overloaded Set_Options is defined later. Pragma Inline appears there -- #1A NAME="AFU_8"#2| - procedure Switch_Options (Itm : in Item; - Options : in Item_Option_Set; + procedure Switch_Options (Itm : in Item; + Options : in Item_Option_Set; On : Boolean := True); -- AKA: item_opts_on() -- AKA: item_opts_off() @@ -255,7 +254,7 @@ -- Pragma Inline appears there -- #1A NAME="AFU_9"#2| - procedure Get_Options (Itm : in Item; + procedure Get_Options (Itm : in Item; Options : out Item_Option_Set); -- AKA: item_opts() @@ -269,7 +268,7 @@ -- |===================================================================== -- #1A NAME="AFU_11"#2| - procedure Name (Itm : in Item; + procedure Name (Itm : in Item; Name : out String); -- AKA: item_name() function Name (Itm : Item) return String; @@ -278,7 +277,7 @@ pragma Inline (Name); -- #1A NAME="AFU_12"#2| - procedure Description (Itm : in Item; + procedure Description (Itm : in Item; Description : out String); -- AKA: item_description(); @@ -292,7 +291,7 @@ -- |===================================================================== -- #1A NAME="AFU_13"#2| - procedure Set_Current (Men : in Menu; + procedure Set_Current (Men : in Menu; Itm : in Item); -- AKA: set_current_item() pragma Inline (Set_Current); @@ -303,7 +302,7 @@ pragma Inline (Current); -- #1A NAME="AFU_15"#2| - procedure Set_Top_Row (Men : in Menu; + procedure Set_Top_Row (Men : in Menu; Line : in Line_Position); -- AKA: set_top_row() pragma Inline (Set_Top_Row); @@ -326,7 +325,7 @@ -- |===================================================================== -- #1A NAME="AFU_18"#2| - procedure Post (Men : in Menu; + procedure Post (Men : in Menu; Post : in Boolean := True); -- AKA: post_menu() -- AKA: unpost_menu() @@ -337,21 +336,21 @@ -- |===================================================================== -- #1A NAME="AFU_19"#2| - procedure Set_Options (Men : in Menu; + procedure Set_Options (Men : in Menu; Options : in Menu_Option_Set); -- AKA: set_menu_opts() pragma Inline (Set_Options); -- #1A NAME="AFU_20"#2| - procedure Switch_Options (Men : in Menu; - Options : in Menu_Option_Set; + procedure Switch_Options (Men : in Menu; + Options : in Menu_Option_Set; On : Boolean := True); -- AKA: menu_opts_on() -- AKA: menu_opts_off() pragma Inline (Switch_Options); -- #1A NAME="AFU_21"#2| - procedure Get_Options (Men : in Menu; + procedure Get_Options (Men : in Menu; Options : out Menu_Option_Set); -- AKA: menu_opts() @@ -365,7 +364,7 @@ -- |===================================================================== -- #1A NAME="AFU_23"#2| - procedure Set_Window (Men : in Menu; + procedure Set_Window (Men : in Menu; Win : in Window); -- AKA: set_menu_win() pragma Inline (Set_Window); @@ -376,7 +375,7 @@ pragma Inline (Get_Window); -- #1A NAME="AFU_25"#2| - procedure Set_Sub_Window (Men : in Menu; + procedure Set_Sub_Window (Men : in Menu; Win : in Window); -- AKA: set_menu_sub() pragma Inline (Set_Sub_Window); @@ -387,8 +386,8 @@ pragma Inline (Get_Sub_Window); -- #1A NAME="AFU_27"#2| - procedure Scale (Men : in Menu; - Lines : out Line_Count; + procedure Scale (Men : in Menu; + Lines : out Line_Count; Columns : out Column_Count); -- AKA: scale_menu() pragma Inline (Scale); @@ -407,13 +406,13 @@ -- |===================================================================== -- #1A NAME="AFU_29"#2| - procedure Set_Mark (Men : in Menu; + procedure Set_Mark (Men : in Menu; Mark : in String); -- AKA: set_menu_mark() pragma Inline (Set_Mark); -- #1A NAME="AFU_30"#2| - procedure Mark (Men : in Menu; + procedure Mark (Men : in Menu; Mark : out String); -- AKA: menu_mark() @@ -428,73 +427,73 @@ -- #1A NAME="AFU_31"#2| procedure Set_Foreground - (Men : in Menu; - Fore : in Character_Attribute_Set := Normal_Video; + (Men : in Menu; + Fore : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA: set_menu_fore() pragma Inline (Set_Foreground); -- #1A NAME="AFU_32"#2| - procedure Foreground (Men : in Menu; + procedure Foreground (Men : in Menu; Fore : out Character_Attribute_Set); -- AKA: menu_fore() -- #1A NAME="AFU_33"#2| - procedure Foreground (Men : in Menu; - Fore : out Character_Attribute_Set; + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set; Color : out Color_Pair); -- AKA: menu_fore() pragma Inline (Foreground); -- #1A NAME="AFU_34"#2| procedure Set_Background - (Men : in Menu; - Back : in Character_Attribute_Set := Normal_Video; + (Men : in Menu; + Back : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA: set_menu_back() pragma Inline (Set_Background); -- #1A NAME="AFU_35"#2| - procedure Background (Men : in Menu; + procedure Background (Men : in Menu; Back : out Character_Attribute_Set); -- AKA: menu_back() -- #1A NAME="AFU_36"#2| - procedure Background (Men : in Menu; - Back : out Character_Attribute_Set; + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set; Color : out Color_Pair); -- AKA: menu_back() pragma Inline (Background); -- #1A NAME="AFU_37"#2| procedure Set_Grey - (Men : in Menu; - Grey : in Character_Attribute_Set := Normal_Video; + (Men : in Menu; + Grey : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA: set_menu_grey() pragma Inline (Set_Grey); -- #1A NAME="AFU_38"#2| - procedure Grey (Men : in Menu; + procedure Grey (Men : in Menu; Grey : out Character_Attribute_Set); -- AKA: menu_grey() -- #1A NAME="AFU_39"#2| procedure Grey - (Men : in Menu; - Grey : out Character_Attribute_Set; + (Men : in Menu; + Grey : out Character_Attribute_Set; Color : out Color_Pair); -- AKA: menu_grey() pragma Inline (Grey); -- #1A NAME="AFU_40"#2| - procedure Set_Pad_Character (Men : in Menu; + procedure Set_Pad_Character (Men : in Menu; Pad : in Character := Space); -- AKA: set_menu_pad() pragma Inline (Set_Pad_Character); -- #1A NAME="AFU_41"#2| - procedure Pad_Character (Men : in Menu; + procedure Pad_Character (Men : in Menu; Pad : out Character); -- AKA: menu_pad() pragma Inline (Pad_Character); @@ -504,17 +503,17 @@ -- |===================================================================== -- #1A NAME="AFU_42"#2| - procedure Set_Spacing (Men : in Menu; - Descr : in Column_Position := 0; - Row : in Line_Position := 0; + procedure Set_Spacing (Men : in Menu; + Descr : in Column_Position := 0; + Row : in Line_Position := 0; Col : in Column_Position := 0); -- AKA: set_menu_spacing() pragma Inline (Set_Spacing); -- #1A NAME="AFU_43"#2| - procedure Spacing (Men : in Menu; - Descr : out Column_Position; - Row : out Line_Position; + procedure Spacing (Men : in Menu; + Descr : out Column_Position; + Row : out Line_Position; Col : out Column_Position); -- AKA: menu_spacing() pragma Inline (Spacing); @@ -524,14 +523,14 @@ -- |===================================================================== -- #1A NAME="AFU_44"#2| - function Set_Pattern (Men : Menu; + function Set_Pattern (Men : Menu; Text : String) return Boolean; -- AKA: set_menu_pattern() -- Return TRUE if the pattern matches, FALSE otherwise pragma Inline (Set_Pattern); -- #1A NAME="AFU_45"#2| - procedure Pattern (Men : in Menu; + procedure Pattern (Men : in Menu; Text : out String); -- AKA: menu_pattern() pragma Inline (Pattern); @@ -541,15 +540,15 @@ -- |===================================================================== -- #1A NAME="AFU_46"#2| - procedure Set_Format (Men : in Menu; - Lines : in Line_Count; + procedure Set_Format (Men : in Menu; + Lines : in Line_Count; Columns : in Column_Count); -- AKA: set_menu_format() pragma Inline (Set_Format); -- #1A NAME="AFU_47"#2| - procedure Format (Men : in Menu; - Lines : out Line_Count; + procedure Format (Men : in Menu; + Lines : out Line_Count; Columns : out Column_Count); -- AKA: menu_format() pragma Inline (Format); @@ -562,25 +561,25 @@ pragma Convention (C, Menu_Hook_Function); -- #1A NAME="AFU_48"#2| - procedure Set_Item_Init_Hook (Men : in Menu; + procedure Set_Item_Init_Hook (Men : in Menu; Proc : in Menu_Hook_Function); -- AKA: set_item_init() pragma Inline (Set_Item_Init_Hook); -- #1A NAME="AFU_49"#2| - procedure Set_Item_Term_Hook (Men : in Menu; + procedure Set_Item_Term_Hook (Men : in Menu; Proc : in Menu_Hook_Function); -- AKA: set_item_term() pragma Inline (Set_Item_Term_Hook); -- #1A NAME="AFU_50"#2| - procedure Set_Menu_Init_Hook (Men : in Menu; + procedure Set_Menu_Init_Hook (Men : in Menu; Proc : in Menu_Hook_Function); -- AKA: set_menu_init() pragma Inline (Set_Menu_Init_Hook); -- #1A NAME="AFU_51"#2| - procedure Set_Menu_Term_Hook (Men : in Menu; + procedure Set_Menu_Term_Hook (Men : in Menu; Proc : in Menu_Hook_Function); -- AKA: set_menu_term() pragma Inline (Set_Menu_Term_Hook); @@ -610,17 +609,17 @@ -- |===================================================================== -- #1A NAME="AFU_56"#2| - procedure Redefine (Men : in Menu; + procedure Redefine (Men : in Menu; Items : in Item_Array_Access); -- AKA: set_menu_items() pragma Inline (Redefine); - procedure Set_Items (Men : in Menu; - Items : in Item_Array_Access) renames Redefine; + procedure Set_Items (Men : in Menu; + Items : in Item_Array_Access) renames Redefine; pragma Inline (Set_Items); -- #1A NAME="AFU_57"#2| - function Items (Men : Menu; + function Items (Men : Menu; Index : Positive) return Item; -- AKA: menu_items() pragma Inline (Items); @@ -651,23 +650,23 @@ -- | Man page menu_new.3x -- |===================================================================== - type Driver_Result is (Menu_Ok, - Request_Denied, - Unknown_Request, + type Driver_Result is (Menu_Ok, + Request_Denied, + Unknown_Request, No_Match); -- #1A NAME="AFU_61"#2| - function Driver (Men : Menu; + function Driver (Men : Menu; Key : Key_Code) return Driver_Result; -- AKA: menu_driver() -- Driver is not inlined ------------------------------------------------------------------------------- private - type Item is new System.Storage_Elements.Integer_Address; + type Item is new System.Storage_Elements.Integer_Address; type Menu is new System.Storage_Elements.Integer_Address; - Null_Item : constant Item := 0; + Null_Item : constant Item := 0; Null_Menu : constant Menu := 0; end Terminal_Interface.Curses.Menus; diff --git a/doc/html/ada/terminal_interface-curses-text_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io__adb.htm index b1fe06a5..f38ec168 100644 --- a/doc/html/ada/terminal_interface-curses-text_io__adb.htm +++ b/doc/html/ada/terminal_interface-curses-text_io__adb.htm @@ -39,7 +39,7 @@ ------------------------------------------------------------------------------ -- Author: Jürgen Pfeifer <<juergen.pfeifer@gmx.net>> 1996 -- Version Control: --- @Revision: 1.11 @ +-- @Revision: 1.12 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO is @@ -139,7 +139,7 @@ if P_Size > 0 and then Line (Win) >= P_Size then New_Page (Win); else - Add (Win, Ascii.LF); + Add (Win, ASCII.LF); end if; end loop; end New_Line; diff --git a/doc/html/ada/terminal_interface-curses__adb.htm b/doc/html/ada/terminal_interface-curses__adb.htm index 145e2a35..a0be638f 100644 --- a/doc/html/ada/terminal_interface-curses__adb.htm +++ b/doc/html/ada/terminal_interface-curses__adb.htm @@ -39,7 +39,7 @@ ------------------------------------------------------------------------------ -- Author: Jürgen Pfeifer <<juergen.pfeifer@gmx.net>> 1996 -- Version Control: --- @Revision: 1.25 @ +-- @Revision: 1.26 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; @@ -926,7 +926,7 @@ when Non_Blocking => Time := 0; when Delayed => if Amount = 0 then - raise CONSTRAINT_ERROR; + raise Constraint_Error; end if; Time := C_Int (Amount); end case; diff --git a/doc/html/ada/terminal_interface-curses__ads.htm b/doc/html/ada/terminal_interface-curses__ads.htm index 208b12a1..bc665087 100644 --- a/doc/html/ada/terminal_interface-curses__ads.htm +++ b/doc/html/ada/terminal_interface-curses__ads.htm @@ -55,8 +55,8 @@ pragma Linker_Options ("-lncurses"); NC_Major_Version : constant := 5; -- Major version of the library - NC_Minor_Version : constant := 0; -- Minor version of the library - NC_Version : constant String := "5.0"; -- Version of library + NC_Minor_Version : constant := 2; -- Minor version of the library + NC_Version : constant String := "5.2"; -- Version of library type Window is private; Null_Window : constant Window; diff --git a/doc/html/announce.html b/doc/html/announce.html index e7a79d6c..3005e49d 100644 --- a/doc/html/announce.html +++ b/doc/html/announce.html @@ -1,15 +1,15 @@ -Announcing ncurses 5.1 +Announcing ncurses 5.2 -

Announcing ncurses 5.1

+

Announcing ncurses 5.2

The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -38,136 +38,327 @@ the GNU distribution site

Release Notes

-This release is designed to be upward compatible from ncurses 5.0; very few -applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.0 release. +This release is designed to be upward compatible from ncurses 5.0 and 5.1; +very few applications will require recompilation, depending on the platform. +These are the highlights from the change-log since ncurses 5.1 release.

Interface changes:

    -
  • made the extended terminal capabilities - (configure --enable-tcap-names) - a standard feature (though the configure script can disable it, - it is built by default). - -
  • removed the trace() function and related trace support - from the production library. This is the only interface change that - may cause problems with existing applications linked to shared - libraries, since not all platforms use the minor version number. - -
  • explicitly initialized to zero several data items which were - implicitly initialized, e.g., cur_term. If not explicitly - initialized, their storage type is C (common), and causes problems - linking on some platforms. - -
  • modified curses.h.in, undef'ing some symbols to avoid conflict with - C++ STL. +
  • change type of ospeed variable back to + short to match its use in legacy applications. It was + altered after ncurses 4.2 to speed_t to repair a type + mismatch which was introduced after 1.9.4 in 1995. The principal + users of termcap continued to use short, which is + not the same size. +

    + NOTE: A few applications will have to be recompiled + (about 1% of the programs in a typical Linux distribution, + 10% of the programs that use ncurses). These are easy to + identify with nm or strings. + +

  • remove a private function _nc_can_clear_with(), which + was built with the configure --enable-expanded option but not used. + +
  • add several private functions (prefixed with "_nc_") for tracing + chtype values in the debug library, and for better + access and buffer limit checking.
-New features: +New features and improvements:
    -
  • added a new extension, assume_default_colors() to - provide better control over the use of default colors. This is - the principal visible difference between ncurses 5.1 and preceding - versions. The new extension allows an application to specify what - colors pair 0 uses. -

    - NOTE: Pair 0 defaults to white on black unless - you have invoked use_default_colors() or set it via - assume_default_colors(). An application that calls - start_colors() without setting the background color - will consistently have a black background no matter what color your - terminal's background actually is. - -

  • made several fixes to the terminfo-to-termcap conversion, and - have been using the generated termcaps without further hand-tuning. - This builds on the extension use_extended_names() by - adding "obsolete" termcap strings to terminfo.src +
  • rewrote tgoto() to make it better support existing + termcap applications which use hardcoded strings rather than obtain + all of their information from the termcap file. If the string does + not appear to be a terminfo string (i.e., does not refer to a "%p" + parameter, or terminfo-style padding), and termcap support is configured, tgoto() + will interpret it as termcap. Otherwise, as before, it will use + tparm(). + +
  • to ensure that the tgoto() changes work properly, + added checks to tic which report capabilities that do + not reference the expected number of parameters. + +
  • new configure script options:
      -
    • modified tic so that if extended names (i.e., - configure --enable-tcap-names) are active, then tic -x - will also write "obsolete" capabilities that are present in the - terminfo source. - -
    • added screen's AX capability (for ECMA SGR 39 and 49) to applicable - terminfo entries, use presence of this as a check for a small - improvement in setting default colors. - -
    • add -a option to tic and infocmp, which retains commented-out - capabilities during source translation/comparison, e.g., captoinfo - and infotocap. +
    • option --disable-root-environ adds runtime checks + which tell ncurses to disregard $TERMINFO and similar environment + variables if the current user is root, or running setuid/setgid. + +
    • option --disable-assumed-color allows you to use the + pre-5.1 convention of default colors used for color-pair 0 to be + configured (see assume_default_colors()). + +
    • implement configure script options that transform installed + program names, e.g., --program-prefix, including the + manpage names and cross references. + +
    • option --with-database allows you to specify a + different terminfo source-file to install. On OS/2 EMX, the + default is misc/emx.src, otherwise misc/terminfo.src + +
    • option --with-default-terminfo-dir allows you to + specify the default terminfo database directory. + +
    • option --with-libtool allows you to build with + libtool.

      NOTE: libtool + uses a different notation for numbering shared library versions + from the existing ncurses configuration. + +

    • option --with-manpage-tbl causes the manpages to be + preprocessed by tbl(1) prior to installation, + +
    • option --without-curses-h causes the installation + process to install curses.h as ncurses.h and make appropriate + changes to headers and manpages.
    -
  • implemented limited support for UTF-8, useful with XFree86 xterm: +
  • modified configure script options:
      -
    • if the configure --enable-widec option is - given, append 'w' to names of the generated libraries (e.g., - libncursesw.so) to avoid conflict with existing ncurses libraries. -
    • add a simple UTF-8 output driver to the experimental - wide-character support. If any of the environment variables - LC_ALL, LC_CTYPE or LANG contain the string "UTF-8", this driver - will be used to translate the output to UTF-8. -
    • modified view.c to make a rudimentary viewer of UTF-8 text. +
    • change symbol used by the --install-prefix configure + option from INSTALL_PREFIX to DESTDIR + (the latter has become common usage although the name is + misleading). + +
    • modify ld -rpath options (e.g., Linux, and Solaris) + to use an absolute pathname for the build tree's lib directory, + avoiding confusion with directories relative to the current one + with the installed programs. + +
    • modified misc/run_tic.in to use + tic -o, to eliminate dependency on + $TERMINFO variable for installs.
    -
  • modify raw() and noraw() to clear/restore - IEXTEN flag which affects stty lnext on systems such as FreeBSD +
  • terminfo database: +
      +
    • updated xterm terminfo entries to match XFree86 xterm patch #146. -
    • reordered tests during mouse initialization to allow for gpm to run - in xterm, or for xterm to be used under OS/2 EMX. Also dropped test - for $DISPLAY in favor of the terminfo capability - kmous=\E[M or - if $TERM environment variable contains "xterm". +
    • added amiga-vnc, + Matrix Orbital, and + QNX qansi to misc/terminfo.src. -
    • added configure option --with-manpage-symlinks, which - provides for fully indexing manpage entries by making symbolic links - for the aliases. +
    • added os2 entry to misc/emx.src. -
    • changed unctrl() to render C1 characters (128-159) as - ~@, ~A, etc. +
    • add S0 and E0 extensions to screen's terminfo entry + since otherwise the FreeBSD port makes it pass termcap equivalents + to tgoto, which would be misinterpreted by older + versions of ncurses. +
    + +
  • improvements to program usability: +
      +
    • modify programs to use curses_version() string to + report the version of ncurses with which they are compiled rather + than the NCURSES_VERSION string. The function returns the patch + level in addition to the major and minor version numbers. -
    • add experimental configure option --enable-colorfgbg to check for - $COLORTERM variable as set by rxvt/aterm/Eterm. +
    • modify tput program so it can be renamed or invoked via a link as + 'reset' or 'init', producing the same effect as tput reset or tput init. -
    • made the infocmp -F option less verbose. +
    • add error checking to infocmp's -v and -m options to ensure that + the option value is indeed a number. +
    -
  • dropped support for gnat 3.10 (gnat 3.12 is current). +
  • improved performance: +
      +
    • replace a lookup table in lib_vidattr.c used to decode + no_color_video with a logic expression which is faster. +
Major bug fixes:
    -
  • modified infocmp -e, -E options to ensure that generated fallback.c - type for Booleans agrees with term.h +
  • correct manlinks.sed script introduced in ncurses 5.1 + to avoid using ERE "\+", which is not understood by standard versions + of sed. This happens to work with GNU sed, + but is not portable, and was the initial motivation for this release. + +
  • remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. + This differed from the "hpux*" case by using reversed symbolic + links, which made the 5.1 version not match the configuration of + 5.0 shared libraries. + +
  • guard against corrupt terminfo data: +
      +
    • modify tparm() to disallow arithmetic on strings, + analyze the varargs list to read strings as strings and numbers as + numbers. + +
    • modify tparm()'s internal function + spop() to treat a null pointer as an empty string. + +
    • modify parse_format() in lib_tparm.c to ignore + precision if it is longer than 10000. + +
    • rewrote limit checks in lib_mvcur.c using new functions + _nc_safe_strcat(), etc. Made other related changes to + check lengths used for strcat() and + strcpy(). +
    + +
  • corrections to screen optimization: +
      +
    • added special case in lib_vidattr.c to reset underline and + standout for devices that have no sgr0 defined. + +
    • change handling of non_dest_scroll_region in + tty_update.c to clear text after it is shifted in rather than before + shifting out. Also correct row computation. + +
    • modify rs2 capability in xterm-r6 and similar entries + where cursor save/restore bracketed the sequence for resetting video + attributes. The cursor restore would undo that. +
    + +
  • UTF-8 support: +
      +
    • when checking LC_ALL, LC_CTYPE, and LANG environment variables + for UTF-8 locale, ignore those which are set to an empty value, as + per SUSV2. -
    • documented a special case of incompatiblity between ncurses 4.2 and - 5.0, added a section for this in INSTALL. +
    • encode 0xFFFD in UTF-8 with 3 bytes, not 2. -
    • corrected tests for file-descriptors in OS/2 EMX mouse support. A - negative value could be used by FD_SET, causing the select() call to - wait indefinitely. +
    • modify _nc_utf8_outch() to avoid sign-extension when + checking for out-of-range value. +
    -
  • made 'tput flash' work properly for xterm by flushing output in - delay_output() when using napms(), and modifying xterm's terminfo to - specify no padding character. Otherwise, xterm's reported baud rate - could mislead ncurses into producing too few padding characters. +
  • other library fixes: +
      +
    • added checks for an empty $HOME environment + variable, to avoid retrieving terminfo descriptions from + ./.terminfo . -
    • modified lib_addch.c to allow repeated update to the lower-right - corner, rather than displaying only the first character written until - the cursor is moved. Recent versions of SVr4 curses can update the - lower-right corner, and behave this way. +
    • change functions _nc_parse_entry() and + postprocess_termcap() to avoid using + strtok(), because it is non-reentrant. -
    • modified echo() behavior of getch() to match Solaris curses for - carriage return and backspace (reported by Neil Zanella). +
    • initialize fds[] array to 0's in + _nc_timed_wait(); apparently poll() only + sets the revents members of that array when there is + activity corresponding to the related file. -
    • corrected offsets used for subwindows in wresize() +
    • add a check for null pointer in Make_Enum_Type(). -
    • modified configure script so AC_MSG_ERROR is temporarily defined to - a warning in AC_PROG_CXX to make it recover from a missing C++ - compiler without requiring user to add --without-cxx option +
    • fix a heap problem with the c++ binding. -
    • corrected logic in lib_twait.c as used by lib_mouse.c for GPM mouse - support when poll() is used rather than select(). +
    • correct missing includes for <string.h> in several places, + including the C++ binding. This is not noted by gcc unless we use + the -fno-builtin option. +
    + +
  • several fixes for tic: +
      +
    • add a check for empty buffers returned by fgets() in + comp_scan.c next_char() function, in case + tic is run on a non-text file (fixes a core dump). + +
    • modify tic to verify that its inputs are really files, + in case someone tries to read a directory (or + /dev/zero). + +
    • correct an uninitialized parameter to open_tempfile() + in tic.c which made "tic -I" give an ambiguous error message about + tmpnam. + +
    • correct logic in adjust_cancels(), which did not check + both alternatives when reclassifying an extended name between + boolean, number and string, causing an infinite loop in + tic. +
    + +
  • using new checks in tic for parameter counts in + capability strings, found/fixed several errors both in the + terminfo database and in the include/Caps file. +
      +
    • modified several terminfo capability strings, including the + definitions for setaf, setab, in include/Caps to indicate that the + entries are parameterized. This information is used to tell which + strings are translated when converting to termcap. This fixes a + problem where the generated termcap would contain a spurious "%p1" + for the terminfo "%p1%d". + +
    • correct parameter counts in include/Caps for dclk as well as some + printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. +
    + +
  • various fixes for install scripts used to support configure + --srcdir and --with-install-prefix. + +
  • correct several mismatches between manpage filename and ".TH" + directives, renaming dft_fgbg.3x to default_colors.3x and + menu_attribs.3x to menu_attributes.3x. +
+ +Portability: +
    +
  • configure script: +
      +
    • newer config.guess, config.sub, including changes to support OS/2 + EMX. The configure script for OS/2 EMX still relies on a patch + since there is no (working) support for that platform in the main + autoconf distribution. + +
    • make configure script checks on variables $GCC and + $GXX consistently compare against 'yes' rather than + test if they are nonnull, since either may be set to the + corresponding name of the C or C++ compiler. + +
    • change configure script to use AC_CANONICAL_SYSTEM rather than + AC_CANONICAL_HOST, which means that configure --target + will set a default program-prefix. + +
    • modify the check for big-core to force a couple of memory + accesses, which may work as needed for older/less-capable machines + (if not, there's still the explicit configure option). + +
    • modify configure test for tcgetattr() to allow for + old implementations, e.g., on BeOS, which only defined it as a + macro. + +
    • add configure check for filesystems (such as OS/2 EMX) which do + not distinguish between upper/lowercase filenames, use this to fix + tags rules in makefiles. + +
    • add MKncurses_def.sh to generate fallback definitions for + ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in + code to consistently use "#if" rather than "#ifdef". + +
    • change most remaining unquoted parameters of test in + configure script to use quotes, for instance fixing a problem in the + --disable-database option. + +
    • modify scripts so that "make install.data" works on OS/2 EMX. + +
    • modify scripts and makefiles so the Ada95 directory builds on + OS/2 EMX. +
    + +
  • library: +
      +
    • replaced case-statement in _nc_tracebits() for CSIZE + with a table to simplify working around implementations that define + random combinations of the related macros to zero. + +
    • improved OS/2 mouse support by retrying as a 2-button mouse if code + fails to set up a 3-button mouse. + +
    • added private entrypoint _nc_basename(), used to + consolidate related code in progs, as well as accommodating OS/2 EMX + pathnames. + +
    • alter definition of NCURSES_CONST to make it non-empty. + +
    • redefine 'TEXT' in menu.h for AMIGA, since it is reported to have + an (unspecified) symbol conflict. +
    + +
  • programs: +
      +
    • modified progs/tset.c and tack/sysdep.c to build with sgttyb + interface if neither termio or termios is available. Tested this + with FreeBSD 2.1.5 (which does have termios - but the sgttyb does + work). +
    -
  • made several fixes for buffer overflows, unchecked recursion, - improvements in performance, etc. See the NEWS file for details.

Features of Ncurses

diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html index 18f4cd94..806aec57 100644 --- a/doc/html/man/captoinfo.1m.html +++ b/doc/html/man/captoinfo.1m.html @@ -23,27 +23,27 @@ If no file is given, then the environment variable TERMCAP is used for the filename or entry. If TERMCAP is a full - pathname to a file, only the terminal whose name is speci- - fied in the environment variable TERM is extracted from - that file. If the environment variable TERMCAP is not - set, then the file @DATADIR@/terminfo is read. + pathname to a file, only the terminal whose name is + specified in the environment variable TERM is extracted + from that file. If the environment variable TERMCAP is + not set, then the file /usr/share/terminfo is read. -v print out tracing information on standard error as the program runs. - -V print out the version of the program in use on stan- - dard error and exit. + -V print out the version of the program in use on + standard error and exit. - -1 cause the fields to print out one to a line. Other- - wise, the fields will be printed several to a line to - a maximum width of 60 characters. + -1 cause the fields to print out one to a line. + Otherwise, the fields will be printed several to a + line to a maximum width of 60 characters. -w change the output to width characters.

FILES

-       @DATADIR@/terminfo  Compiled     terminal      description
+       /usr/share/terminfo Compiled     terminal      description
                            database.
 
 
@@ -51,8 +51,8 @@
 

TRANSLATIONS FROM NONSTANDARD CAPABILITIES

        Some  obsolete nonstandard capabilities will automatically
        be translated into  standard  (SVr4/XSI  Curses)  terminfo
-       capabilities  by  captoinfo.   Whenever one of these auto-
-       matic translations is done,  the  program  will  issue  an
+       capabilities   by   captoinfo.    Whenever  one  of  these
+       automatic translations is done, the program will issue  an
        notification to stderr, inviting the user to check that it
        has not mistakenly translated  a  completely  unknown  and
        random capability and/or syntax error.
@@ -90,9 +90,9 @@
        FC       Sf     Tek     set_foreground
        HS       mh     Iris    enter_dim_mode
 
-       XENIX  termcap  also used to have a set of extension capa-
-       bilities for forms drawing, designed to take advantage  of
-       the IBM PC high-half graphics.  They were as follows:
+       XENIX  termcap  also  used  to  have  a  set  of extension
+       capabilities for forms drawing, designed to take advantage
+       of the IBM PC high-half graphics.  They were as follows:
 
        Cap          Graphic
        -----------------------------
@@ -122,12 +122,12 @@
 
        If  the  single-line  capabilities occur in an entry, they
        will automatically be composed into an acsc  string.   The
-       double-line capabilities and GG are discarded with a warn-
-       ing message.
+       double-line  capabilities  and  GG  are  discarded  with a
+       warning message.
 
-       IBM's AIX has a terminfo facility descended from SVr1 ter-
-       minfo but incompatible with the SVr4 format. The following
-       AIX extensions are automatically translated:
+       IBM's AIX has a  terminfo  facility  descended  from  SVr1
+       terminfo  but  incompatible  with  the  SVr4  format.  The
+       following AIX extensions are automatically translated:
 
         IBM    XSI
        -------------
@@ -138,13 +138,13 @@
        font2   s2ds
        font3   s3ds
 
-       Additionally, the AIX box1 capability  will  be  automati-
-       cally translated to an acsc string.
+       Additionally,   the   AIX   box1   capability   will    be
+       automatically translated to an acsc string.
 
-       Hewlett-Packard's  terminfo  library supports two nonstan-
-       dard terminfo capabilities meml  (memory  lock)  and  memu
-       (memory  unlock).   These will be discarded with a warning
-       message.
+       Hewlett-Packard's    terminfo    library    supports   two
+       nonstandard terminfo capabilities meml (memory  lock)  and
+       memu  (memory  unlock).   These  will  be discarded with a
+       warning message.
 
 
 
diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html index 296d8e9e..b24a83c0 100644 --- a/doc/html/man/curs_color.3x.html +++ b/doc/html/man/curs_color.3x.html @@ -198,8 +198,8 @@

SEE ALSO

-       curses(3x), curs_initscr(3x), curs_attr(3x), dft_fgbg(3x)
-
+       curses(3x), curs_initscr(3x), curs_attr(3x),  default_col-
+       ors(3x)
 
 
 
diff --git a/doc/html/man/curs_extend.3x.html b/doc/html/man/curs_extend.3x.html
index 8fbb8867..a91102ed 100644
--- a/doc/html/man/curs_extend.3x.html
+++ b/doc/html/man/curs_extend.3x.html
@@ -47,8 +47,8 @@
 

SEE ALSO

        curs_getch(3x),       curs_mouse(3x),      curs_print(3x),
-       define_key(3x),  dft_fgbg(3x),  keybound(3x),   keyok(3x),
-       resizeterm(3x), wresize(3x).
+       default_colors(3x),     define_key(3x),      keybound(3x),
+       keyok(3x), resizeterm(3x), wresize(3x).
 
 
 
diff --git a/doc/html/man/curs_scanw.3x.html b/doc/html/man/curs_scanw.3x.html index 8ac48ad1..1fb1ba9e 100644 --- a/doc/html/man/curs_scanw.3x.html +++ b/doc/html/man/curs_scanw.3x.html @@ -6,7 +6,7 @@

NAME

        scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw - con-
-       vert formatted input from a curses widow
+       vert formatted input from a curses window
 
 
 
diff --git a/doc/html/man/curs_trace.3x.html b/doc/html/man/curs_trace.3x.html index 82804268..51d082c5 100644 --- a/doc/html/man/curs_trace.3x.html +++ b/doc/html/man/curs_trace.3x.html @@ -89,6 +89,9 @@ TRACE_DATABASE trace read/write of terminfo/termcap data. + TRACE_ATTRS + trace changes to video attributes and colors. + TRACE_MAXIMUM maximum trace level, enables all of the separate trace features. @@ -119,9 +122,6 @@ - - -
diff --git a/doc/html/man/dft_fgbg.3x.html b/doc/html/man/default_colors.3x.html similarity index 97% rename from doc/html/man/dft_fgbg.3x.html rename to doc/html/man/default_colors.3x.html index 8d5bf7b6..8b6cdca4 100644 --- a/doc/html/man/dft_fgbg.3x.html +++ b/doc/html/man/default_colors.3x.html @@ -5,8 +5,8 @@

NAME

-       dft_fgbg:  use_default_colors, assume_default_colors - use
-       terminal's default colors
+       default_colors:  use_default_colors, assume_default_colors
+       - use terminal's default colors
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html index 78c02edf..5f77495f 100644 --- a/doc/html/man/infocmp.1m.html +++ b/doc/html/man/infocmp.1m.html @@ -160,15 +160,15 @@ The location of the compiled terminfo database is taken from the environment variable TERMINFO . If the variable is not defined, or the terminal is not found in that loca- - tion, the system terminfo database, in @DATADIR@/terminfo, - will be used. The options -A and -B may be used to over- - ride this location. The -A option will set TERMINFO for - the first termname and the -B option will set TERMINFO for - the other termnames. With this, it is possible to compare - descriptions for a terminal with the same name located in - two different databases. This is useful for comparing - descriptions for the same terminal created by different - people. + tion, the system terminfo database, in /usr/share/ter- + minfo, will be used. The options -A and -B may be used to + override this location. The -A option will set TERMINFO + for the first termname and the -B option will set TERMINFO + for the other termnames. With this, it is possible to + compare descriptions for a terminal with the same name + located in two different databases. This is useful for + comparing descriptions for the same terminal created by + different people. Other Options [-s d|i|l|c] [-1FTVefip] [-Rsubset] [-v n] [-w width] @@ -236,8 +236,8 @@ the compiled descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo). - -V prints out the version of the program in use on stan- - dard error and exits. + -V reports the version of ncurses which was used in this + program, and exits. -e Dump the capabilities of the given terminal as a C initializer for a TERMTYPE structure (the terminal @@ -330,14 +330,14 @@

FILES

-       @DATADIR@/terminfo  Compiled     terminal      description
+       /usr/share/terminfo Compiled     terminal      description
                            database.
 
 
 
 

EXTENSIONS

-       The  -E,  -F,  -G,  -R, -T, -a, -e, -f, -g, -i, -p, and -q
+       The -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -p, and -q
        options are not supported in SVr4 curses.
 
        The -r option's notion of `termcap' capabilities is System
diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
index 7194e0ae..38ab95cc 100644
--- a/doc/html/man/infotocap.1m.html
+++ b/doc/html/man/infotocap.1m.html
@@ -36,7 +36,7 @@
 
 

FILES

-       @DATADIR@/terminfo  Compiled      terminal     description
+       /usr/share/terminfo Compiled      terminal     description
                            database.
 
 
diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html
index 74fe0b7f..c72b67f0 100644
--- a/doc/html/man/menu.3x.html
+++ b/doc/html/man/menu.3x.html
@@ -58,19 +58,19 @@
        item_userptr           mitem_userptr(3x)
        item_value             mitem_value(3x)
        item_visible           mitem_visible(3x)
-       menu_back              menu_attribs(3x)
+       menu_back              menu_attributes(3x)
        menu_driver            menu_driver(3x)
-       menu_fore              menu_attribs(3x)
+       menu_fore              menu_attributes(3x)
 
        menu_format            menu_format(3x)
-       menu_grey              menu_attribs(3x)
+       menu_grey              menu_attributes(3x)
        menu_init              menu_hook(3x)
        menu_items             menu_items(3x)
        menu_mark              menu_mark(3x)
        menu_opts              menu_opts(3x)
        menu_opts_off          menu_opts(3x)
        menu_opts_on           menu_opts(3x)
-       menu_pad               menu_attribs(3x)
+       menu_pad               menu_attributes(3x)
        menu_pattern           menu_pattern(3x)
        menu_request_by_name   menu_requestname(3x)
        menu_request_name      menu_requestname(3x)
@@ -90,15 +90,15 @@
        set_item_term          menu_hook(3x)
        set_item_userptr       mitem_userptr(3x)
        set_item_value         mitem_value(3x)
-       set_menu_back          menu_attribs(3x)
-       set_menu_fore          menu_attribs(3x)
+       set_menu_back          menu_attributes(3x)
+       set_menu_fore          menu_attributes(3x)
        set_menu_format        menu_format(3x)
-       set_menu_grey          menu_attribs(3x)
+       set_menu_grey          menu_attributes(3x)
        set_menu_init          menu_hook(3x)
        set_menu_items         menu_items(3x)
        set_menu_mark          menu_mark(3x)
        set_menu_opts          mitem_opts(3x)
-       set_menu_pad           menu_attribs(3x)
+       set_menu_pad           menu_attributes(3x)
        set_menu_pattern       menu_pattern(3x)
        set_menu_spacing       menu_spacing(3x)
        set_menu_sub           menu_win(3x)
diff --git a/doc/html/man/menu_attribs.3x.html b/doc/html/man/menu_attributes.3x.html
similarity index 100%
rename from doc/html/man/menu_attribs.3x.html
rename to doc/html/man/menu_attributes.3x.html
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index 24ba4e7a..5fb8400f 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -16,40 +16,41 @@
 

DESCRIPTION

        The  ncurses  library  routines  give the user a terminal-
-       independent method of updating character screens with rea-
-       sonable   optimization.    This  implementation  is  ``new
+       independent method  of  updating  character  screens  with
+       reasonable  optimization.   This  implementation  is ``new
        curses'' (ncurses) and is  the  approved  replacement  for
        4.4BSD classic curses, which has been discontinued.
 
        The  ncurses  routines  emulate  the curses(3x) library of
        System V Release 4 UNIX, and the XPG4 curses standard (XSI
        curses)  but the ncurses library is freely redistributable
-       in source form.  Differences from the SVr4 curses are sum-
-       marized  under  the EXTENSIONS and BUGS sections below and
-       described in detail in the EXTENSIONS and BUGS sections of
-       individual man pages.
+       in source form.  Differences  from  the  SVr4  curses  are
+       summarized  under  the  EXTENSIONS and BUGS sections below
+       and  described  in  detail  in  the  EXTENSIONS  and  BUGS
+       sections of individual man pages.
 
        A  program  using  these  routines must be linked with the
        -lncurses option, or (if it has been generated)  with  the
        debugging  library  -lncurses_g.   (Your system integrator
        may also have installed these libraries  under  the  names
        -lcurses and -lcurses_g.)  The ncurses_g library generates
-       trace logs (in a file called 'trace' in the current direc-
-       tory) that describe curses actions.
+       trace logs (in  a  file  called  'trace'  in  the  current
+       directory) that describe curses actions.
 
        The  ncurses  package supports: overall screen, window and
-       pad manipulation; output to windows and pads; reading ter-
-       minal  input;  control  over terminal and curses input and
-       output options; environment query routines; color  manipu-
-       lation; use of soft label keys; terminfo capabilities; and
-       access to low-level terminal-manipulation routines.
+       pad manipulation; output  to  windows  and  pads;  reading
+       terminal input; control over terminal and curses input and
+       output  options;   environment   query   routines;   color
+       manipulation;   use   of   soft   label   keys;   terminfo
+       capabilities;   and   access   to   low-level    terminal-
+       manipulation routines.
 
        To initialize the routines, the routine initscr or newterm
-       must  be called before any of the other routines that deal
-       with windows and screens are  used.   The  routine  endwin
+       must be called before any of the other routines that  deal
+       with  windows  and  screens  are used.  The routine endwin
        must be called before exiting.  To get character-at-a-time
-       input without echoing (most interactive,  screen  oriented
-       programs  want  this),  the  following  sequence should be
+       input  without  echoing (most interactive, screen oriented
+       programs want this),  the  following  sequence  should  be
        used:
 
              initscr(); cbreak(); noecho();
@@ -60,468 +61,468 @@
              intrflush(stdscr, FALSE);
              keypad(stdscr, TRUE);
 
-       Before a curses program is run, the tab stops of the  ter-
-       minal  should  be  set  and its initialization strings, if
-       defined, must be output.  This can be  done  by  executing
+       Before  a  curses  program  is  run,  the tab stops of the
+       terminal should be set and its initialization strings,  if
+       defined,  must  be  output.  This can be done by executing
        the tput init command after the shell environment variable
-       TERM has been exported.  tset(1)  is  usually  responsible
+       TERM  has  been  exported.  tset(1) is usually responsible
        for doing this.  [See terminfo(5) for further details.]
 
-       The  ncurses  library  permits manipulation of data struc-
-       tures, called windows, which can be  thought  of  as  two-
-       dimensional  arrays of characters representing all or part
-       of a CRT screen.  A default window called stdscr, which is
-       the  size of the terminal screen, is supplied.  Others may
-       be created with newwin.
-
-       Note that curses  does  not  handle  overlapping  windows,
-       that's  done by the panel(3x) library. This means that you
-       can either use stdscr or divide the screen into tiled win-
-       dows  and  not  using  stdscr  at all. Mixing the two will
+       The  ncurses  library   permits   manipulation   of   data
+       structures,  called  windows,  which  can be thought of as
+       two-dimensional arrays of characters representing  all  or
+       part  of  a  CRT  screen.  A default window called stdscr,
+       which is the size of the  terminal  screen,  is  supplied.
+       Others may be created with newwin.
+
+       Note  that  curses  does  not  handle overlapping windows,
+       that's done by the panel(3x) library. This means that  you
+       can  either  use  stdscr  or  divide the screen into tiled
+       windows and not using stdscr at all. Mixing the  two  will
        result in unpredictable, and undesired, effects.
 
        Windows are referred to by variables declared as WINDOW *.
-       These   data  structures  are  manipulated  with  routines
-       described here and elsewhere in the ncurses manual  pages.
-       Among  which  the  most basic routines are move and addch.
-       More general versions of these routines are included  with
-       names  beginning  with  w,  allowing the user to specify a
+       These  data  structures  are  manipulated  with   routines
+       described  here and elsewhere in the ncurses manual pages.
+       Among which the most basic routines are  move  and  addch.
+       More  general versions of these routines are included with
+       names beginning with w, allowing the  user  to  specify  a
        window.  The routines not beginning with w affect stdscr.)
 
-       After  using  routines  to manipulate a window, refresh is
-       called, telling curses to make the user's CRT screen  look
-       like  stdscr.   The characters in a window are actually of
-       type chtype, (character and attribute data) so that  other
-       information  about  the  character may also be stored with
+       After using routines to manipulate a  window,  refresh  is
+       called,  telling curses to make the user's CRT screen look
+       like stdscr.  The characters in a window are  actually  of
+       type  chtype, (character and attribute data) so that other
+       information about the character may also  be  stored  with
        each character.
 
-       Special windows  called  pads  may  also  be  manipulated.
+       Special  windows  called  pads  may  also  be manipulated.
        These are windows which are not constrained to the size of
-       the screen and whose contents need not be completely  dis-
-       played.  See curs_pad(3x) for more information.
-
-       In  addition  to  drawing  characters on the screen, video
-       attributes and colors may be supported, causing the  char-
-       acters  to show up in such modes as underlined, in reverse
-       video, or in color on terminals that support such  display
-       enhancements.  Line drawing characters may be specified to
-       be output.  On input, curses is  also  able  to  translate
-       arrow  and  function  keys  that transmit escape sequences
-       into single values.  The video  attributes,  line  drawing
-       characters,   and  input  values  use  names,  defined  in
+       the  screen  and  whose  contents  need  not be completely
+       displayed.  See curs_pad(3x) for more information.
+
+       In addition to drawing characters  on  the  screen,  video
+       attributes  and  colors  may  be  supported,  causing  the
+       characters to show up in  such  modes  as  underlined,  in
+       reverse  video, or in color on terminals that support such
+       display enhancements.   Line  drawing  characters  may  be
+       specified  to be output.  On input, curses is also able to
+       translate arrow and function  keys  that  transmit  escape
+       sequences  into single values.  The video attributes, line
+       drawing characters, and input values use names, defined in
        <curses.h>, such as A_REVERSE, ACS_HLINE, and KEY_LEFT.
 
        If the environment variables LINES and COLUMNS are set, or
-       if  the program is executing in a window environment, line
-       and column information in the  environment  will  override
+       if the program is executing in a window environment,  line
+       and  column  information  in the environment will override
        information read by terminfo.  This would effect a program
-       running in an AT&T 630 layer, for example, where the  size
+       running  in an AT&T 630 layer, for example, where the size
        of a screen is changeable (see ENVIRONMENT).
 
-       If  the environment variable TERMINFO is defined, any pro-
-       gram using curses checks for a local  terminal  definition
-       before  checking  in  the standard place.  For example, if
-       TERM is set to att4424, then the compiled terminal defini-
-       tion is found in
+       If the  environment  variable  TERMINFO  is  defined,  any
+       program   using   curses   checks  for  a  local  terminal
+       definition before checking in  the  standard  place.   For
+       example,  if  TERM  is  set  to att4424, then the compiled
+       terminal definition is found in
 
-             @DATADIR@/terminfo/a/att4424.
+             /usr/share/terminfo/a/att4424.
 
        (The a is copied from the first letter of att4424 to avoid
-       creation of huge directories.)  However,  if  TERMINFO  is
+       creation  of  huge  directories.)  However, if TERMINFO is
        set to $HOME/myterms, curses first checks
 
              $HOME/myterms/a/att4424,
 
        and if that fails, it then checks
 
-             @DATADIR@/terminfo/a/att4424.
+             /usr/share/terminfo/a/att4424.
 
-       This  is useful for developing experimental definitions or
-       when write permission in @DATADIR@/terminfo is not  avail-
-       able.
+       This is useful for developing experimental definitions  or
+       when   write  permission  in  /usr/share/terminfo  is  not
+       available.
 
-       The  integer  variables  LINES  and  COLS  are  defined in
-       <curses.h> and will be filled in by initscr with the  size
-       of the screen.  The constants TRUE and FALSE have the val-
-       ues 1 and 0, respectively.
+       The integer  variables  LINES  and  COLS  are  defined  in
+       <curses.h>  and will be filled in by initscr with the size
+       of the screen.  The constants  TRUE  and  FALSE  have  the
+       values 1 and 0, respectively.
 
-       The curses routines also  define  the  WINDOW  *  variable
+       The  curses  routines  also  define  the WINDOW * variable
        curscr which is used for certain low-level operations like
-       clearing and redrawing a screen containing  garbage.   The
+       clearing  and  redrawing a screen containing garbage.  The
        curscr can be used in only a few routines.
 
 
    Routine and Argument Names
-       Many  curses routines have two or more versions.  The rou-
-       tines prefixed with w require a window argument.  The rou-
-       tines prefixed with p require a pad argument.  Those with-
-       out a prefix generally use stdscr.
+       Many curses routines  have  two  or  more  versions.   The
+       routines  prefixed  with w require a window argument.  The
+       routines prefixed with p require a  pad  argument.   Those
+       without a prefix generally use stdscr.
 
        The routines prefixed with mv require a y and x coordinate
-       to  move to before performing the appropriate action.  The
-       mv routines imply a call to move before the  call  to  the
-       other  routine.  The coordinate y always refers to the row
-       (of the window), and x always refers to the  column.   The
+       to move to before performing the appropriate action.   The
+       mv  routines  imply  a call to move before the call to the
+       other routine.  The coordinate y always refers to the  row
+       (of  the  window), and x always refers to the column.  The
        upper left-hand corner is always (0,0), not (1,1).
 
        The routines prefixed with mvw take both a window argument
-       and x and y coordinates.  The window  argument  is  always
+       and  x  and  y coordinates.  The window argument is always
        specified before the coordinates.
 
-       In  each  case, win is the window affected, and pad is the
-       pad affected; win and pad  are  always  pointers  to  type
+       In each case, win is the window affected, and pad  is  the
+       pad  affected;  win  and  pad  are always pointers to type
        WINDOW.
 
        Option setting routines require a Boolean flag bf with the
-       value TRUE or FALSE; bf is always of type bool.  The vari-
-       ables  ch  and attrs below are always of type chtype.  The
-       types WINDOW, SCREEN, bool,  and  chtype  are  defined  in
-       <curses.h>.   The  type  TERMINAL  is defined in <term.h>.
+       value  TRUE  or  FALSE;  bf  is  always of type bool.  The
+       variables ch and attrs below are always  of  type  chtype.
+       The  types WINDOW, SCREEN, bool, and chtype are defined in
+       <curses.h>.  The type TERMINAL  is  defined  in  <term.h>.
        All other arguments are integers.
 
 
    Routine Name Index
        The following table lists each curses routine and the name
-       of  the  manual  page  on which it is described.  Routines
-       flagged with `*' are ncurses-specific,  not  described  by
+       of the manual page on which  it  is  described.   Routines
+       flagged  with  `*'  are ncurses-specific, not described by
        XPG4 or present in SVr4.
 
-               curses Routine Name     Manual Page Name
-               -------------------------------------------
-               COLOR_PAIR              curs_color(3x)
-               PAIR_NUMBER             curs_attr(3x)
-               _nc_tracebits           curs_trace(3x)*
-               _traceattr              curs_trace(3x)*
-               _traceattr2             curs_trace(3x)*
-               _tracechar              curs_trace(3x)*
-               _tracechtype            curs_trace(3x)*
-               _tracechtype2           curs_trace(3x)*
-               _tracedump              curs_trace(3x)*
-               _tracef                 curs_trace(3x)*
-               _tracemouse             curs_trace(3x)*
-               addch                   curs_addch(3x)
-               addchnstr               curs_addchstr(3x)
-               addchstr                curs_addchstr(3x)
-               addnstr                 curs_addstr(3x)
-               addstr                  curs_addstr(3x)
-               assume_default_colors   dft_fgbg(3x)*
-               attr_get                curs_attr(3x)
-               attr_off                curs_attr(3x)
-               attr_on                 curs_attr(3x)
-               attr_set                curs_attr(3x)
-               attroff                 curs_attr(3x)
-               attron                  curs_attr(3x)
-               attrset                 curs_attr(3x)
-               baudrate                curs_termattrs(3x)
-               beep                    curs_beep(3x)
-               bkgd                    curs_bkgd(3x)
-               bkgdset                 curs_bkgd(3x)
-               border                  curs_border(3x)
-               box                     curs_border(3x)
-               can_change_color        curs_color(3x)
-               cbreak                  curs_inopts(3x)
-               chgat                   curs_attr(3x)
-               clear                   curs_clear(3x)
-               clearok                 curs_outopts(3x)
-
-               clrtobot                curs_clear(3x)
-               clrtoeol                curs_clear(3x)
-               color_content           curs_color(3x)
-               color_set               curs_attr(3x)
-               copywin                 curs_overlay(3x)
-               curs_set                curs_kernel(3x)
-               curses_version          curs_extend(3x)*
-               def_prog_mode           curs_kernel(3x)
-               def_shell_mode          curs_kernel(3x)
-               define_key              define_key(3x)*
-               del_curterm             curs_terminfo(3x)
-               delay_output            curs_util(3x)
-               delch                   curs_delch(3x)
-               deleteln                curs_deleteln(3x)
-               delscreen               curs_initscr(3x)
-               delwin                  curs_window(3x)
-               derwin                  curs_window(3x)
-               doupdate                curs_refresh(3x)
-               dupwin                  curs_window(3x)
-               echo                    curs_inopts(3x)
-               echochar                curs_addch(3x)
-               endwin                  curs_initscr(3x)
-               erase                   curs_clear(3x)
-               erasechar               curs_termattrs(3x)
-               filter                  curs_util(3x)
-               flash                   curs_beep(3x)
-               flushinp                curs_util(3x)
-               getbegyx                curs_getyx(3x)
-               getbkgd                 curs_bkgd(3x)
-               getch                   curs_getch(3x)
-               getmaxyx                curs_getyx(3x)
-               getmouse                curs_mouse(3x)*
-               getnstr                 curs_getstr(3x)
-               getparyx                curs_getyx(3x)
-               getstr                  curs_getstr(3x)
-               getsyx                  curs_kernel(3x)
-               getwin                  curs_util(3x)
-               getyx                   curs_getyx(3x)
-               halfdelay               curs_inopts(3x)
-               has_colors              curs_color(3x)
-               has_ic                  curs_termattrs(3x)
-               has_il                  curs_termattrs(3x)
-               has_key                 curs_getch(3x)*
-               hline                   curs_border(3x)
-               idcok                   curs_outopts(3x)
-               idlok                   curs_outopts(3x)
-               immedok                 curs_outopts(3x)
-               inch                    curs_inch(3x)
-               inchnstr                curs_inchstr(3x)
-               inchstr                 curs_inchstr(3x)
-               init_color              curs_color(3x)
-               init_pair               curs_color(3x)
-               initscr                 curs_initscr(3x)
-
-               innstr                  curs_instr(3x)
-               insch                   curs_insch(3x)
-               insdelln                curs_deleteln(3x)
-               insertln                curs_deleteln(3x)
-               insnstr                 curs_insstr(3x)
-               insstr                  curs_insstr(3x)
-               instr                   curs_instr(3x)
-               intrflush               curs_inopts(3x)
-               is_linetouched          curs_touch(3x)
-               is_wintouched           curs_touch(3x)
-               isendwin                curs_initscr(3x)
-               keybound                keybound(3x)*
-               keyname                 curs_util(3x)
-               keyok                   keyok(3x)*
-               keypad                  curs_inopts(3x)
-               killchar                curs_termattrs(3x)
-               leaveok                 curs_outopts(3x)
-               longname                curs_termattrs(3x)
-               mcprint                 curs_print(3x)*
-               meta                    curs_inopts(3x)
-               mouse_trafo             curs_mouse(3x)*
-               mouseinterval           curs_mouse(3x)*
-               mousemask               curs_mouse(3x)*
-               move                    curs_move(3x)
-               mvaddch                 curs_addch(3x)
-               mvaddchnstr             curs_addchstr(3x)
-               mvaddchstr              curs_addchstr(3x)
-               mvaddnstr               curs_addstr(3x)
-               mvaddstr                curs_addstr(3x)
-               mvchgat                 curs_attr(3x)
-               mvcur                   curs_terminfo(3x)
-               mvdelch                 curs_delch(3x)
-               mvderwin                curs_window(3x)
-               mvgetch                 curs_getch(3x)
-               mvgetnstr               curs_getstr(3x)
-               mvgetstr                curs_getstr(3x)
-               mvhline                 curs_border(3x)
-               mvinch                  curs_inch(3x)
-               mvinchnstr              curs_inchstr(3x)
-               mvinchstr               curs_inchstr(3x)
-               mvinnstr                curs_instr(3x)
-               mvinsch                 curs_insch(3x)
-               mvinsnstr               curs_insstr(3x)
-               mvinsstr                curs_insstr(3x)
-               mvinstr                 curs_instr(3x)
-               mvprintw                curs_printw(3x)
-               mvscanw                 curs_scanw(3x)
-               mvvline                 curs_border(3x)
-               mvwaddch                curs_addch(3x)
-               mvwaddchnstr            curs_addchstr(3x)
-               mvwaddchstr             curs_addchstr(3x)
-               mvwaddnstr              curs_addstr(3x)
-               mvwaddstr               curs_addstr(3x)
-
-               mvwchgat                curs_attr(3x)
-               mvwdelch                curs_delch(3x)
-               mvwgetch                curs_getch(3x)
-               mvwgetnstr              curs_getstr(3x)
-               mvwgetstr               curs_getstr(3x)
-               mvwhline                curs_border(3x)
-               mvwin                   curs_window(3x)
-               mvwinch                 curs_inch(3x)
-               mvwinchnstr             curs_inchstr(3x)
-               mvwinchstr              curs_inchstr(3x)
-               mvwinnstr               curs_instr(3x)
-               mvwinsch                curs_insch(3x)
-               mvwinsnstr              curs_insstr(3x)
-               mvwinsstr               curs_insstr(3x)
-               mvwinstr                curs_instr(3x)
-               mvwprintw               curs_printw(3x)
-               mvwscanw                curs_scanw(3x)
-               mvwvline                curs_border(3x)
-               napms                   curs_kernel(3x)
-               newpad                  curs_pad(3x)
-               newterm                 curs_initscr(3x)
-               newwin                  curs_window(3x)
-               nl                      curs_outopts(3x)
-               nocbreak                curs_inopts(3x)
-               nodelay                 curs_inopts(3x)
-               noecho                  curs_inopts(3x)
-               nonl                    curs_outopts(3x)
-               noqiflush               curs_inopts(3x)
-               noraw                   curs_inopts(3x)
-               notimeout               curs_inopts(3x)
-               overlay                 curs_overlay(3x)
-               overwrite               curs_overlay(3x)
-               pair_content            curs_color(3x)
-               pechochar               curs_pad(3x)
-               pnoutrefresh            curs_pad(3x)
-               prefresh                curs_pad(3x)
-               printw                  curs_printw(3x)
-               putp                    curs_terminfo(3x)
-               putwin                  curs_util(3x)
-               qiflush                 curs_inopts(3x)
-               raw                     curs_inopts(3x)
-               redrawwin               curs_refresh(3x)
-               refresh                 curs_refresh(3x)
-               reset_prog_mode         curs_kernel(3x)
-               reset_shell_mode        curs_kernel(3x)
-               resetty                 curs_kernel(3x)
-               resizeterm              resizeterm(3x)*
-               restartterm             curs_terminfo(3x)
-               ripoffline              curs_kernel(3x)
-               savetty                 curs_kernel(3x)
-               scanw                   curs_scanw(3x)
-               scr_dump                curs_scr_dump(3x)
-               scr_init                curs_scr_dump(3x)
-
-               scr_restore             curs_scr_dump(3x)
-               scr_set                 curs_scr_dump(3x)
-               scrl                    curs_scroll(3x)
-               scroll                  curs_scroll(3x)
-               scrollok                curs_outopts(3x)
-               set_curterm             curs_terminfo(3x)
-               set_term                curs_initscr(3x)
-               setscrreg               curs_outopts(3x)
-               setsyx                  curs_kernel(3x)
-               setterm                 curs_terminfo(3x)
-               setupterm               curs_terminfo(3x)
-               slk_attr                curs_slk(3x)*
-               slk_attr_off            curs_slk(3x)
-               slk_attr_on             curs_slk(3x)
-               slk_attr_set            curs_slk(3x)
-               slk_attroff             curs_slk(3x)
-               slk_attron              curs_slk(3x)
-               slk_attrset             curs_slk(3x)
-               slk_clear               curs_slk(3x)
-               slk_color               curs_slk(3x)
-               slk_init                curs_slk(3x)
-               slk_label               curs_slk(3x)
-               slk_noutrefresh         curs_slk(3x)
-               slk_refresh             curs_slk(3x)
-               slk_restore             curs_slk(3x)
-               slk_set                 curs_slk(3x)
-               slk_touch               curs_slk(3x)
-               standend                curs_attr(3x)
-               standout                curs_attr(3x)
-               start_color             curs_color(3x)
-               subpad                  curs_pad(3x)
-               subwin                  curs_window(3x)
-               syncok                  curs_window(3x)
-               termattrs               curs_termattrs(3x)
-               termname                curs_termattrs(3x)
-               tgetent                 curs_termcap(3x)
-               tgetflag                curs_termcap(3x)
-               tgetnum                 curs_termcap(3x)
-               tgetstr                 curs_termcap(3x)
-               tgoto                   curs_termcap(3x)
-               tigetflag               curs_terminfo(3x)
-               tigetnum                curs_terminfo(3x)
-               tigetstr                curs_terminfo(3x)
-               timeout                 curs_inopts(3x)
-               touchline               curs_touch(3x)
-               touchwin                curs_touch(3x)
-               tparm                   curs_terminfo(3x)
-               tputs                   curs_termcap(3x)
-               tputs                   curs_terminfo(3x)
-               trace                   curs_trace(3x)*
-               typeahead               curs_inopts(3x)
-               unctrl                  curs_util(3x)
-               ungetch                 curs_getch(3x)
-
-               ungetmouse              curs_mouse(3x)*
-               untouchwin              curs_touch(3x)
-               use_default_colors      dft_fgbg(3x)*
-               use_env                 curs_util(3x)
-               use_extended_names      curs_extend(3x)*
-               vidattr                 curs_terminfo(3x)
-               vidputs                 curs_terminfo(3x)
-               vline                   curs_border(3x)
-               vw_printw               curs_printw(3x)
-               vw_scanw                curs_scanw(3x)
-               vwprintw                curs_printw(3x)
-               vwscanw                 curs_scanw(3x)
-               waddch                  curs_addch(3x)
-               waddchnstr              curs_addchstr(3x)
-               waddchstr               curs_addchstr(3x)
-               waddnstr                curs_addstr(3x)
-               waddstr                 curs_addstr(3x)
-               wattr_get               curs_attr(3x)
-               wattr_off               curs_attr(3x)
-               wattr_on                curs_attr(3x)
-               wattr_set               curs_attr(3x)
-               wattroff                curs_attr(3x)
-               wattron                 curs_attr(3x)
-               wattrset                curs_attr(3x)
-               wbkgd                   curs_bkgd(3x)
-               wbkgdset                curs_bkgd(3x)
-               wborder                 curs_border(3x)
-               wchgat                  curs_attr(3x)
-               wclear                  curs_clear(3x)
-               wclrtobot               curs_clear(3x)
-               wclrtoeol               curs_clear(3x)
-               wcolor_set              curs_attr(3x)
-               wcursyncup              curs_window(3x)
-               wdelch                  curs_delch(3x)
-               wdeleteln               curs_deleteln(3x)
-               wechochar               curs_addch(3x)
-               wenclose                curs_mouse(3x)*
-               werase                  curs_clear(3x)
-               wgetch                  curs_getch(3x)
-               wgetnstr                curs_getstr(3x)
-               wgetstr                 curs_getstr(3x)
-               whline                  curs_border(3x)
-               winch                   curs_inch(3x)
-               winchnstr               curs_inchstr(3x)
-               winchstr                curs_inchstr(3x)
-               winnstr                 curs_instr(3x)
-               winsch                  curs_insch(3x)
-               winsdelln               curs_deleteln(3x)
-               winsertln               curs_deleteln(3x)
-               winsnstr                curs_insstr(3x)
-               winsstr                 curs_insstr(3x)
-               winstr                  curs_instr(3x)
-               wmouse_trafo            curs_mouse(3x)*
-
-               wmove                   curs_move(3x)
-               wnoutrefresh            curs_refresh(3x)
-               wprintw                 curs_printw(3x)
-               wredrawln               curs_refresh(3x)
-               wrefresh                curs_refresh(3x)
-               wresize                 wresize(3x)*
-               wscanw                  curs_scanw(3x)
-               wscrl                   curs_scroll(3x)
-               wsetscrreg              curs_outopts(3x)
-               wstandend               curs_attr(3x)
-               wstandout               curs_attr(3x)
-               wsyncdown               curs_window(3x)
-               wsyncup                 curs_window(3x)
-               wtimeout                curs_inopts(3x)
-               wtouchln                curs_touch(3x)
-               wvline                  curs_border(3x)
+              curses Routine Name     Manual Page Name
+              --------------------------------------------
+              COLOR_PAIR              curs_color(3x)
+              PAIR_NUMBER             curs_attr(3x)
+              _nc_tracebits           curs_trace(3x)*
+              _traceattr              curs_trace(3x)*
+              _traceattr2             curs_trace(3x)*
+              _tracechar              curs_trace(3x)*
+              _tracechtype            curs_trace(3x)*
+              _tracechtype2           curs_trace(3x)*
+              _tracedump              curs_trace(3x)*
+              _tracef                 curs_trace(3x)*
+              _tracemouse             curs_trace(3x)*
+              addch                   curs_addch(3x)
+              addchnstr               curs_addchstr(3x)
+              addchstr                curs_addchstr(3x)
+              addnstr                 curs_addstr(3x)
+              addstr                  curs_addstr(3x)
+              assume_default_colors   default_colors(3x)*
+              attr_get                curs_attr(3x)
+              attr_off                curs_attr(3x)
+              attr_on                 curs_attr(3x)
+              attr_set                curs_attr(3x)
+              attroff                 curs_attr(3x)
+              attron                  curs_attr(3x)
+              attrset                 curs_attr(3x)
+              baudrate                curs_termattrs(3x)
+              beep                    curs_beep(3x)
+              bkgd                    curs_bkgd(3x)
+              bkgdset                 curs_bkgd(3x)
+              border                  curs_border(3x)
+              box                     curs_border(3x)
+              can_change_color        curs_color(3x)
+              cbreak                  curs_inopts(3x)
+              chgat                   curs_attr(3x)
+              clear                   curs_clear(3x)
+
+              clearok                 curs_outopts(3x)
+              clrtobot                curs_clear(3x)
+              clrtoeol                curs_clear(3x)
+              color_content           curs_color(3x)
+              color_set               curs_attr(3x)
+              copywin                 curs_overlay(3x)
+              curs_set                curs_kernel(3x)
+              curses_version          curs_extend(3x)*
+              def_prog_mode           curs_kernel(3x)
+              def_shell_mode          curs_kernel(3x)
+              define_key              define_key(3x)*
+              del_curterm             curs_terminfo(3x)
+              delay_output            curs_util(3x)
+              delch                   curs_delch(3x)
+              deleteln                curs_deleteln(3x)
+              delscreen               curs_initscr(3x)
+              delwin                  curs_window(3x)
+              derwin                  curs_window(3x)
+              doupdate                curs_refresh(3x)
+              dupwin                  curs_window(3x)
+              echo                    curs_inopts(3x)
+              echochar                curs_addch(3x)
+              endwin                  curs_initscr(3x)
+              erase                   curs_clear(3x)
+              erasechar               curs_termattrs(3x)
+              filter                  curs_util(3x)
+              flash                   curs_beep(3x)
+              flushinp                curs_util(3x)
+              getbegyx                curs_getyx(3x)
+              getbkgd                 curs_bkgd(3x)
+              getch                   curs_getch(3x)
+              getmaxyx                curs_getyx(3x)
+              getmouse                curs_mouse(3x)*
+              getnstr                 curs_getstr(3x)
+              getparyx                curs_getyx(3x)
+              getstr                  curs_getstr(3x)
+              getsyx                  curs_kernel(3x)
+              getwin                  curs_util(3x)
+              getyx                   curs_getyx(3x)
+              halfdelay               curs_inopts(3x)
+              has_colors              curs_color(3x)
+              has_ic                  curs_termattrs(3x)
+              has_il                  curs_termattrs(3x)
+              has_key                 curs_getch(3x)*
+              hline                   curs_border(3x)
+              idcok                   curs_outopts(3x)
+              idlok                   curs_outopts(3x)
+              immedok                 curs_outopts(3x)
+              inch                    curs_inch(3x)
+              inchnstr                curs_inchstr(3x)
+              inchstr                 curs_inchstr(3x)
+              init_color              curs_color(3x)
+              init_pair               curs_color(3x)
+
+              initscr                 curs_initscr(3x)
+              innstr                  curs_instr(3x)
+              insch                   curs_insch(3x)
+              insdelln                curs_deleteln(3x)
+              insertln                curs_deleteln(3x)
+              insnstr                 curs_insstr(3x)
+              insstr                  curs_insstr(3x)
+              instr                   curs_instr(3x)
+              intrflush               curs_inopts(3x)
+              is_linetouched          curs_touch(3x)
+              is_wintouched           curs_touch(3x)
+              isendwin                curs_initscr(3x)
+              keybound                keybound(3x)*
+              keyname                 curs_util(3x)
+              keyok                   keyok(3x)*
+              keypad                  curs_inopts(3x)
+              killchar                curs_termattrs(3x)
+              leaveok                 curs_outopts(3x)
+              longname                curs_termattrs(3x)
+              mcprint                 curs_print(3x)*
+              meta                    curs_inopts(3x)
+              mouse_trafo             curs_mouse(3x)*
+              mouseinterval           curs_mouse(3x)*
+              mousemask               curs_mouse(3x)*
+              move                    curs_move(3x)
+              mvaddch                 curs_addch(3x)
+              mvaddchnstr             curs_addchstr(3x)
+              mvaddchstr              curs_addchstr(3x)
+              mvaddnstr               curs_addstr(3x)
+              mvaddstr                curs_addstr(3x)
+              mvchgat                 curs_attr(3x)
+              mvcur                   curs_terminfo(3x)
+              mvdelch                 curs_delch(3x)
+              mvderwin                curs_window(3x)
+              mvgetch                 curs_getch(3x)
+              mvgetnstr               curs_getstr(3x)
+              mvgetstr                curs_getstr(3x)
+              mvhline                 curs_border(3x)
+              mvinch                  curs_inch(3x)
+              mvinchnstr              curs_inchstr(3x)
+              mvinchstr               curs_inchstr(3x)
+              mvinnstr                curs_instr(3x)
+              mvinsch                 curs_insch(3x)
+              mvinsnstr               curs_insstr(3x)
+              mvinsstr                curs_insstr(3x)
+              mvinstr                 curs_instr(3x)
+              mvprintw                curs_printw(3x)
+              mvscanw                 curs_scanw(3x)
+              mvvline                 curs_border(3x)
+              mvwaddch                curs_addch(3x)
+              mvwaddchnstr            curs_addchstr(3x)
+              mvwaddchstr             curs_addchstr(3x)
+              mvwaddnstr              curs_addstr(3x)
+
+              mvwaddstr               curs_addstr(3x)
+              mvwchgat                curs_attr(3x)
+              mvwdelch                curs_delch(3x)
+              mvwgetch                curs_getch(3x)
+              mvwgetnstr              curs_getstr(3x)
+              mvwgetstr               curs_getstr(3x)
+              mvwhline                curs_border(3x)
+              mvwin                   curs_window(3x)
+              mvwinch                 curs_inch(3x)
+              mvwinchnstr             curs_inchstr(3x)
+              mvwinchstr              curs_inchstr(3x)
+              mvwinnstr               curs_instr(3x)
+              mvwinsch                curs_insch(3x)
+              mvwinsnstr              curs_insstr(3x)
+              mvwinsstr               curs_insstr(3x)
+              mvwinstr                curs_instr(3x)
+              mvwprintw               curs_printw(3x)
+              mvwscanw                curs_scanw(3x)
+              mvwvline                curs_border(3x)
+              napms                   curs_kernel(3x)
+              newpad                  curs_pad(3x)
+              newterm                 curs_initscr(3x)
+              newwin                  curs_window(3x)
+              nl                      curs_outopts(3x)
+              nocbreak                curs_inopts(3x)
+              nodelay                 curs_inopts(3x)
+              noecho                  curs_inopts(3x)
+              nonl                    curs_outopts(3x)
+              noqiflush               curs_inopts(3x)
+              noraw                   curs_inopts(3x)
+              notimeout               curs_inopts(3x)
+              overlay                 curs_overlay(3x)
+              overwrite               curs_overlay(3x)
+              pair_content            curs_color(3x)
+              pechochar               curs_pad(3x)
+              pnoutrefresh            curs_pad(3x)
+              prefresh                curs_pad(3x)
+              printw                  curs_printw(3x)
+              putp                    curs_terminfo(3x)
+              putwin                  curs_util(3x)
+              qiflush                 curs_inopts(3x)
+              raw                     curs_inopts(3x)
+              redrawwin               curs_refresh(3x)
+              refresh                 curs_refresh(3x)
+              reset_prog_mode         curs_kernel(3x)
+              reset_shell_mode        curs_kernel(3x)
+              resetty                 curs_kernel(3x)
+              resizeterm              resizeterm(3x)*
+              restartterm             curs_terminfo(3x)
+              ripoffline              curs_kernel(3x)
+              savetty                 curs_kernel(3x)
+              scanw                   curs_scanw(3x)
+              scr_dump                curs_scr_dump(3x)
+
+              scr_init                curs_scr_dump(3x)
+              scr_restore             curs_scr_dump(3x)
+              scr_set                 curs_scr_dump(3x)
+              scrl                    curs_scroll(3x)
+              scroll                  curs_scroll(3x)
+              scrollok                curs_outopts(3x)
+              set_curterm             curs_terminfo(3x)
+              set_term                curs_initscr(3x)
+              setscrreg               curs_outopts(3x)
+              setsyx                  curs_kernel(3x)
+              setterm                 curs_terminfo(3x)
+              setupterm               curs_terminfo(3x)
+              slk_attr                curs_slk(3x)*
+              slk_attr_off            curs_slk(3x)
+              slk_attr_on             curs_slk(3x)
+              slk_attr_set            curs_slk(3x)
+              slk_attroff             curs_slk(3x)
+              slk_attron              curs_slk(3x)
+              slk_attrset             curs_slk(3x)
+              slk_clear               curs_slk(3x)
+              slk_color               curs_slk(3x)
+              slk_init                curs_slk(3x)
+              slk_label               curs_slk(3x)
+              slk_noutrefresh         curs_slk(3x)
+              slk_refresh             curs_slk(3x)
+              slk_restore             curs_slk(3x)
+              slk_set                 curs_slk(3x)
+              slk_touch               curs_slk(3x)
+              standend                curs_attr(3x)
+              standout                curs_attr(3x)
+              start_color             curs_color(3x)
+              subpad                  curs_pad(3x)
+              subwin                  curs_window(3x)
+              syncok                  curs_window(3x)
+              termattrs               curs_termattrs(3x)
+              termname                curs_termattrs(3x)
+              tgetent                 curs_termcap(3x)
+              tgetflag                curs_termcap(3x)
+              tgetnum                 curs_termcap(3x)
+              tgetstr                 curs_termcap(3x)
+              tgoto                   curs_termcap(3x)
+              tigetflag               curs_terminfo(3x)
+              tigetnum                curs_terminfo(3x)
+              tigetstr                curs_terminfo(3x)
+              timeout                 curs_inopts(3x)
+              touchline               curs_touch(3x)
+              touchwin                curs_touch(3x)
+              tparm                   curs_terminfo(3x)
+              tputs                   curs_termcap(3x)
+              tputs                   curs_terminfo(3x)
+              trace                   curs_trace(3x)*
+              typeahead               curs_inopts(3x)
+              unctrl                  curs_util(3x)
+
+              ungetch                 curs_getch(3x)
+              ungetmouse              curs_mouse(3x)*
+              untouchwin              curs_touch(3x)
+              use_default_colors      default_colors(3x)*
+              use_env                 curs_util(3x)
+              use_extended_names      curs_extend(3x)*
+              vidattr                 curs_terminfo(3x)
+              vidputs                 curs_terminfo(3x)
+              vline                   curs_border(3x)
+              vw_printw               curs_printw(3x)
+              vw_scanw                curs_scanw(3x)
+              vwprintw                curs_printw(3x)
+              vwscanw                 curs_scanw(3x)
+              waddch                  curs_addch(3x)
+              waddchnstr              curs_addchstr(3x)
+              waddchstr               curs_addchstr(3x)
+              waddnstr                curs_addstr(3x)
+              waddstr                 curs_addstr(3x)
+              wattr_get               curs_attr(3x)
+              wattr_off               curs_attr(3x)
+              wattr_on                curs_attr(3x)
+              wattr_set               curs_attr(3x)
+              wattroff                curs_attr(3x)
+              wattron                 curs_attr(3x)
+              wattrset                curs_attr(3x)
+              wbkgd                   curs_bkgd(3x)
+              wbkgdset                curs_bkgd(3x)
+              wborder                 curs_border(3x)
+              wchgat                  curs_attr(3x)
+              wclear                  curs_clear(3x)
+              wclrtobot               curs_clear(3x)
+              wclrtoeol               curs_clear(3x)
+              wcolor_set              curs_attr(3x)
+              wcursyncup              curs_window(3x)
+              wdelch                  curs_delch(3x)
+              wdeleteln               curs_deleteln(3x)
+              wechochar               curs_addch(3x)
+              wenclose                curs_mouse(3x)*
+              werase                  curs_clear(3x)
+              wgetch                  curs_getch(3x)
+              wgetnstr                curs_getstr(3x)
+              wgetstr                 curs_getstr(3x)
+              whline                  curs_border(3x)
+              winch                   curs_inch(3x)
+              winchnstr               curs_inchstr(3x)
+              winchstr                curs_inchstr(3x)
+              winnstr                 curs_instr(3x)
+              winsch                  curs_insch(3x)
+              winsdelln               curs_deleteln(3x)
+              winsertln               curs_deleteln(3x)
+              winsnstr                curs_insstr(3x)
+              winsstr                 curs_insstr(3x)
+              winstr                  curs_instr(3x)
+
+              wmouse_trafo            curs_mouse(3x)*
+              wmove                   curs_move(3x)
+              wnoutrefresh            curs_refresh(3x)
+              wprintw                 curs_printw(3x)
+              wredrawln               curs_refresh(3x)
+              wrefresh                curs_refresh(3x)
+              wresize                 wresize(3x)*
+              wscanw                  curs_scanw(3x)
+              wscrl                   curs_scroll(3x)
+              wsetscrreg              curs_outopts(3x)
+              wstandend               curs_attr(3x)
+              wstandout               curs_attr(3x)
+              wsyncdown               curs_window(3x)
+              wsyncup                 curs_window(3x)
+              wtimeout                curs_inopts(3x)
+              wtouchln                curs_touch(3x)
+              wvline                  curs_border(3x)
 
 
 

RETURN VALUE

-       Routines  that  return  an integer return ERR upon failure
-       and an integer value other than ERR upon  successful  com-
-       pletion,  unless  otherwise  noted in the routine descrip-
-       tions.
-
-       All macros return the  value  of  the  w  version,  except
-       setscrreg,  wsetscrreg,  getyx,  getbegyx,  getmaxyx.  The
-       return values of setscrreg, wsetscrreg,  getyx,  getbegyx,
+       Routines that return an integer return  ERR  upon  failure
+       and  an  integer  value  other  than  ERR  upon successful
+       completion,  unless  otherwise  noted   in   the   routine
+       descriptions.
+
+       All  macros  return  the  value  of  the w version, except
+       setscrreg, wsetscrreg,  getyx,  getbegyx,  getmaxyx.   The
+       return  values  of setscrreg, wsetscrreg, getyx, getbegyx,
        and getmaxyx are undefined (i.e., these should not be used
        as the right-hand side of assignment statements).
 
@@ -530,9 +531,10 @@
 
 

ENVIRONMENT

-       The following environment symbols are useful for customiz-
-       ing the runtime behavior of the ncurses library.  The most
-       important ones have been already discussed in detail.
+       The   following   environment   symbols   are  useful  for
+       customizing the runtime behavior of the  ncurses  library.
+       The  most  important  ones  have been already discussed in
+       detail.
 
        BAUDRATE
             The debugging library checks this environment  symbol
@@ -544,13 +546,13 @@
 
        CC   When set, change occurrences of the command_character
             (i.e., the cmdch capability) of the  loaded  terminfo
-            entries  to  the value of this symbol.  Very few ter-
-            minfo entries provide this feature.
+            entries  to  the  value  of  this  symbol.   Very few
+            terminfo entries provide this feature.
 
        COLUMNS
             Specify  the  width  of  the  screen  in  characters.
-            Applications  running in a windowing environment usu-
-            ally are able to obtain the width of  the  window  in
+            Applications   running  in  a  windowing  environment
+            usually are able to obtain the width of the window in
             which  they  are  executing.  If neither the $COLUMNS
             value nor the terminal's screen  size  is  available,
             ncurses  uses  the size which may be specified in the
@@ -577,8 +579,8 @@
             Specifies  the total time, in milliseconds, for which
             ncurses will await  a  character  sequence,  e.g.,  a
             function  key.  The default value, 1000 milliseconds,
-            is enough for most uses.  However, it is made a vari-
-            able to accommodate unusual applications.
+            is enough for most  uses.   However,  it  is  made  a
+            variable to accommodate unusual applications.
 
             The most common instance where you may wish to change
             this value is to work with slow hosts, e.g.,  running
@@ -587,8 +589,8 @@
             the  terminal did not send characters rapidly enough.
             The library will still see a timeout.
 
-            Note that xterm mouse events are built up from  char-
-            acter  sequences  received  from  the xterm.  If your
+            Note that  xterm  mouse  events  are  built  up  from
+            character sequences received from the xterm.  If your
             application makes heavy use of multiple-clicking, you
             may  wish  to lengthen this default value because the
             timeout applies to the composed multi-click event  as
@@ -605,7 +607,6 @@
             Like  COLUMNS,  specify  the  height of the screen in
             characters.  See COLUMNS for a detailed  description.
 
-
        MOUSE_BUTTONS_123
             This applies only to the OS/2 EMX port.  It specifies
             the order of buttons on the mouse.   OS/2  numbers  a
@@ -624,19 +625,19 @@
             Most of the terminal  descriptions  in  the  terminfo
             database  are  written for real "hardware" terminals.
             Many people use terminal emulators  which  run  in  a
-            windowing  environment  and use curses-based applica-
-            tions.  Terminal emulators can duplicate all  of  the
-            important aspects of a hardware terminal, but they do
-            not have the same limitations.  The chief  limitation
-            of  a  hardware  terminal from the standpoint of your
-            application is the management of dataflow, i.e., tim-
-            ing.  Unless a hardware terminal is interfaced into a
-            terminal concentrator (which does flow  control),  it
-            (or  your application) must manage dataflow, prevent-
-            ing overruns.  The  cheapest  solution  (no  hardware
-            cost) is for your program to do this by pausing after
-            operations that the terminal  does  slowly,  such  as
-            clearing the display.
+            windowing    environment    and    use   curses-based
+            applications.  Terminal emulators can  duplicate  all
+            of  the important aspects of a hardware terminal, but
+            they do not have the  same  limitations.   The  chief
+            limitation of a hardware terminal from the standpoint
+            of your application is the  management  of  dataflow,
+            i.e.,   timing.    Unless   a  hardware  terminal  is
+            interfaced into a terminal concentrator  (which  does
+            flow  control),  it (or your application) must manage
+            dataflow, preventing overruns.  The cheapest solution
+            (no  hardware cost) is for your program to do this by
+            pausing  after  operations  that  the  terminal  does
+            slowly, such as clearing the display.
 
             As  a  result,  many terminal descriptions (including
             the vt100) have delay times embedded.  You  may  wish
@@ -648,11 +649,11 @@
             part of special control sequences such as flash.
 
        NCURSES_NO_SETBUF
-            Normally ncurses enables buffered output during  ter-
-            minal  initialization.   This  is  done  (as  in SVr4
-            curses) for performance reasons.   For  testing  pur-
-            poses, both of ncurses and certain applications, this
-            feature    is    made    optional.     Setting    the
+            Normally  ncurses  enables  buffered  output   during
+            terminal  initialization.   This  is done (as in SVr4
+            curses)  for  performance   reasons.    For   testing
+            purposes,  both  of ncurses and certain applications,
+            this  feature  is   made   optional.    Setting   the
             NCURSES_NO_SETBUF variable disables output buffering,
             leaving the output  in  the  original  (usually  line
             buffered) mode.
@@ -672,8 +673,8 @@
             distinct, though many are similar.
 
        TERMCAP
-            If the ncurses library has been configured with term-
-            cap  support,  ncurses  will  check  for a terminal's
+            If the  ncurses  library  has  been  configured  with
+            termcap  support, ncurses will check for a terminal's
             description in termcap form if it is not available in
             the terminfo database.
 
@@ -701,30 +702,36 @@
 
             -  one or more directories whose names are configured
                and  compiled  into  the  ncurses  library,  e.g.,
-               @DATADIR@/terminfo
+               /usr/share/terminfo
 
        TERMINFO_DIRS
-            Specifies a list of directories to search for  termi-
-            nal  descriptions.   The  list is separated by colons
-            (i.e., ":").  All of the terminal descriptions are in
-            terminfo  form,  which makes a subdirectory named for
-            the first letter of the terminal names therein.
+            Specifies  a  list  of  directories  to  search   for
+            terminal  descriptions.   The  list  is  separated by
+            colons (i.e., ":").  All of the terminal descriptions
+            are  in  terminfo  form,  which  makes a subdirectory
+            named for the first  letter  of  the  terminal  names
+            therein.
 
        TERMPATH
-            If TERMCAP does not hold a  file  name  then  ncurses
-            checks  the TERMPATH symbol.  This is a list of file-
-            names  separated  by  colons  (i.e.,  ":").   If  the
-            TERMPATH  symbol  is  not  set,  ncurses looks in the
+            If  TERMCAP  does  not  hold a file name then ncurses
+            checks the  TERMPATH  symbol.   This  is  a  list  of
+            filenames  separated  by  colons (i.e., ":").  If the
+            TERMPATH symbol is not  set,  ncurses  looks  in  the
             files   /etc/termcap,   /usr/share/misc/termcap   and
             $HOME/.termcap, in that order.
 
+       The library may be configured to disregard  the  following
+       variables  when  the current user is the superuser (root),
+       or if the application uses setuid or  setgid  permissions:
+       $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
+
 
 

FILES

-       @DATADIR@/tabset
+       /usr/share/tabset
             directory  containing  initialization  files  for the
-            terminal capability database @DATADIR@/terminfo  ter-
-            minal capability database
+            terminal  capability   database   /usr/share/terminfo
+            terminal capability database
 
 
 
@@ -736,12 +743,12 @@

EXTENSIONS

        The  ncurses  library  can  be  compiled  with  an  option
-       (-DUSE_GETCAP) that falls back to the old-style /etc/term-
-       cap file if the terminal setup code cannot find a terminfo
-       entry  corresponding  to TERM.  Use of this feature is not
-       recommended, as it essentially includes an entire  termcap
-       compiler  in the ncurses startup code, at significant cost
-       in core and startup cycles.
+       (-DUSE_GETCAP)   that   falls   back   to   the  old-style
+       /etc/termcap file if the terminal setup code cannot find a
+       terminfo entry corresponding to TERM.  Use of this feature
+       is not recommended, as it essentially includes  an  entire
+       termcap   compiler   in   the  ncurses  startup  code,  at
+       significant cost in core and startup cycles.
 
        The ncurses  library  includes  facilities  for  capturing
        mouse  events  on certain terminals (including xterm). See
@@ -759,112 +766,111 @@
        See  the  define_key(3x)  and  keyok(3x)  manual pages for
        details.
 
-       The ncurses library can exploit the capabilities of termi-
-       nals  which  implement the ISO-6429 SGR 39 and SGR 49 con-
-       trols, which allow an application to reset the terminal to
-       its  original  foreground and background colors.  From the
-       users' perspective, the application is able to  draw  col-
-       ored  text  on  a  background  whose color is set indepen-
-       dently, providing better  control  over  color  contrasts.
-       See the use_default_colors(3x) manual page for details.
-
-       The  ncurses  library  includes  a  function for directing
-       application output to a printer attached to  the  terminal
+       The  ncurses  library  can  exploit  the  capabilities  of
+       terminals  which  implement the ISO-6429 SGR 39 and SGR 49
+       controls, which allow an application to reset the terminal
+       to  its  original  foreground and background colors.  From
+       the users' perspective, the application is  able  to  draw
+       colored   text   on   a  background  whose  color  is  set
+       independently,  providing  better   control   over   color
+       contrasts.  See the use_default_colors(3x) manual page for
+       details.
+       The ncurses library  includes  a  function  for  directing
+       application  output  to a printer attached to the terminal
        device.  See the curs_print(3x) manual page for details.
 
 
 

PORTABILITY

-       The   ncurses   library   is  intended  to  be  BASE-level
+       The  ncurses  library  is  intended   to   be   BASE-level
        conformant with the XSI Curses standard.  Certain portions
-       of  the EXTENDED XSI Curses functionality (including color
+       of the EXTENDED XSI Curses functionality (including  color
        support) are supported.  The following EXTENDED XSI Curses
-       calls  in  support  of wide (multibyte) characters are not
-       yet implemented: add_wch, add_wchnstr, add_wchstr,  addnw-
-       str,  addwstr,  bkgrnd,  bkgrndset,  border_set,  box_set,
-       echo_wchar,  erasewchar,  get_wch,  get_wstr,   getbkgrnd,
-       getcchar,   getn_wstr,   getwchtype,   hline_set,  in_wch,
-       in_wchnstr,  in_wchstr,   innwstr,   ins_nwstr,   ins_wch,
-       ins_wstr,  inwchnstr,  inwchstr,  inwstr,  key_name, kill-
-       wchar, mvadd_wch, mvadd_wchnstr, mvadd_wchstr, mvaddnwstr,
-       mvaddwstr,   mvget_wch,   mvget_wstr,   mvgetn_wstr,  mvh-
-       line_set,  mvin_wch,  mvinnwstr,  mvins_nwstr,  mvins_wch,
+       calls in support of wide (multibyte)  characters  are  not
+       yet   implemented:   add_wch,   add_wchnstr,   add_wchstr,
+       addnwstr, addwstr, bkgrnd, bkgrndset, border_set, box_set,
+       echo_wchar,   erasewchar,  get_wch,  get_wstr,  getbkgrnd,
+       getcchar,  getn_wstr,   getwchtype,   hline_set,   in_wch,
+       in_wchnstr,   in_wchstr,   innwstr,   ins_nwstr,  ins_wch,
+       ins_wstr,   inwchnstr,   inwchstr,    inwstr,    key_name,
+       killwchar,    mvadd_wch,    mvadd_wchnstr,   mvadd_wchstr,
+       mvaddnwstr, mvaddwstr, mvget_wch, mvget_wstr, mvgetn_wstr,
+       mvhline_set,  mvin_wch, mvinnwstr, mvins_nwstr, mvins_wch,
        mvins_wstr, mvinwchnstr, mvinwchstr, mvinwchstr, mvinwstr,
        mvvline_set,  mvwadd_wch,  mvwadd_wchnstr,  mvwadd_wchstr,
-       mvwaddnwstr,     mvwaddwstr,     mvwget_ch,    mvwget_wch,
-       mvwget_wstr,   mvwgetn_wstr,   mvwhline_set,    mvwin_wch,
-       mvwin_wchnstr,   mvwin_wchstr,  mvwinnwstr,  mvwins_nwstr,
-       mvwins_wch, mvwins_wstr, mvwinwchnstr.   mvwinwstr,  mvwv-
-       line_set,  pecho_wchar,  setcchar,  slk_wset,  term_attrs,
-       unget_wch,  vhline_set,  vid_attr,  vid_puts,   vline_set,
-       wadd_wch,  wadd_wchnstr, wadd_wchstr, waddnwstr, waddwstr,
-       waddwstr, wbkgrnd,  wbkgrndset,  wbkgrndset,  wborder_set,
+       mvwaddnwstr,    mvwaddwstr,     mvwget_ch,     mvwget_wch,
+       mvwget_wstr,    mvwgetn_wstr,   mvwhline_set,   mvwin_wch,
+       mvwin_wchnstr,  mvwin_wchstr,  mvwinnwstr,   mvwins_nwstr,
+       mvwins_wch,    mvwins_wstr,    mvwinwchnstr.    mvwinwstr,
+       mvwvline_set, pecho_wchar, setcchar, slk_wset, term_attrs,
+       unget_wch,   vhline_set,  vid_attr,  vid_puts,  vline_set,
+       wadd_wch, wadd_wchnstr, wadd_wchstr, waddnwstr,  waddwstr,
+       waddwstr,  wbkgrnd,  wbkgrndset,  wbkgrndset, wborder_set,
        wecho_wchar, wecho_wchar, wget_wch, wget_wstr, wgetbkgrnd,
-       wgetn_wstr, whline_set, win_wch, win_wchnstr,  win_wchstr,
+       wgetn_wstr,  whline_set, win_wch, win_wchnstr, win_wchstr,
        winnwstr,  wins_nwstr,  wins_wch,  wins_wstr,  winwchnstr,
        winwchstr, winwstr, wunctrl, wvline_set,
 
-       A small number of local differences (that  is,  individual
-       differences  between the XSI Curses and ncurses calls) are
-       described in  PORTABILITY  sections  of  the  library  man
+       A  small  number of local differences (that is, individual
+       differences between the XSI Curses and ncurses calls)  are
+       described  in  PORTABILITY  sections  of  the  library man
        pages.
 
        The routine has_key is not part of XPG4, nor is it present
-       in SVr4.  See the curs_getch(3x) manual page for  details.
+       in  SVr4.  See the curs_getch(3x) manual page for details.
 
-       The  routine  slk_attr is not part of XPG4, nor is it pre-
-       sent in  SVr4.   See  the  curs_slk(3x)  manual  page  for
+       The routine slk_attr is  not  part  of  XPG4,  nor  is  it
+       present  in  SVr4.   See  the curs_slk(3x) manual page for
        details.
 
-       The  routines getmouse, mousemask, ungetmouse, mouseinter-
-       val, and wenclose relating to mouse  interfacing  are  not
-       part  of  XPG4,  nor  are  they  present in SVr4.  See the
-       curs_mouse(3x) manual page for details.
+       The    routines    getmouse,    mousemask,     ungetmouse,
+       mouseinterval,  and wenclose relating to mouse interfacing
+       are not part of XPG4, nor are they present in  SVr4.   See
+       the curs_mouse(3x) manual page for details.
 
        The routine mcprint was not present in any previous curses
-       implementation.   See  the  curs_print(3x) manual page for
+       implementation.  See the curs_print(3x)  manual  page  for
        details.
-
        The routine wresize is not part of XPG4, nor is it present
        in SVr4.  See the wresize(3x) manual page for details.
 
-       In  historic curses versions, delays embedded in the capa-
-       bilities cr, ind, cub1, ff and tab activated corresponding
-       delay  bits  in  the UNIX tty driver.  In this implementa-
-       tion, all padding is done by NUL sends.   This  method  is
-       slightly  more expensive, but narrows the interface to the
-       UNIX kernel  significantly  and  increases  the  package's
-       portability correspondingly.
+       In  historic  curses  versions,  delays  embedded  in  the
+       capabilities   cr,   ind,   cub1,  ff  and  tab  activated
+       corresponding delay bits in the UNIX tty driver.  In  this
+       implementation,  all  padding  is done by NUL sends.  This
+       method  is  slightly  more  expensive,  but  narrows   the
+       interface  to  the UNIX kernel significantly and increases
+       the package's portability correspondingly.
 
-       In  the  XSI  standard  and  SVr4 manual pages, many entry
+       In the XSI standard and  SVr4  manual  pages,  many  entry
        points have prototype arguments of the for char *const (or
        cchar_t  *const,  or  wchar_t  *const,  or  void  *const).
-       Depending on one's interpretation of the ANSI  C  standard
-       (see  section  3.5.4.1), these declarations are either (a)
-       meaningless, or (b) meaningless and illegal.  The declara-
-       tion const char *x is a modifiable pointer to unmodifiable
-       data, but char *const x' is  an  unmodifiable  pointer  to
-       modifiable  data.  Given that C passes arguments by value,
-       <type> *const as a formal type is at best  dubious.   Some
-       compilers  choke  on  the  prototypes.  Therefore, in this
-       implementation, they have been changed to const  <type>  *
-       globally.
+       Depending  on  one's interpretation of the ANSI C standard
+       (see section 3.5.4.1), these declarations are  either  (a)
+       meaningless,   or   (b)   meaningless  and  illegal.   The
+       declaration const char  *x  is  a  modifiable  pointer  to
+       unmodifiable  data,  but char *const x' is an unmodifiable
+       pointer to modifiable data.  Given that C passes arguments
+       by  value,  <type>  *const  as  a  formal  type is at best
+       dubious.   Some  compilers  choke   on   the   prototypes.
+       Therefore,  in this implementation, they have been changed
+       to const <type> * globally.
 
 
 

NOTES

-       The  header  file  <curses.h>  automatically  includes the
+       The header  file  <curses.h>  automatically  includes  the
        header files <stdio.h> and <unctrl.h>.
 
-       If standard output from a ncurses program  is  re-directed
-       to  something  which  is not a tty, screen updates will be
-       directed to standard error.  This was an undocumented fea-
-       ture of AT&T System V Release 3 curses.
+       If  standard  output from a ncurses program is re-directed
+       to something which is not a tty, screen  updates  will  be
+       directed  to  standard  error.   This  was an undocumented
+       feature of AT&T System V Release 3 curses.
 
 
 

AUTHORS

-       Zeyd  M.  Ben-Halim,  Eric  S.  Raymond, Thomas E. Dickey.
+       Zeyd M. Ben-Halim, Eric  S.  Raymond,  Thomas  E.  Dickey.
        Based on pcurses by Pavel Curtis.
 
 
@@ -881,11 +887,6 @@
 
 
 
-
-
-
-
-
 
 
 
diff --git a/doc/html/man/term.5.html b/doc/html/man/term.5.html index 8995219c..b4c1ed07 100644 --- a/doc/html/man/term.5.html +++ b/doc/html/man/term.5.html @@ -16,13 +16,13 @@

DESCRIPTION

        Compiled terminfo descriptions are placed under the direc-
-       tory @DATADIR@/terminfo.   In  order  to  avoid  a  linear
+       tory /usr/share/terminfo.  In  order  to  avoid  a  linear
        search of a huge UNIX system directory, a two-level scheme
        is used: /c/name where name is the name of  the  terminal,
        and  c  is the first character of name.  Thus, act4 can be
-       found in the file @DATADIR@/terminfo/a/act4.  Synonyms for
-       the same terminal are implemented by multiple links to the
-       same compiled file.
+       found in the  file  /usr/share/terminfo/a/act4.   Synonyms
+       for the same terminal are implemented by multiple links to
+       the same compiled file.
 
        The format has been chosen so that it will be the same  on
        all  hardware.   An  8 or more bit byte is assumed, but no
@@ -156,7 +156,7 @@
 
 

FILES

-       @DATADIR@/terminfo/*/*   compiled terminal capability data
+       /usr/share/terminfo/*/*  compiled terminal capability data
        base
 
 
diff --git a/doc/html/man/term.7.html b/doc/html/man/term.7.html
index 24ac436e..55df37df 100644
--- a/doc/html/man/term.7.html
+++ b/doc/html/man/term.7.html
@@ -48,7 +48,7 @@
        the system default type for your line.
 
        Terminal type descriptions are stored as files of capabil-
-       ity  data underneath @DATADIR@/terminfo.  To browse a list
+       ity data underneath /usr/share/terminfo.  To browse a list
        of all terminal names recognized by the system, do
 
             toe | more
@@ -63,7 +63,7 @@
 
        where entry-name is the name of the type you wish to exam-
        ine  (and the name of its capability file the subdirectory
-       of @DATADIR@/terminfo named for its first  letter).   This
+       of /usr/share/terminfo named for its first letter).   This
        command  dumps  a  capability  file  in  the  text  format
        described by terminfo(5).
 
@@ -181,7 +181,7 @@
 
 

FILES

-       @DATADIR@/terminfo/?/*
+       /usr/share/terminfo/?/*
             compiled terminal capability data base
 
        /etc/inittab
diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
index 59a79d59..20bb063d 100644
--- a/doc/html/man/terminfo.5.html
+++ b/doc/html/man/terminfo.5.html
@@ -10,7 +10,7 @@
 
 

SYNOPSIS

-       @DATADIR@/terminfo/*/*
+       /usr/share/terminfo/*/*
 
 
 
@@ -293,12 +293,13 @@ (P*) change_char_pitch cpi ZA Change number of characters per inch + to #1 change_line_pitch lpi ZB Change number of - lines per inch + lines per inch to #1 change_res_horz chr ZC Change horizontal - resolution + resolution to #1 change_res_vert cvr ZD Change vertical res- - olution + olution to #1 change_scroll_region csr cs change region to line #1 to line #2 (P) @@ -332,9 +333,9 @@ ble cursor_left cub1 le move left one space - cursor_mem_address mrcup CM memory relative cur- - sor addressing + sor addressing, move + to row #1 columns #2 cursor_normal cnorm ve make cursor appear normal (undo civis/cvvis) @@ -347,13 +348,14 @@ cursor_visible cvvis vs make cursor very visible define_char defc ZE Define a character + #1, #2 dots wide, + descender #3 delete_character dch1 dc delete character (P*) delete_line dl1 dl delete line (P*) dial_phone dial DI dial number #1 dis_status_line dsl ds disable status line - display_clock dclk DK display clock at - (#1,#2) + display_clock dclk DK display clock down_half_line hd hd half a line down ena_acs enacs eA enable alternate char set @@ -384,9 +386,9 @@ mode enter_protected_mode prot mp turn on protected mode + enter_reverse_mode rev mr turn on reverse video mode - enter_secure_mode invis mk turn on blank mode (characters invisi- ble) @@ -438,9 +440,8 @@ from_status_line fsl fs return from status line goto_window wingo WG go to window #1 - hangup hup HU hang-up phone - + hangup hup HU hang-up phone init_1string is1 i1 initialization string init_2string is2 is initialization @@ -493,8 +494,8 @@ screen key key_exit kext @9 exit key key_f0 kf0 k0 F0 function key - key_f1 kf1 k1 F1 function key + key_f1 kf1 k1 F1 function key key_f10 kf10 k; F10 function key key_f11 kf11 F1 F11 function key key_f12 kf12 F2 F12 function key @@ -547,8 +548,8 @@ key_f55 kf55 Fj F55 function key key_f56 kf56 Fk F56 function key key_f57 kf57 Fl F57 function key - key_f58 kf58 Fm F58 function key + key_f58 kf58 Fm F58 function key key_f59 kf59 Fn F59 function key key_f6 kf6 k6 F6 function key key_f60 kf60 Fo F60 function key @@ -601,8 +602,8 @@ key_sf kind kF scroll-forward key key_sfind kFND *0 shifted find key key_shelp kHLP #1 shifted help key - key_shome kHOM #2 shifted home key + key_shome kHOM #2 shifted home key key_sic kIC #3 shifted insert-char- acter key key_sleft kLFT #4 shifted left-arrow @@ -655,8 +656,8 @@ label_format fln Lf label format label_off rmln LF turn off soft labels label_on smln LO turn on soft labels - meta_off rmm mo turn off meta mode + meta_off rmm mo turn off meta mode meta_on smm mm turn on meta mode (8th-bit on) micro_column_address mhpa ZY Like column_address @@ -667,8 +668,8 @@ micro mode micro_right mcuf1 Zb Like cursor_right in micro mode - micro_row_address mvpa Zc Like row_address in - micro mode + micro_row_address mvpa Zc Like row_address #1 + in micro mode micro_up mcuu1 Zd Like cursor_up in micro mode newline nel nw newline (behave like @@ -707,10 +708,12 @@ in micro mode pkey_key pfkey pk program function key #1 to type string #2 + + + pkey_local pfloc pl program function key #1 to execute string #2 - pkey_xmit pfx px program function key #1 to transmit string #2 @@ -743,7 +746,8 @@ position (P) scroll_forward ind sf scroll text up (P) scroll_reverse ri sr scroll text down (P) - select_char_set scs Zj Select character set + select_char_set scs Zj Select character + set, #1 set_attributes sgr sa define video attributes #1-#9 (PG9) @@ -752,22 +756,23 @@ set_bottom_margin smgb Zk Set bottom margin at current line set_bottom_margin_parm smgbp Zl Set bottom margin at - line #1 or #2 lines - from bottom + line #1 or (if smgtp + is not given) #2 + lines from bottom set_clock sclk SC set clock, #1 hrs #2 mins #3 secs set_color_pair scp sp Set current color pair to #1 + + set_foreground setf Sf Set foreground color #1 set_left_margin smgl ML set left soft margin - at current column - - - + at current column. + See smgl. (ML is not + in BSD termcap). set_left_margin_parm smglp Zm Set left (right) margin at column #1 - (#2) set_right_margin smgr MR set right soft mar- gin at current col- umn @@ -779,18 +784,19 @@ current line set_top_margin_parm smgtp Zp Set top (bottom) margin at row #1 - (#2) set_window wind wi current window is lines #1-#2 cols #3-#4 start_bit_image sbim Zq Start printing bit image graphics start_char_set_def scsd Zr Start character set - definition + definition #1, with + #2 characters in the + set stop_bit_image rbim Zs Stop printing bit image graphics stop_char_set_def rcsd Zt End definition of - character set + character set #1 subscript_characters subcs Zu List of subscript- able characters superscript_characters supcs Zv List of superscript- @@ -800,7 +806,8 @@ these_cause_cr docr Zw Printing any of these characters causes CR - to_status_line tsl ts move to status line + to_status_line tsl ts move to status line, + column #1 tone tone TO select touch tone dialing underline_char uc uc underline char and @@ -811,6 +818,7 @@ user2 u2 u2 User string #2 user3 u3 u3 User string #3 user4 u4 u4 User string #4 + user5 u5 u5 User string #5 user6 u6 u6 User string #6 user7 u7 u7 User string #7 @@ -818,13 +826,12 @@ user9 u9 u9 User string #9 wait_tone wait WA wait for dial-tone xoff_character xoffc XF XOFF character - xon_character xonc XN XON character zero_motion zerom Zx No motion for subse- quent character - The following string capabilities are present in the - SVr4.0 term structure, but were originally not documented + The following string capabilities are present in the + SVr4.0 term structure, but were originally not documented in the man page. Variable Cap- TCap Description @@ -838,8 +845,9 @@ of the bit image bit_image_repeat birep Xy Repeat bit image cell #1 #2 times - char_set_names csnm Zy List of character - set names + char_set_names csnm Zy Produce #1'th item + from list of char- + acter set names code_set_init csin ci Init sequence for multiple codesets color_names colornm Yw Give name for @@ -851,7 +859,7 @@ guage/codeset sup- port display_pc_char dispc S1 Display PC charac- - ter + ter #1 end_bit_image_region endbi Yy End a bit-image region enter_pc_charset_mode smpch S2 Enter PC character @@ -862,17 +870,19 @@ display mode exit_scancode_mode rmsc S5 Exit PC scancode mode + + + get_mouse getm Gm Curses should get - button events + button events, + parameter #1 not + documented. key_mouse kmous Km Mouse event has occurred mouse_info minfo Mi Mouse status information pc_term_options pctrm S6 PC terminal options - - - pkey_plab pfxl xl Program function key #1 to type string #2 and show @@ -891,16 +901,18 @@ set3_des_seq s3ds s3 Shift to code set 3 set_a_background setab AB Set background - color using ANSI - escape + color to #1, using + ANSI escape set_a_foreground setaf AF Set foreground - color using ANSI - escape + color to #1, using + ANSI escape set_color_band setcolor Yz Change to ribbon color #1 set_lr_margin smglr ML Set both left and right margins to - #1, #2 + #1, #2. (ML is + not in BSD term- + cap). set_page_length slines YZ Set page length to #1 lines set_tb_margin smgtb MT Sets both top and @@ -925,8 +937,6 @@ mode enter_right_hl_mode erhlm Xr Enter right high- light mode - - enter_top_hl_mode ethlm Xt Enter top highlight mode enter_vertical_hl_mode evhlm Xv Enter vertical high- @@ -1034,64 +1044,65 @@ piled description you are working on. Only that directory is searched. - If TERMINFO is not set, the ncurses version of the - terminfo reader code will instead look in the directory + If TERMINFO is not set, the ncurses version of the ter- + minfo reader code will instead look in the directory $HOME/.terminfo for a compiled description. If it fails to find one there, and the environment variable TER- MINFO_DIRS is set, it will interpret the contents of that variable as a list of colon- separated directories to be searched (an empty entry is interpreted as a command to - search @DATADIR@/terminfo). If no description is found in - any of the TERMINFO_DIRS directories, the fetch fails. + search /usr/share/terminfo). If no description is found + in any of the TERMINFO_DIRS directories, the fetch fails. - If neither TERMINFO nor TERMINFO_DIRS is set, the last - place tried will be the system terminfo directory, - @DATADIR@/terminfo. + If neither TERMINFO nor TERMINFO_DIRS is set, the last + place tried will be the system terminfo directory, + /usr/share/terminfo. - (Neither the $HOME/.terminfo lookups nor TERMINFO_DIRS - extensions are supported under stock System V ter- + (Neither the $HOME/.terminfo lookups nor TERMINFO_DIRS + extensions are supported under stock System V ter- minfo/curses.) Preparing Descriptions - We now outline how to prepare descriptions of terminals. - The most effective way to prepare a terminal description - is by imitating the description of a similar terminal in - terminfo and to build up a description gradually, using + We now outline how to prepare descriptions of terminals. + The most effective way to prepare a terminal description + is by imitating the description of a similar terminal in + terminfo and to build up a description gradually, using partial descriptions with vi or some other screen-oriented - program to check that they are correct. Be aware that a + program to check that they are correct. Be aware that a very unusual terminal may expose deficiencies in the abil- - ity of the terminfo file to describe it or bugs in the + ity of the terminfo file to describe it or bugs in the screen-handling code of the test program. - To get the padding for insert line right (if the terminal + To get the padding for insert line right (if the terminal manufacturer did not document it) a severe test is to edit - a large file at 9600 baud, delete 16 or so lines from the - middle of the screen, then hit the `u' key several times - quickly. If the terminal messes up, more padding is usu- - ally needed. A similar test can be used for insert char- + a large file at 9600 baud, delete 16 or so lines from the + middle of the screen, then hit the `u' key several times + quickly. If the terminal messes up, more padding is usu- + ally needed. A similar test can be used for insert char- acter. Basic Capabilities - The number of columns on each line for the terminal is - given by the cols numeric capability. If the terminal is - a CRT, then the number of lines on the screen is given by + The number of columns on each line for the terminal is + given by the cols numeric capability. If the terminal is + a CRT, then the number of lines on the screen is given by the lines capability. If the terminal wraps around to the - beginning of the next line when it reaches the right mar- - gin, then it should have the am capability. If the termi- - nal can clear its screen, leaving the cursor in the home - position, then this is given by the clear string capabil- - ity. If the terminal overstrikes (rather than clearing a - position when a character is struck over) then it should - have the os capability. If the terminal is a printing - terminal, with no soft copy unit, give it both hc and os. - (os applies to storage scope terminals, such as TEKTRONIX - 4010 series, as well as hard copy and APL terminals.) If - there is a code to move the cursor to the left edge of the - current row, give this as cr. (Normally this will be car- - riage return, control M.) If there is a code to produce - an audible signal (bell, beep, etc) give this as bel. + beginning of the next line when it reaches the right + margin, then it should have the am capability. If the + terminal can clear its screen, leaving the cursor in the + home position, then this is given by the clear string + capability. If the terminal overstrikes (rather than + clearing a position when a character is struck over) then + it should have the os capability. If the terminal is a + printing terminal, with no soft copy unit, give it both hc + and os. (os applies to storage scope terminals, such as + TEKTRONIX 4010 series, as well as hard copy and APL termi- + nals.) If there is a code to move the cursor to the left + edge of the current row, give this as cr. (Normally this + will be carriage return, control M.) If there is a code + to produce an audible signal (bell, beep, etc) give this + as bel. If there is a code to move the cursor one position to the left (such as backspace) that capability should be given @@ -1143,6 +1154,7 @@ 33|tty33|tty|model 33 teletype, bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os, + while the Lear Siegler ADM-3 is described as adm3|3|lsi adm3, @@ -1185,6 +1197,7 @@ %+ %- %* %/ %m arithmetic (%m is mod): push(pop() op pop()) + %& %| %^ bit operations: push(pop() op pop()) %= %> %< logical operations: push(pop() op pop()) %A, %O logical and & or operations (for conditionals) @@ -1508,6 +1521,7 @@ \E[0 always \E[0 ;1 if p1 or p6 %?%p1%p6%|%t;1%; ;4 if p2 %?%p2%|%t;4%; + ;5 if p4 %?%p4%|%t;5%; ;7 if p1 or p3 %?%p1%p3%|%t;7%; ;8 if p7 %?%p7%|%t;8%; @@ -1521,6 +1535,7 @@ Remember that if you specify sgr, you must also specify sgr0. + Terminals with the ``magic cookie'' glitch (xmc) deposit special ``cookies'' when they receive mode-setting sequences, which affect the display algorithm rather than @@ -1631,9 +1646,9 @@ They are normally sent to the terminal, by the init option of the tput program, each time the user logs in. They will be printed in the following order: run the program - iprog; output is1; is2; set the margins using mgc, smgland - smgr; set tabs using tbc and hts; print the file if; and - finally output is3. + iprog; output is1; is2; set the margins using mgc, smgl + and smgr; set tabs using tbc and hts; print the file if; + and finally output is3. Most initialization is done with is2. Special terminal modes can be set up without duplicating strings by putting @@ -1684,6 +1699,7 @@ ter as a pad, then this can be given as pad. Only the first character of the pad string is used. + Status Lines Some terminals have an extra `status line' which is not normally used by software (and thus not counted in the @@ -1737,7 +1753,6 @@ board of squares ACS_BOARD # h bullet ACS_BULLET o ~ checker board (stipple) ACS_CKBOARD : a - degree symbol ACS_DEGREE \ f diamond ACS_DIAMOND + ` greater-than-or-equal-to ACS_GEQUAL > z @@ -1884,10 +1899,10 @@ If the terminal can move up or down half a line, this can be indicated with hu (half-line up) and hd (half-line - down). This is primarily useful for superscripts and sub- - scripts on hard-copy terminals. If a hard-copy terminal - can eject to the next page (form feed), give this as ff - (usually control L). + down). This is primarily useful for superscripts and + subscripts on hard-copy terminals. If a hard-copy termi- + nal can eject to the next page (form feed), give this as + ff (usually control L). If there is a command to repeat a given character a given number of times (to save time transmitting a large number @@ -2103,7 +2118,6 @@ Some SVr4 curses implementations, and all previous to SVr4, don't interpret the %A and %O operators in parameter strings. - SVr4/XPG4 do not specify whether msgr licenses movement while in an alternate-character-set mode (such modes may, among other things, map CR and NL to characters that don't @@ -2159,7 +2173,7 @@

FILES

-       @DATADIR@/terminfo/?/*   files     containing     terminal
+       /usr/share/terminfo/?/*  files     containing     terminal
                                 descriptions
 
 
@@ -2178,6 +2192,46 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 

diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html index a8d6e7d3..eddb8195 100644 --- a/doc/html/man/tic.1m.html +++ b/doc/html/man/tic.1m.html @@ -10,7 +10,7 @@

SYNOPSIS

-       tic  [-1CINRTacfrsx]  [-e  names] [-o dir] [-v[n]] [-w[n]]
+       tic  [-1CINRTVacfrsx]  [-e names] [-o dir] [-v[n]] [-w[n]]
        file
 
 
@@ -21,21 +21,21 @@
        essary for use with the library routines in ncurses(3x).
 
        The results are normally placed  in  the  system  terminfo
-       directory  @DATADIR@/terminfo.   There  are  two  ways  to
+       directory  /usr/share/terminfo.   There  are  two  ways to
        change this behavior.
 
        First, you may override the system default by setting  the
        variable  TERMINFO  in  your  shell environment to a valid
        (existing) directory name.
 
-       Secondly, if tic cannot get access  to  @DATADIR@/terminfo
+       Secondly, if tic cannot get access to  /usr/share/terminfo
        or  your  TERMINFO  directory,  it looks for the directory
        $HOME/.terminfo; if that directory exists,  the  entry  is
        placed there.
 
        Libraries that read terminfo entries are expected to check
        for a TERMINFO directory first, look at $HOME/.terminfo if
-       TERMINFO  is  not  set, and finally look in @DATADIR@/ter-
+       TERMINFO  is  not set, and finally look in /usr/share/ter-
        minfo.
 
        -a     tells  tic  to  retain  commented-out  capabilities
@@ -111,44 +111,47 @@
               since  the compiled descriptions are limited (e.g.,
               1023 for termcap, 4096 for terminfo).
 
-       -r     Force entry resolution (so there are  no  remaining
-              tc  capabilities)  even  when  doing translation to
-              termcap format.  This may  be  needed  if  you  are
-              preparing  a  termcap  file  for  a termcap library
-              (such as GNU termcap  up  to  version  1.3  or  BSD
-              termcap  up to 4.3BSD) that doesn't handle multiple
-              tc capabilities per entry.
+       -V     reports the version of ncurses which  was  used  in
+              this program, and exits.
 
-       -e     Limit writes  and  translations  to  the  following
-              comma-separated  list of terminals.  If any name or
+       -r     Force  entry  resolution (so there are no remaining
+              tc capabilities) even  when  doing  translation  to
+              termcap  format.   This  may  be  needed if you are
+              preparing a termcap  file  for  a  termcap  library
+              (such as GNU termcap up to version 1.3 or BSD term-
+              cap up to 4.3BSD) that doesn't handle  multiple  tc
+              capabilities per entry.
+
+       -e     Limit  writes  and  translations  to  the following
+              comma-separated list of terminals.  If any name  or
               alias of a terminal matches one of the names in the
-              list,  the  entry  will be written or translated as
-              normal.  Otherwise no output will be generated  for
+              list, the entry will be written  or  translated  as
+              normal.   Otherwise no output will be generated for
               it.  The option value is interpreted as a file con-
-              taining the list if  it  contains  a  '/'.   (Note:
-              depending  on how tic was compiled, this option may
+              taining  the  list  if  it  contains a '/'.  (Note:
+              depending on how tic was compiled, this option  may
               require -I or -C.)
 
        -f     Display  complex  terminfo  strings  which  contain
-              if/then/else/endif  expressions  indented for read-
+              if/then/else/endif expressions indented  for  read-
               ability.
 
-       -g     Display constant character literals in quoted  form
+       -g     Display  constant character literals in quoted form
               rather than their decimal equivalents.
 
        -s     Summarize the compile by showing the directory into
               which  entries  are  written,  and  the  number  of
               entries which are compiled.
 
-       -x     Treat  unknown  capabilities as user-defined.  That
-              is, if you supply a capability name which tic  does
-              not  recognize,  it  will  infer its type (boolean,
-              number or string)  from  the  syntax  and  make  an
+       -x     Treat unknown capabilities as  user-defined.   That
+              is,  if you supply a capability name which tic does
+              not recognize, it will  infer  its  type  (boolean,
+              number  or  string)  from  the  syntax  and make an
               extended table entry for that.
 
        file   contains one or more terminfo terminal descriptions
-              in source format [see terminfo(5)].  Each  descrip-
-              tion  in  the  file describes the capabilities of a
+              in  source format [see terminfo(5)].  Each descrip-
+              tion in the file describes the  capabilities  of  a
               particular terminal.
 
        The debug flag levels are as follows:
@@ -165,7 +168,7 @@
 
        8      List of tokens encountered by scanner
 
-       9      All values computed in  construction  of  the  hash
+       9      All  values  computed  in  construction of the hash
               table
 
        If n is not given, it is taken to be one.
@@ -174,78 +177,79 @@
        umented in terminfo(5).  The exception is the use capabil-
        ity.
 
-       When  a  use=entry-name  field is discovered in a terminal
-       entry currently being compiled, tic reads  in  the  binary
-       from  @DATADIR@/terminfo  to complete the entry.  (Entries
-       created from file will be used first.  If the  environment
-       variable  TERMINFO  is  set,  that  directory  is searched
-       instead of @DATADIR@/terminfo.)  tic duplicates the  capa-
-       bilities  in  entry-name  for  the current entry, with the
-       exception  of  those  capabilities  that  explicitly   are
+       When a use=entry-name field is discovered  in  a  terminal
+       entry  currently  being  compiled, tic reads in the binary
+       from /usr/share/terminfo to complete the entry.   (Entries
+       created  from file will be used first.  If the environment
+       variable TERMINFO  is  set,  that  directory  is  searched
+       instead of /usr/share/terminfo.)  tic duplicates the capa-
+       bilities in entry-name for the  current  entry,  with  the
+       exception   of  those  capabilities  that  explicitly  are
        defined in the current entry.
 
-       When    an   entry,   e.g.,   entry_name_1,   contains   a
-       use=entry_name_2  field,  any  canceled  capabilities   in
-       entry_name_2  must also appear in entry_name_1 before use=
+       When   an   entry,   e.g.,   entry_name_1,   contains    a
+       use=entry_name_2   field,  any  canceled  capabilities  in
+       entry_name_2 must also appear in entry_name_1 before  use=
        for these capabilities to be canceled in entry_name_1.
 
-       If the environment variable TERMINFO is set, the  compiled
-       results are placed there instead of @DATADIR@/terminfo.
+       If  the environment variable TERMINFO is set, the compiled
+       results are placed there instead of /usr/share/terminfo.
 
        Total compiled entries cannot exceed 4096 bytes.  The name
-       field cannot exceed 512 bytes.  Terminal  names  exceeding
-       the  maximum  alias  length (32 characters on systems with
+       field  cannot  exceed 512 bytes.  Terminal names exceeding
+       the maximum alias length (32 characters  on  systems  with
        long filenames, 14 characters otherwise) will be truncated
-       to  the maximum alias length and a warning message will be
+       to the maximum alias length and a warning message will  be
        printed.
 
 
 

COMPATIBILITY

-       There is some evidence that historic  tic  implementations
-       treated  description  fields with no whitespace in them as
-       additional aliases or short names.  This tic does  not  do
-       that,  but  it  does  warn  when description fields may be
-       treated that way and check them for dangerous  characters.
+       There  is  some evidence that historic tic implementations
+       treated description fields with no whitespace in  them  as
+       additional  aliases  or short names.  This tic does not do
+       that, but it does warn  when  description  fields  may  be
+       treated  that way and check them for dangerous characters.
 
 
 

EXTENSIONS

        Unlike the stock SVr4 tic command, this implementation can
-       actually compile termcap sources.   In  fact,  entries  in
-       terminfo  and  termcap  syntax  can  be  mixed in a single
-       source file.  See terminfo(5)  for  the  list  of  termcap
+       actually  compile  termcap  sources.   In fact, entries in
+       terminfo and termcap syntax  can  be  mixed  in  a  single
+       source  file.   See  terminfo(5)  for  the list of termcap
        names taken to be equivalent to terminfo names.
 
-       The  SVr4  manual  pages  are  not clear on the resolution
-       rules for use capabilities.  This  implementation  of  tic
+       The SVr4 manual pages are  not  clear  on  the  resolution
+       rules  for  use  capabilities.  This implementation of tic
        will find use targets anywhere in the source file, or any-
-       where in the file tree rooted at TERMINFO (if TERMINFO  is
-       defined),  or  in the user's $HOME/.terminfo directory (if
-       it exists), or (finally) anywhere  in  the  system's  file
+       where  in the file tree rooted at TERMINFO (if TERMINFO is
+       defined), or in the user's $HOME/.terminfo  directory  (if
+       it  exists),  or  (finally)  anywhere in the system's file
        tree of compiled entries.
 
-       The  error  messages from this tic have the same format as
-       GNU C error messages, and can be  parsed  by  GNU  Emacs's
+       The error messages from this tic have the same  format  as
+       GNU  C  error  messages,  and can be parsed by GNU Emacs's
        compile facility.
-       The -C, -G, -I, -N, -R, -T, -a, -e, -f, -g, -o, -r, -s and
-       -x options are not supported under SVr4.  The SVr4 -c mode
-       does not report bad use links.
 
-       System  V does not compile entries to or read entries from
-       your $HOME/.terminfo directory unless TERMINFO is  explic-
+       The -C, -G, -I, -N, -R, -T, -V, -a, -e, -f, -g, -o, -r, -s
+       and  -x options are not supported under SVr4.  The SVr4 -c
+       mode does not report bad use links.
+
+       System V does not compile entries to or read entries  from
+       your  $HOME/.terminfo directory unless TERMINFO is explic-
        itly set to it.
 
 
 

FILES

-       @DATADIR@/terminfo/?/*
+       /usr/share/terminfo/?/*
             Compiled terminal description database.
 
 
 

SEE ALSO

-       infocmp(1m),    captoinfo(1m),   infotocap(1m),   toe(1m),
+       infocmp(1m),   captoinfo(1m),   infotocap(1m),    toe(1m),
        curses(3x), terminfo(5).
 
 
@@ -279,9 +283,6 @@
 
 
 
-
-
-
 
 
 
diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
index 3b017e3a..887a9c49 100644
--- a/doc/html/man/toe.1m.html
+++ b/doc/html/man/toe.1m.html
@@ -48,13 +48,13 @@
               progress.   The optional integer n is a number from
               1 to 10, interpreted as for tic(1).
 
-       -V   prints out the version of the program in use on stan-
-            dard error and exits.
+       -V   reports the version of ncurses which was used in this
+            program, and exits.
 
 
 

FILES

-       @DATADIR@/terminfo/?/*
+       /usr/share/terminfo/?/*
             Compiled terminal description database.
 
 
diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
index 606f7770..17c55aad 100644
--- a/doc/html/man/tput.1.html
+++ b/doc/html/man/tput.1.html
@@ -5,7 +5,8 @@
 
 

NAME

-       tput - initialize a terminal or query terminfo database
+       tput,  reset  -  initialize  a  terminal or query terminfo
+       database
 
 
 
@@ -15,51 +16,55 @@ tput [-Ttype] reset tput [-Ttype] longname tput -S << + tput -V

DESCRIPTION

-       The  tput  utility  uses the terminfo database to make the
-       values of terminal-dependent capabilities and  information
+       The tput utility uses the terminfo database  to  make  the
+       values  of terminal-dependent capabilities and information
        available to the shell (see sh(1)), to initialize or reset
-       the terminal, or return the long  name  of  the  requested
-       terminal  type.   tput  outputs  a string if the attribute
-       (capability name) is of type string, or an integer if  the
+       the  terminal,  or  return  the long name of the requested
+       terminal type.  tput outputs a  string  if  the  attribute
+       (capability  name) is of type string, or an integer if the
        attribute is of type integer.  If the attribute is of type
        boolean, tput simply sets the exit code (0 for TRUE if the
-       terminal  has the capability, 1 for FALSE if it does not),
-       and produces no output.  Before using a value returned  on
-       standard  output,  the user should test the exit code [$?,
-       see sh(1)] to be sure it is 0.  (See the  EXIT  CODES  and
-       DIAGNOSTICS  sections.)   For a complete list of capabili-
-       ties and  the  capname  associated  with  each,  see  ter-
+       terminal has the capability, 1 for FALSE if it does  not),
+       and  produces no output.  Before using a value returned on
+       standard output, the user should test the exit  code  [$?,
+       see  sh(1)]  to  be sure it is 0.  (See the EXIT CODES and
+       DIAGNOSTICS sections.)  For a complete list  of  capabili-
+       ties  and  the  capname  associated  with  each,  see ter-
        minfo(5).
 
-       -Ttype indicates  the  type  of  terminal.   Normally this
+       -Ttype indicates the  type  of  terminal.   Normally  this
               option is unnecessary, because the default is taken
               from the environment variable TERM.  If -T is spec-
-              ified, then the shell variables LINES  and  COLUMNS
-              will  be  ignored,and the operating system will not
+              ified,  then  the shell variables LINES and COLUMNS
+              will be ignored,and the operating system  will  not
               be queried for the actual screen size.
 
        capname
               indicates the attribute from the terminfo database.
-              When  termcap  support  is compiled in, the termcap
+              When termcap support is compiled  in,  the  termcap
               name for the attribute is also accepted.
 
        parms  If the attribute is a string that takes parameters,
-              the  arguments  parms will be instantiated into the
-              string.  An all numeric argument will be passed  to
+              the arguments parms will be instantiated  into  the
+              string.   An all numeric argument will be passed to
               the attribute as a number.
 
-       -S     allows  more  than one capability per invocation of
+       -S     allows more than one capability per  invocation  of
               tput.  The capabilities must be passed to tput from
               the standard input instead of from the command line
-              (see example).  Only one  capname  is  allowed  per
-              line.   The  -S option changes the meaning of the 0
-              and 1 boolean and string exit codes (see  the  EXIT
+              (see  example).   Only  one  capname is allowed per
+              line.  The -S option changes the meaning of  the  0
+              and  1  boolean and string exit codes (see the EXIT
               CODES section).
 
+       -V     reports the version of ncurses which  was  used  in
+              this program, and exits.
+
        init   If  the  terminfo  database is present and an entry
               for the user's terminal exists (see -Ttype, above),
               the  following will occur: (1) if present, the ter-
@@ -88,6 +93,10 @@
               the terminal's description in the terminfo database
               [see term(5)].
 
+       If  tput  is  invoked  by a link named reset, this has the
+       same effect as tput reset.  See tset for comparison, which
+       has similar behavior.
+
 
 

EXAMPLES

@@ -108,8 +117,8 @@
             as the "home" cursor position).
 
        tput clear
-            Echo the clear-screen sequence for the current termi-
-            nal.
+            Echo  the  clear-screen  sequence  for  the   current
+            terminal.
 
        tput cols
             Print the number of columns for the current terminal.
@@ -117,7 +126,6 @@
        tput -T450 cols
             Print the number of columns for the 450 terminal.
 
-
        bold=`tput smso` offbold=`tput rmso`
             Set the shell variables bold, to begin stand-out mode
             sequence, and offbold, to end standout mode sequence,
@@ -138,11 +146,11 @@
             the  type  of terminal specified in the environmental
             variable TERM.
 
-       tput -S <<!
-       > clear
-       > cup 10 10
-       > bold
-       > !
+            tput -S <<!
+            > clear
+            > cup 10 10
+            > bold
+            > !
 
             This example shows tput processing several  capabili-
             ties  in  one  invocation.   This  example clears the
@@ -153,7 +161,7 @@
 
 

FILES

-       @DATADIR@/terminfo
+       /usr/share/terminfo
               compiled terminal description database
 
        /usr/include/curses.h
@@ -162,7 +170,7 @@
        /usr/include/term.h
               terminfo header file
 
-       @DATADIR@/tabset/*
+       /usr/share/tabset/*
               tab settings for some terminals, in a format appro-
               priate   to  be  output  to  the  terminal  (escape
               sequences that set  margins  and  tabs);  for  more
@@ -211,13 +219,15 @@
        responding exit codes.
 
        exit code   error message
-       0           (capname is a numeric variable that is not specified in the
-                   terminfo(5) database for this terminal type, e.g.
+       ---------------------------------------------------------------------
+       0           (capname is a numeric variable that is not specified  in
+                   the  terminfo(5)  database  for this terminal type, e.g.
                    tput -T450 lines and tput -T2621 xmc)
        1           no error message is printed, see the EXIT CODES section.
        2           usage error
        3           unknown terminal type or no terminfo database
        4           unknown terminfo capability capname
+       ---------------------------------------------------------------------
 
 
 
@@ -226,16 +236,6 @@ tion features used in the cup example, are not supported in BSD curses or in AT&T/USL curses before SVr4. - - - - - - - - - -
diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html index aebef36b..635ddd53 100644 --- a/doc/html/man/tset.1.html +++ b/doc/html/man/tset.1.html @@ -5,14 +5,14 @@

NAME

-       tset - terminal initialization
+       tset, reset - terminal initialization
 
 
 

SYNOPSIS

-       tset  [-IQqrs]  [-]  [-e  ch] [-i ch] [-k ch] [-m mapping]
+       tset  [-IQVqrs]  [-]  [-e ch] [-i ch] [-k ch] [-m mapping]
        [terminal]
-       reset [-IQqrs] [-] [-e ch] [-i ch] [-k  ch]  [-m  mapping]
+       reset [-IQVqrs] [-] [-e ch] [-i ch] [-k ch]  [-m  mapping]
        [terminal]
 
 
@@ -79,6 +79,12 @@
        -I   Do  not  send  the  terminal  or  tab  initialization
             strings to the terminal.
 
+       -Q   Don't display any values for the erase, interrupt and
+            line kill characters.
+
+       -V   reports the version of ncurses which was used in this
+            program, and exits.
+
        -i   Set the interrupt character to ch.
 
        -k   Set the line kill character to ch.
@@ -86,34 +92,31 @@
        -m   Specify a mapping from a port  type  to  a  terminal.
             See below for more information.
 
-       -Q   Don't display any values for the erase, interrupt and
-            line kill characters.
-
        -r   Print the terminal type to the standard error output.
 
-       -s   Print  the  sequence  of shell commands to initialize
+       -s   Print the sequence of shell  commands  to  initialize
             the environment variable TERM to the standard output.
-            See  the section below on setting the environment for
+            See the section below on setting the environment  for
             details.
 
        The arguments for the -e, -i, and -k options may either be
-       entered  as  actual characters or by using the `hat' nota-
+       entered as actual characters or by using the  `hat'  nota-
        tion, i.e. control-h may be specified as ``^H'' or ``^h''.
 
 
 

SETTING THE ENVIRONMENT

-       It  is  often  desirable  to  enter  the terminal type and
-       information about the  terminal's  capabilities  into  the
+       It is often desirable  to  enter  the  terminal  type  and
+       information  about  the  terminal's  capabilities into the
        shell's environment.  This is done using the -s option.
 
        When the -s option is specified, the commands to enter the
-       information into the shell's environment  are  written  to
-       the  standard output.  If the SHELL environmental variable
+       information  into  the  shell's environment are written to
+       the standard output.  If the SHELL environmental  variable
        ends in ``csh'', the commands are for csh, otherwise, they
-       are  for  sh.   Note,  the  csh commands set and unset the
-       shell variable noglob, leaving it  unset.   The  following
-       line  in  the .login or .profile files will initialize the
+       are for sh.  Note, the csh  commands  set  and  unset  the
+       shell  variable  noglob,  leaving it unset.  The following
+       line in the .login or .profile files will  initialize  the
        environment correctly:
 
            eval `tset -s options ... `
@@ -124,112 +127,113 @@
 

TERMINAL TYPE MAPPING

        When the terminal is not hardwired into the system (or the
        current system information is incorrect) the terminal type
-       derived from the /etc/ttys file or the TERM  environmental
-       variable  is often something generic like network, dialup,
-       or unknown.  When tset is used in a startup script  it  is
-       often  desirable  to provide information about the type of
+       derived  from the /etc/ttys file or the TERM environmental
+       variable is often something generic like network,  dialup,
+       or  unknown.   When tset is used in a startup script it is
+       often desirable to provide information about the  type  of
        terminal used on such ports.
 
-       The purpose of the -m option is to map from  some  set  of
-       conditions  to a terminal type, that is, to tell tset ``If
-       I'm on this port at a particular speed, guess that I'm  on
+       The  purpose  of  the -m option is to map from some set of
+       conditions to a terminal type, that is, to tell tset  ``If
+       I'm  on this port at a particular speed, guess that I'm on
        that kind of terminal''.
 
        The argument to the -m option consists of an optional port
        type, an optional operator, an optional baud rate specifi-
        cation, an optional colon (``:'') character and a terminal
-       type.  The port type is a string (delimited by either  the
+       type.   The port type is a string (delimited by either the
        operator or the colon character).  The operator may be any
        combination of ``>'', ``<'', ``@'', and ``!''; ``>'' means
-       greater  than, ``<'' means less than, ``@'' means equal to
+       greater than, ``<'' means less than, ``@'' means equal  to
        and ``!'' inverts the sense of the test.  The baud rate is
-       specified  as  a  number and is compared with the speed of
-       the standard error output (which  should  be  the  control
+       specified as a number and is compared with  the  speed  of
+       the  standard  error  output  (which should be the control
        terminal).  The terminal type is a string.
 
        If the terminal type is not specified on the command line,
-       the -m mappings are applied to the terminal type.  If  the
-       port  type  and  baud rate match the mapping, the terminal
-       type specified in the mapping replaces the  current  type.
-       If  more than one mapping is specified, the first applica-
+       the  -m mappings are applied to the terminal type.  If the
+       port type and baud rate match the  mapping,  the  terminal
+       type  specified  in the mapping replaces the current type.
+       If more than one mapping is specified, the first  applica-
        ble mapping is used.
 
-       For   example,    consider    the    following    mapping:
+       For    example,    consider    the    following   mapping:
        dialup>9600:vt100.  The port type is dialup , the operator
-       is >, the baud rate specification is 9600, and the  termi-
+       is  >, the baud rate specification is 9600, and the termi-
        nal type is vt100.  The result of this mapping is to spec-
        ify that if the terminal type is dialup, and the baud rate
-       is  greater  than 9600 baud, a terminal type of vt100 will
+       is greater than 9600 baud, a terminal type of  vt100  will
        be used.
 
        If no baud rate is specified, the terminal type will match
        any baud rate.  If no port type is specified, the terminal
-       type  will  match  any  port  type.    For   example,   -m
+       type   will   match   any  port  type.   For  example,  -m
        dialup:vt100  -m  :?xterm  will  cause  any  dialup  port,
        regardless of baud rate, to match the terminal type vt100,
-       and  any  non-dialup  port type to match the terminal type
-       ?xterm.  Note, because of the leading question  mark,  the
-       user  will be queried on a default port as to whether they
+       and any non-dialup port type to match  the  terminal  type
+       ?xterm.   Note,  because of the leading question mark, the
+       user will be queried on a default port as to whether  they
        are actually using an xterm terminal.
 
-       No whitespace characters are permitted in  the  -m  option
-       argument.   Also,  to avoid problems with meta-characters,
-       it is suggested that the  entire  -m  option  argument  be
-       placed  within single quote characters, and that csh users
-       insert a backslash character (``\'') before  any  exclama-
+       No  whitespace  characters  are permitted in the -m option
+       argument.  Also, to avoid problems  with  meta-characters,
+       it  is  suggested  that  the  entire -m option argument be
+       placed within single quote characters, and that csh  users
+       insert  a  backslash character (``\'') before any exclama-
        tion marks (``!'').
 
 
 

HISTORY

-       The  tset command appeared in BSD 3.0.  The ncurses imple-
-       mentation was lightly adapted from the 4.4BSD sources  for
+       The tset command appeared in BSD 3.0.  The ncurses  imple-
+       mentation  was lightly adapted from the 4.4BSD sources for
        a terminfo environment by Eric S. Raymond <esr@snark.thyr-
        sus.com>.
 
 
 

COMPATIBILITY

-       The tset utility has been provided  for  backward-compati-
-       bility  with  BSD  environments (under most modern UNIXes,
-       /etc/inittab and getty(1) can set TERM  appropriately  for
-       each  dial-up  line;  this  obviates  what was tset's most
-       important use).  This implementation behaves  like  4.4BSD
+       The  tset  utility has been provided for backward-compati-
+       bility with BSD environments (under  most  modern  UNIXes,
+       /etc/inittab  and  getty(1) can set TERM appropriately for
+       each dial-up line; this  obviates  what  was  tset's  most
+       important  use).   This implementation behaves like 4.4BSD
        tset, with a few exceptions specified here.
 
-       The  -S  option  of BSD tset no longer works; it prints an
+       The -S option of BSD tset no longer works;  it  prints  an
        error message to stderr and dies.  The -s option only sets
-       TERM,  not  TERMCAP.   Both  these changes are because the
-       TERMCAP variable is no longer  supported  under  terminfo-
+       TERM, not TERMCAP.  Both these  changes  are  because  the
+       TERMCAP  variable  is  no longer supported under terminfo-
        based ncurses, which makes tset -S useless (we made it die
        noisily rather than silently induce lossage).
 
-       There was an undocumented  4.4BSD  feature  that  invoking
+       There  was  an  undocumented  4.4BSD feature that invoking
        tset via a link named `TSET` (or via any other name begin-
-       ning with an upper-case letter) set the  terminal  to  use
+       ning  with  an  upper-case letter) set the terminal to use
        upper-case only.  This feature has been omitted.
 
-       The  -A,  -E,  -h, -u and -v options were deleted from the
-       tset utility in 4.4BSD. None of them  were  documented  in
+       The -A, -E, -h, -u and -v options were  deleted  from  the
+       tset  utility  in  4.4BSD. None of them were documented in
        4.3BSD and all are of limited utility at best. The -a, -d,
        and -p options are similarly not documented or useful, but
-       were  retained as they appear to be in widespread use.  It
-       is strongly recommended that  any  usage  of  these  three
-       options  be  changed to use the -m option instead.  The -n
-       option remains, but has no effect.  The -adnp options  are
+       were retained as they appear to be in widespread use.   It
+       is  strongly  recommended  that  any  usage of these three
+       options be changed to use the -m option instead.   The  -n
+       option  remains, but has no effect.  The -adnp options are
        therefore omitted from the usage summary above.
 
-       It  is  still  permissible  to  specify the -e, -i, and -k
-       options without arguments, although it is strongly  recom-
-       mended  that such usage be fixed to explicitly specify the
+       It is still permissible to specify  the  -e,  -i,  and  -k
+       options  without arguments, although it is strongly recom-
+       mended that such usage be fixed to explicitly specify  the
        character.
 
-       As of 4.4BSD, executing tset as reset  no  longer  implies
+       As  of  4.4BSD,  executing tset as reset no longer implies
        the -Q option.  Also, the interaction between the - option
        and the terminal argument in some historic implementations
        of tset has been removed.
 
 
+
 

ENVIRONMENT

        The tset command uses the SHELL and TERM environment vari-
@@ -239,10 +243,10 @@
 

FILES

        /etc/ttys
-            system port name to terminal  type  mapping  database
+            system  port  name  to terminal type mapping database
             (BSD versions only).
 
-       @DATADIR@/terminfo
+       /usr/share/terminfo
             terminal capability database
 
 
@@ -284,10 +288,6 @@
 
 
 
-
-
-
-
 
 
 
diff --git a/form/Makefile.in b/form/Makefile.in
index dd65638a..7d9f20fd 100644
--- a/form/Makefile.in
+++ b/form/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.28 2000/05/28 01:40:18 tom Exp $
+# $Id: Makefile.in,v 1.31 2000/10/14 17:57:02 Johnny.C.Lam Exp $
 ##############################################################################
 # Copyright (c) 1998-2000 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -46,13 +46,15 @@ SHELL		= /bin/sh
 THIS		= Makefile
 
 MODEL		= @DFT_LWR_MODEL@
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 libdir		= @libdir@
 includedir	= @includedir@
 
+LIBTOOL		= @LIBTOOL@
+
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
 INSTALL_DATA	= @INSTALL_DATA@
@@ -72,6 +74,7 @@ CPPFLAGS	= @CPPFLAGS@ \
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
@@ -79,7 +82,7 @@ CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
 
-LINK		= $(CC)
+LINK		= $(LIBTOOL) $(CC)
 LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
 
 SHLIB_DIRS	= -L../lib -L$(libdir)
@@ -87,6 +90,8 @@ SHLIB_LIST	= $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
 
 MK_SHARED_LIB	= @MK_SHARED_LIB@
 
+NCURSES_MAJOR	= @NCURSES_MAJOR@
+NCURSES_MINOR	= @NCURSES_MINOR@
 REL_VERSION	= @cf_cv_rel_version@
 ABI_VERSION	= @cf_cv_abi_version@
 
@@ -108,7 +113,7 @@ install ::	$(AUTO_SRC) $(LIBRARIES)
 
 sources :	$(AUTO_SRC)
 
-$(INSTALL_PREFIX)$(libdir) :
+$(DESTDIR)$(libdir) :
 	$(srcdir)/../mkinstalldirs $@
 
 # make copies to simplify include-paths while still keeping form's include
@@ -127,8 +132,8 @@ FORM_PRIV_H = \
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
diff --git a/form/fty_enum.c b/form/fty_enum.c
index 701d80f8..4ad69fb5 100644
--- a/form/fty_enum.c
+++ b/form/fty_enum.c
@@ -13,7 +13,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_enum.c,v 1.11 2000/03/19 01:09:56 Bruno.Haible Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.14 2000/10/18 09:28:19 juergen Exp $")
 
 typedef struct {
   char **kwds;
@@ -33,20 +33,21 @@ typedef struct {
 static void *Make_Enum_Type(va_list * ap)
 {
   enumARG *argp = (enumARG *)malloc(sizeof(enumARG));
-  char **kp;
-  int cnt=0;
 
   if (argp)
     {
+      int cnt = 0;
+      char **kp = (char **)0;
       int ccase, cunique;
+
       argp->kwds        = va_arg(*ap,char **);
       ccase             = va_arg(*ap,int);
       cunique           = va_arg(*ap,int);
       argp->checkcase   = ccase   ? TRUE : FALSE;
       argp->checkunique = cunique ? TRUE : FALSE;
-    
+
       kp = argp->kwds;
-      while( (*kp++) ) cnt++;
+      while( kp && (*kp++) ) cnt++;
       argp->count = cnt;
     }
   return (void *)argp;
@@ -62,11 +63,12 @@ static void *Make_Enum_Type(va_list * ap)
 +--------------------------------------------------------------------------*/
 static void *Copy_Enum_Type(const void * argp)
 {
-  const enumARG *ap = (const enumARG *)argp;
   enumARG *result = (enumARG *)0;
 
   if (argp)
     {
+      const enumARG *ap = (const enumARG *)argp;
+
       result = (enumARG *)malloc(sizeof(enumARG));
       if (result)
 	*result = *ap;
@@ -165,14 +167,14 @@ static bool Check_Enum_Field(FIELD * field, const void  * argp)
   char *s, *t, *p;
   int res;
   
-  while( (s=(*kwds++)) )
+  while( kwds && (s=(*kwds++)) )
     {
       if ((res=Compare((unsigned char *)s,bp,ccase))!=NOMATCH)
 	{
 	  p=t=s; /* t is at least a partial match */
 	  if ((unique && res!=EXACT)) 
 	    {
-	      while( (p = *kwds++) )
+	      while( kwds && (p = *kwds++) )
 		{
 		  if ((res=Compare((unsigned char *)p,bp,ccase))!=NOMATCH)
 		    {
@@ -218,18 +220,20 @@ static bool Next_Enum(FIELD * field, const void * argp)
   int cnt           = args->count;
   unsigned char *bp = (unsigned char *)field_buffer(field,0);
 
-  while(cnt--)
-    {
-      if (Compare((unsigned char *)(*kwds++),bp,ccase)==EXACT) 
-	break;
-    }
-  if (cnt<=0)
-    kwds = args->kwds;
-  if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
-    {
-      set_field_buffer(field,0,*kwds);
-      return TRUE;
-    }
+  if (kwds) {
+    while(cnt--)
+      {
+	if (Compare((unsigned char *)(*kwds++),bp,ccase)==EXACT) 
+	  break;
+      }
+    if (cnt<=0)
+      kwds = args->kwds;
+    if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
+      {
+	set_field_buffer(field,0,*kwds);
+	return TRUE;
+      }
+  }
   return FALSE;
 }
 
@@ -252,20 +256,22 @@ static bool Previous_Enum(FIELD * field, const void * argp)
   bool ccase    = args->checkcase;
   unsigned char *bp = (unsigned char *)field_buffer(field,0);
 
-  while(cnt--)
-    {
-      if (Compare((unsigned char *)(*kwds--),bp,ccase)==EXACT) 
-	break;
-    }
-
-  if (cnt<=0)
-    kwds  = &args->kwds[args->count-1];
-
-  if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
-    {
-      set_field_buffer(field,0,*kwds);
-      return TRUE;
-    }
+  if (kwds) {
+    while(cnt--)
+      {
+	if (Compare((unsigned char *)(*kwds--),bp,ccase)==EXACT) 
+	  break;
+      }
+    
+    if (cnt<=0)
+      kwds  = &args->kwds[args->count-1];
+    
+    if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
+      {
+	set_field_buffer(field,0,*kwds);
+	return TRUE;
+      }
+  }
   return FALSE;
 }
 
diff --git a/include/Caps b/include/Caps
index 8e4435cc..b12370f0 100644
--- a/include/Caps
+++ b/include/Caps
@@ -29,7 +29,7 @@
 # Author: Zeyd M. Ben-Halim  1992,1995
 #    and: Eric S. Raymond 
 #
-# $Id: Caps,v 1.25 1999/11/27 20:13:55 tom Exp $
+# $Id: Caps,v 1.30 2000/10/14 17:36:14 tom Exp $
 #
 # This is the master termcap/terminfo capability table.
 #
@@ -334,7 +334,7 @@ cursor_down     	cud1	str	do	YBCGE	down one line
 cursor_home     	home	str	ho	YBCGE	home cursor (if no cup)
 cursor_invisible	civis	str	vi	YB-G-	make cursor invisible
 cursor_left     	cub1	str	le	YBCGE	move left one space
-cursor_mem_address	mrcup	str	CM	YB-G-	memory relative cursor addressing
+cursor_mem_address	mrcup	str	CM	YB-G-	memory relative cursor addressing, move to row #1 columns #2
 cursor_normal   	cnorm	str	ve	YBCGE	make cursor appear normal (undo civis/cvvis)
 cursor_right    	cuf1	str	nd	YBCGE	non-destructive space (move right one space)
 cursor_to_ll    	ll	str	ll	YBCGE	last line, first column (if no cup)
@@ -454,7 +454,7 @@ set_attributes        	sgr	str	sa	YB-G-	define video attributes #1-#9 (PG9)
 set_tab         	hts	str	st	YB-G-	set a tab in every row, current columns
 set_window      	wind	str	wi	-B-GE	current window is lines #1-#2 cols #3-#4
 tab             	ht	str	ta	YBCGE	tab to next 8-space hardware tab stop
-to_status_line  	tsl	str	ts	YB-G-	move to status line
+to_status_line  	tsl	str	ts	YB-G-	move to status line, column #1
 underline_char  	uc	str	uc	YBCG-	underline char and move past it
 up_half_line    	hu	str	hu	YB-G-	half a line up
 init_prog       	iprog	str	iP	-B---	path name of program for initialization
@@ -594,11 +594,11 @@ key_f62         	kf62	str	Fq	----E	F62 function key
 key_f63         	kf63	str	Fr	----E	F63 function key
 clr_bol         	el1	str	cb	-----	Clear to beginning of line
 clear_margins    	mgc	str	MC	-----	clear right and left soft margins
-set_left_margin    	smgl	str	ML	-----	set left soft margin at current column
+set_left_margin    	smgl	str	ML	-----	set left soft margin at current column.  See smgl. (ML is not in BSD termcap).
 set_right_margin	smgr	str	MR	-----	set right soft margin at current column
 label_format    	fln	str	Lf	-----	label format
 set_clock       	sclk	str	SC	-----	set clock, #1 hrs #2 mins #3 secs
-display_clock   	dclk	str	DK	-----	display clock at (#1,#2)
+display_clock   	dclk	str	DK	-----	display clock
 remove_clock    	rmclk	str	RC	-----	remove clock
 create_window   	cwin	str	CW	-----	define a window #1 from #2,#3 to #4,#5
 goto_window     	wingo	str	WG	-----	go to window #1
@@ -633,11 +633,11 @@ set_background  	setb	str	Sb	-----	Set background color #1
 #
 # SVr4 added these capabilities to support printers
 #
-change_char_pitch	cpi	str	ZA	-----	Change number of characters per inch
-change_line_pitch	lpi	str	ZB	-----	Change number of lines per inch
-change_res_horz  	chr	str	ZC	-----	Change horizontal resolution
-change_res_vert  	cvr	str	ZD	-----	Change vertical resolution
-define_char     	defc	str	ZE	-----	Define a character
+change_char_pitch	cpi	str	ZA	-----	Change number of characters per inch to #1
+change_line_pitch	lpi	str	ZB	-----	Change number of lines per inch to #1
+change_res_horz  	chr	str	ZC	-----	Change horizontal resolution to #1
+change_res_vert  	cvr	str	ZD	-----	Change vertical resolution to #1
+define_char     	defc	str	ZE	-----	Define a character #1, #2 dots wide, descender #3
 enter_doublewide_mode	swidm	str	ZF	-----	Enter double-wide mode
 enter_draft_quality	sdrfq	str	ZG	-----	Enter draft-quality mode
 enter_italics_mode	sitm	str	ZH	-----	Enter italic mode
@@ -661,24 +661,24 @@ micro_column_address	mhpa	str	ZY	-----	Like column_address in micro mode
 micro_down      	mcud1	str	ZZ	-----	Like cursor_down in micro mode
 micro_left      	mcub1	str	Za	-----	Like cursor_left in micro mode
 micro_right     	mcuf1	str	Zb	-----	Like cursor_right in micro mode
-micro_row_address	mvpa	str	Zc	-----	Like row_address in micro mode
+micro_row_address	mvpa	str	Zc	-----	Like row_address #1 in micro mode
 micro_up        	mcuu1	str	Zd	-----	Like cursor_up in micro mode
 order_of_pins   	porder	str	Ze	-----	Match software bits to print-head pins
 parm_down_micro 	mcud	str	Zf	-----	Like parm_down_cursor in micro mode
 parm_left_micro 	mcub	str	Zg	-----	Like parm_left_cursor in micro mode
 parm_right_micro	mcuf	str	Zh	-----	Like parm_right_cursor in micro mode
 parm_up_micro   	mcuu	str	Zi	-----	Like parm_up_cursor in micro mode
-select_char_set 	scs	str	Zj	-----	Select character set
+select_char_set 	scs	str	Zj	-----	Select character set, #1
 set_bottom_margin	smgb	str	Zk	-----	Set bottom margin at current line
-set_bottom_margin_parm	smgbp	str	Zl	-----	Set bottom margin at line #1 or #2 lines from bottom
-set_left_margin_parm	smglp	str	Zm	-----	Set left (right) margin at column #1 (#2)
+set_bottom_margin_parm	smgbp	str	Zl	-----	Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom
+set_left_margin_parm	smglp	str	Zm	-----	Set left (right) margin at column #1
 set_right_margin_parm	smgrp	str	Zn	-----	Set right margin at column #1
 set_top_margin  	smgt	str	Zo	-----	Set top margin at current line
-set_top_margin_parm	smgtp	str	Zp	-----	Set top (bottom) margin at row #1 (#2)
+set_top_margin_parm	smgtp	str	Zp	-----	Set top (bottom) margin at row #1
 start_bit_image 	sbim	str	Zq	-----	Start printing bit image graphics
-start_char_set_def	scsd	str	Zr	-----	Start character set definition
+start_char_set_def	scsd	str	Zr	-----	Start character set definition #1, with #2 characters in the set
 stop_bit_image  	rbim	str	Zs	-----	Stop printing bit image graphics
-stop_char_set_def	rcsd	str	Zt	-----	End definition of character set
+stop_char_set_def	rcsd	str	Zt	-----	End definition of character set #1
 subscript_characters	subcs	str	Zu	-----	List of subscriptable characters
 superscript_characters	supcs	str	Zv	-----	List of superscriptable characters
 these_cause_cr  	docr	str	Zw	-----	Printing any of these characters causes CR
@@ -697,13 +697,13 @@ zero_motion     	zerom	str	Zx	-----	No motion for subsequent character
 #%lw25 lw6 lw2 lw18.
 #%\fBVariable	Cap-	TCap	Description\fR
 #%\fBString	name	Code\fR
-char_set_names  	csnm	str	Zy	-----	List of character set names
+char_set_names  	csnm	str	Zy	-----	Produce #1'th item from list of character set names
 key_mouse       	kmous	str	Km	-----	Mouse event has occurred
 mouse_info      	minfo	str	Mi	-----	Mouse status information
 req_mouse_pos   	reqmp	str	RQ	-----	Request mouse position
-get_mouse       	getm	str	Gm	-----	Curses should get button events
-set_a_foreground	setaf	str	AF	-----	Set foreground color using ANSI escape
-set_a_background	setab	str	AB	-----	Set background color using ANSI escape
+get_mouse       	getm	str	Gm	-----	Curses should get button events, parameter #1 not documented.
+set_a_foreground	setaf	str	AF	-----	Set foreground color to #1, using ANSI escape
+set_a_background	setab	str	AB	-----	Set background color to #1, using ANSI escape
 pkey_plab       	pfxl	str	xl	-----	Program function key #1 to type string #2 and show string #3
 device_type     	devt	str	dv	-----	Indicate language/codeset support
 code_set_init   	csin	str	ci	-----	Init sequence for multiple codesets
@@ -711,7 +711,7 @@ set0_des_seq    	s0ds	str	s0	-----	Shift to code set 0 (EUC set 0, ASCII)
 set1_des_seq    	s1ds	str	s1	-----	Shift to code set 1
 set2_des_seq    	s2ds	str	s2	-----	Shift to code set 2
 set3_des_seq    	s3ds	str	s3	-----	Shift to code set 3
-set_lr_margin   	smglr	str	ML	-----	Set both left and right margins to #1, #2
+set_lr_margin   	smglr	str	ML	-----	Set both left and right margins to #1, #2.  (ML is not in BSD termcap).
 set_tb_margin   	smgtb	str	MT	-----	Sets both top and bottom margins to #1, #2
 bit_image_repeat	birep	str	Xy	-----	Repeat bit image cell #1 #2 times
 bit_image_newline	binel	str	Zz	-----	Move to next row of the bit image
@@ -724,7 +724,7 @@ set_page_length 	slines	str	YZ	-----	Set page length to #1 lines
 #
 # SVr4 added these capabilities for direct PC-clone support
 #
-display_pc_char 	dispc	str	S1	-----	Display PC character
+display_pc_char 	dispc	str	S1	-----	Display PC character #1
 enter_pc_charset_mode	smpch	str	S2	-----	Enter PC character display mode
 exit_pc_charset_mode	rmpch	str	S3	-----	Exit PC character display mode
 enter_scancode_mode	smsc	str	S4	-----	Enter PC scancode mode
diff --git a/include/MKncurses_def.sh b/include/MKncurses_def.sh
new file mode 100755
index 00000000..3ca08c33
--- /dev/null
+++ b/include/MKncurses_def.sh
@@ -0,0 +1,80 @@
+#! /bin/sh
+# $Id: MKncurses_def.sh,v 1.1 2000/09/02 17:37:35 tom Exp $
+##############################################################################
+# Copyright (c) 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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# MKncurses_def.sh -- generate fallback definitions for ncurses_cfg.h
+#
+# Author: Thomas E. Dickey  2000
+#
+# Given the choice between constructs such as
+#
+#	#if defined(foo) && foo
+#	#if foo
+#
+# we chose the latter.  It is guaranteed by the language standard, and there
+# appear to be no broken compilers that do not honor that detail.  But some
+# people want to use gcc's -Wundef option (corresponding to one of the less
+# useful features in Watcom's compiler) to check for misspellings.  So we
+# generate a set of fallback definitions to quiet the warnings without making
+# the code ugly.
+#
+DEFS="${1-ncurses_defs}"
+cat <$@
 
+ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh
+	AWK=$(AWK) sh $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
+
 parametrized.h: $(srcdir)/Caps $(srcdir)/MKparametrized.sh
 	AWK=$(AWK) sh $(srcdir)/MKparametrized.sh $(srcdir)/Caps >$@
 
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
diff --git a/include/curses.h.in b/include/curses.h.in
index b33995e8..5b9e19be 100644
--- a/include/curses.h.in
+++ b/include/curses.h.in
@@ -31,7 +31,7 @@
  *     and: Eric S. Raymond                          *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.93 2000/07/08 11:07:26 tom Exp $ */
+/* $Id: curses.h.in,v 1.96 2000/09/16 16:11:01 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -357,13 +357,13 @@ extern int wresize (WINDOW *, int, int);
  * We cannot define these in ncurses_cfg.h, since they require parameters to be
  * passed (that's non-portable).
  */
-#if	GCC_PRINTF
+#ifdef GCC_PRINTF
 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
 #else
 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
 #endif
 
-#if	GCC_SCANF
+#ifdef GCC_SCANF
 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
 #else
 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
@@ -1343,6 +1343,7 @@ extern void trace(const unsigned int);
 #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_ATTRS	0x1000	/* trace attribute updates */
 #define TRACE_MAXIMUM	0xffff	/* maximum trace level */
 
 #if defined(TRACE) || defined(NCURSES_TEST)
diff --git a/include/edit_cfg.sh b/include/edit_cfg.sh
index baa31f68..ef9694cb 100755
--- a/include/edit_cfg.sh
+++ b/include/edit_cfg.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
-# $Id: edit_cfg.sh,v 1.9 1998/02/11 12:13:46 tom Exp $
+# $Id: edit_cfg.sh,v 1.10 2000/09/09 20:29:58 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -28,7 +28,7 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey  1996,1997
+# Author: Thomas E. Dickey  1996,1997,2000
 #
 # Edit the default value of the term.h file based on the autoconf-generated
 # values:
@@ -43,7 +43,6 @@ for name in \
 	HAVE_TCGETATTR \
 	HAVE_TERMIOS_H \
 	HAVE_TERMIO_H \
-	NCURSES_CONST \
 	BROKEN_LINKER
 do
 	mv $2 $BAK
diff --git a/include/ncurses_cfg.hin b/include/ncurses_cfg.hin
index f80fb83f..4d40dab8 100644
--- a/include/ncurses_cfg.hin
+++ b/include/ncurses_cfg.hin
@@ -30,18 +30,24 @@
  *  Author: Thomas E. Dickey  1997                        *
  ****************************************************************************/
 /*
- * $Id: ncurses_cfg.hin,v 1.2 1998/02/11 12:13:46 tom Exp $
+ * $Id: ncurses_cfg.hin,v 1.3 2000/09/02 17:13:32 tom Exp $
  *
  * This is a template-file used to generate the "ncurses_cfg.h" file.
  *
- * Rather than list every definition, the configuration script substitutes
- * the definitions that it finds using 'sed'.  You need a patch (971222)
- * to autoconf 2.12 to do this.
+ * Rather than list every definition, the configuration script substitutes the
+ * definitions that it finds using 'sed'.  You need a patch (original date
+ * 971222) to autoconf 2.12 or 2.13 to do this.
+ *
+ * See:
+ *	http://dickey.his.com/autoconf/
+ *	ftp://dickey.his.com/autoconf/
  */
 #ifndef NC_CONFIG_H
 #define NC_CONFIG_H
 @DEFS@
 
+#include 
+
 	/* The C compiler may not treat these properly but C++ has to */
 #ifdef __cplusplus
 #undef const
diff --git a/include/ncurses_defs b/include/ncurses_defs
new file mode 100644
index 00000000..e4a391f1
--- /dev/null
+++ b/include/ncurses_defs
@@ -0,0 +1,151 @@
+# $Id: ncurses_defs,v 1.4 2000/10/08 01:04:00 tom Exp $
+##############################################################################
+# Copyright (c) 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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# See "MKncurses_def.sh" for an explanation.
+#
+# (hint: don't try to define NDEBUG ;-)
+
+BROKEN_LINKER
+BSD_TPUTS
+CC_HAS_INLINE_FUNCS
+CC_HAS_PROTOS
+CPP_HAS_PARAM_INIT
+DECL_ERRNO
+ETIP_NEEDS_MATH_H
+GCC_NORETURN	/* nothing */
+GCC_UNUSED	/* nothing */
+HAVE_BIG_CORE
+HAVE_BSD_CGETENT
+HAVE_BUILTIN_H
+HAVE_DIRENT_H
+HAVE_ERRNO
+HAVE_FCNTL_H
+HAVE_FORM_H
+HAVE_GETCWD
+HAVE_GETEGID
+HAVE_GETEUID
+HAVE_GETOPT_H
+HAVE_GETTIMEOFDAY
+HAVE_GETTTYNAM
+HAVE_GPP_BUILTIN_H
+HAVE_GXX_BUILTIN_H
+HAVE_HAS_KEY
+HAVE_ISASCII
+HAVE_ISSETUGID
+HAVE_LIBDBMALLOC
+HAVE_LIBDMALLOC
+HAVE_LIBFORM
+HAVE_LIBGPM
+HAVE_LIBMENU
+HAVE_LIBPANEL
+HAVE_LIMITS_H
+HAVE_LINK
+HAVE_LOCALE_H
+HAVE_LONG_FILE_NAMES
+HAVE_MEMCCPY
+HAVE_MENU_H
+HAVE_MKSTEMP
+HAVE_NANOSLEEP
+HAVE_NC_ALLOC_H
+HAVE_PANEL_H
+HAVE_POLL
+HAVE_POLL_H
+HAVE_REGEXPR_H_FUNCS
+HAVE_REGEXP_H_FUNCS
+HAVE_REGEX_H_FUNCS
+HAVE_REMOVE
+HAVE_RESIZETERM
+HAVE_SELECT
+HAVE_SETBUF
+HAVE_SETBUFFER
+HAVE_SETVBUF
+HAVE_SIGACTION
+HAVE_SIGVEC
+HAVE_SIZECHANGE
+HAVE_STRDUP
+HAVE_STRSTR
+HAVE_SYMLINK
+HAVE_SYS_BSDTYPES_H
+HAVE_SYS_IOCTL_H
+HAVE_SYS_PARAM_H
+HAVE_SYS_POLL_H
+HAVE_SYS_SELECT_H
+HAVE_SYS_TERMIO_H
+HAVE_SYS_TIMES_H
+HAVE_SYS_TIME_H
+HAVE_SYS_TIME_SELECT
+HAVE_TCGETATTR
+HAVE_TCGETPGRP
+HAVE_TELL
+HAVE_TERMIOS_H
+HAVE_TERMIO_H
+HAVE_TIMES
+HAVE_TTYENT_H
+HAVE_TYPEINFO
+HAVE_TYPE_SIGACTION
+HAVE_UNISTD_H
+HAVE_UNLINK
+HAVE_USE_DEFAULT_COLORS
+HAVE_VFSCANF
+HAVE_VSNPRINTF
+HAVE_VSSCANF
+HAVE_WORKING_POLL
+HAVE_WRESIZE
+MIXEDCASE_FILENAMES
+NCURSES_EXPANDED
+NCURSES_EXT_FUNCS
+NCURSES_NOMACROS
+NCURSES_NO_PADDING
+NDEBUG
+NEED_PTEM_H
+NO_LEAKS
+PURE_TERMINFO
+RETSIGTYPE
+STDC_HEADERS
+SVR4_ACTION
+SVR4_TERMIO
+SYSTEM_NAME	"unknown"
+TERMINFO	"none"
+TYPEOF_CHTYPE
+USE_COLORFGBG
+USE_DATABASE
+USE_GETCAP
+USE_GETCAP_CACHE
+USE_HARD_TABS
+USE_HASHMAP
+USE_LINKS
+USE_MY_MEMMOVE
+USE_OK_BCOPY
+USE_RCS_IDS
+USE_SAFE_SPRINTF
+USE_SCROLL_HINTS
+USE_SIGWINCH
+USE_SYMLINKS
+USE_WIDEC_SUPPORT
+USE_XMC_SUPPORT
diff --git a/include/termcap.h.in b/include/termcap.h.in
index 5c6c07a8..21c62398 100644
--- a/include/termcap.h.in
+++ b/include/termcap.h.in
@@ -31,7 +31,7 @@
  *     and: Eric S. Raymond                          *
  ****************************************************************************/
 
-/* $Id: termcap.h.in,v 1.10 1999/01/09 22:38:04 Uchiyama.Yasushi Exp $ */
+/* $Id: termcap.h.in,v 1.12 2000/10/08 01:06:37 tom Exp $ */
 
 #ifndef _NCU_TERMCAP_H
 #define _NCU_TERMCAP_H	1
@@ -45,7 +45,6 @@ extern "C"
 #endif /* __cplusplus */
 
 #include 
-@OSPEED_INCLUDES@ 
 
 #undef  NCURSES_CONST 
 #define NCURSES_CONST @NCURSES_CONST@ 
@@ -53,7 +52,7 @@ extern "C"
 extern char PC;
 extern char *UP;
 extern char *BC;
-extern @OSPEED_TYPE@ ospeed; 
+extern short ospeed; 
 
 #if !defined(_NCU_TERM_H)
 extern char *tgetstr(NCURSES_CONST char *, char **);
diff --git a/include/tic.h b/include/tic.h
index 24f12bcc..bba0c0ff 100644
--- a/include/tic.h
+++ b/include/tic.h
@@ -32,9 +32,9 @@
  ****************************************************************************/
 
 /*
+ * $Id: tic.h,v 1.35 2000/09/09 19:47:16 tom Exp $
  *	tic.h - Global variables and structures for the terminfo
  *			compiler.
- *
  */
 
 #ifndef __TIC_H
@@ -237,6 +237,9 @@ extern const struct name_table_entry	* const *_nc_get_hash_table(bool);
 #define TERMINFO "/usr/share/terminfo"
 #endif
 
+/* access.c */
+extern char *_nc_basename(char *);
+
 /* comp_hash.c: name lookup */
 struct name_table_entry	const *_nc_find_entry(const char *,
 				    const struct name_table_entry *const *);
diff --git a/man/Makefile.in b/man/Makefile.in
index a43bc25d..0d7648ac 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.26 2000/04/01 22:15:22 tom Exp $
+# $Id: Makefile.in,v 1.28 2000/08/19 19:15:44 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -36,27 +36,25 @@
 
 SHELL		= /bin/sh
 
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 datadir		= @datadir@
 mandir		= @mandir@
 
-ticdir		= $(datadir)/terminfo
-
 INSTALL		= @INSTALL@
 INSTALL_DATA	= @INSTALL_DATA@
 
 all \
 sources:	terminfo.5
 
-$(INSTALL_PREFIX)$(mandir) :
+$(DESTDIR)$(mandir) :
 	$(srcdir)/../mkinstalldirs $@
 
-EDITARGS = $(INSTALL_PREFIX)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]*
+EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]*
 
-install install.man : terminfo.5 $(INSTALL_PREFIX)$(mandir)
+install install.man : terminfo.5 $(DESTDIR)$(mandir)
 	sh ./edit_man.sh installing $(EDITARGS)
 
 uninstall uninstall.man :
diff --git a/man/captoinfo.1m b/man/captoinfo.1m
index 16dbe805..40c09f5a 100644
--- a/man/captoinfo.1m
+++ b/man/captoinfo.1m
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: captoinfo.1m,v 1.14 2000/03/19 02:20:28 tom Exp $
+.\" $Id: captoinfo.1m,v 1.16 2000/08/13 01:56:49 tom Exp $
 .TH captoinfo 1M ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 \fBcaptoinfo\fR - convert a \fItermcap\fR description into a \fIterminfo\fR description
 .SH SYNOPSIS
@@ -178,7 +178,7 @@ You can use other \fItic\fR options such as \fB-f\fR and  \fB-x\fR.
 The trace option isn't identical to SVr4's.  Under SVr4, instead of following
 the -v with a trace level n, you repeat it n times.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBinfocmp\fR(1M), \fBterminfo\fR(\*n)
+\fBcurses\fR(3X), \fB@INFOCMP@\fR(1M), \fBterminfo\fR(\*n)
 .SH AUTHOR
 Eric S. Raymond 
 .\"#
diff --git a/man/clear.1 b/man/clear.1
index 71d2883b..4c4991f1 100644
--- a/man/clear.1
+++ b/man/clear.1
@@ -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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: clear.1,v 1.2 1998/03/11 21:12:53 juergen Exp $
+.\" $Id: clear.1,v 1.3 2000/07/15 23:59:35 china Exp $
 .TH clear 1 ""
 .ds n 5
 .SH NAME
@@ -39,7 +39,7 @@
 environment for the terminal type and then in the \fBterminfo\fR database to
 figure out how to clear the screen.
 .SH SEE ALSO
-\fBtput\fR(1), \fBterminfo\fR(\*n)
+\fB@TPUT@\fR(1), \fBterminfo\fR(\*n)
 .\"#
 .\"# The following sets edit modes for GNU EMACS
 .\"# Local Variables:
diff --git a/man/curs_color.3x b/man/curs_color.3x
index 9116b773..ccf8cf82 100644
--- a/man/curs_color.3x
+++ b/man/curs_color.3x
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_color.3x,v 1.15 2000/07/08 11:59:51 tom Exp $
+.\" $Id: curs_color.3x,v 1.16 2000/07/15 22:57:03 tom Exp $
 .TH curs_color 3X ""
 .SH NAME
 \fBstart_color\fR,
@@ -207,7 +207,7 @@ background color for all terminals can be modified using the
 \fBcurses\fR(3X),
 \fBcurs_initscr\fR(3X),
 \fBcurs_attr\fR(3X),
-\fBdft_fgbg\fR(3X)
+\fBdefault_colors\fR(3X)
 .\"#
 .\"# The following sets edit modes for GNU EMACS
 .\"# Local Variables:
diff --git a/man/curs_extend.3x b/man/curs_extend.3x
index 16a3f80b..632fc382 100644
--- a/man/curs_extend.3x
+++ b/man/curs_extend.3x
@@ -28,8 +28,8 @@
 .\"
 .\" Author: Thomas E. Dickey  1999
 .\"
-.\" $Id: curs_extend.3x,v 1.4 2000/07/01 16:43:11 tom Exp $
-.TH use_default_colors 3X ""
+.\" $Id: curs_extend.3x,v 1.6 2000/07/15 22:57:20 tom Exp $
+.TH curs_extend 3X ""
 .SH NAME
 \fBcurs_extend\fR:
 \fBcurses_version\fP,
@@ -72,8 +72,8 @@ any code depending on them be conditioned using NCURSES_VERSION.
 \fBcurs_getch\fR(3X),
 \fBcurs_mouse\fR(3X),
 \fBcurs_print\fR(3X),
+\fBdefault_colors\fR(3X),
 \fBdefine_key\fR(3X),
-\fBdft_fgbg\fR(3X),
 \fBkeybound\fR(3X),
 \fBkeyok\fR(3X),
 \fBresizeterm\fR(3X),
diff --git a/man/curs_scanw.3x b/man/curs_scanw.3x
index c0053315..b7f3795d 100644
--- a/man/curs_scanw.3x
+++ b/man/curs_scanw.3x
@@ -26,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_scanw.3x,v 1.10 2000/07/01 20:06:29 tom Exp $
+.\" $Id: curs_scanw.3x,v 1.11 2000/07/15 21:48:17 tom Exp $
 .TH curs_scanw 3X ""
 .SH NAME
 \fBscanw\fR,
 \fBwscanw\fR,
 \fBmvscanw\fR,
 \fBmvwscanw\fR,
-\fBvwscanw\fR, \fBvw_scanw\fR - convert formatted input from a \fBcurses\fR widow
+\fBvwscanw\fR, \fBvw_scanw\fR - convert formatted input from a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include \fR
 
diff --git a/man/curs_trace.3x b/man/curs_trace.3x
index 9f5b13a4..a9dc57c7 100644
--- a/man/curs_trace.3x
+++ b/man/curs_trace.3x
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_trace.3x,v 1.2 2000/07/08 12:42:51 tom Exp $
+.\" $Id: curs_trace.3x,v 1.3 2000/07/29 16:34:24 tom Exp $
 .TH curs_trace 3X ""
 .SH NAME
 \fB_tracef\fR,
@@ -122,6 +122,9 @@ trace per-character calls.
 TRACE_DATABASE
 trace read/write of terminfo/termcap data.
 .TP 5
+TRACE_ATTRS
+trace changes to video attributes and colors.
+.TP 5
 TRACE_MAXIMUM
 maximum trace level, enables all of the separate trace features.
 
diff --git a/man/dft_fgbg.3x b/man/default_colors.3x
similarity index 96%
rename from man/dft_fgbg.3x
rename to man/default_colors.3x
index eedde7c3..9d6d97c9 100644
--- a/man/dft_fgbg.3x
+++ b/man/default_colors.3x
@@ -26,12 +26,12 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" Author: Thomas E. Dickey  1997,1999
+.\" Author: Thomas E. Dickey  1997,1999,2000
 .\"
-.\" $Id: dft_fgbg.3x,v 1.12 2000/07/04 22:31:56 tom Exp $
-.TH use_default_colors 3X ""
+.\" $Id: default_colors.3x,v 1.13 2000/07/15 22:06:50 tom Exp $
+.TH default_colors 3X ""
 .SH NAME
-\fBdft_fgbg\fR:
+\fBdefault_colors\fR:
 \fBuse_default_colors\fR,
 \fBassume_default_colors\fR \- use terminal's default colors
 ..
diff --git a/man/form_fieldtype.3x b/man/form_fieldtype.3x
index 4c5dcb66..d93ba281 100644
--- a/man/form_fieldtype.3x
+++ b/man/form_fieldtype.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" 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            *
@@ -27,8 +27,8 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_fieldtype.3x,v 1.7 1998/11/29 01:07:16 Rick.Ohnemus Exp $
-.TH form_field 3X ""
+.\" $Id: form_fieldtype.3x,v 1.8 2000/07/15 22:02:03 tom Exp $
+.TH form_fieldtype 3X ""
 .SH NAME
 \fBform_fieldtype\fR - define validation-field types
 .SH SYNOPSIS
diff --git a/man/infocmp.1m b/man/infocmp.1m
index a7449892..1276cca5 100644
--- a/man/infocmp.1m
+++ b/man/infocmp.1m
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infocmp.1m,v 1.25 2000/06/11 02:08:16 tom Exp $
+.\" $Id: infocmp.1m,v 1.27 2000/08/19 18:51:05 tom Exp $
 .TH infocmp 1M ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 \fBinfocmp\fR - compare or print out \fIterminfo\fR descriptions
 .SH SYNOPSIS
@@ -171,7 +171,7 @@ were not needed.
 The location of the compiled \fBterminfo\fR database is taken from the
 environment variable \fBTERMINFO\fR .  If the variable is not defined, or the
 terminal is not found in that location, the system \fBterminfo\fR database,
-in \fB@DATADIR@/terminfo\fR, will be used.  The options \fB-A\fR
+in \fB@TERMINFO@\fR, will be used.  The options \fB-A\fR
 and \fB-B\fR may be used to override this location.  The \fB-A\fR option will
 set \fBTERMINFO\fR for the first \fItermname\fR and the \fB-B\fR option will
 set \fBTERMINFO\fR for the other \fItermnames\fR.  With this, it is possible to
@@ -245,7 +245,7 @@ This is mainly useful for testing and analysis, since the compiled
 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
 .TP 5
 \fB-V\fR
-prints out the version of the program in use on standard error and exits.
+reports the version of ncurses which was used in this program, and exits.
 .TP 5
 \fB-e\fR
 Dump the capabilities of the given terminal as a C initializer for a
@@ -347,6 +347,7 @@ The
 \fB-G\fR,
 \fB-R\fR,
 \fB-T\fR,
+\fB-V\fR,
 \fB-a\fR,
 \fB-e\fR,
 \fB-f\fR,
diff --git a/man/infotocap.1m b/man/infotocap.1m
index 867840da..ef8735b7 100644
--- a/man/infotocap.1m
+++ b/man/infotocap.1m
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infotocap.1m,v 1.2 2000/03/19 02:19:49 tom Exp $
+.\" $Id: infotocap.1m,v 1.3 2000/08/13 01:56:03 tom Exp $
 .TH infotocap 1M ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 \fBinfotocap\fR - convert a \fIterminfo\fR description into a \fItermcap\fR description
 .SH SYNOPSIS
diff --git a/man/man_db.renames b/man/man_db.renames
index 8fc89981..b8248610 100644
--- a/man/man_db.renames
+++ b/man/man_db.renames
@@ -1,4 +1,4 @@
-# $Id: man_db.renames,v 0.19 2000/07/08 12:11:31 tom Exp $
+# $Id: man_db.renames,v 0.20 2000/07/15 22:58:35 tom Exp $
 # Manual-page renamings for the man_db program
 #
 captoinfo.1m			captoinfo.1
@@ -46,8 +46,8 @@ curs_trace.3x			trace.3ncurses
 curs_util.3x			util.3ncurses
 curs_window.3x			window.3ncurses
 curses.3x			ncurses.3ncurses
+default_colors.3x		default_colors.3ncurses
 define_key.3x			define_key.3ncurses
-dft_fgbg.3x			use_default_colors.3ncurses
 form.3x				form.3form
 form_cursor.3x			cursor.3form
 form_data.3x			data.3form
@@ -76,7 +76,7 @@ infotocap.1m			infotocap.1
 keybound.3x			keybound.3ncurses
 keyok.3x			keyok.3ncurses
 menu.3x				menu.3menu
-menu_attribs.3x			attribs.3menu
+menu_attributes.3x		attributes.3menu
 menu_cursor.3x			cursor.3menu
 menu_driver.3x			driver.3menu
 menu_format.3x			format.3menu
diff --git a/man/manlinks.sed b/man/manlinks.sed
index 92214195..e175148a 100644
--- a/man/manlinks.sed
+++ b/man/manlinks.sed
@@ -1,4 +1,4 @@
-# $Id: manlinks.sed,v 1.7 2000/07/01 19:50:06 tom Exp $
+# $Id: manlinks.sed,v 1.9 2000/09/30 23:32:24 tom Exp $
 ##############################################################################
 # Copyright (c) 2000 Free Software Foundation, Inc.                          #
 #                                                                            #
@@ -53,11 +53,11 @@ s/\\-.*/ -/
 s/ /\
 /g
 }
-:syn
 /^\.SH_(SYNOPSIS/,/^\.SH_(DESCRIPTION/{
 	/^#/d
 	/^[^(]*$/d
-	s/^\([^ (]\+ [*]*\)\+//g
+	s/^\([^ (]* [^ (]* [*]*\)//g
+	s/^\([^ (]* [*]*\)//g
 	s/\.SH_(/.SH_/
 	s/(.*//
 	s/\.SH_/.SH_(/
diff --git a/man/menu.3x b/man/menu.3x
index adbfffd9..8279844a 100644
--- a/man/menu.3x
+++ b/man/menu.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" 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            *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu.3x,v 1.13 1998/11/29 01:09:07 Rick.Ohnemus Exp $
+.\" $Id: menu.3x,v 1.14 2000/07/15 22:55:59 tom Exp $
 .TH menu 3X ""
 .SH NAME
 \fBmenu\fR - curses extension for programming menus
@@ -77,18 +77,18 @@ item_term 	\fBmenu_hook\fR(3X)
 item_userptr	\fBmitem_userptr\fR(3X)
 item_value	\fBmitem_value\fR(3X)
 item_visible	\fBmitem_visible\fR(3X)
-menu_back 	\fBmenu_attribs\fR(3X)
+menu_back 	\fBmenu_attributes\fR(3X)
 menu_driver	\fBmenu_driver\fR(3X)
-menu_fore 	\fBmenu_attribs\fR(3X)
+menu_fore 	\fBmenu_attributes\fR(3X)
 menu_format	\fBmenu_format\fR(3X)
-menu_grey 	\fBmenu_attribs\fR(3X)
+menu_grey 	\fBmenu_attributes\fR(3X)
 menu_init 	\fBmenu_hook\fR(3X)
 menu_items	\fBmenu_items\fR(3X)
 menu_mark 	\fBmenu_mark\fR(3X)
 menu_opts 	\fBmenu_opts\fR(3X)
 menu_opts_off	\fBmenu_opts\fR(3X)
 menu_opts_on	\fBmenu_opts\fR(3X)
-menu_pad  	\fBmenu_attribs\fR(3X)
+menu_pad  	\fBmenu_attributes\fR(3X)
 menu_pattern	\fBmenu_pattern\fR(3X)
 menu_request_by_name	\fBmenu_requestname\fR(3X)
 menu_request_name	\fBmenu_requestname\fR(3X)
@@ -108,15 +108,15 @@ set_item_opts	\fBmitem_opts\fR(3X)
 set_item_term	\fBmenu_hook\fR(3X)
 set_item_userptr	\fBmitem_userptr\fR(3X)
 set_item_value	\fBmitem_value\fR(3X)
-set_menu_back	\fBmenu_attribs\fR(3X)
-set_menu_fore	\fBmenu_attribs\fR(3X)
+set_menu_back	\fBmenu_attributes\fR(3X)
+set_menu_fore	\fBmenu_attributes\fR(3X)
 set_menu_format	\fBmenu_format\fR(3X)
-set_menu_grey	\fBmenu_attribs\fR(3X)
+set_menu_grey	\fBmenu_attributes\fR(3X)
 set_menu_init	\fBmenu_hook\fR(3X)
 set_menu_items	\fBmenu_items\fR(3X)
 set_menu_mark	\fBmenu_mark\fR(3X)
 set_menu_opts	\fBmitem_opts\fR(3X)
-set_menu_pad	\fBmenu_attribs\fR(3X)
+set_menu_pad	\fBmenu_attributes\fR(3X)
 set_menu_pattern	\fBmenu_pattern\fR(3X)
 set_menu_spacing	\fBmenu_spacing\fR(3X)
 set_menu_sub	\fBmenu_win\fR(3X)
diff --git a/man/menu_attribs.3x b/man/menu_attributes.3x
similarity index 98%
rename from man/menu_attribs.3x
rename to man/menu_attributes.3x
index 3577db53..82412609 100644
--- a/man/menu_attribs.3x
+++ b/man/menu_attributes.3x
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_attribs.3x,v 1.6 1998/11/29 01:09:20 Rick.Ohnemus Exp $
+.\" $Id: menu_attributes.3x,v 1.6 1998/11/29 01:09:20 Rick.Ohnemus Exp $
 .TH menu_attributes 3X ""
 .SH NAME
 \fBmenu_attributes\fR - color and attribute control for menus
diff --git a/man/ncurses.3x b/man/ncurses.3x
index 5aac8f2e..3b36fa9a 100644
--- a/man/ncurses.3x
+++ b/man/ncurses.3x
@@ -27,11 +27,11 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: ncurses.3x,v 1.40 2000/07/08 13:10:31 tom Exp $
+.\" $Id: ncurses.3x,v 1.44 2000/10/08 01:39:26 tom Exp $
 .hy 0
 .TH ncurses 3X ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 \fBncurses\fR - CRT screen handling and optimization package
 .SH SYNOPSIS
@@ -214,7 +214,7 @@ addchnstr/\fBcurs_addchstr\fR(3X)
 addchstr/\fBcurs_addchstr\fR(3X)
 addnstr/\fBcurs_addstr\fR(3X)
 addstr/\fBcurs_addstr\fR(3X)
-assume_default_colors/\fBdft_fgbg\fR(3X)*
+assume_default_colors/\fBdefault_colors\fR(3X)*
 attr_get/\fBcurs_attr\fR(3X)
 attr_off/\fBcurs_attr\fR(3X)
 attr_on/\fBcurs_attr\fR(3X)
@@ -447,7 +447,7 @@ unctrl/\fBcurs_util\fR(3X)
 ungetch/\fBcurs_getch\fR(3X)
 ungetmouse/\fBcurs_mouse\fR(3X)*
 untouchwin/\fBcurs_touch\fR(3X)
-use_default_colors/\fBdft_fgbg\fR(3X)*
+use_default_colors/\fBdefault_colors\fR(3X)*
 use_env/\fBcurs_util\fR(3X)
 use_extended_names/\fBcurs_extend\fR(3X)*
 vidattr/\fBcurs_terminfo\fR(3X)
@@ -694,7 +694,7 @@ directories listed in the TERMINFO_DIRS symbol
 -
 one or more directories whose names are configured and compiled into the
 ncurses library, e.g.,
-@DATADIR@/terminfo
+@TERMINFO@
 .RE
 .TP 5
 TERMINFO_DIRS
@@ -709,11 +709,16 @@ the TERMPATH symbol.
 This is a list of filenames separated by colons (i.e., ":").
 If the TERMPATH symbol is not set, \fBncurses\fR looks in the files
 /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap, in that order.
+.PP
+The library may be configured to disregard the following variables when the
+current user is the superuser (root), or if the application uses setuid or
+setgid permissions:
+$TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
 .SH FILES
 .TP 5
 @DATADIR@/tabset
 directory containing initialization files for the terminal capability database
-@DATADIR@/terminfo
+@TERMINFO@
 terminal capability database
 .SH SEE ALSO
 \fBterminfo\fR(\*n) and 3X pages whose names begin "curs_" for detailed routine
diff --git a/man/panel.3x b/man/panel.3x
index 046778a8..7ebecc00 100644
--- a/man/panel.3x
+++ b/man/panel.3x
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: panel.3x,v 1.9 1998/03/11 21:12:53 juergen Exp $
+.\" $Id: panel.3x,v 1.10 2000/08/13 01:56:47 tom Exp $
 .TH panel 3X ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 panel - panel stack extension for curses
 .SH SYNOPSIS
diff --git a/man/term.5 b/man/term.5
index f79679db..63a2d35f 100644
--- a/man/term.5
+++ b/man/term.5
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: term.5,v 1.9 1998/03/11 21:12:53 juergen Exp $
+.\" $Id: term.5,v 1.10 2000/08/13 01:56:45 tom Exp $
 .TH TERM 5
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 term \- format of compiled term file.
 .SH SYNOPSIS
diff --git a/man/term.7 b/man/term.7
index e8f81bb6..5a48c5a3 100644
--- a/man/term.7
+++ b/man/term.7
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: term.7,v 1.11 1999/01/24 02:35:14 Todd.Miller Exp $
+.\" $Id: term.7,v 1.12 2000/08/13 01:56:42 tom Exp $
 .TH TERM 7
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 term \- conventions for naming terminal types
 .SH DESCRIPTION
diff --git a/man/terminfo.head b/man/terminfo.head
index 3118c157..36945ff2 100644
--- a/man/terminfo.head
+++ b/man/terminfo.head
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: terminfo.head,v 1.8 1998/03/11 21:12:53 juergen Exp $
+.\" $Id: terminfo.head,v 1.9 2000/08/13 01:56:40 tom Exp $
 .TH TERMINFO 5 "" "" "File Formats"
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 terminfo \- terminal capability data base
 .SH SYNOPSIS
diff --git a/man/terminfo.tail b/man/terminfo.tail
index 65a83c99..e39230f8 100644
--- a/man/terminfo.tail
+++ b/man/terminfo.tail
@@ -1,4 +1,4 @@
-.\" $Id: terminfo.tail,v 1.32 2000/04/15 20:04:58 tom Exp $
+.\" $Id: terminfo.tail,v 1.33 2000/10/14 14:06:50 tom Exp $
 .\" Beginning of terminfo.tail file
 .ps +1
 .PP
@@ -912,7 +912,8 @@ output
 .BR is2 ;
 set the margins using
 .BR mgc ,
-.BR smgl and
+.BR smgl
+and
 .BR smgr ;
 set tabs using
 .B tbc
diff --git a/man/tic.1m b/man/tic.1m
index 40f790ca..e3a09545 100644
--- a/man/tic.1m
+++ b/man/tic.1m
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tic.1m,v 1.26 2000/03/19 02:18:18 tom Exp $
+.\" $Id: tic.1m,v 1.29 2000/08/19 18:51:05 tom Exp $
 .TH tic 1M ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 \fBtic\fR - the \fIterminfo\fR entry-description compiler
 .SH SYNOPSIS
@@ -41,6 +41,7 @@ I\
 N\
 R\
 T\
+V\
 a\
 c\
 f\
@@ -147,6 +148,9 @@ eliminates size-restrictions on the generated text.
 This is mainly useful for testing and analysis, since the compiled
 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
 .TP
+\fB-V\fR
+reports the version of ncurses which was used in this program, and exits.
+.TP
 \fB-r\fR
 Force entry resolution (so there are no remaining tc capabilities) even
 when doing translation to termcap format.  This may be needed if you are
@@ -267,6 +271,7 @@ The
 \fB-N\fR,
 \fB-R\fR,
 \fB-T\fR,
+\fB-V\fR,
 \fB-a\fR,
 \fB-e\fR,
 \fB-f\fR,
@@ -286,8 +291,8 @@ System V does not compile entries to or read entries from your
 \fB\*d/?/*\fR
 Compiled terminal description database.
 .SH SEE ALSO
-\fBinfocmp\fR(1M), \fBcaptoinfo\fR(1M), \fBinfotocap\fR(1M), \fBtoe\fR(1M),
-\fBcurses\fR(3X), \fBterminfo\fR(\*n).
+\fB@INFOCMP@\fR(1M), \fB@CAPTOINFO@\fR(1M), \fB@INFOTOCAP@\fR(1M),
+\fB@TOE@\fR(1M), \fBcurses\fR(3X), \fBterminfo\fR(\*n).
 .\"#
 .\"# The following sets edit modes for GNU EMACS
 .\"# Local Variables:
diff --git a/man/toe.1m b/man/toe.1m
index ea277266..399cf614 100644
--- a/man/toe.1m
+++ b/man/toe.1m
@@ -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            *
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: toe.1m,v 1.7 1998/03/11 21:12:53 juergen Exp $
+.\" $Id: toe.1m,v 1.10 2000/08/19 18:51:05 tom Exp $
 .TH toe 1M ""
 .ds n 5
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .SH NAME
 \fBtoe\fR - table of (terminfo) entries
 .SH SYNOPSIS
@@ -65,14 +65,14 @@ information showing \fBtoe\fR's progress.  The optional integer
 \fIn\fR is a number from 1 to 10, interpreted as for \fBtic\fR(1).
 .TP 5
 \fB-V\fR
-prints out the version of the program in use on standard error and exits.
+reports the version of ncurses which was used in this program, and exits.
 .SH FILES
 .TP 5
 \fB\*d/?/*\fR
 Compiled terminal description database.
 .SH SEE ALSO
-\fBtic\fR(1M), \fBinfocmp\fR(1M), \fBcaptoinfo\fR(1M), \fBinfotocap\fR(1M),
-\fBcurses\fR(3X), \fBterminfo\fR(\*n).
+\fB@TIC@\fR(1M), \fB@INFOCMP@\fR(1M), \fB@CAPTOINFO@\fR(1M),
+\fB@INFOTOCAP@\fR(1M), \fBcurses\fR(3X), \fBterminfo\fR(\*n).
 .\"#
 .\"# The following sets edit modes for GNU EMACS
 .\"# Local Variables:
diff --git a/man/tput.1 b/man/tput.1
index 84b64b25..898df1e6 100644
--- a/man/tput.1
+++ b/man/tput.1
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" 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            *
@@ -27,12 +27,12 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tput.1,v 1.12 1999/01/24 02:44:26 Jeffrey.C.Honig Exp $
+.\" $Id: tput.1,v 1.16 2000/09/09 20:43:33 tom Exp $
 .TH tput 1 ""
-.ds d @DATADIR@/terminfo
+.ds d @TERMINFO@
 .ds n 5
 .SH NAME
-\fBtput\fR - initialize a terminal or query terminfo database
+\fBtput\fR, \fBreset\fR - initialize a terminal or query terminfo database
 .SH SYNOPSIS
 \fBtput\fR [\fB-T\fR\fItype\fR] \fIcapname\fR [\fIparms\fR ... ]
 .br
@@ -44,6 +44,8 @@
 .br
 \fBtput -S\fR  \fB<<\fR
 .br
+\fBtput -V\fR
+.br
 .SH DESCRIPTION
 The \fBtput\fR utility uses the \fBterminfo\fR database to make the
 values of terminal-dependent capabilities and information available to
@@ -85,6 +87,9 @@ instead of from the command line (see example).  Only one
 meaning of the \fB0\fR and \fB1\fR boolean and string exit codes (see the
 EXIT CODES section).
 .TP
+\fB-V\fR
+reports the version of ncurses which was used in this program, and exits.
+.TP
 \fBinit\fR
 If the \fBterminfo\fR database is present and an entry for the user's
 terminal exists (see \fB-T\fR\fItype\fR, above), the following will
@@ -110,6 +115,10 @@ user's terminal exists (see \fB-T\fR\fItype\fR above), then the long name
 of the terminal will be put out.  The long name is the last
 name in the first line of the terminal's description in the
 \fBterminfo\fR database [see \fBterm\fR(5)].
+.PP
+If \fBtput\fR is invoked by a link named \fBreset\fR, this has the
+same effect as \fBtput reset\fR.
+See \fBtset\fR for comparison, which has similar behavior.
 .SH EXAMPLES
 .TP 5
 \fBtput init\fR
@@ -153,7 +162,8 @@ Send the sequence to move the cursor to row 23, column 4.
 Print the long name from the \fBterminfo\fR database for the
 type of terminal specified in the environmental
 variable \fBTERM\fR.
-.TP 0
+.PP
+.RS 5
 \fBtput -S < clear\fR
@@ -163,6 +173,7 @@ variable \fBTERM\fR.
 \fB> bold\fR
 .br
 \fB> !\fR
+.RE
 .TP 5
 \&
 This example shows tput processing several capabilities in one
@@ -187,47 +198,51 @@ sequences that set margins and tabs); for more
 information, see the "Tabs and Initialization"
 section of \fBterminfo\fR(4)
 .SH SEE ALSO
-\fBclear\fR(1), \fBstty\fR(1), \fBtabs\fR(\*n).  \fBprofile\fR(\*n),
+\fB@CLEAR@\fR(1), \fBstty\fR(1), \fBtabs\fR(\*n).  \fBprofile\fR(\*n),
 \fBterminfo\fR(4) in the \fISystem\fR \fIAdministrator\fR'\fIs\fR
 \fIReference\fR \fIManual\fR.  Chapter 10 of the
 \fIProgrammer\fR'\fIs\fR \fIGuide\fR.
 .SH EXIT CODES
 If \fIcapname\fR is of type boolean, a value of \fB0\fR is set for
 TRUE and \fB1\fR for FALSE unless the \fB-S\fR option is used.
-
+.PP
 If \fIcapname\fR is of type string, a value of \fB0\fR is set if the
 \fIcapname\fR is defined for this terminal \fItype\fR (the value of
 \fIcapname\fR is returned on standard output); a value of \fB1\fR is
 set if \fIcapname\fR is not defined for this terminal \fItype\fR (a
 null value is returned on standard output).
-
+.PP
 If \fIcapname\fR is of type boolean or string and the \fB-S\fR option
 is used, a value of \fB0\fR is returned to indicate that all lines
 were successful.  No indication of which line failed can be given so
 exit code \fB1\fR will never appear.  Exit codes \fB2\fR, \fB3\fR, and
 \fB4\fR retain their usual interpretation.
-
+.PP
 If \fIcapname\fR is of type integer, a value of \fB0\fR is always set,
 whether or not \fIcapname\fR is defined for this terminal \fItype\fR.
 To determine if \fIcapname\fR is defined for this terminal \fItype\fR,
 the user must test the value of standard output.  A value of \fB-1\fR
 means that \fIcapname\fR is not defined for this terminal \fItype\fR.
-
+.PP
 Any other exit code indicates an error; see the DIAGNOSTICS section.
 .SH DIAGNOSTICS
 \fBtput\fR prints the following error messages and sets the corresponding exit
 codes.
-
+.PP
 .TS
 l l.
 exit code	error message
-\fB0\fR	(\fIcapname\fR is a numeric variable that is not specified in the
-	\fBterminfo\fR(\*n) database for this terminal type, e.g.
-	\fBtput -T450 lines\fR and \fBtput -T2621 xmc\fR)
+=
+\fB0\fR	T{
+(\fIcapname\fR is a numeric variable that is not specified in the
+\fBterminfo\fR(\*n) database for this terminal type, e.g.
+\fBtput -T450 lines\fR and \fBtput -T2621 xmc\fR)
+T}
 \fB1\fR	no error message is printed, see the \fBEXIT CODES\fR section.
 \fB2\fR	usage error
 \fB3\fR	unknown terminal \fItype\fR or no \fBterminfo\fR database
 \fB4\fR	unknown \fBterminfo\fR capability \fIcapname\fR
+=
 .TE
 .SH PORTABILITY
 The \fBlongname\fR and \fB-S\fR options, and the parameter-substitution
diff --git a/man/tset.1 b/man/tset.1
index 50d58e10..897d9edb 100644
--- a/man/tset.1
+++ b/man/tset.1
@@ -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            *
@@ -26,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tset.1,v 1.8 1998/12/26 01:44:41 tom Exp $
+.\" $Id: tset.1,v 1.12 2000/09/09 20:33:07 tom Exp $
 .TH tset 1 ""
 .SH NAME
-\fBtset\fR - terminal initialization
+\fBtset\fR, \fBreset\fR - terminal initialization
 .SH SYNOPSIS
-tset [-IQqrs] [-] [-e \fIch\fR] [-i \fIch\fR] [-k \fIch\fR] [-m \fImapping\fR] [\fIterminal\fR]
+tset [-IQVqrs] [-] [-e \fIch\fR] [-i \fIch\fR] [-k \fIch\fR] [-m \fImapping\fR] [\fIterminal\fR]
 .br
-reset [-IQqrs] [-] [-e \fIch\fR] [-i \fIch\fR] [-k \fIch\fR] [-m \fImapping\fR] [\fIterminal\fR]
+reset [-IQVqrs] [-] [-e \fIch\fR] [-i \fIch\fR] [-k \fIch\fR] [-m \fImapping\fR] [\fIterminal\fR]
 .SH DESCRIPTION
 \&\fBTset\fR initializes terminals.
 \fBTset\fR first determines the type of terminal that you are using.
@@ -92,6 +92,12 @@ Set the erase character to \fIch\fR.
 -I
 Do not send the terminal or tab initialization strings to the terminal.
 .TP 5
+-Q
+Don't display any values for the erase, interrupt and line kill characters.
+.TP
+\fB-V\fR
+reports the version of ncurses which was used in this program, and exits.
+.TP 5
 -i
 Set the interrupt character to \fIch\fR.
 .TP 5
@@ -102,9 +108,6 @@ Set the line kill character to \fIch\fR.
 Specify a mapping from a port type to a terminal.
 See below for more information.
 .TP 5
--Q
-Don't display any values for the erase, interrupt and line kill characters.
-.TP 5
 -r
 Print the terminal type to the standard error output.
 .TP 5
@@ -228,7 +231,7 @@ environment variables.
 /etc/ttys
 system port name to terminal type mapping database (BSD versions only).
 .TP 5
-@DATADIR@/terminfo
+@TERMINFO@
 terminal capability database
 .SH SEE ALSO
 csh(1),
diff --git a/menu/Makefile.in b/menu/Makefile.in
index 3d802c07..08f7dc25 100644
--- a/menu/Makefile.in
+++ b/menu/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.28 2000/05/28 01:40:08 tom Exp $
+# $Id: Makefile.in,v 1.31 2000/10/14 17:57:02 Johnny.C.Lam Exp $
 ##############################################################################
 # Copyright (c) 1998-2000 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -46,13 +46,15 @@ SHELL		= /bin/sh
 THIS		= Makefile
 
 MODEL		= @DFT_LWR_MODEL@
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 libdir		= @libdir@
 includedir	= @includedir@
 
+LIBTOOL		= @LIBTOOL@
+
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
 INSTALL_DATA	= @INSTALL_DATA@
@@ -72,15 +74,15 @@ CPPFLAGS	= @CPPFLAGS@ \
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
-
 CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
 
-LINK		= $(CC)
+LINK		= $(LIBTOOL) $(CC)
 LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
 
 SHLIB_DIRS	= -L../lib -L$(libdir)
@@ -88,6 +90,8 @@ SHLIB_LIST	= $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
 
 MK_SHARED_LIB	= @MK_SHARED_LIB@
 
+NCURSES_MAJOR	= @NCURSES_MAJOR@
+NCURSES_MINOR	= @NCURSES_MINOR@
 REL_VERSION	= @cf_cv_rel_version@
 ABI_VERSION	= @cf_cv_abi_version@
 
@@ -111,7 +115,7 @@ install ::	$(AUTO_SRC) $(LIBRARIES)
 
 sources :	$(AUTO_SRC)
 
-$(INSTALL_PREFIX)$(libdir) :
+$(DESTDIR)$(libdir) :
 	$(srcdir)/../mkinstalldirs $@
 
 # make copies to simplify include-paths while still keeping menu's include
@@ -134,8 +138,8 @@ MENU_PRIV_H = \
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
diff --git a/menu/menu.h b/menu/menu.h
index 4b4a286a..5be728b1 100644
--- a/menu/menu.h
+++ b/menu/menu.h
@@ -33,6 +33,10 @@
 #ifndef ETI_MENU
 #define ETI_MENU
 
+#ifdef AMIGA
+#define TEXT TEXT_ncurses
+#endif
+
 #include 
 #include 
 
diff --git a/menu/mf_common.h b/menu/mf_common.h
index c13f6c89..6b1e8fee 100644
--- a/menu/mf_common.h
+++ b/menu/mf_common.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            *
@@ -56,7 +56,7 @@ extern int errno;
 
 #include 
 
-#ifdef USE_RCS_IDS
+#if USE_RCS_IDS
 #define MODULE_ID(id) static const char Ident[] = id;
 #else
 #define MODULE_ID(id) /*nothing*/
diff --git a/misc/Makefile.in b/misc/Makefile.in
index 2b6d2e62..4ea04461 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.20 1998/02/11 12:13:52 tom Exp $
+# $Id: Makefile.in,v 1.29 2000/09/30 20:01:10 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -48,7 +48,8 @@ THIS		= Makefile
 CF_MFLAGS 	= @cf_cv_makeflags@
 @SET_MAKE@
 
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
+top_srcdir	= @top_srcdir@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -57,7 +58,8 @@ libdir		= @libdir@
 datadir		= @datadir@
 
 tabsetdir	= $(datadir)/tabset
-ticdir		= $(datadir)/terminfo
+ticdir		= @TERMINFO@
+source		= @TERMINFO_SRC@
 
 INSTALL		= @INSTALL@
 INSTALL_DATA	= @INSTALL_DATA@
@@ -69,29 +71,40 @@ sources:
 
 install: install.data
 
-install.data:	$(INSTALL_PREFIX)$(libdir) \
-		$(INSTALL_PREFIX)$(ticdir) \
-		$(INSTALL_PREFIX)$(tabsetdir)
-	sh $(srcdir)/run_tic.sh $(bindir) $(srcdir) $(ticdir) $(INSTALL_PREFIX)
+install.data :	$(DESTDIR)$(libdir) \
+		$(DESTDIR)$(ticdir) \
+		$(DESTDIR)$(tabsetdir)
+	DESTDIR=${DESTDIR} \
+	prefix=${prefix} \
+	exec_prefix=${exec_prefix} \
+	bindir=${bindir} \
+	top_srcdir=${top_srcdir} \
+	srcdir=${srcdir} \
+	datadir=${datadir} \
+	ticdir=${ticdir} \
+	source=${source} \
+	$(SHELL) ./run_tic.sh
 	@cd $(srcdir)/tabset && \
-		sh -c 'for i in `echo * | fgrep -v CVS | fgrep -v RCS`; do \
-		echo installing $$i; \
-		$(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(tabsetdir); done'
-
-$(INSTALL_PREFIX)$(libdir) \
-$(INSTALL_PREFIX)$(tabsetdir) \
-$(INSTALL_PREFIX)$(ticdir) :
+		$(SHELL) -c 'for i in * ; do \
+			if test -f $$i ; then \
+			echo installing $$i; \
+			$(INSTALL_DATA) $$i $(DESTDIR)$(tabsetdir)/$$i; \
+			fi; done'
+
+$(DESTDIR)$(libdir) \
+$(DESTDIR)$(tabsetdir) \
+$(DESTDIR)$(ticdir) :
 	$(srcdir)/../mkinstalldirs $@
 
 uninstall: uninstall.data
 
 uninstall.data:
-	-cd $(INSTALL_PREFIX)$(ticdir) && rm -rf *
-	-cd $(INSTALL_PREFIX)$(tabsetdir) && rm -rf *
+	-cd $(DESTDIR)$(ticdir) && rm -rf *
+	-cd $(DESTDIR)$(tabsetdir) && rm -rf *
 
 tags:
 
-TAGS:
+@MAKE_UPPER_TAGS@TAGS:
 
 mostlyclean:
 	-rm -f core tags TAGS *~ *.ln *.atac trace
@@ -99,7 +112,7 @@ mostlyclean:
 clean :: mostlyclean
 
 distclean: clean
-	-rm -f Makefile 
+	-rm -f Makefile run_tic.sh
 
 realclean: distclean
 
diff --git a/misc/emx.src b/misc/emx.src
index 7319f5d8..96625116 100644
--- a/misc/emx.src
+++ b/misc/emx.src
@@ -1,4 +1,4 @@
-# $Id: emx.src,v 1.6 1999/08/15 01:56:54 tom Exp $
+# $Id: emx.src,v 1.7 2000/08/27 02:16:08 jmcoopr Exp $
 # This is a reformatted copy of the terminfo source for OS/2 EMX from
 # Juan Jose Garcia Ripoll .
 # http://www.arrakis.es/~worm/
@@ -193,7 +193,7 @@ ansi.sys|ANSI.SYS 3.1 and later versions,
 #		kcub1		kb2		kcuf1
 #
 #		End=\0O		Down=\0P	NxPag=\0Q
-#		kc1,kend       	kcud1		kc3,knp
+#		kc1,kend	kcud1		kc3,knp
 #
 #		Ins=\0R		Del=\0S
 #		kich1		kdch1
@@ -318,6 +318,19 @@ window|ANSI.SYS window,
 	smso=\E[1;37;47m,
 	smul=\E[1;31;47m,
 	use=emx-base,
+os2|OS/2-emx ANSI.SYS,
+	cuu=\E[%p1%dA,
+	cuu1=\E[A,
+	cud=\E[%p1%dB,
+	cud1=\E[B,
+	cuf=\E[%p1%dC,
+	cuf1=\E[C,
+	cub=\E[%p1%dD,
+	cub1=\E[D,
+	sc=\E[s,
+	rc=\E[u,
+	use=ansi,
+	use=mono,
 mono|ANSI.SYS mono,
 	blink=\E[5m,
 	bold=\E[1m,
diff --git a/misc/indent.pro b/misc/indent.pro
index 7ddfe9b7..14cf385a 100644
--- a/misc/indent.pro
+++ b/misc/indent.pro
@@ -14,7 +14,7 @@
 /* format braces inline */
 -br
 /* do not line up parentheses */
--nlp
+-lp
 /* put the type of a procedure on the line before its name */
 -psl
 /* do not insert a space between procedure name and '(' */
diff --git a/misc/run_tic.sh b/misc/run_tic.in
old mode 100755
new mode 100644
similarity index 77%
rename from misc/run_tic.sh
rename to misc/run_tic.in
index cdb6a5ea..59ae3279
--- a/misc/run_tic.sh
+++ b/misc/run_tic.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
 ##############################################################################
 # Copyright (c) 1998,2000 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -27,61 +27,38 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey  1996
+# Author: Thomas E. Dickey 1996,2000
 #
-# $Id: run_tic.sh,v 1.12 2000/07/01 19:25:13 tom Exp $
+# $Id: run_tic.in,v 1.10 2000/10/09 22:57:35 tom Exp $
 # This script is used to install terminfo.src using tic.  We use a script
 # because the path checking is too awkward to do in a makefile.
 #
-# Parameters:
-#	$1 = nominal directory in which to find 'tic', i.e., $(bindir).
-#	$2 = source-directory, i.e., $(srcdir)
-#	$3 = destination-directory path, i.e., $(ticdir)
-#	$4 = install-prefix, if any
-#
 # Assumes:
-#	The leaf directory names (bin, lib, shared, tabset, terminfo)
+#	The leaf directory names (lib, tabset, terminfo)
 #
 echo '** Building terminfo database, please wait...'
 #
-# Parameter parsing is primarily for debugging.  The script is designed to
-# be run from the misc/Makefile as
+# The script is designed to be run from the misc/Makefile as
 #	make install.data
-prefix=/usr/local
-if test $# != 0 ; then
-	bindir=$1
-	shift
-	PREFIX=`echo $bindir | sed -e 's/\/bin$//'`
-	test -n "$PREFIX" && test "x$PREFIX" != "x$bindir" && prefix=$PREFIX
-else
-	bindir=$prefix/bin
-fi
-
-if test $# != 0 ; then
-	srcdir=$1
-	shift
-else
-	srcdir=.
-fi
 
-if test $# != 0 ; then
-	ticdir=$1
-	shift
-else
-	ticdir=$prefix/share/terminfo
-fi
+: ${suffix=@PROG_EXT@}
+: ${DESTDIR=@DESTDIR@}
+: ${prefix=@prefix@}
+: ${exec_prefix=@exec_prefix@}
+: ${bindir=@bindir@}
+: ${top_srcdir=@top_srcdir@}
+: ${srcdir=@srcdir@}
+: ${datadir=@datadir@}
+: ${ticdir=@TERMINFO@}
+: ${source=@TERMINFO_SRC@}
+: ${LN_S="@LN_S@"}
 
-if test $# != 0 ; then
-	IP=$1
-	shift
-else
-	IP=""
-fi
+test -z "${DESTDIR}" && DESTDIR=
 
 # Allow tic to run either from the install-path, or from the build-directory
 case "$PATH" in
-:*) PATH=../progs:$IP$bindir$PATH ;;
-*) PATH=../progs:$IP$bindir:$PATH ;;
+:*) PATH=../progs:${DESTDIR}$bindir$PATH ;;
+*) PATH=../progs:${DESTDIR}$bindir:$PATH ;;
 esac
 export PATH
 
@@ -91,31 +68,30 @@ export PATH
 #
 NEWPATH=$PATH
 export NEWPATH
-PROG_BIN_DIR=$IP$bindir
+PROG_BIN_DIR=${DESTDIR}$bindir
 export PROG_BIN_DIR
 
-TERMINFO=$IP$ticdir ; export TERMINFO
+TERMINFO=${DESTDIR}$ticdir ; export TERMINFO
 umask 022
 
 # Construct the name of the old (obsolete) pathname, e.g., /usr/lib/terminfo.
-TICDIR=`echo $TERMINFO | sed -e 's/\/share\//\/lib\//'`
+TICDIR=`echo $TERMINFO | sed -e 's@/share/@/lib/@'`
 
 # Remove the old terminfo stuff; we don't care if it existed before, and it
 # would generate a lot of confusing error messages if we tried to overwrite it.
 # We explicitly remove its contents rather than the directory itself, in case
 # the directory is actually a symbolic link.
-( rm -fr $TERMINFO/[0-9A-Za-z] 2>/dev/null )
+( cd $TERMINFO && rm -fr ? 2>/dev/null )
 
 # If we're not installing into /usr/share/, we'll have to adjust the location
 # of the tabset files in terminfo.src (which are in a parallel directory).
-TABSET=`echo $ticdir | sed -e 's/\/terminfo$/\/tabset/'`
-SRC=$srcdir/terminfo.src
+TABSET=`echo $ticdir | sed -e 's@/terminfo$@/tabset@'`
 if test "x$TABSET" != "x/usr/share/tabset" ; then
 	echo '** adjusting tabset paths'
 	TMP=${TMPDIR-/tmp}/$$
-	sed -e s:/usr/share/tabset:$TABSET:g $SRC >$TMP
+	sed -e s:/usr/share/tabset:$TABSET:g $source >$TMP
 	trap "rm -f $TMP" 0 1 2 5 15
-	SRC=$TMP
+	source=$TMP
 fi
 
 cat <\E), smcup=\Ei, 
 	smso=\E(, smul=\E[, 
+#
+#
+qnxt|qnxt4|QNX4 terminal, 
+	crxm, use=qnx4, 
+#
+qnxm|QNX4 with mouse events, 
+	maddr#1, 
+	chr=\E/, cvr=\E", is1=\E/0t, mcub=\E/>1h, mcub1=\E/>7h, 
+	mcud=\E/>1h, mcud1=\E/>1l\E/>9h, mcuf=\E/>1h\E/>9l, 
+	mcuf1=\E/>7l, mcuu=\E/>6h, mcuu1=\E/>6l, rmicm=\E/>2l, 
+	smicm=\E/>2h, use=qnx4, 
+#
+qnxw|QNX4 windows, 
+	xvpa, use=qnxm, 
+#
+#	Monochrome QNX4 terminal or console. Setting this terminal type will
+#	allow an application running on a color console to behave as if it
+#	were a monochrome terminal. Output will be through stdout instead of
+#	console writes because the term routines will recognize that the
+#	terminal name starts with 'qnxt'.
+#
+qnxtmono|Monochrome QNX4 terminal or console, 
+	colors@, pairs@, 
+	scp@, use=qnx4, 
 
 # From: Federico Bianchi , 1 Jul 1998
 # (esr: commented out  and  to avoid warnings.)
@@ -1194,6 +1218,72 @@ qnxt2|qnx 2.15 serial terminal,
 	civis@, cnorm@, cvvis@, dch1@, ich1@, kRES@, kRPL@, kUND@, kspd@, 
 	rep@, rmcup@, rmso=\E>, setb@, setf@, smcup@, smso=\E<, use=qnx4, 
 
+# QNX ANSI terminal definition
+qansi-g|QNX ANSI, 
+	am, eslok, hs, xon, 
+	colors#8, cols#80, it#8, lines#25, ncv#19, pairs#64, wsl#80, 
+	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~Oa, 
+	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, 
+	clear=\E[2J\E[H, cnorm=\E[?25h\E[?12l, cr=^M, 
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[D, 
+	cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C, 
+	cup=\E[%i%p1%d;%p2%dH$<5>, cuu=\E[%p1%dA, cuu1=\E[A, 
+	cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, 
+	dl=\E[%p1%dM, dl1=\E[1M, dsl=\E[r, ech=\E[%p1%dX, ed=\E[J, 
+	el=\E[K, el1=\E[1K\E[X, flash=\E[?5h$<200>\E[?5l, 
+	fsl=\E[?6h\E8, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, 
+	ich=\E[%p1%d@, ich1=\E[1@, il=\E[%p1%dL, il1=\E[1L, 
+	ind=\E[S, indn=\E[%p1%dS, invis=\E[9m, 
+	is2=\E>\E[?1l\E[?7h\E[0;10;39;49m, is3=\E(B\E)0, 
+	kBEG=\ENn, kCAN=\E[s, kCMD=\E[t, kCPY=\ENs, kCRT=\ENt, 
+	kDL=\ENv, kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kHOM=\E[h, 
+	kLFT=\E[d, kNXT=\E[u, kOPT=\ENz, kPRV=\E[v, kRIT=\E[c, 
+	kbs=^H, kcan=\E[S, kcbt=\E[Z, kclo=\ENc, kclr=\ENa, 
+	kcmd=\E[G, kcpy=\E[g, kctab=\E[z, kcub1=\E[D, kcud1=\E[B, 
+	kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[P, kdl1=\E[p, kend=\E[Y, 
+	kext=\E[y, kf1=\EOP, kf10=\EOY, kf11=\EOZ, kf12=\EOA, 
+	kf13=\EOp, kf14=\EOq, kf15=\EOr, kf16=\EOs, kf17=\EOt, 
+	kf18=\EOu, kf19=\EOv, kf2=\EOQ, kf20=\EOw, kf21=\EOx, 
+	kf22=\EOy, kf23=\EOz, kf24=\EOa, kf25=\E[1~, kf26=\E[2~, 
+	kf27=\E[3~, kf28=\E[4~, kf29=\E[5~, kf3=\EOR, kf30=\E[6~, 
+	kf31=\E[7~, kf32=\E[8~, kf33=\E[9~, kf34=\E[10~, 
+	kf35=\E[11~, kf36=\E[12~, kf37=\E[17~, kf38=\E[18~, 
+	kf39=\E[19~, kf4=\EOS, kf40=\E[20~, kf41=\E[21~, 
+	kf42=\E[22~, kf43=\E[23~, kf44=\E[24~, kf45=\E[25~, 
+	kf46=\E[26~, kf47=\E[27~, kf48=\E[28~, kf5=\EOT, kf6=\EOU, 
+	kf7=\EOV, kf8=\EOW, kf9=\EOX, kfnd=\ENf, khlp=\ENh, 
+	khome=\E[H, khts=\ENb, kich1=\E[@, kil1=\E[`, kind=\E[a, 
+	kmov=\ENi, kmrk=\ENm, kmsg=\ENe, knp=\E[U, kopn=\ENo, 
+	kopt=\ENk, kpp=\E[V, kref=\ENl, kres=\ENp, krfr=\ENg, 
+	kri=\E[b, krpl=\ENr, krst=\ENj, ksav=\ENq, kslt=\E[T, 
+	ktbc=\ENd, kund=\ENu, ll=\E[99H, nel=\EE, op=\E[39;49m, 
+	rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, ri=\E[T, 
+	rin=\E[%p1%dT, rmacs=^O, rmam=\E[?7l, rmso=\E[27m, 
+	rmul=\E[24m, rs1=\017\E[?7h\E[0;39;49m$<2>\E>\E[?1l, 
+	rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, 
+	setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
+	setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
+	sgr=\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p4%t;5%;%?%p3%p1%|%t;7%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, 
+	sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smso=\E[7m, 
+	smul=\E[4m, tbc=\E[2g, 
+	tsl=\E7\E1;24r\E[?6l\E[25;%i%p1%dH, 
+#
+qansi|QNX ansi with console writes, 
+	daisy, xhpa, use=qansi-g, 
+#
+qansi-t|QNX ansi without console writes, 
+	crxm, use=qansi, 
+#
+qansi-m|QNX ansi with mouse, 
+	maddr#1, 
+	chr=\E[, cvr=\E], is1=\E[0t, mcub=\E[>1h, mcub1=\E[>7h, 
+	mcud=\E[>1h, mcud1=\E[>1l\E[>9h, mcuf=\E[>1h\E[>9l, 
+	mcuf1=\E[>7l, mcuu=\E[>6h, mcuu1=\E[>6l, rmicm=\E[>2l, 
+	smicm=\E[>2h, use=qansi, 
+#
+qansi-w|QNX ansi for windows, 
+	xvpa, use=qansi-m, 
+
 #### NetBSD consoles
 #
 # pcvt termcap database entries (corresponding to release 3.31)
@@ -1352,7 +1442,7 @@ rcons|BSD rasterconsole,
 rcons-color|BSD rasterconsole with ANSI color, 
 	bce, 
 	colors#8, pairs#64, 
-	op=\E[m, setab=\E[4%dm, setaf=\E[3%dm, use=rcons, 
+	op=\E[m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=rcons, 
 
 # mgterm -- MGL/MGL2, MobileGear Graphic Library
 # for PocketBSD,PocketLinux,NetBSD/{hpcmips,mac68k}
@@ -2171,7 +2261,7 @@ vt420pc|DEC VT420 w/PC keyboard,
 
 vt420pcdos|DEC VT420 w/PC for DOS Merge, 
 	lines#25, 
-	dispc=%?%p2%{19}%=%t\E\023\021%e%p2%{32}%<%t\E%p2%c%e%p2%{127}%=%t\E\177%e%p2%c%;, 
+	dispc=%?%p1%{19}%=%t\E\023\021%e%p1%{32}%<%t\E%p1%c%e%p1%{127}%=%t\E\177%e%p1%c%;, 
 	pctrm@, 
 	rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sgr@, 
 	sgr0=\E[m, smsc=\E[?1;2r\E[34h, use=vt420pc, 
@@ -2450,7 +2540,7 @@ xterm-r6|xterm-old|xterm X11R6 version,
 	kslt=\E[4~, meml=\El, memu=\Em, rc=\E8, rev=\E[7m, ri=\EM, 
 	rmacs=^O, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, 
 	rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, 
-	rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, sc=\E7, 
+	rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, 
 	sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h, 
 	smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, 
 	u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, 
@@ -2483,7 +2573,7 @@ xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System),
 	memu=\Em, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l, 
 	rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, 
 	rmso=\E[27m, rmul=\E[24m, rs1=^O, 
-	rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, sc=\E7, 
+	rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, 
 	setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
 	setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
 	sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, 
@@ -2510,7 +2600,7 @@ xterm-xf86-v333|xterm terminal emulator (XFree86 3.3.3 Window System),
 	sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, 
 	smcup=\E[?1048h\E[?1047h, use=xterm-xf86-v33, 
 
-# This beta version will probably be released in XFree86 4.0.
+# This version was released in XFree86 4.0.
 xterm-xf86-v40|xterm terminal emulator (XFree86 4.0 Window System), 
 	npc, 
 	kDC=\E[3;5~, kEND=\EO5F, kHOM=\EO5H, kIC=\E[2;5~, 
@@ -2531,7 +2621,54 @@ xterm-xf86-v40|xterm terminal emulator (XFree86 4.0 Window System),
 	smcup=\E[?1049h, use=xterm-xf86-v333, 
 
 xterm-xfree86|xterm-new|xterm terminal emulator (XFree86 4.0 Window System), 
-	use=xterm-xf86-v40, 
+	npc, 
+	kDC=\E[3;5~, kEND=\EO5F, kHOM=\EO5H, kIC=\E[2;5~, 
+	kLFT=\EO5D, kNXT=\E[6;5~, kPRV=\E[5;5~, kRIT=\EO5C, 
+	kb2=\EOE, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, 
+	kcuu1=\EOA, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~, 
+	kf11=\E[23~, kf12=\E[24~, kf13=\EO2P, kf14=\EO2Q, 
+	kf15=\EO2R, kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, 
+	kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, 
+	kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~, kf25=\EO5P, 
+	kf26=\EO5Q, kf27=\EO5R, kf28=\EO5S, kf29=\E[15;5~, 
+	kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~, kf32=\E[19;5~, 
+	kf33=\E[20;5~, kf34=\E[21;5~, kf35=\E[23;5~, 
+	kf36=\E[24;5~, kf37=\EO6P, kf38=\EO6Q, kf39=\EO6R, 
+	kf4=\EOS, kf40=\EO6S, kf41=\E[15;6~, kf42=\E[17;6~, 
+	kf43=\E[18;6~, kf44=\E[19;6~, kf45=\E[20;6~, 
+	kf46=\E[21;6~, kf47=\E[23;6~, kf48=\E[24;6~, kf5=\E[15~, 
+	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\EOH, 
+	kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
+	use=xterm-basic, 
+#
+# This chunk is used for building the VT220/Sun/PC keyboard variants.
+xterm-basic|xterm terminal emulator - common (XFree86), 
+	am, bce, km, mc5i, mir, msgr, xenl, 
+	colors#8, cols#80, it#8, lines#24, pairs#64, 
+	acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 
+	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, 
+	clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, 
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 
+	cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
+	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, 
+	ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, 
+	flash=\E[?5h$<100/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, 
+	ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, 
+	ind=^J, invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^H, 
+	kdch1=\E[3~, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El, 
+	memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 
+	rmam=\E[?7l, rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, 
+	rmso=\E[27m, rmul=\E[24m, rs1=\Ec, 
+	rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, setab=\E[4%p1%dm, 
+	setaf=\E[3%p1%dm, 
+	setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
+	setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
+	sgr=\E[0%?%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, 
+	sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E[?1049h, 
+	smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, 
+	tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, 
+	vpa=\E[%i%p1%dd, 
 
 # From: David J. MacKenzie , 14 Nov 1997
 xterm-xi|xterm on XI Graphics Accelerated X under BSD/OS 3.1, 
@@ -2539,17 +2676,17 @@ xterm-xi|xterm on XI Graphics Accelerated X under BSD/OS 3.1,
 
 # This is one of the variants of XFree86 3.3 xterm, updated for 4.0 (T.Dickey)
 xterm-16color|xterm with 16 colors like aixterm, 
-	colors#16, pairs#256, 
+	colors#16, ncv#32, pairs#256, 
 	setab=\E[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm, 
 	setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm, 
 	setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, 
 	setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, 
-	use=xterm-xf86-v40, 
+	use=xterm-xfree86, 
 
 # These variants of XFree86 3.9.16 xterm are built as a configure option.
 xterm-256color|xterm with 256 colors, 
 	ccc, 
-	colors#256, pairs#256, 
+	colors#256, ncv#32, pairs#256, 
 	initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, 
 	setab=\E[48;5;%p1%dm, setaf=\E[38;5;%p1%dm, 
 	setb=\E[48;5;%p1%dm, setf=\E[38;5;%p1%dm, 
@@ -2583,7 +2720,7 @@ xterm-8bit|xterm terminal emulator 8-bit controls (X Window System),
 	invis=\2338m, 
 	is2=\E7\E G\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>, 
 	ka1=\217w, ka3=\217u, kb2=\217y, kbeg=\217E, kbs=^H, 
-	kc1=\217q, kc3=\217s, kcub1=\217D, kcud1=\217B, 
+	kc1=\217q, kc3=\217s, kcbt=\233Z, kcub1=\217D, kcud1=\217B, 
 	kcuf1=\217C, kcuu1=\217A, kdch1=\2333~, kend=\2334~, 
 	kent=\217M, kf1=\23311~, kf10=\23321~, kf11=\23323~, 
 	kf12=\23324~, kf13=\23325~, kf14=\23326~, kf15=\23328~, 
@@ -2596,11 +2733,11 @@ xterm-8bit|xterm terminal emulator 8-bit controls (X Window System),
 	ri=\215, rmacs=^O, rmam=\233?7l, rmcup=\233?1049l, 
 	rmir=\2334l, rmkx=\233?1l\E>, rmso=\23327m, rmul=\23324m, 
 	rs1=\Ec, 
-	rs2=\E7\E[62"p\E G\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>, 
+	rs2=\E[62"p\E G\E7\233r\E8\233m\233?7h\233?1;3;4;6l\2334l\E>, 
 	sc=\E7, setab=\2334%p1%dm, setaf=\2333%p1%dm, 
 	setb=\2334%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
 	setf=\2333%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, 
-	sgr=\2330%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, 
+	sgr=\2330%?%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, 
 	sgr0=\233m^O, smacs=^N, smam=\233?7h, smcup=\233?1049h, 
 	smir=\2334h, smkx=\233?1h\E=, smso=\2337m, smul=\2334m, 
 	tbc=\2333g, u6=\233[%i%d;%dR, u7=\E[6n, u8=\233[?1;2c, 
@@ -2610,18 +2747,38 @@ xterm-hp|XFree86 xterm with hpterm function keys,
 	kclr=\EJ, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, 
 	kdch1=\EP, kend=\EF, kf1=\Ep, kf2=\Eq, kf3=\Er, kf4=\Es, 
 	kf5=\Et, kf6=\Eu, kf7=\Ev, kf8=\Ew, khome=\Eh, kich1=\EQ, 
-	knp=\ES, kpp=\ET, use=xterm-xfree86, 
-
+	knp=\ES, kpp=\ET, use=xterm-basic, 
+
+xterm-sco|XFree86 xterm with SCO function keys, 
+	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[F, 
+	kf1=\E[M, kf10=\E[V, kf11=\E[W, kf12=\E[X, kf13=\E[Y, 
+	kf15=\E[a, kf16=\E[b, kf17=\E[c, kf18=\E[d, kf19=\E[e, 
+	kf2=\E[N, kf20=\E[f, kf21=\E[g, kf22=\E[h, kf23=\E[i, 
+	kf24=\E[j, kf25=\E[k, kf26=\E[l, kf27=\E[m, kf28=\E[n, 
+	kf29=\E[o, kf3=\E[O, kf30=\E[p, kf31=\E[q, kf32=\E[r, 
+	kf33=\E[s, kf34=\E[t, kf35=\E[u, kf4=\E[P, kf5=\E[Q, 
+	kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, 
+	kich1=\E[L, knp=\E[G, kpp=\E[I, use=xterm-basic, 
+
+# The xterm-xfree86 description has all of the features, but is not completely
+# compatible with vt220.  If you are using a Sun or PC keyboard, set the
+# sunKeyboard resource to true:
+#	+ maps the editing keypad
+#	+ interprets control-function-key as a second array of keys, so a
+#	  12-fkey keyboard can support vt220's 20-fkeys.
+#	+ maps numeric keypad "+" to ",".
+#	+ uses DEC-style control sequences for the application keypad.
+#	  
 xterm-vt220|XFree86 xterm emulating vt220, 
-	ka1=\EOw, ka3=\EOy, kbeg=\EOu, kbs=^H, kc1=\EOq, kc3=\EOs, 
-	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 
-	kdch1=\E[3~, kend=\E[4~, kent=\EOM, kf1=\EOP, kf10=\E[21~, 
-	kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, 
-	kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, 
-	kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS, 
-	kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 
-	khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
-	use=xterm-xfree86, 
+	ka1=\EOw, ka3=\EOy, kbeg=\EOu, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, 
+	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kend=\E[4~, 
+	kent=\EOM, kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, 
+	kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, 
+	kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\EOQ, 
+	kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, 
+	kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[1~, 
+	kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
+	use=xterm-basic, 
 
 xterm-vt52|XFree86 xterm emulating dec vt52, 
 	cols#80, it#8, lines#24, 
@@ -2670,6 +2827,8 @@ kterm|kterm kanji terminal emulator (X window system),
 	acsc@, csr=\E[%i%p1%d;%p2%dr, dsl=\E[?H, enacs@, fsl=\E[?F, 
 	kmous=\E[M, rc=\E8, rmacs@, sc=\E7, smacs@, 
 	tsl=\E[?E\E[?%i%dT, use=xterm-r6, use=ecma+color, 
+kterm-color|kterm-co|kterm with ANSI colors, 
+	ncv@, use=kterm, use=ecma+color, 
 # See the note on ICH/ICH1 VERSUS RMIR/SMIR near the end of file
 xterm-nic|xterm with ich/ich1 suppressed for non-curses programs, 
 	ich@, ich1@, use=xterm, 
@@ -3028,6 +3187,8 @@ eterm|gnu emacs term.el terminal emulation,
 #      G0   (bool)  Terminal can deal with ISO 2022  font  selection sequences.
 #      AX   (bool)  Does  understand ANSI set default fg/bg color
 #                   (\E[39m / \E[49m).
+#      S0   (str)   Switch charset 'G0' to the specified charset.
+#      E0   (str)   Switch charset 'G0' back to standard charset.
 screen|VT 100/ANSI X3.64 virtual terminal, 
 	OTbs, OTpt, am, km, mir, msgr, xenl, G0, 
 	colors#8, cols#80, it#8, lines#24, pairs#64, 
@@ -3048,8 +3209,8 @@ screen|VT 100/ANSI X3.64 virtual terminal,
 	kpp=\E[5~, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 
 	rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, 
 	rs2=\Ec, sc=\E7, sgr0=\E[m, smacs=^N, smir=\E[4h, 
-	smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, 
-	use=ecma+color, 
+	smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, E0=\E(B, 
+	S0=\E(%p1%c, use=ecma+color, 
 
 screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols, 
 	cols#132, use=screen, 
@@ -3141,7 +3302,7 @@ ncsa-m|ncsa-vt220-8|NCSA Telnet 2.6 for Macintosh in vt220-8 mode,
 	rc=\E8, rev=\E[7m, rf=/usr/share/tabset/vt100, ri=\EM, 
 	rmacs=^O, rmam=\E[?7l, rmcup=\E[2J\E8, rmir=\E[4l, 
 	rmso=\E[27m, rmul=\E[24m, 
-	rs2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>, sc=\E7, 
+	rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;4;6l\E[4l\E>, sc=\E7, 
 	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;, 
 	sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7, 
 	smir=\E[4h, smso=\E[7m, smul=\E[4m, tbc=\E[3g, tsl=\E]0;, 
@@ -3169,9 +3330,10 @@ ncsa-vt220|NCSA Telnet using vt220-compatible function keys,
 
 #### Pilot Pro Palm-Top
 #
-# From: Jason Downs , 15 Jun 1997 (Top Gun Telnet's author)
+# Termcap for Top Gun Telnet and SSH on the Palm Pilot.
+# http://www.isaac.cs.berkeley.edu/pilot/tgtelnet.html
 pilot|tgtelnet|Top Gun Telnet on the Palm Pilot Professional, 
-	am, xenl, 
+	OTbs, am, xenl, 
 	cols#39, lines#16, 
 	bel=^G, clear=\Ec, cr=^M, cub1=^H, cud1=^J, 
 	cup=\Em%p1%{32}%+%c%p2%{32}%+%c, home=\Em\s\s, ht=^I, 
@@ -3702,7 +3864,7 @@ pcmw|PC running Microsoft Works,
 altos2|alt2|altos-2|altos II, 
 	cols#80, it#8, lines#24, xmc#0, 
 	clear=\E[H\E[2J, cr=^M, cub1=^H, cud1=\E[1B, cuf1=\E[1C, 
-	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[1A, dch1=\E[P, dl=\E[M, 
+	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[1A, dch1=\E[P, dl1=\E[M, 
 	ed=\E[J, el=\E[K, home=\E[H, ht=^I, ich1=\E[@, 
 	if=/usr/share/tabset/vt100, il1=\E[L, ind=^J, 
 	is2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, kDL=^Am\r, 
@@ -3743,7 +3905,7 @@ altos7|alt7|altos VII,
 	acsc=j5k3l2m1n8q\:t4u9v=w0x6, blink=\EG2, bold=\EGt, 
 	clear=\E+^^, cr=^M, cub1=^H, cud1=^J, cuf1=^L, 
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, dch1=\EW, 
-	dim=\EGp, dl=\ER, ed=\EY, el=\ET, home=^^, ht=^I, il1=\EE, 
+	dim=\EGp, dl1=\ER, ed=\EY, el=\ET, home=^^, ht=^I, il1=\EE, 
 	ind=^J, invis=\EG1, 
 	is2=\E`\:\Ee(\EO\Ee6\Ec41\E~4\Ec21\Eu\E~2, kDL=^Am\r, 
 	kEOL=^An\r, kbs=^H, kcbt=^AK\r, kclr=^AL\r, kcub1=^H, 
@@ -4356,12 +4518,12 @@ bobcat|sbobcat|HP 9000 model 300 console,
 	am, da, db, mir, xhp, 
 	cols#128, it#8, lines#47, xmc#0, 
 	cbt=\Ei, clear=\EH\EJ, cr=^M, cub1=^H, cud1=\EB, cuf1=\EC, 
-	cup=\E&a%dy%dC$<6/>, cuu1=\EA, dch1=\EP, dl1=\EM$<10*/>, 
-	ed=\EJ, el=\EK, hpa=\E&a%dC$<6/>, ht=^I, il1=\EL$<10*/>, 
-	ind=^J, kbs=^H, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, 
-	khome=\Eh, nel=^M^J, rmir=\ER, rmkx=\E&s0A, rmso=\E&d@, 
-	rmul=\E&d@, sgr0=\E&d@, smir=\EQ, smkx=\E&s1A, smso=\E&dB, 
-	smul=\E&dD, vpa=\E&a%dY$<6/>, 
+	cup=\E&a%p1%dy%p2%dC$<6/>, cuu1=\EA, dch1=\EP, 
+	dl1=\EM$<10*/>, ed=\EJ, el=\EK, hpa=\E&a%p1%dC$<6/>, ht=^I, 
+	il1=\EL$<10*/>, ind=^J, kbs=^H, kcub1=\ED, kcud1=\EB, 
+	kcuf1=\EC, kcuu1=\EA, khome=\Eh, nel=^M^J, rmir=\ER, 
+	rmkx=\E&s0A, rmso=\E&d@, rmul=\E&d@, sgr0=\E&d@, smir=\EQ, 
+	smkx=\E&s1A, smso=\E&dB, smul=\E&dD, vpa=\E&a%p1%dY$<6/>, 
 gator-t|HP 9000 model 237 emulating extra-tall AAA, 
 	lines#94, use=gator, 
 gator|HP 9000 model 237 emulating AAA, 
@@ -4783,7 +4945,7 @@ pt100|pt200|wren|fenix|prime pt100/pt200,
 	cbt=\E[Z, clear=\E?, cr=^M, cub=\E[%p1%dD, cub1=^H, 
 	cud=\E[%p1%dB, cud1=\ED, cuf=\E[%p1%dC, cuf1=\E[C, 
 	cup=\E0%p1%{33}%+%c%p2%{33}%+%c, cuu=\E[%p1%dA, 
-	cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[M, 
+	cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl1=\E[M, 
 	ed=\E[J\E[r, el=\E[K\E[t, flash=\E$$<200/>\E$P, 
 	home=\E$B, ht=^I, il1=\E[L\E[t, ind=^J, kbs=^H, kcub1=\E[D, 
 	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E$A, nel=^M^J, 
@@ -5168,7 +5330,7 @@ tvi921|televideo model 921 with sysline same as page & real vi function,
 	if=/usr/share/tabset/stdcrt, il1=\EE, ind=^J, invis@, 
 	is2=\El\E"\EF1\E.3\017\EA\E<, kbs=^H, kclr=^Z, kcub1=^H, 
 	kcud1=^V, kcuf1=^L, kcuu1=^K, kdch1=\EW, kdl1=\ER$<1*/>, 
-	ked=\EY, kel=\ET, kich1=\EQ, kil1=\EE, nel=^M^J, rmacs=\E%, 
+	ked=\EY, kel=\ET, kich1=\EQ, kil1=\EE, nel=^M^J, rmacs=\E%%, 
 	rmir=, smacs=\E$, smir=, tsl=\Ef\EG0, use=adm+sgr, 
 # without the beeper
 # (tvi92B: removed :ko=bt: before translation, I see no backtab cap;
@@ -5184,7 +5346,7 @@ tvi92B|televideo model 921 with sysline same as page & real vi function & no bee
 	invis@, is2=\El\E"\EF1\E.3\017\EA\E<, kbs=^H, kclr=^Z, 
 	kcub1=^H, kcud1=^V, kcuf1=^L, kcuu1=^K, kdch1=\EW, 
 	kdl1=\ER$<1*/>, ked=\EY, kel=\ET, kich1=\EQ, kil1=\EE, 
-	nel=^M^J, rmacs=\E%, smacs=\E$, tsl=\Ef\EG0, use=adm+sgr, 
+	nel=^M^J, rmacs=\E%%, smacs=\E$, tsl=\Ef\EG0, use=adm+sgr, 
 # (tvi92D: removed :ko=bt: before translation, I see no backtab cap -- esr)
 tvi92D|tvi92B with DTR instead of XON/XOFF & better padding, 
 	dl1=\ER$<2*/>, il1=\EE$<2*/>, 
@@ -5553,7 +5715,7 @@ tvi955|televideo 955,
 	civis=\E.0, cnorm=\E.2, cud1=^V, cup=\E[%i%p1%d;%p2%dH, 
 	cvvis=\E.1, dim=\E[=5h, ind@, invis=\EG1, 
 	is2=\E[=3l\EF1\Ed\EG0\E[=5l\E%\El, kctab=\E2, khts=\E1, 
-	knp=\EK, kpp=\EJ, krmir=\EQ, ktbc=\E3, mc0=\EP, rmacs=\E%, 
+	knp=\EK, kpp=\EJ, krmir=\EQ, ktbc=\E3, mc0=\EP, rmacs=\E%%, 
 	rmam=\E[=7l, rmxon=^N, 
 	rs1=\EDF\EC\Eg\Er\EO\E'\E(\Ew\EX\Ee \017\E0P\E6\0\E0p\E4\0\Ef\r, 
 	sgr0=\EG0\E[=5l, smacs=\E$, smam=\E[=7h, smxon=^O, 
@@ -5640,7 +5802,7 @@ tvi9065|televideo 9065,
 	pln=\E_%p1%{63}%+%c%p2%s\r, prot=\E&, 
 	rep=\E[%p2%db%p1%c, rev=\EG4, 
 	rf=/usr/share/tabset/stdcrt, ri=\Ej, rin=\E[%p1%dT, 
-	rmacs=\E%, rmam=\E[=7l, rmcup=\E.3\Er\E[1;25r\E[25;0H, 
+	rmacs=\E%%, rmam=\E[=7l, rmcup=\E.3\Er\E[1;25r\E[25;0H, 
 	rmdc=\0, rmir=\Er, rmln=\E[4;1v, rmso=\EG0, rmul=\EG0, 
 	rmxon=^N, rs1=\EC\EDF\E[0;0v\E[8;1v\E[=65l, 
 	rs2=\E.b\E[10;20v\E[14;1v\E[3;0v\E[7;0v\E[=11.h\E[=12.h\E[=13.h\E[=14.h\E[=15l\E[=20h\E[=60l\E[=61h\E[=9l\E[=10l\E[=21l\E[=23l\E[=3l\E_40\E_50\En\Ew\Ee \Ex0\0\0\Ex1\0\0\Ex2\0\0\Ex3\0\0\Ex4\0\0\E1, 
@@ -7158,9 +7320,9 @@ vt320-k3|MS-Kermit 3.00's vt320 emulation,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 
 	bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, 
 	clear=\E[H\E[J, cmdch=\E, cnorm=\E[?25h, cr=^M, 
-	csr=\E[%i%p1%d;%p1%dr, cub=\E[%p1%dD, cub1=^H, 
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 
 	cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 
-	cup=\E[%i%p1%d;%p1%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
 	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, 
 	dsl=\E[0$~, ech=\E[%p1%dX, ed=\E[J, el=\E[K, 
 	flash=\E[?5h\E[?5l\E[?5h\E[?5l\E[?5h\E[?5l, 
@@ -7313,6 +7475,43 @@ rbcomm-w|IBM PC with RBcomm in 132 column mode,
 	is2=\017\035\E(B\E)0\E[?7h\E[?3h\E[>8g, kbs=^H, 
 	kcub1=^H, kcud1=^J, nel=^M^J, use=rbcomm, 
 
+######## LCD DISPLAYS
+#
+
+#### Matrix Orbital
+# from: Eric Z. Ayers  (eric@ale.org)
+#
+# Matrix Orbital 20x4 LCD display
+# Command Character is 0xFE (decimal 254, octal 376)
+#
+# On this device, cursor addressability isn't possible.  The LCD expects:
+#      0xfe G   
+#      for cup: %p1 == row and %p2 is column
+#
+# This line:
+#	cup=\376G%p2%c%p1%c
+# LOOKS like it will work, but sometimes only one of the two numbers is sent. 
+# See the terminfo (5) manpage commented regarding 'Terminals which use "%c"'.
+# 
+# Alas, there is no cursor upline capability on this display.
+#
+# These entries add some 'sanity stuff' to the clear function.  That is, it
+# does a 'clear' and also turns OFF auto scroll, turns ON Auto Line Wrapping,
+# and turns off the cursor blinking and stuff like that.
+#
+# NOTE: calling 'beep' turns on the backlight (bell)
+# NOTE: calling 'flash' turns it on and back off (visual bell)
+#
+MtxOrb| Generic Matrix Orbital LCD display, 
+	bel=\376B^A, clear=\376X\376C\376R\376K\376T, 
+	cnorm=\376K\376T, cub1=\376L, cuf1=\376M, 
+	flash=\376B\001$<200>\376F, home=\376H, 
+MtxOrb204| 20x4 Matrix Orbital LCD display, 
+	cols#20, lines#4, use=MtxOrb, 
+MtxOrb162| 16x2 Matrix Orbital LCD display, 
+	cols#16, lines#2, use=MtxOrb, 
+# The end
+
 ######## OLDER TERMINAL TYPES
 #
 # This section is devoted to older commercial terminal brands that are now
@@ -7568,7 +7767,7 @@ att4418|att5418|AT&T 5418 80 cols,
 	cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[1P, dim=\E[2m, 
 	dl=\E[%p1%dM, dl1=\E[M, ed=\E[0J, el=\E[0K, home=\E[H, 
 	ich=\E[%p1%d@, ich1=\E[1@, il=\E[%p1%dL, il1=\E[1L, ind=^J, 
-	is1=\E[?3l, is2=\E)0\E?6l\E?5l, kclr=\E[%, kcub1=\E@, 
+	is1=\E[?3l, is2=\E)0\E?6l\E?5l, kclr=\E[%%, kcub1=\E@, 
 	kcud1=\EU, kcuf1=\EA, kcuu1=\ES, kent=\E[, kf1=\E[h, 
 	kf10=\E[m, kf11=\E[n, kf12=\E[o, kf13=\E[H, kf14=\E[I, 
 	kf15=\E[J, kf18=\E[K, kf19=\E[L, kf2=\E[i, kf20=\E[E, 
@@ -7960,7 +8159,7 @@ att605|AT&T 605 80 column 102key keyboard,
 att605-pc|ATT 605 in pc term mode, 
 	acsc=j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263, 
 	cbt=\E[Z, cub1=\E[D, cud1=\E[B, cuf1=\E[C, cuu1=\E[A, 
-	dch1=\E[P, dl1=\E[M, ich1=\E[@, il=\E[L, il1=\E[L, kcbt=\E[Z, 
+	dch1=\E[P, dl1=\E[M, ich1=\E[@, il1=\E[L, kcbt=\E[Z, 
 	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[P, 
 	kdl1=\E[M, kend=\E[F, kf1=\E[M, kf10=\E[V, kf2=\E[N, 
 	kf3=\E[O, kf4=\E[P, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, 
@@ -9965,7 +10164,7 @@ dgkeys+11|Private entry describing 11 minimal-subset DG mode special keys,
 	kf20=^^i, kf21=^^j, kf22=^^k, kf23=^^1, kf24=^^2, kf25=^^3, 
 	kf26=^^4, kf27=^^5, kf28=^^6, kf29=^^7, kf3=^^s, kf30=^^8, 
 	kf31=^^9, kf32=^^\:, kf33=^^;, kf34=^^!, kf35=^^", kf36=^^#, 
-	kf37=^^$, kf38=^^%, kf39=^^&, kf4=^^t, kf40=^^', kf41=^^(, 
+	kf37=^^$, kf38=^^%%, kf39=^^&, kf4=^^t, kf40=^^', kf41=^^(, 
 	kf42=^^), kf43=^^*, kf44=^^+, kf5=^^u, kf6=^^v, kf7=^^w, 
 	kf8=^^x, kf9=^^y, khome=^H, 
 
@@ -9978,7 +10177,7 @@ dgkeys+15|Private entry describing 15 DG mode special keys,
 	kf30=^^`, kf31=^^1, kf32=^^2, kf33=^^3, kf34=^^4, kf35=^^5, 
 	kf36=^^6, kf37=^^7, kf38=^^8, kf39=^^9, kf4=^^t, kf40=^^\:, 
 	kf41=^^;, kf42=^^<, kf43=^^=, kf44=^^>, kf45=^^0, kf46=^^!, 
-	kf47=^^", kf48=^^#, kf49=^^$, kf5=^^u, kf50=^^%, kf51=^^&, 
+	kf47=^^", kf48=^^#, kf49=^^$, kf5=^^u, kf50=^^%%, kf51=^^&, 
 	kf52=^^', kf53=^^(, kf54=^^), kf55=^^*, kf56=^^+, kf57=^^\,, 
 	kf58=^^-, kf59=^^., kf6=^^v, kf60=^^\s, kf7=^^w, kf8=^^x, 
 	kf9=^^y, 
@@ -10888,7 +11087,7 @@ f100|freedom|freedom100|freedom model 100,
 	kcuf1=^L, kcuu1=^K, kf1=^A@\r, kf10=^AI\r, kf2=^AA\r, 
 	kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, 
 	kf8=^AG\r, kf9=^AH\r, khome=^^, ri=\Ej, rmacs=\E$, rmir=\Er, 
-	smacs=\E%, smir=\Eq, tbc=\E3, tsl=\Eg\Ef, 
+	smacs=\E%%, smir=\Eq, tbc=\E3, tsl=\Eg\Ef, 
 	vpa=\E[%p1%{32}%+%c, use=adm+sgr, 
 f100-rv|freedom-rv|freedom 100 in reverse video, 
 	flash=\Ed$<200>\Eb, is2=\Eg\Ef\r\Eb, use=f100, 
@@ -11915,10 +12114,10 @@ icl6404|kds7372|icl6402|kds6402|ICL 6404 aka Kokusai Display Systems 7372,
 	cnorm=\E.3, cr=^M, 
 	csr=\E!%+%p1%{32}%+%p2%{32} cud1=\026, cuf1=^L, 
 	cup=\E=%p1%{32}%+%c%p2%{80}%m%{32}%+%c%p2%{80}%>%{32}%+%c, 
-	cuu1=^K, cvvis=\E.1, dch=\EW, dl1=\ER, home=^^, ht=^I, hts=\E1, 
-	il1=\EE, invis=\E[1ZZ, is1=\EC\E.3\EDF\EV1\Eg\E[0ZZ, 
-	nel=^_, rev=\E[4ZZ, rmir=\Er, 
-	rmso=\E[%gh%{4}%^%Ph%gh%dZZ, 
+	cuu1=^K, cvvis=\E.1, dch1=\EW, dl1=\ER, home=^^, ht=^I, 
+	hts=\E1, il1=\EE, invis=\E[1ZZ, 
+	is1=\EC\E.3\EDF\EV1\Eg\E[0ZZ, nel=^_, rev=\E[4ZZ, 
+	rmir=\Er, rmso=\E[%gh%{4}%^%Ph%gh%dZZ, 
 	rmul=\E[%gh%{8}%^%Ph%gh%dZZ, rs2=\Eo1, 
 	sgr=\E[%{0}%?%p1%t%{4}%|%;%?%p2%t%{8}%|%;%?%p3%t%{4}%|%;%?%p4%t%{2}%|%;%?%p7%t%{1}%|%;ZZ, 
 	sgr0=\E[0ZZ, smir=\Eq, smso=\E[8ZZ, smul=\E[8ZZ, tbc=\E3, 
@@ -11945,7 +12144,7 @@ intext|Interactive Systems Corporation modified owl 1200,
 	kcub1=^_, kcud1=^J, kcuf1=^^, kcuu1=^\, kf0=^VJ\r, kf1=^VA\r, 
 	kf2=^VB\r, kf3=^VC\r, kf4=^VD\r, kf5=^VE\r, kf6=^VF\r, 
 	kf7=^VG\r, kf8=^VH\r, kf9=^VI\r, khome=^Z, rmir=^V<, 
-	rmkx=^V9, rmso=^V#\s, smir=^V;, smkx=\036\:\264\026%, 
+	rmkx=^V9, rmso=^V#\s, smir=^V;, smkx=\036\:\264\026%%, 
 	smso=^V$\,, 
 intext2|intextii|INTERACTIVE modified owl 1251, 
 	am, bw, ul, 
@@ -12065,7 +12264,7 @@ kt7ix|kimtron model kt-7 or 70 in IX mode,
 	ked=\EY, kel=\ET, kend=\EY, kf0=^AI\r, kf1=^A@\r, kf2=^AA\r, 
 	kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, 
 	kf8=^AG\r, kf9=^AH\r, khome=^^, kich1=\EQ, kil1=\EE, knp=\EJ, 
-	nel=^M^J, pulse=\EK, rmacs=\E%, rmir=, rmso=\EG0, rmul=\EG0, 
+	nel=^M^J, pulse=\EK, rmacs=\E%%, rmir=, rmso=\EG0, rmul=\EG0, 
 	sgr0=\EG0, smacs=\E$, smir=, smso=\EG4, smul=\EG8, tsl=\Ef, 
 
 #### Microdata/MDIS
@@ -12511,7 +12710,7 @@ ergo4000|microterm ergo 4000,
 	bel=^G, clear=\E[H\E[2J$<80>, cr=^M, cub1=^H, cud1=\E[B, 
 	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, 
 	dch1=\E[1P$<80>, dl1=\E[1M$<5*>, ed=\E[0J$<15>, 
-	el=\E[0K$<13>, ht=^I, il=\E[1L$<5*>, ind=\ED$<20*>, 
+	el=\E[0K$<13>, ht=^I, il1=\E[1L$<5*>, ind=\ED$<20*>, 
 	is2=\E<\E=\E[?1l\E[?4l\E[?5l\E[?7h\E[?8h$<300>, 
 	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf1=\EOP, 
 	kf2=\EOQ, kf3=\EOR, kf4=\EOS, lf1=pf1, lf2=pf2, lf3=pf3, 
@@ -14051,7 +14250,7 @@ apple-videx3|vapple|Apple II with 80 col card,
 	clear=\Ev, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c, 
 	cuu1=\EA, el=\Ex, home=\EH, kcub1=\ED, kcud1=\EB, kcuf1=\EC, 
 	kcuu1=\EA, kf0=\EP, kf1=\EQ, kf2=\ER, kf3=\E\s, kf4=\E!, 
-	kf5=\E", kf6=\E#, kf7=\E$, kf8=\E%, kf9=\E&, khome=\EH, 
+	kf5=\E", kf6=\E#, kf7=\E$, kf8=\E%%, kf9=\E&, khome=\EH, 
 #From: decvax!cbosgd!cbdkc1!mww Mike Warren via BRL
 aepro|Apple II+ running ASCII Express Pro--vt52, 
 	OTbs, 
@@ -14277,6 +14476,34 @@ amiga-8bit|Amiga ANSI using 8-bit controls,
 	acsc=, dl=\233%p1%dM, dl1=\233M, il=\233%p1%dL, il1=\233L, 
 	ind=\204, indn@, ri=\215, rin@, use=amiga-h, 
 
+# From: Ruediger Kuhlmann , 18 Jul 2000
+# requires use of appropriate preferences settings.
+amiga-vnc|Amiga using VNC console (black on light gray), 
+	am, da, db, msgr, ndscr, 
+	btns#1, colors#16, cols#80, lines#24, lm#0, ncv#0, pairs#256, 
+	bel=^G, blink=\E[7;2m, bold=\E[1m, civis=\E[0p, 
+	clear=\E[H\E[J, cnorm=\E[p\E[>?6l, cr=^M, 
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[D, 
+	cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C, 
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
+	cvvis=\E[>?6h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, 
+	dl=\E[%p1%dM, dl1=\E[1M, ed=\E[J, el=\E[K, flash=^G, 
+	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[1L, ind=\ED, 
+	indn=\E[%p1%dS, invis=\E8m, 
+	is2=\E[>?2;18l\E[>?26;?6;20;>?15;?7;>?22;>?8h, 
+	kbs=^H, kcbt=\233Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, 
+	kcuu1=\E[A, kdch1=\177, kf0=\E[9~, kf1=\E[0~, kf2=\E[1~, 
+	kf3=\E[2~, kf4=\E[3~, kf5=\E[4~, kf6=\E[5~, kf7=\E[6~, 
+	kf8=\E[7~, kf9=\E[8~, khlp=\E[?~, khome=\E[44~, kll=\E[45~, 
+	kmous=\E[M, knp=\E[42~, kpp=\E[41~, nel=\EE, oc=\E[0m, 
+	rev=\E[7m, ri=\EM, rin=\E[%p1%dT, rmcup=\E[?7h\E[r\E[J, 
+	rmkx=\E[?1l, rmso=\E[21m, rmul=\E[24m, rs1=\Ec, 
+	rs2=\E[>?2;18l\E[>?26;?6;20;>?15;?7;>?22;>?8h, 
+	setab=\E[%?%p1%{8}%>%t%'F'%p1%+%d%e4%p1%d%;m, 
+	setaf=\E[%?%p1%{8}%>%t%'2'%p1%+%d%e3%p1%d%;m, 
+	sgr0=\E[0m\017\E[30;85;>15m, smcup=\E[?7h, smkx=\E[?1h, 
+	smso=\E[1m, smul=\E[4m, 
+
 # Commodore B-128 microcomputer from Doug Tyrol 
 # 	I'm trying to write a termcap for a commodore b-128, and I'm
 # having a little trouble. I've had to map most of my control characters
@@ -14515,15 +14742,15 @@ m2-nam|minitel|minitel-2|minitel-2-nam|France Telecom Minitel 2 mode te'le'infor
 	cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 
 	cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, 
 	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, flash=^G, fsl=^J, 
-	home=\E[H, ht=^I, il=\E[%p1%dL, il1=\E[L, ind=^J, indn=^J, 
-	ip=$<7/>, is1=\E\:1}\Ec\E[?4l\E[12h, is2=\Ec\E[12h\E)0, 
+	home=\E[H, ht=^I, il=\E[%p1%dL, il1=\E[L, ind=^J, ip=$<7/>, 
+	is1=\E\:1}\Ec\E[?4l\E[12h, is2=\Ec\E[12h\E)0, 
 	is3=\E[?3l kbs=\010, kclr=\E[2J, kcub1=\E[D, kcud1=\E[B, 
 	kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[P, kdl1=\E[M, kf0=\EOp, 
 	kf1=\EOq, kf10=\EOp, kf2=\EOr, kf3=\EOs, kf4=\EOt, kf5=\EOu, 
 	kf6=\EOv, kf7=\EOw, kf8=\EOx, kf9=\EOy, khome=\E[H, 
 	kich1=\E[4h, kil1=\E[4l, knp=\EOn, kpp=\EOR, ll=\E[24;80H, 
-	mc0=\E[i, nel=^M^J, rc=\E8, rev=\E[7m, ri=\EM, rin=\EM, 
-	rmacs=^O, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, 
+	mc0=\E[i, nel=^M^J, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 
+	rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, 
 	rs1=\Ec\E[?4l\E[12h, rs2=\Ec\E)0, sc=\E7, sgr0=\E[m, 
 	smacs=^N, smir=\E[4h, smso=\E[7m, smul=\E[4m, tsl=^_@A, 
 	u6=\E[%i%d;%dR, u7=\E[6n, 
@@ -15892,8 +16119,8 @@ mt70|mt-70|Morrow MD-70; native Morrow mode,
 	kf17=^Af\r, kf18=^Ag\r, kf19=^Ah\r, kf2=^AA\r, kf20=^Ai\r, 
 	kf3=^AB\r, kf4=^AC\r, kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, 
 	kf8=^AG\r, kf9=^AH\r, khlp=^AO\r, khome=^AN\r, nel=^_, 
-	rmacs=\E%, rmcup=, smacs=\E$, smcup=\E"2\EG0\E], smul=\EG1, 
-	tbc=\E0, use=adm+sgr, 
+	rmacs=\E%%, rmcup=, smacs=\E$, smcup=\E"2\EG0\E], 
+	smul=\EG1, tbc=\E0, use=adm+sgr, 
 
 #### Motorola
 #
@@ -16891,7 +17118,7 @@ opus3n1+|Esprit Opus3n1+ in wy60 mode with ANSI arrow keys,
 	sgr0=\E(\EH\003\EG0\EcD, smacs=\EH^B, smam=\Ed/, 
 	smcup=\Ezz&\E[A\177\Ezz'\E[B\177\Ezz(\E[D\177\Ezz)\E[C\177\Ezz<\E[Q\177, 
 	smir=\Eq, smln=\EA10, smxon=\Ec21, tbc=\E0, tsl=\Ez(, 
-	uc=\EG8%p1%c\EG0, use=adm+sgr, 
+	uc=\EG8\EG0, use=adm+sgr, 
 teletec|Teletec Datascreen, 
 	OTbs, am, 
 	cols#80, lines#24, 
@@ -18346,6 +18573,30 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 # 2000/7/1
 #	* add Eterm (Michael Jennings)
 #
+# 2000-07-18
+#       * add amiga-vnc entry.
+#
+# 2000-08-12
+#	* correct description of Top Gun Telnet.
+#	* add kterm-color
+#
+# 2000-08-26
+#	* add qansi* entries from QNX ftp site.
+#
+# 2000-09-16
+#	* add Matrix Orbital entries by Eric Z. Ayers).
+#	* add xterm-basic, xterm-sco entries, update related entries to XFree86
+#	  4.0.1c -TD
+#
+# 2000-09-17
+#	* add S0, E0 extensions to screen's entry -TD
+#
+# 2000-09-23
+#	* several corrections based on tic's new parameter-checking code -TD
+#	* modify xterm-r6 and similar rs2 sequences which had \E7...\E8
+#	  bracketing sequences that reset video attributes (\E8 would restore
+#	  them) -TD
+#
 # The following sets edit modes for GNU EMACS.
 # Local Variables:
 # fill-prefix:"\t"
diff --git a/mk-1st.awk b/mk-1st.awk
index 63ec24b4..c14219cd 100644
--- a/mk-1st.awk
+++ b/mk-1st.awk
@@ -1,4 +1,4 @@
-# $Id: mk-1st.awk,v 1.44 2000/07/07 00:27:51 tom Exp $
+# $Id: mk-1st.awk,v 1.46 2000/10/14 17:57:02 Johnny.C.Lam Exp $
 ##############################################################################
 # Copyright (c) 1998,2000 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -183,30 +183,30 @@ END	{
 				print  ""
 				print  "install \\"
 				print  "install.libs \\"
-				printf "install.%s :: $(INSTALL_PREFIX)$(libdir) ../lib/%s\n", name, end_name
-				printf "\t@echo installing ../lib/%s as $(INSTALL_PREFIX)$(libdir)/%s\n", end_name, end_name
-				printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s\n", end_name
-				printf "\t$(INSTALL_LIB) ../lib/%s $(INSTALL_PREFIX)$(libdir)/%s\n", end_name, end_name
-				sharedlinks("$(INSTALL_PREFIX)$(libdir)")
+				printf "install.%s :: $(DESTDIR)$(libdir) ../lib/%s\n", name, end_name
+				printf "\t@echo installing ../lib/%s as $(DESTDIR)$(libdir)/%s\n", end_name, end_name
+				printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", end_name
+				printf "\t$(INSTALL_LIB) ../lib/%s $(DESTDIR)$(libdir)/%s\n", end_name, end_name
+				sharedlinks("$(DESTDIR)$(libdir)")
 				if ( overwrite == "yes" && name == "ncurses" )
 				{
 					ovr_name = sprintf("libcurses%s", suffix)
 					printf "\t@echo linking %s to %s\n", end_name, ovr_name
-					printf "\tcd $(INSTALL_PREFIX)$(libdir) && (rm -f %s; $(LN_S) %s %s; )\n", ovr_name, end_name, ovr_name
+					printf "\tcd $(DESTDIR)$(libdir) && (rm -f %s; $(LN_S) %s %s; )\n", ovr_name, end_name, ovr_name
 				}
 				if ( ldconfig != "" ) {
-					printf "\t- test -z \"$(INSTALL_PREFIX)\" && %s\n", ldconfig
+					printf "\t- test -z \"$(DESTDIR)\" && %s\n", ldconfig
 				}
 				print  ""
 				print  "uninstall \\"
 				print  "uninstall.libs \\"
 				printf "uninstall.%s ::\n", name
-				printf "\t@echo uninstalling $(INSTALL_PREFIX)$(libdir)/%s\n", end_name
-				removelinks("$(INSTALL_PREFIX)$(libdir)")
+				printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", end_name
+				removelinks("$(DESTDIR)$(libdir)")
 				if ( overwrite == "yes" && name == "ncurses" )
 				{
 					ovr_name = sprintf("libcurses%s", suffix)
-					printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s\n", ovr_name
+					printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", ovr_name
 				}
 				if ( rmSoLocs == "yes" ) {
 					print  ""
@@ -215,6 +215,29 @@ END	{
 					printf "\t-@rm -f so_locations\n"
 				}
 			}
+			else if ( MODEL == "LIBTOOL" )
+			{
+				if ( $2 == "c++" ) {
+					compile="CXX"
+				} else {
+					compile="CC"
+				}
+				end_name = lib_name;
+				printf "../lib/%s : $(%s_OBJS)\n", lib_name, OBJS
+				printf "\tcd ../lib && $(LIBTOOL) $(%s) -o %s $(%s_OBJS:.o=.lo) -rpath $(DESTDIR)$(libdir) -version-info $(NCURSES_MAJOR):$(NCURSES_MINOR)\n", compile, lib_name, OBJS
+				print  ""
+				print  "install \\"
+				print  "install.libs \\"
+				printf "install.%s :: $(DESTDIR)$(libdir) ../lib/%s\n", name, lib_name
+				printf "\t@echo installing ../lib/%s as $(DESTDIR)$(libdir)/%s\n", lib_name, lib_name
+				printf "\tcd ../lib; $(LIBTOOL) $(INSTALL_DATA) %s $(DESTDIR)$(libdir)\n", lib_name
+				print  ""
+				print  "uninstall \\"
+				print  "uninstall.libs \\"
+				printf "uninstall.%s ::\n", name
+				printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", lib_name
+				printf "\t-@$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/%s\n", lib_name
+			}
 			else
 			{
 				end_name = lib_name;
@@ -228,36 +251,36 @@ END	{
 				print  ""
 				print  "install \\"
 				print  "install.libs \\"
-				printf "install.%s :: $(INSTALL_PREFIX)$(libdir) ../lib/%s\n", name, lib_name
-				printf "\t@echo installing ../lib/%s as $(INSTALL_PREFIX)$(libdir)/%s\n", lib_name, lib_name
-				printf "\t$(INSTALL_DATA) ../lib/%s $(INSTALL_PREFIX)$(libdir)/%s\n", lib_name, lib_name
+				printf "install.%s :: $(DESTDIR)$(libdir) ../lib/%s\n", name, lib_name
+				printf "\t@echo installing ../lib/%s as $(DESTDIR)$(libdir)/%s\n", lib_name, lib_name
+				printf "\t$(INSTALL_DATA) ../lib/%s $(DESTDIR)$(libdir)/%s\n", lib_name, lib_name
 				if ( overwrite == "yes" && lib_name == "libncurses.a" )
 				{
 					printf "\t@echo linking libcurses.a to libncurses.a\n"
-					printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/libcurses.a\n"
-					printf "\t(cd $(INSTALL_PREFIX)$(libdir) && $(LN_S) libncurses.a libcurses.a)\n"
+					printf "\t-@rm -f $(DESTDIR)$(libdir)/libcurses.a\n"
+					printf "\t(cd $(DESTDIR)$(libdir) && $(LN_S) libncurses.a libcurses.a)\n"
 				}
-				printf "\t$(RANLIB) $(INSTALL_PREFIX)$(libdir)/%s\n", lib_name
+				printf "\t$(RANLIB) $(DESTDIR)$(libdir)/%s\n", lib_name
 				if ( target == "vxworks" )
 				{
-					printf "\t@echo installing ../lib/lib%s.o as $(INSTALL_PREFIX)$(libdir)/lib%s.o\n", name, name
-					printf "\t$(INSTALL_DATA) ../lib/lib%s.o $(INSTALL_PREFIX)$(libdir)/lib%s.o\n", name, name
+					printf "\t@echo installing ../lib/lib%s.o as $(DESTDIR)$(libdir)/lib%s.o\n", name, name
+					printf "\t$(INSTALL_DATA) ../lib/lib%s.o $(DESTDIR)$(libdir)/lib%s.o\n", name, name
 				}
 				print  ""
 				print  "uninstall \\"
 				print  "uninstall.libs \\"
 				printf "uninstall.%s ::\n", name
-				printf "\t@echo uninstalling $(INSTALL_PREFIX)$(libdir)/%s\n", lib_name
-				printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/%s\n", lib_name
+				printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", lib_name
+				printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", lib_name
 				if ( overwrite == "yes" && lib_name == "libncurses.a" )
 				{
 					printf "\t@echo linking libcurses.a to libncurses.a\n"
-					printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/libcurses.a\n"
+					printf "\t-@rm -f $(DESTDIR)$(libdir)/libcurses.a\n"
 				}
 				if ( target == "vxworks" )
 				{
-					printf "\t@echo uninstalling $(INSTALL_PREFIX)$(libdir)/lib%s.o\n", name
-					printf "\t-@rm -f $(INSTALL_PREFIX)$(libdir)/lib%s.o\n", name
+					printf "\t@echo uninstalling $(DESTDIR)$(libdir)/lib%s.o\n", name
+					printf "\t-@rm -f $(DESTDIR)$(libdir)/lib%s.o\n", name
 				}
 			}
 			print ""
@@ -266,14 +289,23 @@ END	{
 			print ""
 			print "mostlyclean::"
 			printf "\t-rm -f $(%s_OBJS)\n", OBJS
+			if ( MODEL == "LIBTOOL" ) {
+				printf "\t-rm -f $(%s_OBJS:.o=.lo)\n", OBJS
+			}
 		}
 		else if ( found == 2 )
 		{
 			print ""
 			print "mostlyclean::"
 			printf "\t-rm -f $(%s_OBJS)\n", OBJS
+			if ( MODEL == "LIBTOOL" ) {
+				printf "\t-rm -f $(%s_OBJS:.o=.lo)\n", OBJS
+			}
 			print ""
 			print "clean ::"
 			printf "\t-rm -f $(%s_OBJS)\n", OBJS
+			if ( MODEL == "LIBTOOL" ) {
+				printf "\t-rm -f $(%s_OBJS:.o=.lo)\n", OBJS
+			}
 		}
 	}
diff --git a/mk-2nd.awk b/mk-2nd.awk
index e90f16d0..45def012 100644
--- a/mk-2nd.awk
+++ b/mk-2nd.awk
@@ -1,4 +1,4 @@
-# $Id: mk-2nd.awk,v 1.12 2000/04/01 20:50:36 tom Exp $
+# $Id: mk-2nd.awk,v 1.13 2000/10/14 17:57:02 Johnny.C.Lam Exp $
 ##############################################################################
 # Copyright (c) 1998 Free Software Foundation, Inc.                          #
 #                                                                            #
@@ -100,9 +100,9 @@ BEGIN	{
 					dir = $3 "/"
 					sub("^\\$\\(srcdir\\)/","",dir);
 					sub("^\\./","",dir);
-					printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c ../%s/%s%s%s", atsign, model, compile, MODEL, name, dir, $1, suffix
+					printf "\t%scd ../%s; $(LIBTOOL) $(%s) $(CFLAGS_%s) -c ../%s/%s%s%s", atsign, model, compile, MODEL, name, dir, $1, suffix
 				} else
-					printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c %s/%s%s", atsign, model, compile, MODEL, $3, $1, suffix
+					printf "\t%scd ../%s; $(LIBTOOL) $(%s) $(CFLAGS_%s) -c %s/%s%s", atsign, model, compile, MODEL, $3, $1, suffix
 			} else {
 				printf "%s", $1
 				for (n = 2; n <= NF; n++) printf " %s", $n
diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in
index 41b66f69..208b819d 100644
--- a/ncurses/Makefile.in
+++ b/ncurses/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.66 2000/05/28 01:39:56 tom Exp $
+# $Id: Makefile.in,v 1.71 2000/10/14 22:55:35 tom Exp $
 ##############################################################################
 # Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -54,7 +54,7 @@ CF_MFLAGS 	= @cf_cv_makeflags@
 @SET_MAKE@
 
 MODEL		= @DFT_LWR_MODEL@
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -62,7 +62,7 @@ libdir		= @libdir@
 includedir	= @includedir@
 datadir		= @datadir@
 
-ticdir		= $(datadir)/terminfo
+LIBTOOL		= @LIBTOOL@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -80,7 +80,7 @@ CFLAGS		= @CFLAGS@
 
 INCDIR		= $(srcdir)/../include
 CPPFLAGS	= -I../ncurses -I$(srcdir) @CPPFLAGS@ \
-		  -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"
+		  -DHAVE_CONFIG_H
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
@@ -88,6 +88,7 @@ HOSTCC		= @BUILD_CC@
 HOSTCCFLAGS	= @CFLAGS@ $(CPPFLAGS)
 HOSTLDFLAGS	= @LDFLAGS@ @LIBS@
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
@@ -95,7 +96,7 @@ CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
 
-LINK		= $(CC)
+LINK		= $(LIBTOOL) $(CC)
 LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
 
 SHLIB_DIRS	= -L../lib -L$(libdir)
@@ -104,6 +105,8 @@ TINFO_LIST	= $(SHLIB_DIRS) @TINFO_LIST@
 
 MK_SHARED_LIB	= @MK_SHARED_LIB@
 
+NCURSES_MAJOR	= @NCURSES_MAJOR@
+NCURSES_MINOR	= @NCURSES_MINOR@
 REL_VERSION	= @cf_cv_rel_version@
 ABI_VERSION	= @cf_cv_abi_version@
 
@@ -150,7 +153,7 @@ libs ::		$(AUTO_SRC) ../lib $(LIBRARIES)
 
 sources:	$(AUTO_SRC)
 
-$(INSTALL_PREFIX)$(libdir) :
+$(DESTDIR)$(libdir) :
 	$(srcdir)/../mkinstalldirs $@
 
 ../lib : ; mkdir $@
@@ -202,8 +205,8 @@ make_hash$x : \
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
@@ -213,6 +216,7 @@ clean :: mostlyclean
 	-rm -f $(AUTO_SRC)
 	-rm -f make_keys$x
 	-rm -f make_hash$x
+	-rm -rf .libs
 
 distclean :: clean
 	-rm -f Makefile
diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
index 0a29c608..33779400 100755
--- a/ncurses/base/MKlib_gen.sh
+++ b/ncurses/base/MKlib_gen.sh
@@ -2,7 +2,7 @@
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
-# ($Id: MKlib_gen.sh,v 1.11 1998/01/17 14:16:52 Juan.Jose.Garcia.Ripoll Exp $)
+# ($Id: MKlib_gen.sh,v 1.12 2000/07/29 16:30:11 tom Exp $)
 #
 # The XSI Curses standard requires all curses entry points to exist as
 # functions, even though many definitions would normally be shadowed
@@ -113,6 +113,11 @@ BEGIN	{
 		print "\n"
 	skip=1;
 
+	if ( $1 == "chtype" ) {
+		returnType = "Char";
+	} else {
+		returnType = "Code";
+	}
 	print "M_" $2
 	print $0;
 	print "{";
@@ -200,7 +205,7 @@ BEGIN	{
 	if (match($0, "^void"))
 		call = ""
 	else if (dotrace)
-		call = "returnCode( ";
+		call = sprintf("return%s( ", returnType);
 	else
 		call = "%%return ";
 
diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c
index 0a721659..59a3bae8 100644
--- a/ncurses/base/lib_addstr.c
+++ b/ncurses/base/lib_addstr.c
@@ -40,7 +40,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_addstr.c,v 1.17 2000/04/29 21:15:55 tom Exp $")
+MODULE_ID("$Id: lib_addstr.c,v 1.18 2000/07/29 16:42:41 tom Exp $")
 
 int
 waddnstr(WINDOW *win, const char *const astr, int n)
@@ -51,7 +51,7 @@ waddnstr(WINDOW *win, const char *const astr, int n)
     T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbuf(astr), n));
 
     if (win && (str != 0)) {
-	T(("... current %s", _traceattr(win->_attrs)));
+	TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs)));
 	TR(TRACE_VIRTPUT, ("str is not null"));
 	code = OK;
 	if (n < 0)
diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c
index 71bee424..492194ba 100644
--- a/ncurses/base/lib_color.c
+++ b/ncurses/base/lib_color.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: lib_color.c,v 1.51 2000/05/20 20:09:22 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.53 2000/09/02 18:02:15 tom Exp $")
 
 /*
  * These should be screen structure members.  They need to be globals for
@@ -85,7 +85,7 @@ static const color_t hls_palette[] =
 };
 /* *INDENT-ON* */
 
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
 /*
  * These are called from _nc_do_color(), which in turn is called from
  * vidattr - so we have to assume that SP may be null.
@@ -265,7 +265,7 @@ init_pair(short pair, short f, short b)
 
     if ((pair < 0) || (pair >= COLOR_PAIRS))
 	returnCode(ERR);
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     if (SP->_default_color) {
 	if (f < 0)
 	    f = C_MASK;
@@ -438,7 +438,7 @@ _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int))
 	pair_content(old_pair, &old_fg, &old_bg);
 	if ((fg == C_MASK && old_fg != C_MASK)
 	    || (bg == C_MASK && old_bg != C_MASK)) {
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
 	    /*
 	     * A minor optimization - but extension.  If "AX" is specified in
 	     * the terminal description, treat it as screen's indicator of ECMA
@@ -458,7 +458,7 @@ _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int))
 	    return;
     }
 
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     if (fg == C_MASK)
 	fg = default_fg();
     if (bg == C_MASK)
@@ -471,7 +471,7 @@ _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int))
 	bg = xx;
     }
 
-    T(("setting colors: pair = %d, fg = %d, bg = %d", pair, fg, bg));
+    TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, fg, bg));
 
     if (fg != C_MASK) {
 	set_foreground_color(fg, outc);
diff --git a/ncurses/base/lib_colorset.c b/ncurses/base/lib_colorset.c
index d9fc5c28..3870e875 100644
--- a/ncurses/base/lib_colorset.c
+++ b/ncurses/base/lib_colorset.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            *
@@ -40,17 +40,19 @@
 #include 
 #include 
 
-MODULE_ID("$Id: lib_colorset.c,v 1.5 1999/05/16 17:13:43 juergen Exp $")
+MODULE_ID("$Id: lib_colorset.c,v 1.6 2000/07/29 16:37:19 tom Exp $")
 
-int wcolor_set(WINDOW *win, short color_pair_number, void *opts)
+int
+wcolor_set(WINDOW *win, short color_pair_number, void *opts)
 {
-	T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
-	if (win && !opts && (color_pair_number >= 0) && (color_pair_number < COLOR_PAIRS)) {
-		T(("... current %ld", (long) PAIR_NUMBER(win->_attrs)));
-		toggle_attr_on(win->_attrs,COLOR_PAIR(color_pair_number));
-		returnCode(OK);
-	} else
-		returnCode(ERR);
+    T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
+    if (win
+	&& !opts
+	&& (color_pair_number >= 0)
+	&& (color_pair_number < COLOR_PAIRS)) {
+	TR(TRACE_ATTRS, ("... current %ld", (long) PAIR_NUMBER(win->_attrs)));
+	toggle_attr_on(win->_attrs, COLOR_PAIR(color_pair_number));
+	returnCode(OK);
+    } else
+	returnCode(ERR);
 }
-
-
diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c
index c5a5dc3e..f67bf9a3 100644
--- a/ncurses/base/lib_getch.c
+++ b/ncurses/base/lib_getch.c
@@ -40,56 +40,17 @@
 
 #include 
 
-MODULE_ID("$Id: lib_getch.c,v 1.48 2000/07/08 11:21:51 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.50 2000/10/09 23:53:57 Ilya.Zakharevich Exp $")
 
 #include 
 
 int ESCDELAY = 1000;		/* max interval betw. chars in funkeys, in millisecs */
 
-#ifdef USE_EMX_MOUSE
-#  include 
-static int
-kbd_mouse_read(unsigned char *p)
-{
-    fd_set fdset;
-    int nums = SP->_ifd + 1;
-
-    for (;;) {
-	FD_ZERO(&fdset);
-	FD_SET(SP->_ifd, &fdset);
-	if (SP->_checkfd >= 0) {
-	    FD_SET(SP->_checkfd, &fdset);
-	    if (SP->_checkfd >= nums)
-		nums = SP->_checkfd + 1;
-	}
-	if (SP->_mouse_fd >= 0) {
-	    FD_SET(SP->_mouse_fd, &fdset);
-	    if (SP->_mouse_fd >= nums)
-		nums = SP->_mouse_fd + 1;
-	}
-	if (select(nums, &fdset, NULL, NULL, NULL) >= 0) {
-	    int n;
-
-	    if (SP->_mouse_fd >= 0
-		&& FD_ISSET(SP->_mouse_fd, &fdset)) {	/* Prefer mouse */
-		n = read(SP->_mouse_fd, p, 1);
-	    } else {
-		n = read(SP->_ifd, p, 1);
-	    }
-	    return n;
-	}
-	if (errno != EINTR) {
-	    return -1;
-	}
-    }
-}
-#endif /* USE_EMX_MOUSE */
-
 static inline int
 fifo_peek(void)
 {
     int ch = SP->_fifo[peek];
-    T(("peeking at %d", peek));
+    TR(TRACE_IEVENT, ("peeking at %d", peek));
 
     p_inc();
     return ch;
@@ -100,7 +61,7 @@ fifo_pull(void)
 {
     int ch;
     ch = SP->_fifo[head];
-    T(("pulling %d from %d", ch, head));
+    TR(TRACE_IEVENT, ("pulling %d from %d", ch, head));
 
     if (peek == head) {
 	h_inc();
@@ -129,7 +90,7 @@ fifo_push(void)
     errno = 0;
 #endif
 
-#if USE_GPM_SUPPORT
+#if USE_GPM_SUPPORT || defined(USE_EMX_MOUSE)
     if ((SP->_mouse_fd >= 0)
 	&& (_nc_timed_wait(3, -1, (int *) 0) & 2)) {
 	SP->_mouse_event(SP);
@@ -139,11 +100,7 @@ fifo_push(void)
 #endif
     {
 	unsigned char c2 = 0;
-#ifdef USE_EMX_MOUSE
-	n = kbd_mouse_read(&c2);
-#else
 	n = read(SP->_ifd, &c2, 1);
-#endif
 	ch = c2 & 0xff;
     }
 
@@ -162,17 +119,17 @@ fifo_push(void)
 #endif
 
     if ((n == -1) || (n == 0)) {
-	T(("read(%d,&ch,1)=%d, errno=%d", SP->_ifd, n, errno));
+	TR(TRACE_IEVENT, ("read(%d,&ch,1)=%d, errno=%d", SP->_ifd, n, errno));
 	ch = ERR;
     }
-    T(("read %d characters", n));
+    TR(TRACE_IEVENT, ("read %d characters", n));
 
     SP->_fifo[tail] = ch;
     SP->_fifohold = 0;
     if (head == -1)
 	head = peek = tail;
     t_inc();
-    T(("pushed %#x at %d", ch, tail));
+    TR(TRACE_IEVENT, ("pushed %#x at %d", ch, tail));
 #ifdef TRACE
     if (_nc_tracing & TRACE_IEVENT)
 	_nc_fifo_dump();
@@ -223,7 +180,7 @@ wgetch(WINDOW *win)
     if (head == -1 && !SP->_raw && !SP->_cbreak) {
 	char buf[MAXCOLUMNS], *sp;
 
-	T(("filling queue in cooked mode"));
+	TR(TRACE_IEVENT, ("filling queue in cooked mode"));
 
 	wgetnstr(win, buf, MAXCOLUMNS);
 
@@ -241,13 +198,13 @@ wgetch(WINDOW *win)
     if (!win->_notimeout && (win->_delay >= 0 || SP->_cbreak > 1)) {
 	int delay;
 
-	T(("timed delay in wgetch()"));
+	TR(TRACE_IEVENT, ("timed delay in wgetch()"));
 	if (SP->_cbreak > 1)
 	    delay = (SP->_cbreak - 1) * 100;
 	else
 	    delay = win->_delay;
 
-	T(("delay is %d milliseconds", delay));
+	TR(TRACE_IEVENT, ("delay is %d milliseconds", delay));
 
 	if (head == -1)		/* fifo is empty */
 	    if (!_nc_timed_wait(3, delay, (int *) 0))
diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c
index 59db16d1..3b856350 100644
--- a/ncurses/base/lib_mouse.c
+++ b/ncurses/base/lib_mouse.c
@@ -84,7 +84,7 @@
 #endif
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.52 2000/06/29 23:02:26 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.55 2000/10/10 00:07:28 Ilya.Zakharevich Exp $")
 
 #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
 
@@ -130,8 +130,8 @@ _trace_slot(const char *tag)
 
     for (ep = events; ep < events + EV_MAX; ep++)
 	_tracef("mouse event queue slot %ld = %s",
-	    (long) (ep - events),
-	    _tracemouse(ep));
+		(long) (ep - events),
+		_tracemouse(ep));
 }
 #endif
 
@@ -154,7 +154,7 @@ write_event(int down, int button, int x, int y)
     char buf[6];
     unsigned long ignore;
 
-    strcpy(buf, key_mouse);
+    strncpy(buf, key_mouse, 3);	/* should be "\033[M" */
     buf[3] = ' ' + (button - 1) + (down ? 0 : 0x40);
     buf[4] = ' ' + x - LEFT_COL + 1;
     buf[5] = ' ' + y - TOP_ROW + 1;
@@ -169,20 +169,27 @@ mouse_server(unsigned long ignored GCC_UNUSED)
     MOUEVENTINFO mouev;
     HMOU hmou;
     unsigned short mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN | MOUSE_BN3_DOWN;
+    int nbuttons = 3;
     int oldstate = 0;
-    char errmess[] = "Unexpected termination of mouse thread\r\n";
-    unsigned long ignore;
+    char err[80];
+    unsigned long rc;
 
     /* open the handle for the mouse */
     if (MouOpen(NULL, &hmou) == 0) {
-
-	if (MouSetEventMask(&mask, hmou) == 0
-	    && MouDrawPtr(hmou) == 0) {
-
+	rc = MouSetEventMask(&mask, hmou);
+	if (rc) {		/* retry with 2 buttons */
+	    mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN;
+	    rc = MouSetEventMask(&mask, hmou);
+	    nbuttons = 2;
+	}
+	if (rc == 0 && MouDrawPtr(hmou) == 0) {
 	    for (;;) {
 		/* sit and wait on the event queue */
-		if (MouReadEventQue(&mouev, &fWait, hmou))
+		rc = MouReadEventQue(&mouev, &fWait, hmou);
+		if (rc) {
+		    sprintf(err, "Error reading mouse queue, rc=%lu.\r\n", rc);
 		    break;
+		}
 		if (!mouse_activated)
 		    goto finish;
 
@@ -195,24 +202,27 @@ mouse_server(unsigned long ignored GCC_UNUSED)
 		 */
 		if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN)
 		    write_event(mouev.fs & MOUSE_BN1_DOWN,
-			mouse_buttons[1], mouev.col, mouev.row);
+				mouse_buttons[1], mouev.col, mouev.row);
 		if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN)
 		    write_event(mouev.fs & MOUSE_BN2_DOWN,
-			mouse_buttons[3], mouev.col, mouev.row);
+				mouse_buttons[3], mouev.col, mouev.row);
 		if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN)
 		    write_event(mouev.fs & MOUSE_BN3_DOWN,
-			mouse_buttons[2], mouev.col, mouev.row);
+				mouse_buttons[2], mouev.col, mouev.row);
 
 	      finish:
 		oldstate = mouev.fs;
 	    }
-	}
+	} else
+	    sprintf(err, "Error setting event mask, buttons=%d, rc=%lu.\r\n",
+		    nbuttons, rc);
 
-	DosWrite(2, errmess, strlen(errmess), &ignore);
+	DosWrite(2, err, strlen(err), &rc);
 	MouClose(hmou);
     }
     DosExit(EXIT_THREAD, 0L);
 }
+
 static void
 server_state(const int state)
 {				/* It would be nice to implement pointer-off and stop looping... */
@@ -248,8 +258,10 @@ initialize_mousetype(void)
 	&& strstr(cur_term->type.term_names, "xterm") == 0
 	&& key_mouse) {
 	int handles[2];
+
 	if (pipe(handles) < 0) {
 	    perror("mouse pipe error");
+	    return;
 	} else {
 	    int rc;
 
@@ -270,9 +282,10 @@ initialize_mousetype(void)
 	    setmode(handles[1], O_BINARY);
 	    /* Do not use CRT functions, we may single-threaded. */
 	    rc = DosCreateThread((unsigned long *) &mouse_thread,
-		mouse_server, 0, 0, 8192);
+				 mouse_server, 0, 0, 8192);
 	    if (rc) {
 		printf("mouse thread error %d=%#x", rc, rc);
+		return;
 	    } else {
 		mousetype = M_XTERM;
 		return;
@@ -359,6 +372,23 @@ _nc_mouse_event(SCREEN * sp GCC_UNUSED)
     }
 #endif
 
+#ifdef USE_EMX_MOUSE
+    if (SP->_mouse_fd >= 0
+	&& (_nc_timed_wait(3, 0, (int *) 0) & 2) != 0) {
+	char kbuf[3];
+
+	int i, res = read(M_FD(sp), &kbuf, 3);	/* Eat the prefix */
+	if (res != 3)
+	    printf("Got %d chars instead of 3 for prefix.\n", res);
+	for (i = 0; i < res; i++) {
+	    if (kbuf[i] != key_mouse[i])
+		printf("Got char %d instead of %d for prefix.\n",
+		       (int) kbuf[i], (int) key_mouse[i]);
+	}
+	return TRUE;
+    }
+#endif /* USE_EMX_MOUSE */
+
     /* xterm: never have to query, mouse events are in the keyboard stream */
     return (FALSE);		/* no event waiting */
 }
@@ -419,7 +449,7 @@ _nc_mouse_inline(SCREEN * sp)
 	kbuf[3] = '\0';
 
 	TR(TRACE_IEVENT,
-	    ("_nc_mouse_inline sees the following xterm data: '%s'", kbuf));
+	   ("_nc_mouse_inline sees the following xterm data: '%s'", kbuf));
 
 	eventp->id = 0;		/* there's only one mouse... */
 
@@ -457,8 +487,8 @@ _nc_mouse_inline(SCREEN * sp)
 	     */
 	    eventp->bstate =
 		(BUTTON1_RELEASED |
-		BUTTON2_RELEASED |
-		BUTTON3_RELEASED);
+		 BUTTON2_RELEASED |
+		 BUTTON3_RELEASED);
 	    /*
 	     * ...however, because there are no kinds of mouse events under
 	     * xterm that can intervene between press and release, we can
@@ -488,9 +518,9 @@ _nc_mouse_inline(SCREEN * sp)
 	eventp->x = (kbuf[1] - ' ') - 1;
 	eventp->y = (kbuf[2] - ' ') - 1;
 	TR(MY_TRACE,
-	    ("_nc_mouse_inline: primitive mouse-event %s has slot %ld",
-		_tracemouse(eventp),
-		(long) (eventp - events)));
+	   ("_nc_mouse_inline: primitive mouse-event %s has slot %ld",
+	    _tracemouse(eventp),
+	    (long) (eventp - events)));
 
 	/* bump the next-free pointer into the circular list */
 	eventp = NEXT(eventp);
@@ -514,7 +544,7 @@ mouse_activate(bool on)
 
 	switch (mousetype) {
 	case M_XTERM:
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
 	    keyok(KEY_MOUSE, on);
 #endif
 	    TPUTS_TRACE("xterm mouse initialization");
@@ -598,9 +628,9 @@ _nc_mouse_parse(int runcount)
      */
     if (runcount == 1) {
 	TR(MY_TRACE,
-	    ("_nc_mouse_parse: returning simple mouse event %s at slot %ld",
-		_tracemouse(prev),
-		(long) (prev - events)));
+	   ("_nc_mouse_parse: returning simple mouse event %s at slot %ld",
+	    _tracemouse(prev),
+	    (long) (prev - events)));
 	return (prev->id >= 0)
 	    ? ((prev->bstate & eventmask) ? TRUE : FALSE)
 	    : FALSE;
@@ -616,9 +646,9 @@ _nc_mouse_parse(int runcount)
     if (_nc_tracing & TRACE_IEVENT) {
 	_trace_slot("before mouse press/release merge:");
 	_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
-	    (long) (runp - events),
-	    (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
-	    runcount);
+		(long) (runp - events),
+		(long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+		runcount);
     }
 #endif /* TRACE */
 
@@ -664,9 +694,9 @@ _nc_mouse_parse(int runcount)
     if (_nc_tracing & TRACE_IEVENT) {
 	_trace_slot("before mouse click merge:");
 	_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
-	    (long) (runp - events),
-	    (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
-	    runcount);
+		(long) (runp - events),
+		(long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+		runcount);
     }
 #endif /* TRACE */
 
@@ -700,7 +730,7 @@ _nc_mouse_parse(int runcount)
 
 		/* merge click events forward */
 		if ((ep->bstate &
-			(BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))
+		     (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))
 		    && (follower->bstate &
 			(BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))) {
 		    if ((eventmask & BUTTON1_DOUBLE_CLICKED)
@@ -727,9 +757,9 @@ _nc_mouse_parse(int runcount)
 
 		/* merge double-click events forward */
 		if ((ep->bstate &
-			(BUTTON1_DOUBLE_CLICKED
-			    | BUTTON2_DOUBLE_CLICKED
-			    | BUTTON3_DOUBLE_CLICKED))
+		     (BUTTON1_DOUBLE_CLICKED
+		      | BUTTON2_DOUBLE_CLICKED
+		      | BUTTON3_DOUBLE_CLICKED))
 		    && (follower->bstate &
 			(BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))) {
 		    if ((eventmask & BUTTON1_TRIPLE_CLICKED)
@@ -761,9 +791,9 @@ _nc_mouse_parse(int runcount)
     if (_nc_tracing & TRACE_IEVENT) {
 	_trace_slot("before mouse event queue compaction:");
 	_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
-	    (long) (runp - events),
-	    (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
-	    runcount);
+		(long) (runp - events),
+		(long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+		runcount);
     }
 #endif /* TRACE */
 
@@ -779,16 +809,16 @@ _nc_mouse_parse(int runcount)
     if (_nc_tracing & TRACE_IEVENT) {
 	_trace_slot("after mouse event queue compaction:");
 	_tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
-	    (long) (runp - events),
-	    (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
-	    runcount);
+		(long) (runp - events),
+		(long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
+		runcount);
     }
     for (ep = runp; ep != eventp; ep = NEXT(ep))
 	if (ep->id != INVALID_EVENT)
 	    TR(MY_TRACE,
-		("_nc_mouse_parse: returning composite mouse event %s at slot %ld",
-		    _tracemouse(ep),
-		    (long) (ep - events)));
+	       ("_nc_mouse_parse: returning composite mouse event %s at slot %ld",
+		_tracemouse(ep),
+		(long) (ep - events)));
 #endif /* TRACE */
 
     /* after all this, do we have a valid event? */
@@ -847,8 +877,8 @@ getmouse(MEVENT * aevent)
 	*aevent = *prev;
 
 	TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
-		_tracemouse(prev),
-		(long) (prev - events)));
+			  _tracemouse(prev),
+			  (long) (prev - events)));
 
 	prev->id = INVALID_EVENT;	/* so the queue slot becomes free */
 	returnCode(OK);
@@ -888,12 +918,12 @@ mousemask(mmask_t newmask, mmask_t * oldmask)
     if (mousetype != M_NONE) {
 	eventmask = newmask &
 	    (BUTTON_ALT | BUTTON_CTRL | BUTTON_SHIFT
-	    | BUTTON1_PRESSED | BUTTON1_RELEASED | BUTTON1_CLICKED
-	    | BUTTON1_DOUBLE_CLICKED | BUTTON1_TRIPLE_CLICKED
-	    | BUTTON2_PRESSED | BUTTON2_RELEASED | BUTTON2_CLICKED
-	    | BUTTON2_DOUBLE_CLICKED | BUTTON2_TRIPLE_CLICKED
-	    | BUTTON3_PRESSED | BUTTON3_RELEASED | BUTTON3_CLICKED
-	    | BUTTON3_DOUBLE_CLICKED | BUTTON3_TRIPLE_CLICKED);
+	     | BUTTON1_PRESSED | BUTTON1_RELEASED | BUTTON1_CLICKED
+	     | BUTTON1_DOUBLE_CLICKED | BUTTON1_TRIPLE_CLICKED
+	     | BUTTON2_PRESSED | BUTTON2_RELEASED | BUTTON2_CLICKED
+	     | BUTTON2_DOUBLE_CLICKED | BUTTON2_TRIPLE_CLICKED
+	     | BUTTON3_PRESSED | BUTTON3_RELEASED | BUTTON3_CLICKED
+	     | BUTTON3_DOUBLE_CLICKED | BUTTON3_TRIPLE_CLICKED);
 
 	mouse_activate(eventmask != 0);
 
@@ -910,9 +940,9 @@ wenclose(const WINDOW *win, int y, int x)
     if (win) {
 	y -= win->_yoffset;
 	return ((win->_begy <= y &&
-		win->_begx <= x &&
-		(win->_begx + win->_maxx) >= x &&
-		(win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
+		 win->_begx <= x &&
+		 (win->_begx + win->_maxx) >= x &&
+		 (win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
     }
     return FALSE;
 }
diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c
index 08e35cf5..7da4069b 100644
--- a/ncurses/base/lib_newterm.c
+++ b/ncurses/base/lib_newterm.c
@@ -40,14 +40,14 @@
 
 #include 
 
-#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
+#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
 #endif
 
 #include 		/* clear_screen, cup & friends, cur_term */
 #include 
 
-MODULE_ID("$Id: lib_newterm.c,v 1.46 2000/07/01 22:26:22 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.48 2000/09/02 18:11:42 tom Exp $")
 
 #ifndef ONLCR			/* Allows compilation under the QNX 4.2 OS */
 #define ONLCR 0
@@ -191,17 +191,21 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp)
     SP->_use_rmso = SGR0_TEST(exit_standout_mode);
     SP->_use_rmul = SGR0_TEST(exit_underline_mode);
 
-#ifdef USE_WIDEC_SUPPORT
+#if USE_WIDEC_SUPPORT
     /*
      * XFree86 xterm can be configured to support UTF-8 based on environment
      * variable settings.
      */
     {
 	char *s;
-	if (((s = getenv("LC_ALL")) != 0
-		|| (s = getenv("LC_CTYPE")) != 0
-		|| (s = getenv("LANG")) != 0)
-	    && strstr(s, "UTF-8") != 0) {
+	s = getenv("LC_ALL");
+	if (s == NULL || *s == '\0') {
+	    s = getenv("LC_CTYPE");
+	    if (s == NULL || *s == '\0') {
+		s = getenv("LANG");
+	    }
+	}
+	if (s != NULL && *s != '\0' && strstr(s, "UTF-8") != NULL) {
 	    SP->_outch = _nc_utf8_outch;
 	}
     }
diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c
index de0182f4..831e3255 100644
--- a/ncurses/base/lib_restart.c
+++ b/ncurses/base/lib_restart.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            *
@@ -41,50 +41,51 @@
 
 #include 
 
-#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
+#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
 #endif
 
-#include 	/* lines, columns, cur_term */
+#include 		/* lines, columns, cur_term */
 
-MODULE_ID("$Id: lib_restart.c,v 1.2 1999/07/24 20:10:04 tom Exp $")
+MODULE_ID("$Id: lib_restart.c,v 1.3 2000/09/02 18:09:44 tom Exp $")
 
-int restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
+int
+restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
 {
-int saveecho = SP->_echo;
-int savecbreak = SP->_cbreak;
-int saveraw = SP->_raw;
-int savenl = SP->_nl;
+    int saveecho = SP->_echo;
+    int savecbreak = SP->_cbreak;
+    int saveraw = SP->_raw;
+    int savenl = SP->_nl;
 
-	T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret));
+    T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret));
 
-	setupterm(termp, filenum, errret);
+    setupterm(termp, filenum, errret);
 
-	if (saveecho)
-		echo();
-	else
-		noecho();
+    if (saveecho)
+	echo();
+    else
+	noecho();
 
-	if (savecbreak) {
-		cbreak();
-		noraw();
-	} else if (saveraw) {
-		nocbreak();
-		raw();
-	} else {
-		nocbreak();
-		noraw();
-	}
-	if (savenl)
-		nl();
-	else
-		nonl();
+    if (savecbreak) {
+	cbreak();
+	noraw();
+    } else if (saveraw) {
+	nocbreak();
+	raw();
+    } else {
+	nocbreak();
+	noraw();
+    }
+    if (savenl)
+	nl();
+    else
+	nonl();
 
-	reset_prog_mode();
+    reset_prog_mode();
 
 #if USE_SIZECHANGE
-	_nc_update_screensize();
+    _nc_update_screensize();
 #endif
 
-	returnCode(OK);
+    returnCode(OK);
 }
diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c
index b4d547fc..15dd6d3f 100644
--- a/ncurses/base/lib_set_term.c
+++ b/ncurses/base/lib_set_term.c
@@ -43,7 +43,7 @@
 #include 		/* cur_term */
 #include 
 
-MODULE_ID("$Id: lib_set_term.c,v 1.55 2000/07/02 00:22:18 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.58 2000/10/04 22:05:48 tom Exp $")
 
 SCREEN *
 set_term(SCREEN * screenp)
@@ -171,7 +171,7 @@ no_mouse_wrap(SCREEN * sp GCC_UNUSED)
 {
 }
 
-#if defined(NCURSES_EXT_FUNCS) && defined(USE_COLORFGBG)
+#if NCURSES_EXT_FUNCS && USE_COLORFGBG
 static char *
 extract_fgbg(char *src, int *result)
 {
@@ -220,17 +220,45 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output)
     SP->_endwin = TRUE;
     SP->_ofp = output;
     SP->_cursor = -1;		/* cannot know real cursor shape */
-#ifdef NCURSES_NO_PADDING
+
+#if NCURSES_NO_PADDING
     SP->_no_padding = getenv("NCURSES_NO_PADDING") != 0;
     TR(TRACE_CHARPUT | TRACE_MOVE, ("padding will%s be used",
 	    SP->_no_padding ? " not" : ""));
 #endif
-#ifdef NCURSES_EXT_FUNCS
+
+#if NCURSES_EXT_FUNCS
     SP->_default_color = FALSE;
     SP->_has_sgr_39_49 = FALSE;
+
+    /*
+     * Set our assumption of the terminal's default foreground and background
+     * colors.  The curs_color man-page states that we can assume that the
+     * background is black.  The origin of this assumption appears to be
+     * terminals that displayed colored text, but no colored backgrounds, e.g.,
+     * the first colored terminals around 1980.  More recent ones with better
+     * technology can display not only colored backgrounds, but all
+     * combinations.  So a terminal might be something other than "white" on
+     * black (green/black looks monochrome too), but black on white or even
+     * on ivory.
+     *
+     * White-on-black is the simplest thing to use for monochrome.  Almost
+     * all applications that use color paint both text and background, so
+     * the distinction is moot.  But a few do not - which is why we leave this
+     * configurable (a better solution is to use assume_default_colors() for
+     * the rare applications that do require that sort of appearance, since
+     * is appears that more users expect to be able to make a white-on-black
+     * or black-on-white display under control of the application than not).
+     */
+#ifdef USE_ASSUMED_COLOR
     SP->_default_fg = COLOR_WHITE;
     SP->_default_bg = COLOR_BLACK;
-#ifdef USE_COLORFGBG
+#else
+    SP->_default_fg = C_MASK;
+    SP->_default_bg = C_MASK;
+#endif
+
+#if USE_COLORFGBG
     /*
      * If rxvt's $COLORFGBG variable is set, use it to specify the assumed
      * default colors.  Note that rxvt (mis)uses bold colors, equating a bold
diff --git a/ncurses/base/lib_winch.c b/ncurses/base/lib_winch.c
index 119c731e..76522079 100644
--- a/ncurses/base/lib_winch.c
+++ b/ncurses/base/lib_winch.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            *
@@ -39,14 +39,15 @@
 
 #include 
 
-MODULE_ID("$Id: lib_winch.c,v 1.1 1998/11/14 22:06:09 tom Exp $")
+MODULE_ID("$Id: lib_winch.c,v 1.2 2000/07/29 16:41:44 tom Exp $")
 
-chtype winch(WINDOW *win)
+chtype
+winch(WINDOW *win)
 {
-	T((T_CALLED("winch(%p)"), win));
-	if (win != 0) {
-		returnCode(win->_line[win->_cury].text[win->_curx]);
-	} else {
-		returnCode(0);
-	}
+    T((T_CALLED("winch(%p)"), win));
+    if (win != 0) {
+	returnChar(win->_line[win->_cury].text[win->_curx]);
+    } else {
+	returnChar(0);
+    }
 }
diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h
index d3d5f296..d82e3aad 100644
--- a/ncurses/curses.priv.h
+++ b/ncurses/curses.priv.h
@@ -33,7 +33,7 @@
 
 
 /*
- * $Id: curses.priv.h,v 1.162 2000/06/24 21:06:10 tom Exp $
+ * $Id: curses.priv.h,v 1.168 2000/10/08 01:24:59 tom Exp $
  *
  *	curses.priv.h
  *
@@ -99,7 +99,7 @@ extern int errno;
 /* Some systems have a broken 'select()', but workable 'poll()'.  Use that */
 #if HAVE_WORKING_POLL
 #define USE_FUNC_POLL 1
-#ifdef HAVE_POLL_H
+#if HAVE_POLL_H
 #include 
 #else
 #include 
@@ -134,7 +134,7 @@ extern int errno;
  * If we don't have signals to support it, don't add a sigwinch handler.
  * In any case, resizing is an extended feature.  Use it if we've got it.
  */
-#ifndef NCURSES_EXT_FUNCS
+#if !NCURSES_EXT_FUNCS
 #undef HAVE_SIZECHANGE
 #endif
 
@@ -144,6 +144,17 @@ extern int errno;
 #undef USE_SIGWINCH
 #endif
 
+/*
+ * If desired, one can configure this, disabling environment variables that
+ * point to custom terminfo/termcap locations.
+ */
+#ifdef USE_ROOT_ENVIRON
+#define use_terminfo_vars() 1
+#else
+#define use_terminfo_vars() _nc_env_access()
+extern int _nc_env_access(void);
+#endif
+
 /*
  * Not all platforms have memmove; some have an equivalent bcopy.  (Some may
  * have neither).
@@ -288,7 +299,7 @@ struct screen {
 	SLK             *_slk;          /* ptr to soft key struct / NULL    */
         int             slk_format;     /* selected format for this screen  */
 	/* cursor movement costs; units are 10ths of milliseconds */
-#ifdef NCURSES_NO_PADDING
+#if NCURSES_NO_PADDING
 	int             _no_padding;    /* flag to set if padding disabled  */
 #endif
 	int             _char_padding;  /* cost of character put            */
@@ -329,9 +340,7 @@ struct screen {
 	int             _ip_cost;       /* cost of (insert_padding)         */
 	/* used in lib_mvcur.c */
 	char *          _address_cursor;
-	int             _carriage_return_length;
-	int             _cursor_home_length;
-	int             _cursor_to_ll_length;
+	/* used in tty_update.c */
 	int             _scrolling;     /* 1 if terminal's smart enough to  */
 
 	/* used in lib_color.c */
@@ -339,7 +348,7 @@ struct screen {
 	int             _color_count;   /* count of colors in palette        */
 	unsigned short  *_color_pairs;  /* screen's color pair list          */
 	int             _pair_count;    /* count of color pairs              */
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
 	bool            _default_color; /* use default colors                */
 	bool            _has_sgr_39_49; /* has ECMA default color support    */
 	int             _default_fg;    /* assumed default foreground        */
@@ -407,7 +416,7 @@ struct screen {
 
 extern SCREEN *_nc_screen_chain;
 
-#ifdef NCURSES_NOMACROS
+#if NCURSES_NOMACROS
 #include 
 #endif
 
@@ -530,12 +539,14 @@ typedef	struct {
 #define TPUTS_TRACE(s)	_nc_tputs_trace = s;
 #define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
 #define returnAttr(code) TRACE_RETURN(code,attr_t)
+#define returnChar(code) TRACE_RETURN(code,chtype)
 #define returnCode(code) TRACE_RETURN(code,int)
 #define returnPtr(code)  TRACE_RETURN(code,ptr)
 #define returnVoid       T((T_RETURN(""))); return
 #define returnWin(code)  TRACE_RETURN(code,win)
 extern WINDOW * _nc_retrace_win(WINDOW *);
 extern attr_t _nc_retrace_attr_t(attr_t);
+extern attr_t _nc_retrace_chtype(chtype);
 extern char *_nc_retrace_ptr(char *);
 extern const char *_nc_tputs_trace;
 extern int _nc_retrace_int(int);
@@ -546,6 +557,7 @@ extern void _nc_fifo_dump(void);
 #define TR(n, a)
 #define TPUTS_TRACE(s)
 #define returnAttr(code) return code
+#define returnChar(code) return code
 #define returnCode(code) return code
 #define returnPtr(code)  return code
 #define returnVoid       return
@@ -568,7 +580,7 @@ extern const char *_nc_visbuf2(int, const char *);
       (S) = ((S) & ALL_BUT_COLOR) | (at);\
    else\
       (S) |= (at);\
-   T(("new attribute is %s", _traceattr((S))));}
+   TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
 
 
 #define toggle_attr_off(S,at) {\
@@ -583,7 +595,7 @@ extern const char *_nc_visbuf2(int, const char *);
       else /* leave color alone */\
 	 (S) &= ~(at);\
    }\
-   T(("new attribute is %s", _traceattr((S))));}
+   TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
 
 #define DelCharCost(count) \
 		((parm_dch != 0) \
@@ -607,7 +619,8 @@ extern const char *_nc_visbuf2(int, const char *);
 				vidattr(AttrOf(c)); \
 				if (magic_cookie_glitch > 0 \
 				 && XMC_CHANGES((chg ^ SP->_current_attr))) { \
-					T(("%s @%d before glitch %d,%d", \
+					TR(TRACE_ATTRS, \
+						("%s @%d before glitch %d,%d", \
 						__FILE__, __LINE__, \
 						SP->_cursrow, \
 						SP->_curscol)); \
@@ -619,7 +632,7 @@ extern const char *_nc_visbuf2(int, const char *);
 				vidattr(AttrOf(c))
 #endif
 
-#if defined(NCURSES_EXPANDED) && defined(NCURSES_EXT_FUNCS)
+#if NCURSES_EXPANDED && NCURSES_EXT_FUNCS
 
 #undef  toggle_attr_on
 #define toggle_attr_on(S,at) _nc_toggle_attr_on(&(S), at)
@@ -678,14 +691,40 @@ extern void _nc_screen_init(void);
 extern void _nc_screen_resume(void);
 extern void _nc_screen_wrap(void);
 
+/* lib_mouse.c */
+extern int _nc_has_mouse(void);
+
+/* lib_mvcur.c */
+#define INFINITY	1000000	/* cost: too high to use */
+
+typedef struct {
+    char *s_head;
+    char *s_tail;
+    size_t s_size;
+} string_desc;
+
+/* strings.c */
+extern string_desc *_nc_str_init(string_desc * dst, char *src, size_t len);
+extern string_desc *_nc_str_null(string_desc * dst, size_t len);
+extern string_desc *_nc_str_copy(string_desc * dst, string_desc * src);
+extern bool _nc_safe_strcat(string_desc * dst, const char *src);
+extern bool _nc_safe_strcpy(string_desc * dst, const char *src);
+
+extern void _nc_mvcur_init(void);
+extern void _nc_mvcur_resume(void);
+extern void _nc_mvcur_wrap(void);
+
+extern int _nc_scrolln(int, int, int, int);
+
+extern void _nc_screen_init(void);
+extern void _nc_screen_resume(void);
+extern void _nc_screen_wrap(void);
+
 #if !HAVE_STRSTR
 #define strstr _nc_strstr
 extern char *_nc_strstr(const char *, const char *);
 #endif
 
-/* lib_mouse.c */
-extern int _nc_has_mouse(void);
-
 /* safe_sprintf.c */
 extern char * _nc_printf_string(const char *fmt, va_list ap);
 
@@ -731,7 +770,7 @@ extern void _nc_trace_tries(struct tries *tree);
 extern void _nc_update_screensize(void);
 #endif
 
-#ifdef USE_WIDEC_SUPPORT
+#if USE_WIDEC_SUPPORT
 extern int _nc_utf8_outch(int);
 #endif
 
@@ -750,10 +789,6 @@ extern int *_nc_oldnums;
  * On systems with a broken linker, define 'SP' as a function to force the
  * linker to pull in the data-only module with 'SP'.
  */
-#ifndef BROKEN_LINKER
-#define BROKEN_LINKER 0
-#endif
-
 #if BROKEN_LINKER
 #define SP _nc_screen()
 extern SCREEN *_nc_screen(void);
diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses
index 82f3e06f..280325ac 100644
--- a/ncurses/llib-lncurses
+++ b/ncurses/llib-lncurses
@@ -1728,6 +1728,11 @@ char	*_tracechtype(
 		chtype	ch)
 		{ return(*(char **)0); }
 
+#undef _nc_retrace_chtype
+attr_t	_nc_retrace_chtype(
+		attr_t	code)
+		{ return(*(attr_t *)0); }
+
 /* ./trace/lib_tracedmp.c */
 
 #undef _tracedump
@@ -1949,11 +1954,6 @@ void	_nc_toggle_attr_off(
 		attr_t	at)
 		{ /* void */ }
 
-#undef _nc_can_clear_with
-int	_nc_can_clear_with(
-		chtype	ch)
-		{ return(*(int *)0); }
-
 #undef _nc_DelCharCost
 int	_nc_DelCharCost(
 		int	count)
@@ -2067,12 +2067,21 @@ int	wresize(
 
 /* ./tinfo/access.c */
 
+#undef _nc_basename
+char	*_nc_basename(
+		char	*path)
+		{ return(*(char **)0); }
+
 #undef _nc_access
 int	_nc_access(
 		const char *path, 
 		int	mode)
 		{ return(*(int *)0); }
 
+#undef _nc_env_access
+int	_nc_env_access(void)
+		{ return(*(int *)0); }
+
 /* ./tinfo/add_tries.c */
 
 #undef _nc_add_to_try
@@ -2391,8 +2400,8 @@ void	_nc_init_acs(void)
 #include 
 
 struct speed {
-	speed_t s;
-	int sp;
+    int s;	
+    int sp;	
 };
 
 #undef _nc_baudrate
@@ -2654,6 +2663,14 @@ char	*tgetstr(
 		char	**area)
 		{ return(*(char **)0); }
 
+/* ./tinfo/lib_termname.c */
+
+#undef termname
+char	*termname(void)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_tgoto.c */
+
 #undef tgoto
 char	*tgoto(
 		const char *string, 
@@ -2661,12 +2678,6 @@ char	*tgoto(
 		int	y)
 		{ return(*(char **)0); }
 
-/* ./tinfo/lib_termname.c */
-
-#undef termname
-char	*termname(void)
-		{ return(*(char **)0); }
-
 /* ./tinfo/lib_ti.c */
 
 #undef tigetflag
@@ -2686,9 +2697,12 @@ char	*tigetstr(
 
 /* ./tinfo/lib_tparm.c */
 
-typedef union {
-	unsigned int	num;
-	char	       *str;
+typedef struct {
+    union {
+	unsigned int num;
+	char *str;
+    } data;
+    bool num_type;
 } stack_frame;
 
 #undef tparm
@@ -2702,7 +2716,7 @@ char	*tparm(
 #undef PC
 char	PC;
 #undef ospeed
-speed_t	ospeed;
+short	ospeed;
 #undef _nc_nulls_sent
 int	_nc_nulls_sent;
 
@@ -2930,6 +2944,39 @@ void	_nc_set_buffer(
 		bool	buffered)
 		{ /* void */ }
 
+/* ./tinfo/strings.c */
+
+#undef _nc_str_init
+string_desc *_nc_str_init(
+		string_desc *dst, 
+		char	*src, 
+		size_t	len)
+		{ return(*(string_desc **)0); }
+
+#undef _nc_str_null
+string_desc *_nc_str_null(
+		string_desc *dst, 
+		size_t	len)
+		{ return(*(string_desc **)0); }
+
+#undef _nc_str_copy
+string_desc *_nc_str_copy(
+		string_desc *dst, 
+		string_desc *src)
+		{ return(*(string_desc **)0); }
+
+#undef _nc_safe_strcat
+bool	_nc_safe_strcat(
+		string_desc *dst, 
+		const char *src)
+		{ return(*(bool *)0); }
+
+#undef _nc_safe_strcpy
+bool	_nc_safe_strcpy(
+		string_desc *dst, 
+		const char *src)
+		{ return(*(bool *)0); }
+
 /* ./trace/trace_buf.c */
 
 typedef struct {
diff --git a/ncurses/modules b/ncurses/modules
index 12ed6a5f..eb84a07e 100644
--- a/ncurses/modules
+++ b/ncurses/modules
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.72 2000/02/13 01:03:28 tom Exp $
+# $Id: modules,v 1.74 2000/10/03 08:51:18 tom Exp $
 ##############################################################################
 # Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -167,6 +167,7 @@ lib_raw 	lib		$(tinfo)	../include/term.h
 lib_setup	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h
 lib_termcap	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h $(INCDIR)/capdefaults.c
 lib_termname	lib		$(tinfo)	$(INCDIR)/tic.h
+lib_tgoto	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
 lib_ti		lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
 lib_tparm	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
 lib_tputs	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
@@ -181,6 +182,7 @@ parse_entry	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic
 read_entry	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
 read_termcap	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
 setbuf		lib		$(tinfo)
+strings		lib		$(tinfo)
 trace_buf	lib		$(trace)
 trace_tries	lib		$(trace)
 unctrl		lib		.
diff --git a/ncurses/tinfo/access.c b/ncurses/tinfo/access.c
index 54e54949..6fbe9217 100644
--- a/ncurses/tinfo/access.c
+++ b/ncurses/tinfo/access.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            *
@@ -27,29 +27,68 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey  1998                        *
+ *  Author: Thomas E. Dickey  1998,2000                   *
  ****************************************************************************/
 
-
 #include 
+#include 
 
-MODULE_ID("$Id: access.c,v 1.1 1998/07/25 20:17:09 tom Exp $")
+MODULE_ID("$Id: access.c,v 1.4 2000/10/08 01:25:06 tom Exp $")
 
-int _nc_access(const char *path, int mode)
+char *
+_nc_basename(char *path)
 {
-	if (access(path, mode) < 0) {
-		if ((mode & W_OK) != 0
-		 && errno == ENOENT) {
-			char head[PATH_MAX];
-			char *leaf = strrchr(strcpy(head, path), '/');
-			if (leaf == 0)
-				leaf = head;
-			*leaf = '\0';
-			if (head == leaf)
-				(void)strcpy(head, ".");
-			return access(head, R_OK|W_OK|X_OK);
-		}
-		return -1;
+    char *result = strrchr(path, '/');
+#ifdef __EMX__
+    if (result == 0)
+	result = strrchr(path, '\\');
+#endif
+    if (result == 0)
+	result = path;
+    else
+	result++;
+    return result;
+}
+
+int
+_nc_access(const char *path, int mode)
+{
+    if (access(path, mode) < 0) {
+	if ((mode & W_OK) != 0
+	    && errno == ENOENT
+	    && strlen(path) < PATH_MAX) {
+	    char head[PATH_MAX];
+	    char *leaf = _nc_basename(strcpy(head, path));
+
+	    if (leaf == 0)
+		leaf = head;
+	    *leaf = '\0';
+	    if (head == leaf)
+		(void) strcpy(head, ".");
+
+	    return access(head, R_OK | W_OK | X_OK);
 	}
-	return 0;
+	return -1;
+    }
+    return 0;
+}
+
+#ifndef USE_ROOT_ENVIRON
+/*
+ * Returns true if we allow application to use environment variables that are
+ * used for searching lists of directories, etc.
+ */
+int
+_nc_env_access(void)
+{
+#if HAVE_ISSETUGID
+    if (issetugid())
+	return FALSE;
+#elif HAVE_GETEUID && HAVE_GETEGID
+    if (getuid() != geteuid()
+     || getgid() != getegid())
+	return FALSE;
+#endif
+    return getuid() != 0;	/* ...finally, disallow root */
 }
+#endif
diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c
index 660381a3..eac7c80f 100644
--- a/ncurses/tinfo/alloc_ttype.c
+++ b/ncurses/tinfo/alloc_ttype.c
@@ -43,7 +43,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: alloc_ttype.c,v 1.8 2000/03/25 17:03:11 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.10 2000/08/12 21:56:24 tom Exp $")
 
 #if NCURSES_XNAMES
 /*
@@ -54,7 +54,7 @@ static int
 merge_names(char **dst, char **a, int na, char **b, int nb)
 {
     int n = 0;
-    while (na && nb) {
+    while (na > 0 && nb > 0) {
 	int cmp = strcmp(*a, *b);
 	if (cmp < 0) {
 	    dst[n++] = *a++;
@@ -93,7 +93,7 @@ find_name(char **table, int length, char *name)
 
 static void
 realign_data(TERMTYPE * to, char **ext_Names, int ext_Booleans, int
-    ext_Numbers, int ext_Strings)
+	     ext_Numbers, int ext_Strings)
 {
     int n, m, base;
     int limit = (to->ext_Booleans + to->ext_Numbers + to->ext_Strings);
@@ -102,8 +102,8 @@ realign_data(TERMTYPE * to, char **ext_Names, int ext_Booleans, int
 	to->num_Booleans += (ext_Booleans - to->ext_Booleans);
 	to->Booleans = typeRealloc(char, to->num_Booleans, to->Booleans);
 	for (n = to->ext_Booleans - 1,
-	    m = ext_Booleans - 1,
-	    base = to->num_Booleans - (m + 1); m >= 0; m--) {
+	     m = ext_Booleans - 1,
+	     base = to->num_Booleans - (m + 1); m >= 0; m--) {
 	    if (find_name(to->ext_Names, limit, ext_Names[m])) {
 		to->Booleans[base + m] = to->Booleans[base + n--];
 	    } else {
@@ -116,8 +116,8 @@ realign_data(TERMTYPE * to, char **ext_Names, int ext_Booleans, int
 	to->num_Numbers += (ext_Numbers - to->ext_Numbers);
 	to->Numbers = typeRealloc(short, to->num_Numbers, to->Numbers);
 	for (n = to->ext_Numbers - 1,
-	    m = ext_Numbers - 1,
-	    base = to->num_Numbers - (m + 1); m >= 0; m--) {
+	     m = ext_Numbers - 1,
+	     base = to->num_Numbers - (m + 1); m >= 0; m--) {
 	    if (find_name(to->ext_Names, limit, ext_Names[m + ext_Booleans])) {
 		to->Numbers[base + m] = to->Numbers[base + n--];
 	    } else {
@@ -130,8 +130,8 @@ realign_data(TERMTYPE * to, char **ext_Names, int ext_Booleans, int
 	to->num_Strings += (ext_Strings - to->ext_Strings);
 	to->Strings = typeRealloc(char *, to->num_Strings, to->Strings);
 	for (n = to->ext_Strings - 1,
-	    m = ext_Strings - 1,
-	    base = to->num_Strings - (m + 1); m >= 0; m--) {
+	     m = ext_Strings - 1,
+	     base = to->num_Strings - (m + 1); m >= 0; m--) {
 	    if (find_name(to->ext_Names, limit, ext_Names[m + ext_Booleans + ext_Numbers])) {
 		to->Strings[base + m] = to->Strings[base + n--];
 	    } else {
@@ -235,7 +235,7 @@ _nc_ext_data_index(TERMTYPE * tp, int n, int token_type)
  * Adjust tables to remove (not free) an extended name and its corresponding
  * data.
  */
-static void
+static bool
 _nc_del_ext_name(TERMTYPE * tp, char *name, int token_type)
 {
     int j;
@@ -270,7 +270,9 @@ _nc_del_ext_name(TERMTYPE * tp, char *name, int token_type)
 	    tp->num_Strings -= 1;
 	    break;
 	}
+	return TRUE;
     }
+    return FALSE;
 }
 
 /*
@@ -345,14 +347,22 @@ adjust_cancels(TERMTYPE * to, TERMTYPE * from)
 
 	if (to->Strings[j + j_str] == CANCELLED_STRING) {
 	    if ((k = _nc_find_ext_name(from, to->ext_Names[j], BOOLEAN)) >= 0) {
-		_nc_del_ext_name(to, name, STRING);
-		k = _nc_ins_ext_name(to, name, BOOLEAN);
-		to->Booleans[k] = FALSE;
+		if (_nc_del_ext_name(to, name, STRING)
+		    || _nc_del_ext_name(to, name, NUMBER)) {
+		    k = _nc_ins_ext_name(to, name, BOOLEAN);
+		    to->Booleans[k] = FALSE;
+		} else {
+		    j++;
+		}
 	    } else if ((k = _nc_find_ext_name(from, to->ext_Names[j],
-		NUMBER)) >= 0) {
-		_nc_del_ext_name(to, name, STRING);
-		k = _nc_ins_ext_name(to, name, NUMBER);
-		to->Numbers[k] = CANCELLED_NUMERIC;
+					      NUMBER)) >= 0) {
+		if (_nc_del_ext_name(to, name, STRING)
+		    || _nc_del_ext_name(to, name, BOOLEAN)) {
+		    k = _nc_ins_ext_name(to, name, NUMBER);
+		    to->Numbers[k] = CANCELLED_NUMERIC;
+		} else {
+		    j++;
+		}
 	    }
 	} else {
 	    j++;
@@ -371,7 +381,7 @@ _nc_align_termtype(TERMTYPE * to, TERMTYPE * from)
     int ext_Booleans, ext_Numbers, ext_Strings;
 
     DEBUG(2, ("align_termtype to(%d:%s), from(%d:%s)", na, to->term_names,
-	    nb, from->term_names));
+	      nb, from->term_names));
 
     if (na != 0 || nb != 0) {
 	if ((na == nb)		/* check if the arrays are equivalent */
@@ -402,26 +412,26 @@ _nc_align_termtype(TERMTYPE * to, TERMTYPE * from)
 	    adjust_cancels(from, to);
 
 	ext_Booleans = merge_names(ext_Names,
-	    to->ext_Names,
-	    to->ext_Booleans,
-	    from->ext_Names,
-	    from->ext_Booleans);
+				   to->ext_Names,
+				   to->ext_Booleans,
+				   from->ext_Names,
+				   from->ext_Booleans);
 	ext_Numbers = merge_names(ext_Names + ext_Booleans,
-	    to->ext_Names
-	    + to->ext_Booleans,
-	    to->ext_Numbers,
-	    from->ext_Names
-	    + from->ext_Booleans,
-	    from->ext_Numbers);
+				  to->ext_Names
+				  + to->ext_Booleans,
+				  to->ext_Numbers,
+				  from->ext_Names
+				  + from->ext_Booleans,
+				  from->ext_Numbers);
 	ext_Strings = merge_names(ext_Names + ext_Numbers + ext_Booleans,
-	    to->ext_Names
-	    + to->ext_Booleans
-	    + to->ext_Numbers,
-	    to->ext_Strings,
-	    from->ext_Names
-	    + from->ext_Booleans
-	    + from->ext_Numbers,
-	    from->ext_Strings);
+				  to->ext_Names
+				  + to->ext_Booleans
+				  + to->ext_Numbers,
+				  to->ext_Strings,
+				  from->ext_Names
+				  + from->ext_Booleans
+				  + from->ext_Numbers,
+				  from->ext_Strings);
 	/*
 	 * Now we must reallocate the Booleans, etc., to allow the data to be
 	 * overlaid.
@@ -431,7 +441,7 @@ _nc_align_termtype(TERMTYPE * to, TERMTYPE * from)
 	    FreeIfNeeded(to->ext_Names);
 	    to->ext_Names = ext_Names;
 	    DEBUG(2, ("realigned %d extended names for '%s' (to)",
-		    NUM_EXT_NAMES(to), to->term_names));
+		      NUM_EXT_NAMES(to), to->term_names));
 	}
 	if (nb != (ext_Booleans + ext_Numbers + ext_Strings)) {
 	    nb = (ext_Booleans + ext_Numbers + ext_Strings);
@@ -439,7 +449,7 @@ _nc_align_termtype(TERMTYPE * to, TERMTYPE * from)
 	    from->ext_Names = typeRealloc(char *, nb, from->ext_Names);
 	    memcpy(from->ext_Names, ext_Names, sizeof(char *) * nb);
 	    DEBUG(2, ("realigned %d extended names for '%s' (from)",
-		    NUM_EXT_NAMES(from), from->term_names));
+		      NUM_EXT_NAMES(from), from->term_names));
 	}
     }
 }
diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c
index ca58bb57..ecb2f583 100644
--- a/ncurses/tinfo/comp_parse.c
+++ b/ncurses/tinfo/comp_parse.c
@@ -52,7 +52,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: comp_parse.c,v 1.40 2000/04/15 16:57:08 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.42 2000/10/14 17:50:45 Bernhard.Rosenkraenzer Exp $")
 
 static void sanity_check(TERMTYPE *);
 void (*_nc_check_termtype) (TERMTYPE *) = sanity_check;
@@ -122,26 +122,29 @@ _nc_free_entries(ENTRY * headp)
     }
 }
 
+static char *
+force_bar(char *dst, char *src)
+{
+    if (strchr(src, '|') == 0) {
+	size_t len = strlen(src);
+	if (len > MAX_NAME_SIZE)
+	    len = MAX_NAME_SIZE;
+	(void) strncpy(dst, src, len);
+	(void) strcpy(dst + len, "|");
+	src = dst;
+    }
+    return src;
+}
+
 bool
 _nc_entry_match(char *n1, char *n2)
 /* do any of the aliases in a pair of terminal names match? */
 {
     char *pstart, *qstart, *pend, *qend;
-    char nc1[MAX_NAME_SIZE + 1], nc2[MAX_NAME_SIZE + 1];
+    char nc1[MAX_NAME_SIZE + 2], nc2[MAX_NAME_SIZE + 2];
 
-    if (strchr(n1, '|') == 0) {
-	(void) strncpy(nc1, n1, sizeof(nc1) - 2);
-	nc1[sizeof(nc1) - 2] = '\0';
-	(void) strcat(nc1, "|");
-	n1 = nc1;
-    }
-
-    if (strchr(n2, '|') == 0) {
-	(void) strncpy(nc2, n2, sizeof(nc2) - 2);
-	nc2[sizeof(nc2) - 2] = '\0';
-	(void) strcat(nc2, "|");
-	n2 = nc2;
-    }
+    n1 = force_bar(nc1, n1);
+    n2 = force_bar(nc2, n2);
 
     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1)
 	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1)
diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c
index 56ba1d1a..e1118f6f 100644
--- a/ncurses/tinfo/comp_scan.c
+++ b/ncurses/tinfo/comp_scan.c
@@ -50,7 +50,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: comp_scan.c,v 1.45 2000/07/08 00:43:55 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.47 2000/09/24 01:15:17 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -80,8 +80,8 @@ static char separator;		/* capability separator */
 static int pushtype;		/* type of pushback token */
 static char pushname[MAX_NAME_SIZE + 1];
 
-#ifdef NCURSES_EXT_FUNCS
-bool _nc_disable_period = FALSE; /* used by tic -a option */
+#if NCURSES_EXT_FUNCS
+bool _nc_disable_period = FALSE;	/* used by tic -a option */
 #endif
 
 static int last_char(void);
@@ -153,7 +153,7 @@ _nc_get_token(void)
 
 	_nc_set_type(pushname);
 	DEBUG(3, ("pushed-back token: `%s', class %d",
-		_nc_curr_token.tk_name, pushtype));
+		  _nc_curr_token.tk_name, pushtype));
 
 	pushtype = NO_PUSHBACK;
 	pushname[0] = '\0';
@@ -180,10 +180,10 @@ _nc_get_token(void)
 	    ch = next_char();
 
 	if (ch == '.'
-#ifdef NCURSES_EXT_FUNCS
-	 && !_nc_disable_period
+#if NCURSES_EXT_FUNCS
+	    && !_nc_disable_period
 #endif
-	) {
+	    ) {
 	    dot_flag = TRUE;
 	    DEBUG(8, ("dot-flag set"));
 
@@ -198,12 +198,12 @@ _nc_get_token(void)
 
 	/* have to make some punctuation chars legal for terminfo */
 	if (!isalnum(ch)
-#ifdef NCURSES_EXT_FUNCS
-	 && !(ch == '.' && _nc_disable_period)
+#if NCURSES_EXT_FUNCS
+	    && !(ch == '.' && _nc_disable_period)
 #endif
-	 && !strchr(terminfo_punct, (char) ch)) {
+	    && !strchr(terminfo_punct, (char) ch)) {
 	    _nc_warning("Illegal character (expected alphanumeric or %s) - %s",
-		terminfo_punct, unctrl(ch));
+			terminfo_punct, unctrl(ch));
 	    _nc_panic_mode(separator);
 	    goto start_token;
 	}
@@ -338,7 +338,7 @@ _nc_get_token(void)
 	    case '@':
 		if ((ch = next_char()) != separator)
 		    _nc_warning("Missing separator after `%s', have %s",
-			buffer, unctrl(ch));
+				buffer, unctrl(ch));
 		_nc_curr_token.tk_name = buffer;
 		type = CANCEL;
 		break;
@@ -391,30 +391,30 @@ _nc_get_token(void)
 	switch (type) {
 	case BOOLEAN:
 	    _tracef("Token: Boolean; name='%s'",
-		_nc_curr_token.tk_name);
+		    _nc_curr_token.tk_name);
 	    break;
 
 	case NUMBER:
 	    _tracef("Token: Number;  name='%s', value=%d",
-		_nc_curr_token.tk_name,
-		_nc_curr_token.tk_valnumber);
+		    _nc_curr_token.tk_name,
+		    _nc_curr_token.tk_valnumber);
 	    break;
 
 	case STRING:
 	    _tracef("Token: String;  name='%s', value=%s",
-		_nc_curr_token.tk_name,
-		_nc_visbuf(_nc_curr_token.tk_valstring));
+		    _nc_curr_token.tk_name,
+		    _nc_visbuf(_nc_curr_token.tk_valstring));
 	    break;
 
 	case CANCEL:
 	    _tracef("Token: Cancel; name='%s'",
-		_nc_curr_token.tk_name);
+		    _nc_curr_token.tk_name);
 	    break;
 
 	case NAMES:
 
 	    _tracef("Token: Names; value='%s'",
-		_nc_curr_token.tk_name);
+		    _nc_curr_token.tk_name);
 	    break;
 
 	case EOF:
@@ -571,7 +571,7 @@ _nc_trans_string(char *ptr, char *last)
 
 		default:
 		    _nc_warning("Illegal character %s in \\ sequence",
-			unctrl(ch));
+				unctrl(ch));
 		    *(ptr++) = (char) ch;
 		}		/* endswitch (ch) */
 	    }			/* endelse (ch < '0' ||  ch > '7') */
@@ -621,7 +621,7 @@ _nc_push_token(int tokclass)
     _nc_get_type(pushname);
 
     DEBUG(3, ("pushing token: `%s', class %d",
-	    _nc_curr_token.tk_name, pushtype));
+	      _nc_curr_token.tk_name, pushtype));
 }
 
 /*
@@ -736,7 +736,7 @@ next_char(void)
 	} while
 	    (bufstart != NULL && line[0] == '#');
 
-	if (bufstart == NULL)
+	if (bufstart == NULL || *bufstart == 0)
 	    return (EOF);
 
 	while (iswhite(*bufptr))
@@ -749,10 +749,19 @@ next_char(void)
 	if ((len = strlen(bufptr)) > 1) {
 	    if (bufptr[len - 1] == '\n'
 		&& bufptr[len - 2] == '\r') {
-		bufptr[len - 2] = '\n';
-		bufptr[len - 1] = '\0';
+		len--;
+		bufptr[len - 1] = '\n';
+		bufptr[len] = '\0';
 	    }
 	}
+
+	/*
+	 * If we don't have a trailing newline, it's because the line is simply
+	 * too long.  Give up.  (FIXME:  We could instead reallocate the line
+	 * buffer and allow arbitrary-length lines).
+	 */
+	if (len == 0 || (bufptr[len - 1] != '\n'))
+	    return (EOF);
     }
 
     first_column = (bufptr == bufstart);
@@ -782,7 +791,7 @@ end_of_stream(void)
 /* are we at end of input? */
 {
     return ((yyin ? feof(yyin) : (bufptr && *bufptr == '\0'))
-	? TRUE : FALSE);
+	    ? TRUE : FALSE);
 }
 
 /* comp_scan.c ends here */
diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c
index 7aa4ca11..69b8a96f 100644
--- a/ncurses/tinfo/home_terminfo.c
+++ b/ncurses/tinfo/home_terminfo.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            *
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey  1998                        *
+ *  Author: Thomas E. Dickey  1998,2000                   *
  ****************************************************************************/
 
 /*
@@ -37,7 +37,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: home_terminfo.c,v 1.2 1999/02/27 19:58:46 tom Exp $")
+MODULE_ID("$Id: home_terminfo.c,v 1.3 2000/10/04 02:31:53 tom Exp $");
 
 #define my_length (strlen(home) + sizeof(PRIVATE_INFO))
 
@@ -46,17 +46,20 @@ MODULE_ID("$Id: home_terminfo.c,v 1.2 1999/02/27 19:58:46 tom Exp $")
 char *
 _nc_home_terminfo(void)
 {
-	char *home;
-	static char *temp = 0;
+    char *home;
+    static char *temp = 0;
 
+    if (use_terminfo_vars()) {
 	if (temp == 0) {
-		if ((home = getenv("HOME")) != 0
-		 && my_length <= PATH_MAX) {
-			temp = typeMalloc(char, my_length);
-			if (temp == 0)
-				_nc_err_abort("Out of memory");
-			(void) sprintf(temp, PRIVATE_INFO, home);
-		}
+	    if ((home = getenv("HOME")) != 0
+		&& my_length <= PATH_MAX) {
+		temp = typeMalloc(char, my_length);
+		if (temp == 0)
+		    _nc_err_abort("Out of memory");
+		(void) sprintf(temp, PRIVATE_INFO, home);
+	    }
 	}
 	return temp;
+    }
+    return 0;
 }
diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c
index 4077ba38..0d7fa27b 100644
--- a/ncurses/tinfo/lib_baudrate.c
+++ b/ncurses/tinfo/lib_baudrate.c
@@ -31,17 +31,16 @@
  *     and: Eric S. Raymond                          *
  ****************************************************************************/
 
-
 /*
  *	lib_baudrate.c
  *
  */
 
 #include 
-#include 	/* cur_term, pad_char */
-#include 	/* ospeed */
+#include 		/* cur_term, pad_char */
+#include 		/* ospeed */
 
-MODULE_ID("$Id: lib_baudrate.c,v 1.15 1999/01/31 03:05:25 tom Exp $")
+MODULE_ID("$Id: lib_baudrate.c,v 1.17 2000/10/08 00:59:08 tom Exp $")
 
 /*
  *	int
@@ -52,117 +51,118 @@ MODULE_ID("$Id: lib_baudrate.c,v 1.15 1999/01/31 03:05:25 tom Exp $")
  */
 
 struct speed {
-	speed_t s;
-	int sp;
+    int s;	/* value for 'ospeed' is an index */
+    int sp;	/* the actual speed */
 };
 
-static struct speed const speeds[] = {
-	{B0, 0},
-	{B50, 50},
-	{B75, 75},
-	{B110, 110},
-	{B134, 134},
-	{B150, 150},
-	{B200, 200},
-	{B300, 300},
-	{B600, 600},
-	{B1200, 1200},
-	{B1800, 1800},
-	{B2400, 2400},
-	{B4800, 4800},
-	{B9600, 9600},
+static struct speed const speeds[] =
+{
+    {B0, 0},
+    {B50, 50},
+    {B75, 75},
+    {B110, 110},
+    {B134, 134},
+    {B150, 150},
+    {B200, 200},
+    {B300, 300},
+    {B600, 600},
+    {B1200, 1200},
+    {B1800, 1800},
+    {B2400, 2400},
+    {B4800, 4800},
+    {B9600, 9600},
 #ifdef B19200
-	{B19200, 19200},
+    {B19200, 19200},
 #else
 #ifdef EXTA
-	{EXTA, 19200},
+    {EXTA, 19200},
 #endif
 #endif
 #ifdef B38400
-	{B38400, 38400},
+    {B38400, 38400},
 #else
 #ifdef EXTB
-	{EXTB, 38400},
+    {EXTB, 38400},
 #endif
 #endif
 #ifdef B57600
-	{B57600, 57600},
+    {B57600, 57600},
 #endif
 #ifdef B115200
-	{B115200, 115200},
+    {B115200, 115200},
 #endif
 #ifdef B230400
-	{B230400, 230400},
+    {B230400, 230400},
 #endif
 #ifdef B460800
-	{B460800, 460800},
+    {B460800, 460800},
 #endif
 };
 
-int _nc_baudrate(int OSpeed)
+int
+_nc_baudrate(int OSpeed)
 {
-	static int last_OSpeed;
-	static int last_baudrate;
-
-	int result;
-	unsigned i;
-
-	if (OSpeed == last_OSpeed) {
-		result = last_baudrate;
-	} else {
-		result = ERR;
-		if (OSpeed >= 0) {
-			for (i = 0; i < SIZEOF(speeds); i++) {
-				if (speeds[i].s == (speed_t)OSpeed) {
-					result = speeds[i].sp;
-					break;
-				}
-			}
+    static int last_OSpeed;
+    static int last_baudrate;
+
+    int result;
+    unsigned i;
+
+    if (OSpeed == last_OSpeed) {
+	result = last_baudrate;
+    } else {
+	result = ERR;
+	if (OSpeed >= 0) {
+	    for (i = 0; i < SIZEOF(speeds); i++) {
+		if (speeds[i].s == OSpeed) {
+		    result = speeds[i].sp;
+		    break;
 		}
-		last_baudrate = result;
+	    }
 	}
-	return (result);
+	last_baudrate = result;
+    }
+    return (result);
 }
 
-
-int _nc_ospeed(int BaudRate)
+int
+_nc_ospeed(int BaudRate)
 {
-	speed_t result = 1;
-	unsigned i;
-
-	if (BaudRate >= 0) {
-		for (i = 0; i < SIZEOF(speeds); i++) {
-			if (speeds[i].sp == BaudRate) {
-				result = speeds[i].s;
-				break;
-			}
-		}
+    int result = 1;
+    unsigned i;
+
+    if (BaudRate >= 0) {
+	for (i = 0; i < SIZEOF(speeds); i++) {
+	    if (speeds[i].sp == BaudRate) {
+		result = speeds[i].s;
+		break;
+	    }
 	}
-	return (result);
+    }
+    return (result);
 }
 
 int
 baudrate(void)
 {
-int result;
+    int result;
 
-	T((T_CALLED("baudrate()")));
+    T((T_CALLED("baudrate()")));
 
-	/*
-	 * In debugging, allow the environment symbol to override when we're
-	 * redirecting to a file, so we can construct repeatable test-cases
-	 * that take into account costs that depend on baudrate.
-	 */
+    /*
+     * In debugging, allow the environment symbol to override when we're
+     * redirecting to a file, so we can construct repeatable test-cases
+     * that take into account costs that depend on baudrate.
+     */
 #ifdef TRACE
-	if (SP && !isatty(fileno(SP->_ofp))
-	 && getenv("BAUDRATE") != 0) {
-		int ret;
-		if ((ret = _nc_getenv_num("BAUDRATE")) <= 0)
-			ret = 9600;
-		ospeed = _nc_ospeed(ret);
-		returnCode(ret);
-	}
-	else
+    if (SP && !isatty(fileno(SP->_ofp))
+	&& getenv("BAUDRATE") != 0) {
+	int ret;
+	if ((ret = _nc_getenv_num("BAUDRATE")) <= 0)
+	    ret = 9600;
+	ospeed = _nc_ospeed(ret);
+	returnCode(ret);
+    } else
 #endif
 
 #ifdef TERMIOS
@@ -170,9 +170,9 @@ int result;
 #else
 	ospeed = cur_term->Nttyb.sg_ospeed;
 #endif
-	result = _nc_baudrate(ospeed);
-	if (cur_term != 0)
-		cur_term->_baudrate = result;
+    result = _nc_baudrate(ospeed);
+    if (cur_term != 0)
+	cur_term->_baudrate = result;
 
-	returnCode(result);
+    returnCode(result);
 }
diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c
index b58602af..fc3dc42b 100644
--- a/ncurses/tinfo/lib_options.c
+++ b/ncurses/tinfo/lib_options.c
@@ -42,7 +42,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_options.c,v 1.39 2000/03/12 00:19:11 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.40 2000/09/02 18:02:05 tom Exp $")
 
 int
 idlok(WINDOW *win, bool flag)
@@ -206,7 +206,7 @@ typeahead(int fd)
 **
 */
 
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
 static int
 has_key_internal(int keycode, struct tries *tp)
 {
diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c
index 6033ed9c..6df95714 100644
--- a/ncurses/tinfo/lib_raw.c
+++ b/ncurses/tinfo/lib_raw.c
@@ -48,9 +48,9 @@
 #include 
 #include 		/* cur_term */
 
-MODULE_ID("$Id: lib_raw.c,v 1.7 2000/02/13 01:01:26 tom Exp $")
+MODULE_ID("$Id: lib_raw.c,v 1.8 2000/09/02 18:08:48 tom Exp $")
 
-#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
+#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
 #endif
 
diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c
index 50c330eb..1fd0d48f 100644
--- a/ncurses/tinfo/lib_setup.c
+++ b/ncurses/tinfo/lib_setup.c
@@ -42,13 +42,13 @@
 #include 		/* for MAX_NAME_SIZE */
 #include 
 
-#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
+#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
 #endif
 
 #include 		/* lines, columns, cur_term */
 
-MODULE_ID("$Id: lib_setup.c,v 1.59 2000/02/13 01:01:26 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.60 2000/09/02 18:13:12 tom Exp $")
 
 /****************************************************************************
  *
@@ -245,7 +245,7 @@ grab_entry(const char *const tn, TERMTYPE * const tp)
 
     if ((status = _nc_read_entry(tn, filename, tp)) != 1) {
 
-#ifndef PURE_TERMINFO
+#if !PURE_TERMINFO
 	/*
 	 * Try falling back on the termcap file.
 	 * Note:  allowing this call links the entire terminfo/termcap
diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c
index c4740013..ecec2865 100644
--- a/ncurses/tinfo/lib_termcap.c
+++ b/ncurses/tinfo/lib_termcap.c
@@ -39,7 +39,7 @@
 #define __INTERNAL_CAPS_VISIBLE
 #include 
 
-MODULE_ID("$Id: lib_termcap.c,v 1.36 2000/02/13 01:01:26 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.37 2000/09/16 20:30:16 tom Exp $")
 
 /*
    some of the code in here was contributed by:
@@ -190,19 +190,3 @@ tgetstr(NCURSES_CONST char *id, char **area)
     }
     returnPtr(NULL);
 }
-
-/*
- *	char *
- *	tgoto(string, x, y)
- *
- *	Retained solely for upward compatibility.  Note the intentional
- *	reversing of the last two arguments.
- *
- */
-
-char *
-tgoto(const char *string, int x, int y)
-{
-    T((T_CALLED("tgoto(%s,%d,%d)"), string, x, y));
-    returnPtr(tparm((NCURSES_CONST char *) string, y, x));
-}
diff --git a/ncurses/tinfo/lib_tgoto.c b/ncurses/tinfo/lib_tgoto.c
new file mode 100644
index 00000000..73557eb7
--- /dev/null
+++ b/ncurses/tinfo/lib_tgoto.c
@@ -0,0 +1,197 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                                                *
+ ****************************************************************************/
+
+#include 
+
+#include 
+#include 
+
+MODULE_ID("$Id: lib_tgoto.c,v 1.2 2000/09/24 00:19:14 tom Exp $")
+
+#if !PURE_TERMINFO
+static bool
+is_termcap(const char *string)
+{
+    bool result = TRUE;
+
+    while ((*string != '\0') && result) {
+	if (*string == '%') {
+	    switch (*++string) {
+	    case 'p':
+		result = FALSE;
+		break;
+	    case '\0':
+		string--;
+		break;
+	    }
+	} else if (string[0] == '$' && string[1] == '<') {
+	    result = FALSE;
+	}
+	string++;
+    }
+    return result;
+}
+
+static char *
+tgoto_internal(const char *string, int x, int y)
+{
+    static char *result;
+    static size_t length;
+
+    int swap_arg;
+    int param[3];
+    size_t used = 0;
+    size_t need = 10;
+    int *value = param;
+    bool need_BC = FALSE;
+
+    if (BC)
+	need += strlen(BC);
+
+    param[0] = y;
+    param[1] = x;
+    param[2] = 0;
+
+    while (*string != 0) {
+	if ((used + need) > length) {
+	    length += (used + need);
+	    if ((result = _nc_doalloc(result, length)) == 0) {
+		length = 0;
+		break;
+	    }
+	}
+	if (*string == '%') {
+	    char *fmt = 0;
+
+	    switch (*++string) {
+	    case '\0':
+		string--;
+		break;
+	    case 'd':
+		fmt = "%d";
+		break;
+	    case '2':
+		fmt = "%02d";
+		*value %= 100;
+		break;
+	    case '3':
+		fmt = "%03d";
+		*value %= 1000;
+		break;
+	    case '+':
+		*value += (*++string & 0xff);
+		/* FALLTHRU */
+	    case '.':
+		/*
+		 * Guard against tputs() seeing a truncated string.  The
+		 * termcap documentation refers to a similar fixup for \n
+		 * and \r, but I don't see that it could work -TD
+		 */
+		if (*value == 0) {
+		    if (BC != 0) {
+			*value += 1;
+			need_BC = TRUE;
+		    } else {
+			*value = 0200;	/* tputs will treat this as \0 */
+		    }
+		}
+		result[used++] = *value++;
+		break;
+	    case '%':
+		result[used++] = *string;
+		break;
+	    case 'r':
+		swap_arg = param[0];
+		param[0] = param[1];
+		param[1] = swap_arg;
+		break;
+	    case 'i':
+		param[0] += 1;
+		param[1] += 1;
+		break;
+	    case '>':
+		if (*value > string[1])
+		    *value += string[2];
+		string += 2;
+		break;
+	    case 'n':		/* Datamedia 2500 */
+		param[0] ^= 0140;
+		param[1] ^= 0140;
+		break;
+	    case 'B':		/* BCD */
+		*value = 16 * (*value / 10) + (*value % 10);
+		break;
+	    case 'D':		/* Reverse coding (Delta Data) */
+		*value -= 2 * (*value / 16);
+		break;
+	    }
+	    if (fmt != 0) {
+		sprintf(result + used, fmt, *value++);
+		used += strlen(result + used);
+		fmt = 0;
+	    }
+	    if (value - param > 2) {
+		value = param + 2;
+		*value = 0;
+	    }
+	} else {
+	    result[used++] = *string;
+	}
+	string++;
+    }
+    if (need_BC) {
+	strcpy(result + used, BC);
+	used += strlen(BC);
+    }
+    result[used] = '\0';
+    return result;
+}
+#endif
+
+/*
+ * Retained solely for upward compatibility.  Note the intentional reversing of
+ * the last two arguments when invoking tparm().
+ */
+char *
+tgoto(const char *string, int x, int y)
+{
+    char *result;
+
+    T((T_CALLED("tgoto(%s, %d, %d)"), _nc_visbuf(string), x, y));
+#if !PURE_TERMINFO
+    if (is_termcap(string))
+	result = tgoto_internal(string, x, y);
+    else
+#endif
+	result = tparm((NCURSES_CONST char *) string, y, x);
+    returnPtr(result);
+}
diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c
index 71b82916..52352c9a 100644
--- a/ncurses/tinfo/lib_tparm.c
+++ b/ncurses/tinfo/lib_tparm.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,7 +31,6 @@
  *     and: Eric S. Raymond                          *
  ****************************************************************************/
 
-
 /*
  *	tparm.c
  *
@@ -43,7 +42,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: lib_tparm.c,v 1.39 1999/06/06 00:04:55 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.48 2000/10/14 17:45:00 Sergei.Ivanov Exp $")
 
 /*
  *	char *
@@ -74,6 +73,8 @@ MODULE_ID("$Id: lib_tparm.c,v 1.39 1999/06/06 00:04:55 tom Exp $")
  *	     %s        print pop() like %s in printf()
  *           %[[:]flags][width[.precision]][doxXs]
  *                     as in printf, flags are [-+#] and space
+ *                     The ':' is used to avoid making %+ or %-
+ *                     patterns (see below).
  *
  *	     %p[1-9]   push ith parm
  *	     %P[a-z]   set dynamic variable [a-z] to pop()
@@ -105,481 +106,635 @@ MODULE_ID("$Id: lib_tparm.c,v 1.39 1999/06/06 00:04:55 tom Exp $")
 
 #define STACKSIZE	20
 
-typedef union {
-	unsigned int	num;
-	char	       *str;
+typedef struct {
+    union {
+	unsigned int num;
+	char *str;
+    } data;
+    bool num_type;
 } stack_frame;
 
-static  stack_frame	stack[STACKSIZE];
-static	int	stack_ptr;
+static stack_frame stack[STACKSIZE];
+static int stack_ptr;
+
 #ifdef TRACE
 static const char *tname;
 #endif /* TRACE */
 
-static char  *out_buff;
+static char *out_buff;
 static size_t out_size;
 static size_t out_used;
 
 #if NO_LEAKS
-void _nc_free_tparm(void)
+void
+_nc_free_tparm(void)
 {
-	if (out_buff != 0) {
-		FreeAndNull(out_buff);
-		out_size = 0;
-		out_used = 0;
-	}
+    if (out_buff != 0) {
+	FreeAndNull(out_buff);
+	out_size = 0;
+	out_used = 0;
+    }
 }
 #endif
 
-static void really_get_space(size_t need)
+static void
+really_get_space(size_t need)
 {
-	out_size = need * 2;
-	out_buff = typeRealloc(char, out_size, out_buff);
-	if (out_buff == 0)
-		_nc_err_abort("Out of memory");
+    out_size = need * 2;
+    out_buff = typeRealloc(char, out_size, out_buff);
+    if (out_buff == 0)
+	_nc_err_abort("Out of memory");
 }
 
-static inline void get_space(size_t need)
+static inline void
+get_space(size_t need)
 {
-	need += out_used;
-	if (need > out_size)
-		really_get_space(need);
+    need += out_used;
+    if (need > out_size)
+	really_get_space(need);
 }
 
-static inline void save_text(const char *fmt, char *s, int len)
+static inline void
+save_text(const char *fmt, const char *s, int len)
 {
-	size_t s_len = strlen(s);
-	if (len > (int)s_len)
-		s_len = len;
+    size_t s_len = strlen(s);
+    if (len > (int) s_len)
+	s_len = len;
 
-	get_space(s_len + 1);
+    get_space(s_len + 1);
 
-	(void)sprintf(out_buff+out_used, fmt, s);
-	out_used += strlen(out_buff+out_used);
+    (void) sprintf(out_buff + out_used, fmt, s);
+    out_used += strlen(out_buff + out_used);
 }
 
-static inline void save_number(const char *fmt, int number, int len)
+static inline void
+save_number(const char *fmt, int number, int len)
 {
-	if (len < 30)
-		len = 30; /* actually log10(MAX_INT)+1 */
+    if (len < 30)
+	len = 30;		/* actually log10(MAX_INT)+1 */
 
-	get_space(len + 1);
+    get_space(len + 1);
 
-	(void)sprintf(out_buff+out_used, fmt, number);
-	out_used += strlen(out_buff+out_used);
+    (void) sprintf(out_buff + out_used, fmt, number);
+    out_used += strlen(out_buff + out_used);
 }
 
-static inline void save_char(int c)
+static inline void
+save_char(int c)
 {
-	if (c == 0)
-		c = 0200;
-	get_space(1);
-	out_buff[out_used++] = c;
+    if (c == 0)
+	c = 0200;
+    get_space(1);
+    out_buff[out_used++] = c;
 }
 
-static inline void npush(int x)
+static inline void
+npush(int x)
 {
-	if (stack_ptr < STACKSIZE) {
-		stack[stack_ptr].num = x;
-		stack_ptr++;
-	}
+    if (stack_ptr < STACKSIZE) {
+	stack[stack_ptr].num_type = TRUE;
+	stack[stack_ptr].data.num = x;
+	stack_ptr++;
+    }
 }
 
-static inline int npop(void)
+static inline int
+npop(void)
 {
-	return   (stack_ptr > 0  ?  stack[--stack_ptr].num  :  0);
+    int result = 0;
+    if (stack_ptr > 0) {
+	stack_ptr--;
+	if (stack[stack_ptr].num_type)
+	    result = stack[stack_ptr].data.num;
+    }
+    return result;
 }
 
-static inline char *spop(void)
+static inline void
+spush(char *x)
 {
-	static char dummy[] = "";	/* avoid const-cast */
-	return   (stack_ptr > 0  ?  stack[--stack_ptr].str  :  dummy);
+    if (stack_ptr < STACKSIZE) {
+	stack[stack_ptr].num_type = FALSE;
+	stack[stack_ptr].data.str = x;
+	stack_ptr++;
+    }
 }
 
-static inline const char *parse_format(const char *s, char *format, int *len)
+static inline char *
+spop(void)
 {
-	bool done = FALSE;
-	bool allowminus = FALSE;
-	bool dot = FALSE;
-	int prec  = 0;
-	int width = 0;
+    static char dummy[] = "";	/* avoid const-cast */
+    char *result = dummy;
+    if (stack_ptr > 0) {
+	stack_ptr--;
+	if (!stack[stack_ptr].num_type && stack[stack_ptr].data.str != 0)
+	    result = stack[stack_ptr].data.str;
+    }
+    return result;
+}
 
-	*len = 0;
-	*format++ = '%';
-	while (*s != '\0' && !done) {
-		switch (*s) {
-		case 'c':	/* FALLTHRU */
-		case 'd':	/* FALLTHRU */
-		case 'o':	/* FALLTHRU */
-		case 'x':	/* FALLTHRU */
-		case 'X':	/* FALLTHRU */
-		case 's':
-			*format++ = *s;
-			done = TRUE;
-			break;
-		case '.':
-			*format++ = *s++;
-			dot = TRUE;
-			break;
-		case '#':
-			*format++ = *s++;
-			break;
-		case ' ':
-			*format++ = *s++;
-			break;
-		case ':':
-			s++;
-			allowminus = TRUE;
-			break;
-		case '-':
-			if (allowminus) {
-				*format++ = *s++;
-			} else {
-				done = TRUE;
-			}
-			break;
-		default:
-			if (isdigit(*s)) {
-				if (dot)
-					prec  = (prec * 10) + (*s - '0');
-				else
-					width = (width * 10) + (*s - '0');
-				*format++ = *s++;
-			} else {
-				done = TRUE;
-			}
-		}
+static inline const char *
+parse_format(const char *s, char *format, int *len)
+{
+    bool done = FALSE;
+    bool allowminus = FALSE;
+    bool dot = FALSE;
+    bool err = FALSE;
+    char *fmt = format;
+    int prec = 0;
+    int width = 0;
+    int value = 0;
+
+    *len = 0;
+    *format++ = '%';
+    while (*s != '\0' && !done) {
+	switch (*s) {
+	case 'c':		/* FALLTHRU */
+	case 'd':		/* FALLTHRU */
+	case 'o':		/* FALLTHRU */
+	case 'x':		/* FALLTHRU */
+	case 'X':		/* FALLTHRU */
+	case 's':
+	    *format++ = *s;
+	    done = TRUE;
+	    break;
+	case '.':
+	    *format++ = *s++;
+	    if (dot) {
+		err = TRUE;
+	    } else {
+		dot = TRUE;
+		prec = value;
+	    }
+	    value = 0;
+	    break;
+	case '#':
+	    *format++ = *s++;
+	    break;
+	case ' ':
+	    *format++ = *s++;
+	    break;
+	case ':':
+	    s++;
+	    allowminus = TRUE;
+	    break;
+	case '-':
+	    if (allowminus) {
+		*format++ = *s++;
+	    } else {
+		done = TRUE;
+	    }
+	    break;
+	default:
+	    if (isdigit(*s)) {
+		value = (value * 10) + (*s - '0');
+		if (value > 10000)
+		    err = TRUE;
+		*format++ = *s++;
+	    } else {
+		done = TRUE;
+	    }
 	}
-	*format = '\0';
-	/* return maximum string length in print */
-	*len = (prec > width) ? prec : width;
-	return s;
+    }
+
+    /*
+     * If we found an error, ignore (and remove) the flags.
+     */
+    if (err) {
+	prec = width = value = 0;
+	format = fmt;
+	*format++ = '%';
+	*format++ = *s;
+    }
+
+    if (dot)
+	width = value;
+    else
+	prec = value;
+
+    *format = '\0';
+    /* return maximum string length in print */
+    *len = (prec > width) ? prec : width;
+    return s;
 }
 
 #define isUPPER(c) ((c) >= 'A' && (c) <= 'Z')
 #define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
 
-static inline char *tparam_internal(const char *string, va_list ap)
+static inline char *
+tparam_internal(const char *string, va_list ap)
 {
 #define NUM_VARS 26
-int	param[9];
-int	popcount;
-int	number;
-int	len;
-int	level;
-int	x, y;
-int	i;
-register const char *cp;
-static	size_t len_fmt;
-static	char *format;
-static	int dynamic_var[NUM_VARS];
-static	int static_vars[NUM_VARS];
-
-	out_used = 0;
-	if (string == NULL)
-		return NULL;
-
-	/*
-	 * Find the highest parameter-number referred to in the format string.
-	 * Use this value to limit the number of arguments copied from the
-	 * variable-length argument list.
-	 */
-	for (cp = string, popcount = number = 0; *cp != '\0'; cp++) {
-		if (cp[0] == '%' && cp[1] != '\0') {
-			switch (cp[1]) {
-			case '%':
-				cp++;
-				break;
-			case 'i':
-				if (popcount < 2)
-					popcount = 2;
-				break;
-			case 'p':
-				cp++;
-				if (cp[1] >= '1' && cp[1] <= '9') {
-					int c = cp[1] - '0';
-					if (c > popcount)
-						popcount = c;
-				}
-				break;
-			case '0': case '1': case '2': case '3': case '4':
-			case '5': case '6': case '7': case '8': case '9':
-			case 'd': case 'c': case 's':
-				++number;
-				break;
-			}
+    char *p_is_s[9];
+    int param[9];
+    int lastpop;
+    int popcount;
+    int number;
+    int len;
+    int level;
+    int x, y;
+    int i;
+    size_t len2;
+    register const char *cp;
+    static size_t len_fmt;
+    static char dummy[] = "";
+    static char *format;
+    static int dynamic_var[NUM_VARS];
+    static int static_vars[NUM_VARS];
+
+    out_used = 0;
+    if (string == NULL)
+	return NULL;
+
+    if ((len2 = strlen(string)) > len_fmt) {
+	len_fmt = len2 + len_fmt + 2;
+	if ((format = typeRealloc(char, len_fmt, format)) == 0)
+	      return 0;
+    }
+
+    /*
+     * Find the highest parameter-number referred to in the format string.
+     * Use this value to limit the number of arguments copied from the
+     * variable-length argument list.
+     */
+
+    number = 0;
+    lastpop = -1;
+    popcount = 0;
+    memset(p_is_s, 0, sizeof(p_is_s));
+
+    /*
+     * Analyze the string to see how many parameters we need from the varargs
+     * list, and what their types are.  We will only accept string parameters
+     * if they appear as a %l or %s format following an explicit parameter
+     * reference (e.g., %p2%s).  All other parameters are numbers.
+     *
+     * 'number' counts coarsely the number of pop's we see in the string, and
+     * 'popcount' shows the highest parameter number in the string.  We would
+     * like to simply use the latter count, but if we are reading termcap
+     * strings, there may be cases that we cannot see the explicit parameter
+     * numbers.
+     */
+    for (cp = string; (cp - string) < (int) len2;) {
+	if (*cp == '%') {
+	    cp++;
+	    cp = parse_format(cp, format, &len);
+	    switch (*cp) {
+	    default:
+		break;
+
+	    case 'd':		/* FALLTHRU */
+	    case 'o':		/* FALLTHRU */
+	    case 'x':		/* FALLTHRU */
+	    case 'X':		/* FALLTHRU */
+	    case 'c':		/* FALLTHRU */
+		number++;
+		lastpop = -1;
+		break;
+
+	    case 'l':
+	    case 's':
+		if (lastpop > 0)
+		    p_is_s[lastpop - 1] = dummy;
+		++number;
+		break;
+
+	    case 'p':
+		cp++;
+		i = (*cp - '0');
+		if (i >= 0 && i <= 9) {
+		    lastpop = i;
+		    if (lastpop > popcount)
+			popcount = lastpop;
 		}
+		break;
+
+	    case 'P':
+	    case 'g':
+		cp++;
+		break;
+
+	    case S_QUOTE:
+		cp += 2;
+		lastpop = -1;
+		break;
+
+	    case L_BRACE:
+		cp++;
+		while (*cp >= '0' && *cp <= '9') {
+		    cp++;
+		}
+		break;
+
+	    case '+':
+	    case '-':
+	    case '*':
+	    case '/':
+	    case 'm':
+	    case 'A':
+	    case 'O':
+	    case '&':
+	    case '|':
+	    case '^':
+	    case '=':
+	    case '<':
+	    case '>':
+	    case '!':
+	    case '~':
+		lastpop = -1;
+		number += 2;
+		break;
+
+	    case 'i':
+		lastpop = -1;
+		if (popcount < 2)
+		    popcount = 2;
+		break;
+	    }
 	}
-	if ((size_t)(cp - string) > len_fmt) {
-		len_fmt = (cp - string) + len_fmt + 2;
-		if ((format = typeRealloc(char, len_fmt, format)) == 0)
-			return 0;
-	}
-
-	if (number > 9) number = 9;
-	for (i = 0; i < max(popcount, number); i++) {
-		/*
-		 * FIXME: potential loss here if sizeof(int) != sizeof(char *).
-		 * A few caps (such as plab_norm) have string-valued parms.
-		 */
-		param[i] = va_arg(ap, int);
-	}
+	if (*cp != '\0')
+	    cp++;
+    }
 
+    if (number > 9)
+	number = 9;
+    for (i = 0; i < max(popcount, number); i++) {
 	/*
-	 * This is a termcap compatibility hack.  If there are no explicit pop
-	 * operations in the string, load the stack in such a way that
-	 * successive pops will grab successive parameters.  That will make
-	 * the expansion of (for example) \E[%d;%dH work correctly in termcap
-	 * style, which means tparam() will expand termcap strings OK.
+	 * A few caps (such as plab_norm) have string-valued parms.
+	 * We'll have to assume that the caller knows the difference, since
+	 * a char* and an int may not be the same size on the stack.
 	 */
-	stack_ptr = 0;
-	if (popcount == 0) {
-		popcount = number;
-		for (i = number - 1; i >= 0; i--)
-			npush(param[i]);
+	if (p_is_s[i] != 0) {
+	    p_is_s[i] = va_arg(ap, char *);
+	} else {
+	    param[i] = va_arg(ap, int);
 	}
-
+    }
+
+    /*
+     * This is a termcap compatibility hack.  If there are no explicit pop
+     * operations in the string, load the stack in such a way that
+     * successive pops will grab successive parameters.  That will make
+     * the expansion of (for example) \E[%d;%dH work correctly in termcap
+     * style, which means tparam() will expand termcap strings OK.
+     */
+    stack_ptr = 0;
+    if (popcount == 0) {
+	popcount = number;
+	for (i = number - 1; i >= 0; i--)
+	    npush(param[i]);
+    }
 #ifdef TRACE
-	if (_nc_tracing & TRACE_CALLS) {
-		for (i = 0; i < popcount; i++)
-			save_number(", %d", param[i], 0);
-		_tracef(T_CALLED("%s(%s%s)"), tname, _nc_visbuf(string), out_buff);
-		out_used = 0;
+    if (_nc_tracing & TRACE_CALLS) {
+	for (i = 0; i < popcount; i++) {
+	    if (p_is_s[i] != 0)
+		save_text(", %s", _nc_visbuf(p_is_s[i]), 0);
+	    else
+		save_number(", %d", param[i], 0);
 	}
+	_tracef(T_CALLED("%s(%s%s)"), tname, _nc_visbuf(string), out_buff);
+	out_used = 0;
+    }
 #endif /* TRACE */
 
-	while (*string) {
-		if (*string != '%') {
-			save_char(*string);
-		} else {
-			string++;
-			string = parse_format(string, format, &len);
-			switch (*string) {
-			default:
-				break;
-			case '%':
-				save_char('%');
-				break;
-
-			case 'd':	/* FALLTHRU */
-			case 'o':	/* FALLTHRU */
-			case 'x':	/* FALLTHRU */
-			case 'X':	/* FALLTHRU */
-			case 'c':
-				save_number(format, npop(), len);
-				break;
-
-			case 'l':
-				save_number("%d", strlen(spop()), 0);
-				break;
-
-			case 's':
-				save_text(format, spop(), len);
-				break;
-
-			case 'p':
-				string++;
-				if (*string >= '1'  &&  *string <= '9')
-					npush(param[*string - '1']);
-				break;
-
-			case 'P':
-				string++;
-				if (isUPPER(*string)) {
-					i = (*string - 'A');
-					static_vars[i] = npop();
-				} else if (isLOWER(*string)) {
-					i = (*string - 'a');
-					dynamic_var[i] = npop();
-				}
-				break;
-
-			case 'g':
-				string++;
-				if (isUPPER(*string)) {
-					i = (*string - 'A');
-					npush(static_vars[i]);
-				} else if (isLOWER(*string)) {
-					i = (*string - 'a');
-					npush(dynamic_var[i]);
-				}
-				break;
-
-			case S_QUOTE:
-				string++;
-				npush(*string);
-				string++;
-				break;
-
-			case L_BRACE:
-				number = 0;
-				string++;
-				while (*string >= '0'  &&  *string <= '9') {
-					number = number * 10 + *string - '0';
-					string++;
-				}
-				npush(number);
-				break;
-
-			case '+':
-				npush(npop() + npop());
-				break;
-
-			case '-':
-				y = npop();
-				x = npop();
-				npush(x - y);
-				break;
-
-			case '*':
-				npush(npop() * npop());
-				break;
-
-			case '/':
-				y = npop();
-				x = npop();
-				npush(y ? (x / y) : 0);
-				break;
-
-			case 'm':
-				y = npop();
-				x = npop();
-				npush(y ? (x % y) : 0);
-				break;
-
-			case 'A':
-				npush(npop() && npop());
-				break;
-
-			case 'O':
-				npush(npop() || npop());
-				break;
-
-			case '&':
-				npush(npop() & npop());
-				break;
-
-			case '|':
-				npush(npop() | npop());
-				break;
-
-			case '^':
-				npush(npop() ^ npop());
-				break;
-
-			case '=':
-				y = npop();
-				x = npop();
-				npush(x == y);
-				break;
-
-			case '<':
-				y = npop();
-				x = npop();
-				npush(x < y);
-				break;
+    while (*string) {
+	if (*string != '%') {
+	    save_char(*string);
+	} else {
+	    string++;
+	    string = parse_format(string, format, &len);
+	    switch (*string) {
+	    default:
+		break;
+	    case '%':
+		save_char('%');
+		break;
+
+	    case 'd':		/* FALLTHRU */
+	    case 'o':		/* FALLTHRU */
+	    case 'x':		/* FALLTHRU */
+	    case 'X':		/* FALLTHRU */
+	    case 'c':		/* FALLTHRU */
+		save_number(format, npop(), len);
+		break;
+
+	    case 'l':
+		save_number("%d", strlen(spop()), 0);
+		break;
+
+	    case 's':
+		save_text(format, spop(), len);
+		break;
+
+	    case 'p':
+		string++;
+		i = (*string - '1');
+		if (i >= 0 && i < 9) {
+		    if (p_is_s[i])
+			spush(p_is_s[i]);
+		    else
+			npush(param[i]);
+		}
+		break;
 
-			case '>':
-				y = npop();
-				x = npop();
-				npush(x > y);
-				break;
+	    case 'P':
+		string++;
+		if (isUPPER(*string)) {
+		    i = (*string - 'A');
+		    static_vars[i] = npop();
+		} else if (isLOWER(*string)) {
+		    i = (*string - 'a');
+		    dynamic_var[i] = npop();
+		}
+		break;
 
-			case '!':
-				npush(! npop());
-				break;
+	    case 'g':
+		string++;
+		if (isUPPER(*string)) {
+		    i = (*string - 'A');
+		    npush(static_vars[i]);
+		} else if (isLOWER(*string)) {
+		    i = (*string - 'a');
+		    npush(dynamic_var[i]);
+		}
+		break;
 
-			case '~':
-				npush(~ npop());
-				break;
+	    case S_QUOTE:
+		string++;
+		npush(*string);
+		string++;
+		break;
 
-			case 'i':
-				param[0]++;
-				param[1]++;
+	    case L_BRACE:
+		number = 0;
+		string++;
+		while (*string >= '0' && *string <= '9') {
+		    number = number * 10 + *string - '0';
+		    string++;
+		}
+		npush(number);
+		break;
+
+	    case '+':
+		npush(npop() + npop());
+		break;
+
+	    case '-':
+		y = npop();
+		x = npop();
+		npush(x - y);
+		break;
+
+	    case '*':
+		npush(npop() * npop());
+		break;
+
+	    case '/':
+		y = npop();
+		x = npop();
+		npush(y ? (x / y) : 0);
+		break;
+
+	    case 'm':
+		y = npop();
+		x = npop();
+		npush(y ? (x % y) : 0);
+		break;
+
+	    case 'A':
+		npush(npop() && npop());
+		break;
+
+	    case 'O':
+		npush(npop() || npop());
+		break;
+
+	    case '&':
+		npush(npop() & npop());
+		break;
+
+	    case '|':
+		npush(npop() | npop());
+		break;
+
+	    case '^':
+		npush(npop() ^ npop());
+		break;
+
+	    case '=':
+		y = npop();
+		x = npop();
+		npush(x == y);
+		break;
+
+	    case '<':
+		y = npop();
+		x = npop();
+		npush(x < y);
+		break;
+
+	    case '>':
+		y = npop();
+		x = npop();
+		npush(x > y);
+		break;
+
+	    case '!':
+		npush(!npop());
+		break;
+
+	    case '~':
+		npush(~npop());
+		break;
+
+	    case 'i':
+		if (p_is_s[0] == 0)
+		    param[0]++;
+		if (p_is_s[1] == 0)
+		    param[1]++;
+		break;
+
+	    case '?':
+		break;
+
+	    case 't':
+		x = npop();
+		if (!x) {
+		    /* scan forward for %e or %; at level zero */
+		    string++;
+		    level = 0;
+		    while (*string) {
+			if (*string == '%') {
+			    string++;
+			    if (*string == '?')
+				level++;
+			    else if (*string == ';') {
+				if (level > 0)
+				    level--;
+				else
+				    break;
+			    } else if (*string == 'e' && level == 0)
 				break;
+			}
 
-			case '?':
-				break;
+			if (*string)
+			    string++;
+		    }
+		}
+		break;
 
-			case 't':
-				x = npop();
-				if (!x) {
-					/* scan forward for %e or %; at level zero */
-					string++;
-					level = 0;
-					while (*string) {
-						if (*string == '%') {
-							string++;
-							if (*string == '?')
-								level++;
-							else if (*string == ';') {
-								if (level > 0)
-									level--;
-								else
-									break;
-							}
-							else if (*string == 'e'  && level == 0)
-								break;
-						}
-
-						if (*string)
-							string++;
-					}
-				}
+	    case 'e':
+		/* scan forward for a %; at level zero */
+		string++;
+		level = 0;
+		while (*string) {
+		    if (*string == '%') {
+			string++;
+			if (*string == '?')
+			    level++;
+			else if (*string == ';') {
+			    if (level > 0)
+				level--;
+			    else
 				break;
+			}
+		    }
 
-			case 'e':
-				/* scan forward for a %; at level zero */
-				string++;
-				level = 0;
-				while (*string) {
-					if (*string == '%') {
-						string++;
-						if (*string == '?')
-							level++;
-						else if (*string == ';') {
-							if (level > 0)
-								level--;
-							else
-								break;
-						}
-					}
-
-					if (*string)
-						string++;
-				}
-				break;
+		    if (*string)
+			string++;
+		}
+		break;
 
-			case ';':
-				break;
+	    case ';':
+		break;
 
-			} /* endswitch (*string) */
-		} /* endelse (*string == '%') */
+	    }			/* endswitch (*string) */
+	}			/* endelse (*string == '%') */
 
-		if (*string == '\0')
-			break;
+	if (*string == '\0')
+	    break;
 
-		string++;
-	} /* endwhile (*string) */
+	string++;
+    }				/* endwhile (*string) */
 
-	if (out_buff == 0 && (out_buff = typeCalloc(char,1)) == NULL)
-		return(NULL);
-	out_buff[out_used] = '\0';
+    get_space(1);
+    out_buff[out_used] = '\0';
 
-	T((T_RETURN("%s"), _nc_visbuf(out_buff)));
-	return(out_buff);
+    T((T_RETURN("%s"), _nc_visbuf(out_buff)));
+    return (out_buff);
 }
 
-char *tparm(NCURSES_CONST char *string, ...)
+char *
+tparm(NCURSES_CONST char *string,...)
 {
-va_list	ap;
-char *result;
+    va_list ap;
+    char *result;
 
-	va_start(ap, string);
+    va_start(ap, string);
 #ifdef TRACE
-	tname = "tparm";
+    tname = "tparm";
 #endif /* TRACE */
-	result = tparam_internal(string, ap);
-	va_end(ap);
-	return result;
+    result = tparam_internal(string, ap);
+    va_end(ap);
+    return result;
 }
diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c
index f17d8382..93eebf88 100644
--- a/ncurses/tinfo/lib_tputs.c
+++ b/ncurses/tinfo/lib_tputs.c
@@ -45,10 +45,10 @@
 #include 		/* ospeed */
 #include 
 
-MODULE_ID("$Id: lib_tputs.c,v 1.47 2000/05/27 23:08:41 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.51 2000/10/08 00:22:24 tom Exp $")
 
 char PC = 0;			/* used by termcap library */
-speed_t ospeed = 0;		/* used by termcap library */
+short ospeed = 0;		/* used by termcap library */
 
 int _nc_nulls_sent = 0;		/* used by 'tack' program */
 
@@ -78,7 +78,7 @@ delay_output(int ms)
 void
 _nc_flush(void)
 {
-    (void)fflush(NC_OUTPUT);
+    (void) fflush(NC_OUTPUT);
 }
 
 int
@@ -102,7 +102,7 @@ _nc_outch(int ch)
     return OK;
 }
 
-#ifdef USE_WIDEC_SUPPORT
+#if USE_WIDEC_SUPPORT
 /*
  * Reference: The Unicode Standard 2.0
  *
@@ -120,20 +120,20 @@ _nc_utf8_outch(int ch)
     int result[7], *ptr;
     int count = 0;
 
-    if (ch < 0x80)
+    if ((unsigned int) ch < 0x80)
 	count = 1;
-    else if (ch < 0x800)
+    else if ((unsigned int) ch < 0x800)
 	count = 2;
-    else if (ch < 0x10000)
+    else if ((unsigned int) ch < 0x10000)
 	count = 3;
-    else if (ch < 0x200000)
+    else if ((unsigned int) ch < 0x200000)
 	count = 4;
-    else if (ch < 0x4000000)
+    else if ((unsigned int) ch < 0x4000000)
 	count = 5;
-    else if (ch <= 0x7FFFFFFF)
+    else if ((unsigned int) ch <= 0x7FFFFFFF)
 	count = 6;
     else {
-	count = 2;
+	count = 3;
 	ch = 0xFFFD;
     }
     ptr = result + count;
@@ -141,20 +141,26 @@ _nc_utf8_outch(int ch)
     case 6:
 	*--ptr = (ch | otherMark) & byteMask;
 	ch >>= 6;
+	/* FALLTHRU */
     case 5:
 	*--ptr = (ch | otherMark) & byteMask;
 	ch >>= 6;
+	/* FALLTHRU */
     case 4:
 	*--ptr = (ch | otherMark) & byteMask;
 	ch >>= 6;
+	/* FALLTHRU */
     case 3:
 	*--ptr = (ch | otherMark) & byteMask;
 	ch >>= 6;
+	/* FALLTHRU */
     case 2:
 	*--ptr = (ch | otherMark) & byteMask;
 	ch >>= 6;
+	/* FALLTHRU */
     case 1:
 	*--ptr = (ch | firstMark[count]);
+	break;
     }
     while (count--)
 	_nc_outch(*ptr++);
@@ -174,7 +180,7 @@ tputs(const char *string, int affcnt, int (*outc) (int))
     bool always_delay;
     bool normal_delay;
     int number;
-#ifdef BSD_TPUTS
+#if BSD_TPUTS
     int trailpad;
 #endif /* BSD_TPUTS */
 
@@ -188,7 +194,7 @@ tputs(const char *string, int affcnt, int (*outc) (int))
 	    (void) sprintf(addrbuf, "%p", outc);
 	if (_nc_tputs_trace) {
 	    _tracef("tputs(%s = %s, %d, %s) called", _nc_tputs_trace,
-		_nc_visbuf(string), affcnt, addrbuf);
+		    _nc_visbuf(string), affcnt, addrbuf);
 	} else {
 	    _tracef("tputs(%s, %d, %s) called", _nc_visbuf(string), affcnt, addrbuf);
 	}
@@ -207,13 +213,13 @@ tputs(const char *string, int affcnt, int (*outc) (int))
 	normal_delay =
 	    !xon_xoff
 	    && padding_baud_rate
-#ifdef NCURSES_NO_PADDING
+#if NCURSES_NO_PADDING
 	    && (SP == 0 || !(SP->_no_padding))
 #endif
 	    && (_nc_baudrate(ospeed) >= padding_baud_rate);
     }
 
-#ifdef BSD_TPUTS
+#if BSD_TPUTS
     /*
      * This ugly kluge deals with the fact that some ancient BSD programs
      * (like nethack) actually do the likes of tputs("50") to get delays.
@@ -304,7 +310,7 @@ tputs(const char *string, int affcnt, int (*outc) (int))
 	string++;
     }
 
-#ifdef BSD_TPUTS
+#if BSD_TPUTS
     /*
      * Emit any BSD-style prefix padding that we've accumulated now.
      */
diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
index 1aff562d..24bf3c37 100644
--- a/ncurses/tinfo/parse_entry.c
+++ b/ncurses/tinfo/parse_entry.c
@@ -47,7 +47,7 @@
 #define __INTERNAL_CAPS_VISIBLE
 #include 
 
-MODULE_ID("$Id: parse_entry.c,v 1.44 2000/04/30 00:17:42 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.48 2000/10/03 09:38:48 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
@@ -200,7 +200,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 {
     int token_type;
     struct name_table_entry const *entry_ptr;
-    char *ptr, namecpy[MAX_NAME_SIZE + 1];
+    char *ptr, *base;
 
     token_type = _nc_get_token();
 
@@ -235,22 +235,22 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
     _nc_set_type(_nc_first_name(entryp->tterm.term_names));
 
     /* check for overly-long names and aliases */
-    (void) strncpy(namecpy, entryp->tterm.term_names, MAX_NAME_SIZE);
-    namecpy[MAX_NAME_SIZE] = '\0';
-    if ((ptr = strrchr(namecpy, '|')) != (char *) 0)
-	*ptr = '\0';
-    ptr = strtok(namecpy, "|");
-    if (strlen(ptr) > MAX_ALIAS)
-	_nc_warning("primary name may be too long");
-    while ((ptr = strtok((char *) 0, "|")) != (char *) 0)
-	if (strlen(ptr) > MAX_ALIAS)
-	    _nc_warning("alias `%s' may be too long", ptr);
+    for (base = entryp->tterm.term_names; (ptr = strchr(base, '|')) != 0;
+	 base = ptr + 1) {
+	if (ptr - base > MAX_ALIAS) {
+	    _nc_warning("%s `%.*s' may be too long",
+			(base == entryp->tterm.term_names)
+			? "primary name"
+			: "alias",
+			ptr - base, base);
+	}
+    }
 
     entryp->nuses = 0;
 
     for (token_type = _nc_get_token();
-	token_type != EOF && token_type != NAMES;
-	token_type = _nc_get_token()) {
+	 token_type != EOF && token_type != NAMES;
+	 token_type = _nc_get_token()) {
 	if (strcmp(_nc_curr_token.tk_name, "use") == 0
 	    || strcmp(_nc_curr_token.tk_name, "tc") == 0) {
 	    entryp->uses[entryp->nuses].name = _nc_save_str(_nc_curr_token.tk_valstring);
@@ -259,7 +259,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 	} else {
 	    /* normal token lookup */
 	    entry_ptr = _nc_find_entry(_nc_curr_token.tk_name,
-		_nc_syntax ? _nc_cap_hash_table : _nc_info_hash_table);
+				       _nc_syntax ? _nc_cap_hash_table : _nc_info_hash_table);
 
 	    /*
 	     * Our kluge to handle aliasing.  The reason it's done
@@ -277,14 +277,14 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 			if (strcmp(ap->from, _nc_curr_token.tk_name) == 0) {
 			    if (ap->to == (char *) 0) {
 				_nc_warning("%s (%s termcap extension) ignored",
-				    ap->from, ap->source);
+					    ap->from, ap->source);
 				goto nexttok;
 			    }
 
 			    entry_ptr = _nc_find_entry(ap->to, _nc_cap_hash_table);
 			    if (entry_ptr && !silent)
 				_nc_warning("%s (%s termcap extension) aliased to %s",
-				    ap->from, ap->source, ap->to);
+					    ap->from, ap->source, ap->to);
 			    break;
 			}
 		} else {	/* if (_nc_syntax == SYN_TERMINFO) */
@@ -292,14 +292,14 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 			if (strcmp(ap->from, _nc_curr_token.tk_name) == 0) {
 			    if (ap->to == (char *) 0) {
 				_nc_warning("%s (%s terminfo extension) ignored",
-				    ap->from, ap->source);
+					    ap->from, ap->source);
 				goto nexttok;
 			    }
 
 			    entry_ptr = _nc_find_entry(ap->to, _nc_info_hash_table);
 			    if (entry_ptr && !silent)
 				_nc_warning("%s (%s terminfo extension) aliased to %s",
-				    ap->from, ap->source, ap->to);
+					    ap->from, ap->source, ap->to);
 			    break;
 			}
 
@@ -316,7 +316,8 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 	    if (entry_ptr == NOTFOUND
 		&& _nc_user_definable
 		&& (entry_ptr = _nc_extend_names(entryp,
-			_nc_curr_token.tk_name, token_type)) != 0) {
+						 _nc_curr_token.tk_name,
+						 token_type)) != 0) {
 		if (_nc_tracing >= DEBUG_LEVEL(1))
 		    _nc_warning("extended capability '%s'", _nc_curr_token.tk_name);
 	    }
@@ -326,7 +327,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 	    if (entry_ptr == NOTFOUND) {
 		if (!silent)
 		    _nc_warning("unknown capability '%s'",
-			_nc_curr_token.tk_name);
+				_nc_curr_token.tk_name);
 		continue;
 	    }
 
@@ -345,12 +346,14 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 		/* tell max_attributes from arrow_key_map */
 		if (token_type == NUMBER && !strcmp("ma", _nc_curr_token.tk_name))
 		    entry_ptr = _nc_find_type_entry("ma", NUMBER,
-			_nc_get_table(_nc_syntax != 0));
+						    _nc_get_table(_nc_syntax
+								  != 0));
 
 		/* map terminfo's string MT to MT */
 		else if (token_type == STRING && !strcmp("MT", _nc_curr_token.tk_name))
 		    entry_ptr = _nc_find_type_entry("MT", STRING,
-			_nc_get_table(_nc_syntax != 0));
+						    _nc_get_table(_nc_syntax
+								  != 0));
 
 		/* treat strings without following "=" as empty strings */
 		else if (token_type == BOOLEAN && entry_ptr->nte_type == STRING)
@@ -374,7 +377,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 			    break;
 			}
 			_nc_warning("wrong type used for %s capability '%s'",
-			    type_name, _nc_curr_token.tk_name);
+				    type_name, _nc_curr_token.tk_name);
 		    }
 		    continue;
 		}
@@ -411,8 +414,8 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 		ptr = _nc_curr_token.tk_valstring;
 		if (_nc_syntax == SYN_TERMCAP)
 		    ptr = _nc_captoinfo(_nc_curr_token.tk_name,
-			ptr,
-			parametrized[entry_ptr->nte_index]);
+					ptr,
+					parametrized[entry_ptr->nte_index]);
 		entryp->tterm.Strings[entry_ptr->nte_index] = _nc_save_str(ptr);
 		break;
 
@@ -479,14 +482,14 @@ _nc_capcmp(const char *s, const char *t)
 	if (s[0] == '$' && s[1] == '<') {
 	    for (s += 2;; s++)
 		if (!(isdigit(*s) || *s == '.' || *s == '*' || *s == '/' ||
-			*s == '>'))
+		      *s == '>'))
 		    break;
 	}
 
 	if (t[0] == '$' && t[1] == '<') {
 	    for (t += 2;; t++)
 		if (!(isdigit(*t) || *t == '.' || *t == '*' || *t == '/' ||
-			*t == '>'))
+		      *t == '>'))
 		    break;
 	}
 
@@ -503,6 +506,26 @@ _nc_capcmp(const char *s, const char *t)
     }
 }
 
+static void
+append_acs0(string_desc *dst, int code, int src)
+{
+    if (src != 0) {
+	char temp[3];
+	temp[0] = code;
+	temp[1] = src;
+	temp[2] = 0;
+	_nc_safe_strcat(dst, temp);
+    }
+}
+
+static void
+append_acs(string_desc *dst, int code, char *src)
+{
+    if (src != 0 && strlen(src) == 1) {
+	append_acs0(dst, code, *src);
+    }
+}
+
 /*
  * The ko capability, if present, consists of a comma-separated capability
  * list.  For each capability, we may assume there is a keycap that sends the
@@ -563,11 +586,11 @@ static const char C_HT[] = "\t";
 #undef CUR
 #define CUR tp->
 
-static
-void
+static void
 postprocess_termcap(TERMTYPE * tp, bool has_base)
 {
     char buf[MAX_LINE * 2 + 2];
+    string_desc result;
 
     /*
      * TERMCAP DEFAULTS AND OBSOLETE-CAPABILITY TRANSLATIONS
@@ -632,17 +655,15 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
 		} else
 		    newline = _nc_save_str(C_LF);
 	    } else if (PRESENT(carriage_return) && PRESENT(scroll_forward)) {
-		strncpy(buf, carriage_return, MAX_LINE - 2);
-		buf[MAX_LINE - 1] = '\0';
-		strncat(buf, scroll_forward, MAX_LINE - strlen(buf) - 1);
-		buf[MAX_LINE] = '\0';
-		newline = _nc_save_str(buf);
+		_nc_str_init(&result, buf, sizeof(buf));
+		if (_nc_safe_strcat(&result, carriage_return)
+		 && _nc_safe_strcat(&result, scroll_forward))
+		    newline = _nc_save_str(buf);
 	    } else if (PRESENT(carriage_return) && PRESENT(cursor_down)) {
-		strncpy(buf, carriage_return, MAX_LINE - 2);
-		buf[MAX_LINE - 1] = '\0';
-		strncat(buf, cursor_down, MAX_LINE - strlen(buf) - 1);
-		buf[MAX_LINE] = '\0';
-		newline = _nc_save_str(buf);
+		_nc_str_init(&result, buf, sizeof(buf));
+		if (_nc_safe_strcat(&result, carriage_return)
+		 && _nc_safe_strcat(&result, cursor_down))
+		    newline = _nc_save_str(buf);
 	    }
 	}
     }
@@ -695,7 +716,7 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
 	else {
 	    if (tab && _nc_capcmp(tab, C_HT))
 		_nc_warning("hardware tabs with a non-^I tab string %s",
-		    _nc_visbuf(tab));
+			    _nc_visbuf(tab));
 	    else {
 		if (WANTED(tab))
 		    tab = _nc_save_str(C_HT);
@@ -708,7 +729,8 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
      * isn't from mytinfo...
      */
     if (PRESENT(other_non_function_keys)) {
-	char *dp, *cp = strtok(other_non_function_keys, ",");
+	char *base = other_non_function_keys;
+	char *bp, *cp, *dp;
 	struct name_table_entry const *from_ptr;
 	struct name_table_entry const *to_ptr;
 	assoc const *ap;
@@ -717,15 +739,21 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
 
 	/* we're going to use this for a special case later */
 	dp = strchr(other_non_function_keys, 'i');
-	foundim = dp && dp[1] == 'm';
+	foundim = (dp != 0) && (dp[1] == 'm');
 
 	/* look at each comma-separated capability in the ko string... */
-	do {
+	for (base = other_non_function_keys;
+	     (cp = strchr(base, ',')) != 0;
+	     base = cp + 1) {
+	    size_t len = cp - base;
+
 	    for (ap = ko_xlate; ap->from; ap++)
-		if (strcmp(ap->from, cp) == 0)
+		if (len == strlen(ap->from)
+		    && strncmp(ap->from, base, len) == 0)
 		    break;
 	    if (!ap->to) {
-		_nc_warning("unknown capability `%s' in ko string", cp);
+		_nc_warning("unknown capability `%.*s' in ko string",
+			    (int) len, base);
 		continue;
 	    } else if (ap->to == CANCELLED_STRING)	/* ignore it */
 		continue;
@@ -748,11 +776,11 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
 		 * string; that's just an inefficiency.
 		 */
 		if (strcmp(
-			tp->Strings[from_ptr->nte_index],
-			tp->Strings[to_ptr->nte_index]) != 0)
+			      tp->Strings[from_ptr->nte_index],
+			      tp->Strings[to_ptr->nte_index]) != 0)
 		    _nc_warning("%s (%s) already has an explicit value %s, ignoring ko",
-			ap->to, ap->from,
-			_nc_visbuf(tp->Strings[to_ptr->nte_index]));
+				ap->to, ap->from,
+				_nc_visbuf(tp->Strings[to_ptr->nte_index]));
 		continue;
 	    }
 
@@ -760,22 +788,18 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
 	     * The magic moment -- copy the mapped key string over,
 	     * stripping out padding.
 	     */
-	    dp = buf2;
-	    for (cp = tp->Strings[from_ptr->nte_index]; *cp; cp++) {
-		if (cp[0] == '$' && cp[1] == '<') {
-		    while (*cp && *cp != '>')
-			if (!*cp)
-			    break;
-			else
-			    ++cp;
+	    for (dp = buf2, bp = tp->Strings[from_ptr->nte_index]; *bp; bp++) {
+		if (bp[0] == '$' && bp[1] == '<') {
+		    while (*bp && *bp != '>') {
+			++bp;
+		    }
 		} else
-		    *dp++ = *cp;
+		    *dp++ = *bp;
 	    }
 	    *dp++ = '\0';
 
 	    tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2);
-	} while
-	    ((cp = strtok((char *) 0, ",")) != 0);
+	}
 
 	/*
 	 * Note: ko=im and ko=ic both want to grab the `Insert'
@@ -812,74 +836,36 @@ postprocess_termcap(TERMTYPE * tp, bool has_base)
 	PRESENT(acs_hline) ||
 	PRESENT(acs_vline) ||
 	PRESENT(acs_plus)) {
-	char buf2[MAX_TERMCAP_LENGTH], *bp = buf2;
-
-	if (acs_chars) {
-	    (void) strcpy(bp, acs_chars);
-	    bp += strlen(bp);
-	}
-
-	if (acs_ulcorner && acs_ulcorner[1] == '\0') {
-	    *bp++ = 'l';
-	    *bp++ = *acs_ulcorner;
-	}
-	if (acs_llcorner && acs_llcorner[1] == '\0') {
-	    *bp++ = 'm';
-	    *bp++ = *acs_llcorner;
-	}
-	if (acs_urcorner && acs_urcorner[1] == '\0') {
-	    *bp++ = 'k';
-	    *bp++ = *acs_urcorner;
-	}
-	if (acs_lrcorner && acs_lrcorner[1] == '\0') {
-	    *bp++ = 'j';
-	    *bp++ = *acs_lrcorner;
-	}
-	if (acs_ltee && acs_ltee[1] == '\0') {
-	    *bp++ = 't';
-	    *bp++ = *acs_ltee;
-	}
-	if (acs_rtee && acs_rtee[1] == '\0') {
-	    *bp++ = 'u';
-	    *bp++ = *acs_rtee;
-	}
-	if (acs_btee && acs_btee[1] == '\0') {
-	    *bp++ = 'v';
-	    *bp++ = *acs_btee;
-	}
-	if (acs_ttee && acs_ttee[1] == '\0') {
-	    *bp++ = 'w';
-	    *bp++ = *acs_ttee;
-	}
-	if (acs_hline && acs_hline[1] == '\0') {
-	    *bp++ = 'q';
-	    *bp++ = *acs_hline;
-	}
-	if (acs_vline && acs_vline[1] == '\0') {
-	    *bp++ = 'x';
-	    *bp++ = *acs_vline;
-	}
-	if (acs_plus) {
-	    *bp++ = 'n';
-	    strcpy(bp, acs_plus);
-	    bp = buf2 + strlen(buf2);
-	}
-
-	if (bp != buf2) {
-	    *bp++ = '\0';
+	char buf2[MAX_TERMCAP_LENGTH];
+
+	_nc_str_init(&result, buf2, sizeof(buf2));
+	_nc_safe_strcat(&result, acs_chars);
+
+	append_acs (&result, 'j', acs_lrcorner);
+	append_acs (&result, 'k', acs_urcorner);
+	append_acs (&result, 'l', acs_ulcorner);
+	append_acs (&result, 'm', acs_llcorner);
+	append_acs (&result, 'n', acs_plus);
+	append_acs (&result, 'q', acs_hline);
+	append_acs (&result, 't', acs_ltee);
+	append_acs (&result, 'u', acs_rtee);
+	append_acs (&result, 'v', acs_btee);
+	append_acs (&result, 'w', acs_ttee);
+	append_acs (&result, 'x', acs_vline);
+
+	if (buf2[0]) {
 	    acs_chars = _nc_save_str(buf2);
 	    _nc_warning("acsc string synthesized from XENIX capabilities");
 	}
     } else if (acs_chars == 0
-	    && enter_alt_charset_mode != 0
-	&& exit_alt_charset_mode != 0) {
+	       && enter_alt_charset_mode != 0
+	       && exit_alt_charset_mode != 0) {
 	acs_chars =
 	    _nc_save_str("``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~");
     }
 }
 
-static
-void
+static void
 postprocess_terminfo(TERMTYPE * tp)
 {
     /*
@@ -891,60 +877,25 @@ postprocess_terminfo(TERMTYPE * tp)
      * Translate AIX forms characters.
      */
     if (PRESENT(box_chars_1)) {
-	char buf2[MAX_TERMCAP_LENGTH], *bp = buf2;
-
-	if (acs_chars) {
-	    (void) strcpy(bp, acs_chars);
-	    bp += strlen(bp);
-	}
-
-	if (box_chars_1[0]) {	/* ACS_ULCORNER */
-	    *bp++ = 'l';
-	    *bp++ = box_chars_1[0];
-	}
-	if (box_chars_1[1]) {	/* ACS_HLINE */
-	    *bp++ = 'q';
-	    *bp++ = box_chars_1[1];
-	}
-	if (box_chars_1[2]) {	/* ACS_URCORNER */
-	    *bp++ = 'k';
-	    *bp++ = box_chars_1[2];
-	}
-	if (box_chars_1[3]) {	/* ACS_VLINE */
-	    *bp++ = 'x';
-	    *bp++ = box_chars_1[3];
-	}
-	if (box_chars_1[4]) {	/* ACS_LRCORNER */
-	    *bp++ = 'j';
-	    *bp++ = box_chars_1[4];
-	}
-	if (box_chars_1[5]) {	/* ACS_LLCORNER */
-	    *bp++ = 'm';
-	    *bp++ = box_chars_1[5];
-	}
-	if (box_chars_1[6]) {	/* ACS_TTEE */
-	    *bp++ = 'w';
-	    *bp++ = box_chars_1[6];
-	}
-	if (box_chars_1[7]) {	/* ACS_RTEE */
-	    *bp++ = 'u';
-	    *bp++ = box_chars_1[7];
-	}
-	if (box_chars_1[8]) {	/* ACS_BTEE */
-	    *bp++ = 'v';
-	    *bp++ = box_chars_1[8];
-	}
-	if (box_chars_1[9]) {	/* ACS_LTEE */
-	    *bp++ = 't';
-	    *bp++ = box_chars_1[9];
-	}
-	if (box_chars_1[10]) {	/* ACS_PLUS */
-	    *bp++ = 'n';
-	    *bp++ = box_chars_1[10];
-	}
-
-	if (bp != buf2) {
-	    *bp++ = '\0';
+	char buf2[MAX_TERMCAP_LENGTH];
+	string_desc result;
+
+	_nc_str_init(&result, buf2, sizeof(buf2));
+	_nc_safe_strcat(&result, acs_chars);
+
+	append_acs0 (&result, 'l', box_chars_1[0]);	/* ACS_ULCORNER */
+	append_acs0 (&result, 'q', box_chars_1[1]);	/* ACS_HLINE */
+	append_acs0 (&result, 'k', box_chars_1[2]);	/* ACS_URCORNER */
+	append_acs0 (&result, 'x', box_chars_1[3]);	/* ACS_VLINE */
+	append_acs0 (&result, 'j', box_chars_1[4]);	/* ACS_LRCORNER */
+	append_acs0 (&result, 'm', box_chars_1[5]);	/* ACS_LLCORNER */
+	append_acs0 (&result, 'w', box_chars_1[6]);	/* ACS_TTEE */
+	append_acs0 (&result, 'u', box_chars_1[7]);	/* ACS_RTEE */
+	append_acs0 (&result, 'v', box_chars_1[8]);	/* ACS_BTEE */
+	append_acs0 (&result, 't', box_chars_1[9]);	/* ACS_LTEE */
+	append_acs0 (&result, 'n', box_chars_1[10]);	/* ACS_PLUS */
+
+	if (buf2[0]) {
 	    acs_chars = _nc_save_str(buf2);
 	    _nc_warning("acsc string synthesized from AIX capabilities");
 	    box_chars_1 = ABSENT_STRING;
@@ -963,8 +914,7 @@ postprocess_terminfo(TERMTYPE * tp)
  * up in _nc_info_table, which is organized so that the nte_index fields are
  * sorted, but the nte_type fields are not necessarily grouped together.
  */
-static
-struct name_table_entry const *
+static struct name_table_entry const *
 lookup_fullname(const char *find)
 {
     int state = -1;
@@ -991,7 +941,7 @@ lookup_fullname(const char *find)
 	    if (!strcmp(names[count], find)) {
 		struct name_table_entry const *entry_ptr = _nc_get_table(FALSE);
 		while (entry_ptr->nte_type != state
-		    || entry_ptr->nte_index != count)
+		       || entry_ptr->nte_index != count)
 		    entry_ptr++;
 		return entry_ptr;
 	    }
diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c
index 85dc3e0b..deef4985 100644
--- a/ncurses/tinfo/read_entry.c
+++ b/ncurses/tinfo/read_entry.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: read_entry.c,v 1.67 2000/03/11 12:35:45 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.69 2000/10/10 00:57:40 Todd.Miller Exp $")
 
 #if !HAVE_TELL
 #define tell(fd) 0		/* lseek() is POSIX, but not tell() - odd... */
@@ -79,7 +79,7 @@ _nc_tic_dir(const char *path)
 	if (path != 0) {
 	    result = path;
 	    have_tic_directory = TRUE;
-	} else if (!have_tic_directory) {
+	} else if (!have_tic_directory && use_terminfo_vars()) {
 	    char *envp;
 	    if ((envp = getenv("TERMINFO")) != 0)
 		return _nc_tic_dir(envp);
@@ -176,9 +176,9 @@ read_termtype(int fd, TERMTYPE * ptr)
     str_size = LOW_MSB(buf + 10);
 
     TR(TRACE_DATABASE,
-	    ("TERMTYPE name_size=%d, bool=%d/%d, num=%d/%d str=%d/%d(%d)",
-	    name_size, bool_count, BOOLCOUNT, num_count, NUMCOUNT,
-	    str_count, STRCOUNT, str_size));
+       ("TERMTYPE name_size=%d, bool=%d/%d, num=%d/%d str=%d/%d(%d)",
+	name_size, bool_count, BOOLCOUNT, num_count, NUMCOUNT,
+	str_count, STRCOUNT, str_size));
     if (name_size < 0
 	|| bool_count < 0
 	|| num_count < 0
@@ -281,19 +281,20 @@ read_termtype(int fd, TERMTYPE * ptr)
 	ptr->Strings = typeRealloc(char *, ptr->num_Strings, ptr->Strings);
 
 	TR(TRACE_DATABASE, ("extended header is %d/%d/%d(%d:%d)",
-		ext_bool_count, ext_num_count, ext_str_count, ext_str_size, ext_str_limit));
+			    ext_bool_count, ext_num_count, ext_str_count,
+			    ext_str_size, ext_str_limit));
 
 	TR(TRACE_DATABASE, ("READ %d extended-booleans @%d",
-		ext_bool_count, tell(fd)));
+			    ext_bool_count, tell(fd)));
 	if ((ptr->ext_Booleans = ext_bool_count) != 0) {
 	    if (read(fd, ptr->Booleans + BOOLCOUNT, (unsigned)
-		    ext_bool_count) != ext_bool_count)
+		     ext_bool_count) != ext_bool_count)
 		return (0);
 	}
 	even_boundary(ext_bool_count);
 
 	TR(TRACE_DATABASE, ("READ %d extended-numbers @%d",
-		ext_num_count, tell(fd)));
+			    ext_num_count, tell(fd)));
 	if ((ptr->ext_Numbers = ext_num_count) != 0) {
 	    if (!read_shorts(fd, buf, ext_num_count))
 		return (0);
@@ -307,7 +308,7 @@ read_termtype(int fd, TERMTYPE * ptr)
 	    return (0);
 
 	TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d",
-		ext_str_limit, tell(fd)));
+			    ext_str_limit, tell(fd)));
 
 	if (ext_str_limit) {
 	    if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0)
@@ -319,20 +320,20 @@ read_termtype(int fd, TERMTYPE * ptr)
 
 	if ((ptr->ext_Strings = ext_str_count) != 0) {
 	    TR(TRACE_DATABASE,
-		("Before computing extended-string capabilities str_count=%d, ext_str_count=%d",
-		    str_count, ext_str_count));
+	       ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d",
+		str_count, ext_str_count));
 	    convert_strings(buf, ptr->Strings + str_count, ext_str_count,
-		ext_str_limit, ptr->ext_str_table);
+			    ext_str_limit, ptr->ext_str_table);
 	    for (i = ext_str_count - 1; i >= 0; i--) {
 		TR(TRACE_DATABASE, ("MOVE from [%d:%d] %s",
-			i, i + str_count,
-			_nc_visbuf(ptr->Strings[i + str_count])));
+				    i, i + str_count,
+				    _nc_visbuf(ptr->Strings[i + str_count])));
 		ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count];
 		if (VALID_STRING(ptr->Strings[i + STRCOUNT]))
 		    base += (strlen(ptr->Strings[i + STRCOUNT]) + 1);
 		TR(TRACE_DATABASE, ("... to    [%d] %s",
-			i + STRCOUNT,
-			_nc_visbuf(ptr->Strings[i + STRCOUNT])));
+				    i + STRCOUNT,
+				    _nc_visbuf(ptr->Strings[i + STRCOUNT])));
 	    }
 	}
 
@@ -340,23 +341,23 @@ read_termtype(int fd, TERMTYPE * ptr)
 	    if ((ptr->ext_Names = typeCalloc(char *, need)) == 0)
 		  return (0);
 	    TR(TRACE_DATABASE,
-		("ext_NAMES starting @%d in extended_strings, first = %s",
-		    base, _nc_visbuf(ptr->ext_str_table + base)));
+	       ("ext_NAMES starting @%d in extended_strings, first = %s",
+		base, _nc_visbuf(ptr->ext_str_table + base)));
 	    convert_strings(buf + (2 * ext_str_count), ptr->ext_Names, need,
-		ext_str_limit, ptr->ext_str_table + base);
+			    ext_str_limit, ptr->ext_str_table + base);
 	}
 
 	T(("...done reading terminfo bool %d(%d) num %d(%d) str %d(%d)",
-		ptr->num_Booleans, ptr->ext_Booleans,
-		ptr->num_Numbers, ptr->ext_Numbers,
-		ptr->num_Strings, ptr->ext_Strings));
+	   ptr->num_Booleans, ptr->ext_Booleans,
+	   ptr->num_Numbers, ptr->ext_Numbers,
+	   ptr->num_Strings, ptr->ext_Strings));
 
 	TR(TRACE_DATABASE, ("extend: num_Booleans:%d", ptr->num_Booleans));
     } else
 #endif /* NCURSES_XNAMES */
     {
 	T(("...done reading terminfo bool %d num %d str %d",
-		bool_count, num_count, str_count));
+	   bool_count, num_count, str_count));
 #if NCURSES_XNAMES
 	TR(TRACE_DATABASE, ("normal: num_Booleans:%d", ptr->num_Booleans));
 #endif
@@ -398,7 +399,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE * ptr)
  */
 static int
 _nc_read_tic_entry(char *const filename,
-    const char *const dir, const char *ttn, TERMTYPE * const tp)
+		   const char *const dir, const char *ttn, TERMTYPE * const tp)
 {
 /* maximum safe length of terminfo root directory name */
 #define MAX_TPATH	(PATH_MAX - MAX_ALIAS - 6)
@@ -415,7 +416,7 @@ _nc_read_tic_entry(char *const filename,
  */
 static int
 _nc_read_terminfo_dirs(const char *dirs, char *const filename, const char *const
-    ttn, TERMTYPE * const tp)
+		       ttn, TERMTYPE * const tp)
 {
     char *list, *a;
     const char *b;
@@ -471,19 +472,22 @@ _nc_read_entry(const char *const tn, char *const filename, TERMTYPE * const tp)
 	&& _nc_read_tic_entry(filename, _nc_tic_dir(0), ttn, tp) == 1)
 	return 1;
 
-    if ((envp = getenv("TERMINFO")) != 0
-	&& _nc_read_tic_entry(filename, _nc_tic_dir(envp), ttn, tp) == 1)
-	return 1;
+    if (use_terminfo_vars()) {
+	if ((envp = getenv("TERMINFO")) != 0
+	    && _nc_read_tic_entry(filename, _nc_tic_dir(envp), ttn, tp) == 1)
+	    return 1;
 
-    if ((envp = _nc_home_terminfo()) != 0) {
-	if (_nc_read_tic_entry(filename, envp, ttn, tp) == 1) {
-	    return (1);
+	/* this is an ncurses extension */
+	if ((envp = _nc_home_terminfo()) != 0) {
+	    if (_nc_read_tic_entry(filename, envp, ttn, tp) == 1) {
+		return (1);
+	    }
 	}
-    }
 
-    /* this is an ncurses extension */
-    if ((envp = getenv("TERMINFO_DIRS")) != 0)
-	return _nc_read_terminfo_dirs(envp, filename, ttn, tp);
+	/* this is an ncurses extension */
+	if ((envp = getenv("TERMINFO_DIRS")) != 0)
+	    return _nc_read_terminfo_dirs(envp, filename, ttn, tp);
+    }
 
     /* Try the system directory.  Note that the TERMINFO_DIRS value, if
      * defined by the configure script, begins with a ":", which will be
diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c
index 26e72d40..9487dd66 100644
--- a/ncurses/tinfo/read_termcap.c
+++ b/ncurses/tinfo/read_termcap.c
@@ -55,9 +55,9 @@
 #include 
 #include 
 
-MODULE_ID("$Id: read_termcap.c,v 1.47 2000/04/15 16:53:19 Todd.C.Miller Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.51 2000/10/21 00:34:11 Philip.Guenther Exp $")
 
-#ifndef PURE_TERMINFO
+#if !PURE_TERMINFO
 
 #ifdef __EMX__
 #define is_pathname(s) ((((s) != 0) && ((s)[0] == '/')) \
@@ -81,7 +81,8 @@ MODULE_ID("$Id: read_termcap.c,v 1.47 2000/04/15 16:53:19 Todd.C.Miller Exp $")
 #define _nc_cgetset   cgetset
 #else
 static int _nc_cgetmatch(char *, const char *);
-static int _nc_getent(char **, unsigned *, int *, int, char **, int, const char *, int, char *);
+static int _nc_getent(char **, unsigned *, int *, int, char **, int, const char
+		      *, int, char *);
 static int _nc_nfcmp(const char *, char *);
 
 /*-
@@ -257,15 +258,15 @@ _nc_cgetent(char **buf, int *oline, char **db_array, const char *name)
 #define DOALLOC(size) typeRealloc(char, size, record)
 static int
 _nc_getent(
-    char **cap,			/* termcap-content */
-    unsigned *len,		/* length, needed for recursion */
-    int *beginning,		/* line-number at match */
-    int in_array,		/* index in 'db_array[] */
-    char **db_array,		/* list of files to search */
-    int fd,
-    const char *name,
-    int depth,
-    char *nfield)
+	      char **cap,	/* termcap-content */
+	      unsigned *len,	/* length, needed for recursion */
+	      int *beginning,	/* line-number at match */
+	      int in_array,	/* index in 'db_array[] */
+	      char **db_array,	/* list of files to search */
+	      int fd,
+	      const char *name,
+	      int depth,
+	      char *nfield)
 {
     register char *r_end, *rp;
     int myfd = FALSE;
@@ -318,7 +319,7 @@ _nc_getent(
 	    if (fd >= 0) {
 		(void) lseek(fd, (off_t) 0, SEEK_SET);
 	    } else if ((_nc_access(db_array[current], R_OK) < 0)
-		|| (fd = open(db_array[current], O_RDONLY, 0)) < 0) {
+		       || (fd = open(db_array[current], O_RDONLY, 0)) < 0) {
 		/* No error on unfound file. */
 		if (errno == ENOENT)
 		    continue;
@@ -481,7 +482,7 @@ _nc_getent(
 	    tcend = s;
 
 	    iret = _nc_getent(&icap, &ilen, &oline, current, db_array, fd,
-		tc, depth + 1, 0);
+			      tc, depth + 1, 0);
 	    newicap = icap;	/* Put into a register. */
 	    newilen = ilen;
 	    if (iret != TC_SUCCESS) {
@@ -769,7 +770,7 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
 
     register char *p;
     register char *cp;
-    char *dummy;
+    char *dummy = NULL;
     char **fname;
     char *home;
     int i;
@@ -777,12 +778,13 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
     char *pathvec[PVECSIZ];	/* to point to names in pathbuf */
     char **pvec;		/* holds usable tail of path vector */
     char *termpath;
+    string_desc desc;
 
     fname = pathvec;
     pvec = pathvec;
     tbuf = bp;
     p = pathbuf;
-    cp = getenv("TERMCAP");
+    cp = use_terminfo_vars() ? getenv("TERMCAP") : NULL;
 
     /*
      * TERMCAP can have one of two things in it.  It can be the name of a file
@@ -793,22 +795,29 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
      * instead.  The path is found in the TERMPATH variable, or becomes
      * "$HOME/.termcap /etc/termcap" if no TERMPATH exists.
      */
-    if (!is_pathname(cp)) {	/* no TERMCAP or it holds an entry */
+    _nc_str_init(&desc, pathbuf, sizeof(pathbuf));
+    if (cp == NULL) {
+	_nc_safe_strcpy(&desc, "/etc/termcap /usr/share/misc/termcap");
+    } else if (!is_pathname(cp)) {	/* TERMCAP holds an entry */
 	if ((termpath = getenv("TERMPATH")) != 0) {
-	    strncpy(pathbuf, termpath, PBUFSIZ - 1);
+	    _nc_safe_strcat(&desc, termpath);
 	} else {
-	    if ((home = getenv("HOME")) != 0 &&
-		strlen(home) < PBUFSIZ) {	/* setup path */
-		p += strlen(home);	/* path, looking in */
-		strcpy(pathbuf, home);	/* $HOME first */
-		*p++ = '/';
-	    }			/* if no $HOME look in current directory */
-#define	MY_PATH_DEF	".termcap /etc/termcap /usr/share/misc/termcap"
-	    strncpy(p, MY_PATH_DEF, (size_t) (PBUFSIZ - (p - pathbuf) - 1));
+	    char temp[PBUFSIZ];
+	    temp[0] = 0;
+	    if ((home = getenv("HOME")) != 0 && *home != '\0'
+		&& strchr(home, ' ') == 0
+		&& strlen(home) < sizeof(temp) - 10) {	/* setup path */
+		sprintf(temp, "%s/", home);	/* $HOME first */
+	    }
+	    /* if no $HOME look in current directory */
+	    strcat(temp, ".termcap");
+	    _nc_safe_strcat(&desc, temp);
+	    _nc_safe_strcat(&desc, " /etc/termcap");
+	    _nc_safe_strcat(&desc, " /usr/share/misc/termcap");
 	}
-    } else			/* user-defined name in TERMCAP */
-	strncpy(pathbuf, cp, PBUFSIZ - 1);	/* still can be tokenized */
-    pathbuf[PBUFSIZ - 1] = '\0';
+    } else {			/* user-defined name in TERMCAP */
+	_nc_safe_strcat(&desc, cp);	/* still can be tokenized */
+    }
 
     *fname++ = pathbuf;		/* tokenize path into vector of names */
     while (*++p) {
@@ -921,7 +930,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
     static char *source;
     static int lineno;
 
-    if ((p = getenv("TERMCAP")) != 0
+    if (use_terminfo_vars() && (p = getenv("TERMCAP")) != 0
 	&& !is_pathname(p) && _nc_name_match(p, tn, "|:")) {
 	/* TERMCAP holds a termcap entry */
 	strncpy(tc, p, sizeof(tc) - 1);
@@ -971,7 +980,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
     char pathbuf[PATH_MAX];
 
     termpaths[filecount] = 0;
-    if ((tc = getenv("TERMCAP")) != 0) {
+    if (use_terminfo_vars() && (tc = getenv("TERMCAP")) != 0) {
 	if (is_pathname(tc)) {	/* interpret as a filename */
 	    ADD_TC(tc, 0);
 	} else if (_nc_name_match(tc, tn, "|:")) {	/* treat as a capability file */
@@ -1004,7 +1013,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp)
 
 #define PRIVATE_CAP "%s/.termcap"
 
-	if ((h = getenv("HOME")) != NULL
+	if ((h = getenv("HOME")) != NULL && *h != '\0'
 	    && (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX) {
 	    /* user's .termcap, if any, should override it */
 	    (void) strcpy(envhome, h);
diff --git a/ncurses/tinfo/strings.c b/ncurses/tinfo/strings.c
new file mode 100644
index 00000000..8198ec40
--- /dev/null
+++ b/ncurses/tinfo/strings.c
@@ -0,0 +1,139 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                                                *
+ ****************************************************************************/
+
+/*
+**	lib_mvcur.c
+**/
+
+#include 
+
+MODULE_ID("$Id")
+
+/****************************************************************************
+ * Useful string functions (especially for mvcur)
+ ****************************************************************************/
+
+#if !HAVE_STRSTR
+char *
+_nc_strstr(const char *haystack, const char *needle)
+{
+    size_t len1 = strlen(haystack);
+    size_t len2 = strlen(needle);
+    char *result = 0;
+
+    while ((len1 != 0) && (len1-- >= len2)) {
+	if (!strncmp(haystack, needle, len2)) {
+	    result = haystack;
+	    break;
+	}
+	haystack++;
+    }
+    return result;
+}
+#endif
+
+/*
+ * Initialize the descriptor so we can append to it.
+ */
+string_desc *
+_nc_str_init(string_desc * dst, char *src, size_t len)
+{
+    if (dst != 0) {
+	dst->s_head = src;
+	dst->s_tail = src;
+	dst->s_size = len - 1;
+	if (src != 0)
+	    *src = 0;
+    }
+    return dst;
+}
+
+/*
+ * Initialize the descriptor for only tracking the amount of memory used.
+ */
+string_desc *
+_nc_str_null(string_desc * dst, size_t len)
+{
+    return _nc_str_init(dst, 0, len);
+}
+
+/*
+ * Copy a descriptor
+ */
+string_desc *
+_nc_str_copy(string_desc * dst, string_desc * src)
+{
+    *dst = *src;
+    return dst;
+}
+
+/*
+ * Replaces strcat into a fixed buffer, returning false on failure.
+ */
+bool
+_nc_safe_strcat(string_desc * dst, const char *src)
+{
+    if (src != 0) {
+	size_t len = strlen(src);
+
+	if (len < dst->s_size) {
+	    if (dst->s_tail != 0) {
+		strcpy(dst->s_tail, src);
+		dst->s_tail += len;
+	    }
+	    dst->s_size -= len;
+	    return TRUE;
+	}
+    }
+    return FALSE;
+}
+
+/*
+ * Replaces strcpy into a fixed buffer, returning false on failure.
+ */
+bool
+_nc_safe_strcpy(string_desc * dst, const char *src)
+{
+    if (src != 0) {
+	size_t len = strlen(src);
+
+	if (len < dst->s_size) {
+	    if (dst->s_head != 0) {
+		strcpy(dst->s_head, src);
+		dst->s_tail = dst->s_head + len;
+	    }
+	    dst->s_size -= len;
+	    return TRUE;
+	}
+    }
+    return FALSE;
+}
diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c
index 12aedd6e..af4b4fda 100644
--- a/ncurses/tinfo/write_entry.c
+++ b/ncurses/tinfo/write_entry.c
@@ -52,7 +52,7 @@
 #define TRACE_OUT(p)		/*nothing */
 #endif
 
-MODULE_ID("$Id: write_entry.c,v 1.52 2000/03/11 12:23:42 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.53 2000/10/04 02:32:14 tom Exp $")
 
 static int total_written;
 
@@ -116,10 +116,12 @@ _nc_set_writedir(char *dir)
     const char *destination;
     char actual[PATH_MAX];
 
+    if (dir == 0
+     && use_terminfo_vars())
+	dir = getenv("TERMINFO");
+
     if (dir != 0)
 	(void) _nc_tic_dir(dir);
-    else if (getenv("TERMINFO") != NULL)
-	(void) _nc_tic_dir(getenv("TERMINFO"));
 
     destination = _nc_tic_dir(0);
     if (make_directory(destination) < 0) {
diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c
index d9e00751..c65c584f 100644
--- a/ncurses/trace/lib_traceatr.c
+++ b/ncurses/trace/lib_traceatr.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,27 +31,29 @@
  *     and: Eric S. Raymond                          *
  ****************************************************************************/
 
-
-
 /*
  *	lib_traceatr.c - Tracing/Debugging routines (attributes)
  */
 
 #include 
-#include 	/* acs_chars */
+#include 		/* acs_chars */
 
-MODULE_ID("$Id: lib_traceatr.c,v 1.28 1998/03/21 18:39:36 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.30 2000/07/29 18:06:09 tom Exp $")
 
 #define COLOR_OF(c) (c < 0 || c > 7 ? "default" : colors[c].name)
 
 #ifdef TRACE
-char *_traceattr2(int bufnum, attr_t newmode)
+char *
+_traceattr2(int bufnum, attr_t newmode)
 {
-char	*buf = _nc_trace_buf(bufnum, BUFSIZ);
-char	*tmp = buf;
-static const	struct {unsigned int val; const char *name;}
-names[] =
+    char *buf = _nc_trace_buf(bufnum, BUFSIZ);
+    char *tmp = buf;
+    static const struct {
+	unsigned int val;
+	const char *name;
+    } names[] =
     {
+	/* *INDENT-OFF* */
 	{ A_STANDOUT,		"A_STANDOUT" },
 	{ A_UNDERLINE,		"A_UNDERLINE" },
 	{ A_REVERSE,		"A_REVERSE" },
@@ -64,9 +66,12 @@ names[] =
 	{ A_CHARTEXT,		"A_CHARTEXT" },
 	{ A_NORMAL,		"A_NORMAL" },
 	{ A_COLOR,		"A_COLOR" },
+	/* *INDENT-ON* */
+
     },
-colors[] =
+	colors[] =
     {
+	/* *INDENT-OFF* */
 	{ COLOR_BLACK,		"COLOR_BLACK" },
 	{ COLOR_RED,		"COLOR_RED" },
 	{ COLOR_GREEN,		"COLOR_GREEN" },
@@ -75,122 +80,125 @@ colors[] =
 	{ COLOR_MAGENTA,	"COLOR_MAGENTA" },
 	{ COLOR_CYAN,		"COLOR_CYAN" },
 	{ COLOR_WHITE,		"COLOR_WHITE" },
+	/* *INDENT-ON* */
+
     };
-size_t n;
-unsigned save_nc_tracing = _nc_tracing;
-	_nc_tracing = 0;
-
-	strcpy(tmp++, "{");
-
-	for (n = 0; n < SIZEOF(names); n++) {
-		if ((newmode & names[n].val) != 0) {
-			if (buf[1] != '\0')
-				strcat(tmp, "|");
-			strcat(tmp, names[n].name);
-			tmp += strlen(tmp);
-
-			if (names[n].val == A_COLOR)
-			{
-				short pairnum = PAIR_NUMBER(newmode);
-				short fg, bg;
-	
-				if (pair_content(pairnum, &fg, &bg) == OK)
-					(void) sprintf(tmp,
-						"{%d = {%s, %s}}",
-						pairnum,
-						COLOR_OF(fg),
-						COLOR_OF(bg)
-						);
-				else
-					(void) sprintf(tmp, "{%d}", pairnum);
-			}
-		}
-	}
-	if (AttrOf(newmode) == A_NORMAL) {
-		if (buf[1] != '\0')
-			strcat(tmp, "|");
-		strcat(tmp, "A_NORMAL");
+    size_t n;
+    unsigned save_nc_tracing = _nc_tracing;
+    _nc_tracing = 0;
+
+    strcpy(tmp++, "{");
+
+    for (n = 0; n < SIZEOF(names); n++) {
+	if ((newmode & names[n].val) != 0) {
+	    if (buf[1] != '\0')
+		strcat(tmp, "|");
+	    strcat(tmp, names[n].name);
+	    tmp += strlen(tmp);
+
+	    if (names[n].val == A_COLOR) {
+		short pairnum = PAIR_NUMBER(newmode);
+		short fg, bg;
+
+		if (pair_content(pairnum, &fg, &bg) == OK)
+		    (void) sprintf(tmp,
+				   "{%d = {%s, %s}}",
+				   pairnum,
+				   COLOR_OF(fg),
+				   COLOR_OF(bg)
+			);
+		else
+		    (void) sprintf(tmp, "{%d}", pairnum);
+	    }
 	}
+    }
+    if (AttrOf(newmode) == A_NORMAL) {
+	if (buf[1] != '\0')
+	    strcat(tmp, "|");
+	strcat(tmp, "A_NORMAL");
+    }
 
-	_nc_tracing = save_nc_tracing;
-	return (strcat(buf,"}"));
+    _nc_tracing = save_nc_tracing;
+    return (strcat(buf, "}"));
 }
 
-char *_traceattr(attr_t newmode)
+char *
+_traceattr(attr_t newmode)
 {
-	return _traceattr2(0, newmode);
+    return _traceattr2(0, newmode);
 }
 
 /* Trace 'int' return-values */
-attr_t _nc_retrace_attr_t(attr_t code)
+attr_t
+_nc_retrace_attr_t(attr_t code)
 {
-	T((T_RETURN("%s"), _traceattr(code)));
-	return code;
+    T((T_RETURN("%s"), _traceattr(code)));
+    return code;
 }
 
-char *_tracechtype2(int bufnum, chtype ch)
+char *
+_tracechtype2(int bufnum, chtype ch)
 {
-char	*buf = _nc_trace_buf(bufnum, BUFSIZ);
-char	*found = 0;
+    char *buf = _nc_trace_buf(bufnum, BUFSIZ);
+    char *found = 0;
 
     strcpy(buf, "{");
-    if (ch & A_ALTCHARSET)
-    {
-	char	*cp;
-	static const	struct {unsigned int val; const char *name;}
-	names[] =
+    if (ch & A_ALTCHARSET) {
+	char *cp;
+	static const struct {
+	    unsigned int val;
+	    const char *name;
+	} names[] =
 	{
-	    {'l', "ACS_ULCORNER"},	/* upper left corner */
-	    {'m', "ACS_LLCORNER"},	/* lower left corner */
-	    {'k', "ACS_URCORNER"},	/* upper right corner */
-	    {'j', "ACS_LRCORNER"},	/* lower right corner */
-	    {'t', "ACS_LTEE"},		/* tee pointing right */
-	    {'u', "ACS_RTEE"},		/* tee pointing left */
-	    {'v', "ACS_BTEE"},		/* tee pointing up */
-	    {'w', "ACS_TTEE"},		/* tee pointing down */
-	    {'q', "ACS_HLINE"},		/* horizontal line */
-	    {'x', "ACS_VLINE"},		/* vertical line */
-	    {'n', "ACS_PLUS"},		/* large plus or crossover */
-	    {'o', "ACS_S1"},		/* scan line 1 */
-	    {'s', "ACS_S9"},		/* scan line 9 */
-	    {'`', "ACS_DIAMOND"},	/* diamond */
-	    {'a', "ACS_CKBOARD"},	/* checker board (stipple) */
-	    {'f', "ACS_DEGREE"},	/* degree symbol */
-	    {'g', "ACS_PLMINUS"},	/* plus/minus */
-	    {'~', "ACS_BULLET"},	/* bullet */
-	    {',', "ACS_LARROW"},	/* arrow pointing left */
-	    {'+', "ACS_RARROW"},	/* arrow pointing right */
-	    {'.', "ACS_DARROW"},	/* arrow pointing down */
-	    {'-', "ACS_UARROW"},	/* arrow pointing up */
-	    {'h', "ACS_BOARD"},		/* board of squares */
-	    {'i', "ACS_LANTERN"},	/* lantern symbol */
-	    {'0', "ACS_BLOCK"},		/* solid square block */
-	    {'p', "ACS_S3"},		/* scan line 3 */
-	    {'r', "ACS_S7"},		/* scan line 7 */
-	    {'y', "ACS_LEQUAL"},	/* less/equal */
-	    {'z', "ACS_GEQUAL"},	/* greater/equal */
-	    {'{', "ACS_PI"},		/* Pi */
-	    {'|', "ACS_NEQUAL"},	/* not equal */
-	    {'}', "ACS_STERLING"},	/* UK pound sign */
-	    {'\0',(char *)0}
+	    /* *INDENT-OFF* */
+	    { 'l', "ACS_ULCORNER" },	/* upper left corner */
+	    { 'm', "ACS_LLCORNER" },	/* lower left corner */
+	    { 'k', "ACS_URCORNER" },	/* upper right corner */
+	    { 'j', "ACS_LRCORNER" },	/* lower right corner */
+	    { 't', "ACS_LTEE" },	/* tee pointing right */
+	    { 'u', "ACS_RTEE" },	/* tee pointing left */
+	    { 'v', "ACS_BTEE" },	/* tee pointing up */
+	    { 'w', "ACS_TTEE" },	/* tee pointing down */
+	    { 'q', "ACS_HLINE" },	/* horizontal line */
+	    { 'x', "ACS_VLINE" },	/* vertical line */
+	    { 'n', "ACS_PLUS" },	/* large plus or crossover */
+	    { 'o', "ACS_S1" },		/* scan line 1 */
+	    { 's', "ACS_S9" },		/* scan line 9 */
+	    { '`', "ACS_DIAMOND" },	/* diamond */
+	    { 'a', "ACS_CKBOARD" },	/* checker board (stipple) */
+	    { 'f', "ACS_DEGREE" },	/* degree symbol */
+	    { 'g', "ACS_PLMINUS" },	/* plus/minus */
+	    { '~', "ACS_BULLET" },	/* bullet */
+	    { ',', "ACS_LARROW" },	/* arrow pointing left */
+	    { '+', "ACS_RARROW" },	/* arrow pointing right */
+	    { '.', "ACS_DARROW" },	/* arrow pointing down */
+	    { '-', "ACS_UARROW" },	/* arrow pointing up */
+	    { 'h', "ACS_BOARD" },	/* board of squares */
+	    { 'i', "ACS_LANTERN" },	/* lantern symbol */
+	    { '0', "ACS_BLOCK" },	/* solid square block */
+	    { 'p', "ACS_S3" },		/* scan line 3 */
+	    { 'r', "ACS_S7" },		/* scan line 7 */
+	    { 'y', "ACS_LEQUAL" },	/* less/equal */
+	    { 'z', "ACS_GEQUAL" },	/* greater/equal */
+	    { '{', "ACS_PI" },		/* Pi */
+	    { '|', "ACS_NEQUAL" },	/* not equal */
+	    { '}', "ACS_STERLING" },	/* UK pound sign */
+	    { '\0', (char *) 0 }
+		/* *INDENT-OFF* */
 	},
-	*sp;
+	    *sp;
 
-	for (cp = acs_chars; cp[0] && cp[1]; cp += 2)
-	{
-	    if (TextOf(cp[1]) == TextOf(ch))
-	    {
+	for (cp = acs_chars; cp[0] && cp[1]; cp += 2) {
+	    if (TextOf(cp[1]) == TextOf(ch)) {
 		found = cp;
 		/* don't exit from loop - there may be redefinitions */
 	    }
 	}
 
-	if (found != 0)
-	{
+	if (found != 0) {
 	    ch = TextOf(*found);
 	    for (sp = names; sp->val; sp++)
-		if (sp->val == ch)
-		{
+		if (sp->val == ch) {
 		    (void) strcat(buf, sp->name);
 		    ch &= ~A_ALTCHARSET;
 		    break;
@@ -202,17 +210,31 @@ char	*found = 0;
 	(void) strcat(buf, _tracechar(TextOf(ch)));
 
     if (AttrOf(ch) != A_NORMAL)
-	(void) sprintf(buf + strlen(buf), " | %s", _traceattr2(bufnum+20,AttrOf(ch)));
+	(void) sprintf(buf + strlen(buf), " | %s",
+		_traceattr2(bufnum + 20, AttrOf(ch)));
 
     strcat(buf, "}");
-    return(buf);
+    return (buf);
 }
 
-char *_tracechtype(chtype ch)
+char *
+_tracechtype(chtype ch)
 {
-	return _tracechtype2(0, ch);
+    return _tracechtype2(0, ch);
 }
+
+/* Trace 'chtype' return-values */
+attr_t
+_nc_retrace_chtype(attr_t code)
+{
+    T((T_RETURN("%s"), _tracechtype(code)));
+    return code;
+}
+
 #else
-extern	void _nc_lib_traceatr(void);
-	void _nc_lib_traceatr(void) { }
+extern void _nc_lib_traceatr(void);
+void
+_nc_lib_traceatr(void)
+{
+}
 #endif /* TRACE */
diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c
index 6dbb2f79..a8cb343b 100644
--- a/ncurses/trace/lib_tracebits.c
+++ b/ncurses/trace/lib_tracebits.c
@@ -34,9 +34,9 @@
 #include 
 #include 		/* cur_term */
 
-MODULE_ID("$Id: lib_tracebits.c,v 1.5 2000/02/13 01:01:55 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.7 2000/09/02 18:08:37 tom Exp $")
 
-#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
+#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
 #endif
 
@@ -153,30 +153,41 @@ _nc_tracebits(void)
 	lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.c_cflag);
 
 #if defined(CS5) && defined(CS8)
-    switch (cur_term->Nttyb.c_cflag & CSIZE) {
-#if defined(CS5) && (CS5 != 0)
-    case CS5:
-	strcat(buf, "CS5 ");
-	break;
-#endif
-#if defined(CS6) && (CS6 != 0)
-    case CS6:
-	strcat(buf, "CS6 ");
-	break;
-#endif
-#if defined(CS7) && (CS7 != 0)
-    case CS7:
-	strcat(buf, "CS7 ");
-	break;
-#endif
-#if defined(CS8) && (CS8 != 0)
-    case CS8:
-	strcat(buf, "CS8 ");
-	break;
-#endif
-    default:
-	strcat(buf, "CSIZE? ");
-	break;
+    {
+	static struct {
+	    char *name;
+	    int value;
+	} csizes[] = {
+	    {
+		"CS5 ", CS5
+	    },
+#ifdef CS6
+	    {
+		"CS6 ", CS6
+	    },
+#endif
+#ifdef CS7
+	    {
+		"CS7 ", CS7
+	    },
+#endif
+	    {
+		"CS8 ", CS8
+	    },
+	};
+	char *result = "CSIZE? ";
+	int value = (cur_term->Nttyb.c_cflag & CSIZE);
+	unsigned n;
+
+	if (value != 0) {
+	    for (n = 0; n < SIZEOF(csizes); n++) {
+		if (csizes[n].value == value) {
+		    result = csizes[n].name;
+		    break;
+		}
+	    }
+	}
+	strcat(buf, result);
     }
 #endif
 
diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh
index b008becc..e44f5834 100755
--- a/ncurses/tty/MKexpanded.sh
+++ b/ncurses/tty/MKexpanded.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 ##############################################################################
-# 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 "Software"), #
@@ -29,7 +29,7 @@
 #
 # Author: Thomas E. Dickey  1997
 #
-# $Id: MKexpanded.sh,v 1.7 1998/11/11 20:15:39 Alexander.V.Lukyanov Exp $
+# $Id: MKexpanded.sh,v 1.9 2000/09/02 22:55:21 tom Exp $
 #
 # Script to generate 'expanded.c', a dummy source that contains functions
 # corresponding to complex macros used in this library.  By making functions,
@@ -54,7 +54,7 @@ cat <
 #include 
-#ifdef NCURSES_EXPANDED
+#if NCURSES_EXPANDED
 EOF
 
 cat >$TMP <
 #include 
 
-MODULE_ID("$Id: lib_mvcur.c,v 1.67 2000/06/24 21:13:51 tom Exp $")
-
-#define STRLEN(s)       (s != 0) ? strlen(s) : 0
+MODULE_ID("$Id: lib_mvcur.c,v 1.72 2000/10/08 00:58:25 tom Exp $")
 
 #define CURRENT_ROW	SP->_cursrow	/* phys cursor row */
 #define CURRENT_COLUMN	SP->_curscol	/* phys cursor column */
@@ -174,25 +172,6 @@ static float diff;
 
 static int normalized_cost(const char *const cap, int affcnt);
 
-#if !HAVE_STRSTR
-char *
-_nc_strstr(const char *haystack, const char *needle)
-{
-    size_t len1 = strlen(haystack);
-    size_t len2 = strlen(needle);
-    char *result = 0;
-
-    while ((len1 != 0) && (len1-- >= len2)) {
-	if (!strncmp(haystack, needle, len2)) {
-	    result = haystack;
-	    break;
-	}
-	haystack++;
-    }
-    return result;
-}
-#endif
-
 /****************************************************************************
  *
  * Initialization/wrapup (including cost pre-computation)
@@ -205,7 +184,7 @@ trace_cost_of(const char *capname, const char *cap, int affcnt)
 {
     int result = _nc_msec_cost(cap, affcnt);
     TR(TRACE_CHARPUT | TRACE_MOVE,
-	("CostOf %s %d %s", capname, result, _nc_visbuf(cap)));
+       ("CostOf %s %d %s", capname, result, _nc_visbuf(cap)));
     return result;
 }
 #define CostOf(cap,affcnt) trace_cost_of(#cap,cap,affcnt);
@@ -215,7 +194,7 @@ trace_normalized_cost(const char *capname, const char *cap, int affcnt)
 {
     int result = normalized_cost(cap, affcnt);
     TR(TRACE_CHARPUT | TRACE_MOVE,
-	("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap)));
+       ("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap)));
     return result;
 }
 #define NormalizedCost(cap,affcnt) trace_normalized_cost(#cap,cap,affcnt);
@@ -235,12 +214,12 @@ _nc_msec_cost(const char *const cap, int affcnt)
 	return (INFINITY);
     else {
 	const char *cp;
-	float cum_cost = 0;
+	float cum_cost = 0.0;
 
 	for (cp = cap; *cp; cp++) {
 	    /* extract padding, either mandatory or required */
 	    if (cp[0] == '$' && cp[1] == '<' && strchr(cp, '>')) {
-		float number = 0;
+		float number = 0.0;
 
 		for (cp += 2; *cp != '>'; cp++) {
 		    if (isdigit(*cp))
@@ -251,7 +230,7 @@ _nc_msec_cost(const char *const cap, int affcnt)
 			number += (*cp - '0') / 10.0;
 		}
 
-#ifdef NCURSES_NO_PADDING
+#if NCURSES_NO_PADDING
 		if (!(SP->_no_padding))
 #endif
 		    cum_cost += number * 10;
@@ -402,13 +381,8 @@ _nc_mvcur_init(void)
     SP->_hpa_ch_cost = NormalizedCost(tparm(column_address, 23), 1);
     SP->_cuf_ch_cost = NormalizedCost(tparm(parm_right_cursor, 23), 1);
     SP->_inline_cost = min(SP->_cup_ch_cost,
-	min(SP->_hpa_ch_cost,
-	    SP->_cuf_ch_cost));
-
-    /* pre-compute some capability lengths */
-    SP->_carriage_return_length = STRLEN(carriage_return);
-    SP->_cursor_home_length = STRLEN(cursor_home);
-    SP->_cursor_to_ll_length = STRLEN(cursor_to_ll);
+			   min(SP->_hpa_ch_cost,
+			       SP->_cuf_ch_cost));
 
     /*
      * If save_cursor is used within enter_ca_mode, we should not use it for
@@ -468,18 +442,17 @@ _nc_mvcur_wrap(void)
  * Perform repeated-append, returning cost
  */
 static inline int
-repeated_append(int total, int num, int repeat, char *dst, const char *src)
+repeated_append(string_desc * target, int total, int num, int repeat, const char *src)
 {
-    register size_t src_len = strlen(src);
-    register size_t dst_len = STRLEN(dst);
-
-    if ((dst_len + repeat * src_len) < OPT_SIZE - 1) {
-	total += (num * repeat);
-	if (dst) {
-	    dst += dst_len;
-	    while (repeat-- > 0) {
-		(void) strcpy(dst, src);
-		dst += src_len;
+    size_t need = repeat * strlen(src);
+
+    if (need < target->s_size) {
+	while (repeat-- > 0) {
+	    if (_nc_safe_strcat(target, src)) {
+		total += num;
+	    } else {
+		total = INFINITY;
+		break;
 	    }
 	}
     } else {
@@ -497,53 +470,51 @@ repeated_append(int total, int num, int repeat, char *dst, const char *src)
  */
 #define LASTTAB(fr)	((fr > 0) ? ((fr - 1) / init_tabs) * init_tabs : -1)
 
-/* Note: we'd like to inline this for speed, but GNU C barfs on the attempt. */
-
 static int
-relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw)
+relative_move(string_desc * target, int from_y, int from_x, int to_y, int
+	      to_x, bool ovw)
 /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */
 {
+    string_desc save;
     int n, vcost = 0, hcost = 0;
 
-    if (result)
-	result[0] = '\0';
+    (void) _nc_str_copy(&save, target);
 
     if (to_y != from_y) {
 	vcost = INFINITY;
 
-	if (row_address) {
-	    if (result)
-		(void) strcpy(result, tparm(row_address, to_y));
+	if (row_address != 0
+	    && _nc_safe_strcat(target, tparm(row_address, to_y))) {
 	    vcost = SP->_vpa_cost;
 	}
 
 	if (to_y > from_y) {
 	    n = (to_y - from_y);
 
-	    if (parm_down_cursor && SP->_cud_cost < vcost) {
-		if (result)
-		    (void) strcpy(result, tparm(parm_down_cursor, n));
+	    if (parm_down_cursor
+		&& SP->_cud_cost < vcost
+		&& _nc_safe_strcat(_nc_str_copy(target, &save),
+				   tparm(parm_down_cursor, n))) {
 		vcost = SP->_cud_cost;
 	    }
 
 	    if (cursor_down && (n * SP->_cud1_cost < vcost)) {
-		if (result)
-		    result[0] = '\0';
-		vcost = repeated_append(0, SP->_cud1_cost, n, result, cursor_down);
+		vcost = repeated_append(_nc_str_copy(target, &save), 0,
+					SP->_cud1_cost, n, cursor_down);
 	    }
 	} else {		/* (to_y < from_y) */
 	    n = (from_y - to_y);
 
-	    if (parm_up_cursor && SP->_cup_cost < vcost) {
-		if (result)
-		    (void) strcpy(result, tparm(parm_up_cursor, n));
+	    if (parm_up_cursor
+		&& SP->_cup_cost < vcost
+		&& _nc_safe_strcat(_nc_str_copy(target, &save),
+				   tparm(parm_up_cursor, n))) {
 		vcost = SP->_cup_cost;
 	    }
 
 	    if (cursor_up && (n * SP->_cuu1_cost < vcost)) {
-		if (result)
-		    result[0] = '\0';
-		vcost = repeated_append(0, SP->_cuu1_cost, n, result, cursor_up);
+		vcost = repeated_append(_nc_str_copy(target, &save), 0,
+					SP->_cuu1_cost, n, cursor_up);
 	    }
 	}
 
@@ -551,33 +522,34 @@ relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw
 	    return (INFINITY);
     }
 
-    if (result)
-	result += strlen(result);
+    save = *target;
 
     if (to_x != from_x) {
 	char str[OPT_SIZE];
+	string_desc check;
 
 	hcost = INFINITY;
 
-	if (column_address) {
-	    if (result)
-		(void) strcpy(result, tparm(column_address, to_x));
+	if (column_address
+	    && _nc_safe_strcat(_nc_str_copy(target, &save),
+			       tparm(column_address, to_x))) {
 	    hcost = SP->_hpa_cost;
 	}
 
 	if (to_x > from_x) {
 	    n = to_x - from_x;
 
-	    if (parm_right_cursor && SP->_cuf_cost < hcost) {
-		if (result)
-		    (void) strcpy(result, tparm(parm_right_cursor, n));
+	    if (parm_right_cursor
+		&& SP->_cuf_cost < hcost
+		&& _nc_safe_strcat(_nc_str_copy(target, &save),
+				   tparm(parm_right_cursor, n))) {
 		hcost = SP->_cuf_cost;
 	    }
 
 	    if (cursor_right) {
 		int lhcost = 0;
 
-		str[0] = '\0';
+		(void) _nc_str_init(&check, str, sizeof(str));
 
 #if USE_HARD_TABS
 		/* use hard tabs, if we have them, to do as much as possible */
@@ -585,8 +557,8 @@ relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw
 		    int nxt, fr;
 
 		    for (fr = from_x; (nxt = NEXTTAB(fr)) <= to_x; fr = nxt) {
-			lhcost = repeated_append(lhcost, SP->_ht_cost, 1,
-			    str, tab);
+			lhcost = repeated_append(&check, lhcost,
+						 SP->_ht_cost, 1, tab);
 			if (lhcost == INFINITY)
 			    break;
 		    }
@@ -597,7 +569,7 @@ relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw
 #endif /* USE_HARD_TABS */
 
 #if defined(REAL_ATTR) && defined(WANT_CHAR)
-#ifdef BSD_TPUTS
+#if BSD_TPUTS
 		/*
 		 * If we're allowing BSD-style padding in tputs, don't generate
 		 * a string with a leading digit.  Otherwise, that will be
@@ -606,6 +578,7 @@ relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw
 		 */
 		if (ovw
 		    && n > 0
+		    && n < (int) check.s_size
 		    && vcost == 0
 		    && str[0] == '\0'
 		    && isdigit(TextOf(WANT_CHAR(to_y, from_x))))
@@ -629,48 +602,47 @@ relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw
 			}
 		}
 		if (ovw) {
-		    char *sp;
 		    int i;
 
-		    sp = str + strlen(str);
-
 		    for (i = 0; i < n; i++)
-			*sp++ = WANT_CHAR(to_y, from_x + i);
-		    *sp = '\0';
+			*check.s_tail++ = WANT_CHAR(to_y, from_x + i);
+		    *check.s_tail = '\0';
+		    check.s_size -= n;
 		    lhcost += n * SP->_char_padding;
 		} else
 #endif /* defined(REAL_ATTR) && defined(WANT_CHAR) */
 		{
-		    lhcost = repeated_append(lhcost, SP->_cuf1_cost, n, str, cursor_right);
+		    lhcost = repeated_append(&check, lhcost, SP->_cuf1_cost,
+					     n, cursor_right);
 		}
 
-		if (lhcost < hcost) {
-		    if (result)
-			(void) strcpy(result, str);
+		if (lhcost < hcost
+		    && _nc_safe_strcat(_nc_str_copy(target, &save), str)) {
 		    hcost = lhcost;
 		}
 	    }
 	} else {		/* (to_x < from_x) */
 	    n = from_x - to_x;
 
-	    if (parm_left_cursor && SP->_cub_cost < hcost) {
-		if (result)
-		    (void) strcpy(result, tparm(parm_left_cursor, n));
+	    if (parm_left_cursor
+		&& SP->_cub_cost < hcost
+		&& _nc_safe_strcat(_nc_str_copy(target, &save),
+				   tparm(parm_left_cursor, n))) {
 		hcost = SP->_cub_cost;
 	    }
 
 	    if (cursor_left) {
 		int lhcost = 0;
 
-		str[0] = '\0';
+		(void) _nc_str_init(&check, str, sizeof(str));
 
 #if USE_HARD_TABS
 		if (init_tabs > 0 && back_tab) {
 		    int nxt, fr;
 
 		    for (fr = from_x; (nxt = LASTTAB(fr)) >= to_x; fr = nxt) {
-			lhcost = repeated_append(lhcost, SP->_cbt_cost, 1,
-			    str, back_tab);
+			lhcost = repeated_append(&check, lhcost,
+						 SP->_cbt_cost, 1, back_tab);
 			if (lhcost == INFINITY)
 			    break;
 		    }
@@ -679,11 +651,10 @@ relative_move(char *result, int from_y, int from_x, int to_y, int to_x, bool ovw
 		}
 #endif /* USE_HARD_TABS */
 
-		lhcost = repeated_append(lhcost, SP->_cub1_cost, n, str, cursor_left);
+		lhcost = repeated_append(&check, lhcost, SP->_cub1_cost, n, cursor_left);
 
-		if (lhcost < hcost) {
-		    if (result)
-			(void) strcpy(result, str);
+		if (lhcost < hcost
+		    && _nc_safe_strcat(_nc_str_copy(target, &save), str)) {
 		    hcost = lhcost;
 		}
 	    }
@@ -712,7 +683,8 @@ static inline int
 onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
 /* onscreen move from (yold, xold) to (ynew, xnew) */
 {
-    char use[OPT_SIZE], *sp;
+    string_desc result;
+    char buffer[OPT_SIZE];
     int tactic = 0, newcost, usecost = INFINITY;
     int t5_cr_cost;
 
@@ -722,11 +694,12 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
     gettimeofday(&before, NULL);
 #endif /* MAIN */
 
+#define NullResult _nc_str_null(&result, sizeof(buffer))
+#define InitResult _nc_str_init(&result, buffer, sizeof(buffer))
+
     /* tactic #0: use direct cursor addressing */
-    sp = tparm(SP->_address_cursor, ynew, xnew);
-    if (sp) {
+    if (_nc_safe_strcpy(InitResult, tparm(SP->_address_cursor, ynew, xnew))) {
 	tactic = 0;
-	(void) strcpy(use, sp);
 	usecost = SP->_cup_cost;
 
 #if defined(TRACE) || defined(NCURSES_TEST)
@@ -756,7 +729,8 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
 #ifndef NO_OPTIMIZE
     /* tactic #1: use local movement */
     if (yold != -1 && xold != -1
-	&& ((newcost = relative_move(NULL, yold, xold, ynew, xnew, ovw)) != INFINITY)
+	&& ((newcost = relative_move(NullResult, yold, xold, ynew, xnew,
+				     ovw)) != INFINITY)
 	&& newcost < usecost) {
 	tactic = 1;
 	usecost = newcost;
@@ -764,7 +738,8 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
 
     /* tactic #2: use carriage-return + local movement */
     if (yold != -1 && carriage_return
-	&& ((newcost = relative_move(NULL, yold, 0, ynew, xnew, ovw)) != INFINITY)
+	&& ((newcost = relative_move(NullResult, yold, 0, ynew, xnew, ovw))
+	    != INFINITY)
 	&& SP->_cr_cost + newcost < usecost) {
 	tactic = 2;
 	usecost = SP->_cr_cost + newcost;
@@ -772,7 +747,7 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
 
     /* tactic #3: use home-cursor + local movement */
     if (cursor_home
-	&& ((newcost = relative_move(NULL, 0, 0, ynew, xnew, ovw)) != INFINITY)
+	&& ((newcost = relative_move(NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY)
 	&& SP->_home_cost + newcost < usecost) {
 	tactic = 3;
 	usecost = SP->_home_cost + newcost;
@@ -780,8 +755,8 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
 
     /* tactic #4: use home-down + local movement */
     if (cursor_to_ll
-	&& ((newcost = relative_move(NULL, screen_lines - 1, 0, ynew, xnew,
-		    ovw)) != INFINITY)
+	&& ((newcost = relative_move(NullResult, screen_lines - 1, 0, ynew,
+				     xnew, ovw)) != INFINITY)
 	&& SP->_ll_cost + newcost < usecost) {
 	tactic = 4;
 	usecost = SP->_ll_cost + newcost;
@@ -794,8 +769,8 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
     t5_cr_cost = (xold > 0 ? SP->_cr_cost : 0);
     if (auto_left_margin && !eat_newline_glitch
 	&& yold > 0 && cursor_left
-	&& ((newcost = relative_move(NULL, yold - 1, screen_columns - 1,
-		    ynew, xnew, ovw)) != INFINITY)
+	&& ((newcost = relative_move(NullResult, yold - 1, screen_columns -
+				     1, ynew, xnew, ovw)) != INFINITY)
 	&& t5_cr_cost + SP->_cub1_cost + newcost < usecost) {
 	tactic = 5;
 	usecost = t5_cr_cost + SP->_cub1_cost + newcost;
@@ -804,32 +779,30 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
     /*
      * These cases are ordered by estimated relative frequency.
      */
+    if (tactic)
+	InitResult;
     switch (tactic) {
     case 1:
-	(void) relative_move(use, yold, xold, ynew, xnew, ovw);
+	(void) relative_move(&result, yold, xold, ynew, xnew, ovw);
 	break;
     case 2:
-	(void) strcpy(use, carriage_return);
-	(void) relative_move(use + SP->_carriage_return_length,
-	    yold, 0, ynew, xnew, ovw);
+	(void) _nc_safe_strcpy(&result, carriage_return);
+	(void) relative_move(&result, yold, 0, ynew, xnew, ovw);
 	break;
     case 3:
-	(void) strcpy(use, cursor_home);
-	(void) relative_move(use + SP->_cursor_home_length,
-	    0, 0, ynew, xnew, ovw);
+	(void) _nc_safe_strcpy(&result, cursor_home);
+	(void) relative_move(&result, 0, 0, ynew, xnew, ovw);
 	break;
     case 4:
-	(void) strcpy(use, cursor_to_ll);
-	(void) relative_move(use + SP->_cursor_to_ll_length,
-	    screen_lines - 1, 0, ynew, xnew, ovw);
+	(void) _nc_safe_strcpy(&result, cursor_to_ll);
+	(void) relative_move(&result, screen_lines - 1, 0, ynew, xnew, ovw);
 	break;
     case 5:
-	use[0] = '\0';
 	if (xold > 0)
-	    (void) strcat(use, carriage_return);
-	(void) strcat(use, cursor_left);
-	(void) relative_move(use + strlen(use),
-	    yold - 1, screen_columns - 1, ynew, xnew, ovw);
+	    (void) _nc_safe_strcat(&result, carriage_return);
+	(void) _nc_safe_strcat(&result, cursor_left);
+	(void) relative_move(&result, yold - 1, screen_columns - 1, ynew,
+			     xnew, ovw);
 	break;
     }
 #endif /* !NO_OPTIMIZE */
@@ -840,14 +813,14 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
 	+ (after.tv_sec - before.tv_sec) * 1000000;
     if (!profiling)
 	(void) fprintf(stderr,
-	    "onscreen: %d msec, %f 28.8Kbps char-equivalents\n",
-	    (int) diff, diff / 288);
+		       "onscreen: %d msec, %f 28.8Kbps char-equivalents\n",
+		       (int) diff, diff / 288);
 #endif /* MAIN */
 
   nonlocal:
     if (usecost != INFINITY) {
 	TPUTS_TRACE("mvcur");
-	tputs(use, 1, _nc_outch);
+	tputs(buffer, 1, _nc_outch);
 	return (OK);
     } else
 	return (ERR);
@@ -951,7 +924,7 @@ _nc_outch(int ch)
 }
 
 char PC = 0;			/* used by termcap library */
-speed_t ospeed = 0;		/* used by termcap library */
+short ospeed = 0;		/* used by termcap library */
 int _nc_nulls_sent = 0;		/* used by 'tack' program */
 
 int
@@ -1009,7 +982,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 	    (void) puts("s[croll] n t b m -- display scrolling sequence");
 	    (void)
 		printf("r[eload]         -- reload terminal info for %s\n",
-		termname());
+		       termname());
 	    (void)
 		puts("l[oad]     -- load terminal info for type ");
 	    (void) puts("d[elete]    -- delete named capability");
@@ -1030,8 +1003,9 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 	    gettimeofday(&after, NULL);
 
 	    printf("\" (%ld msec)\n",
-		(long) (after.tv_usec - before.tv_usec + (after.tv_sec -
-			before.tv_sec) * 1000000));
+		   (long) (after.tv_usec - before.tv_usec
+			   + (after.tv_sec - before.tv_sec)
+			   * 1000000));
 	} else if (sscanf(buf, "s %d %d %d %d", &fy, &fx, &ty, &tx) == 4) {
 	    struct timeval before, after;
 
@@ -1042,8 +1016,9 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 	    gettimeofday(&after, NULL);
 
 	    printf("\" (%ld msec)\n",
-		(long) (after.tv_usec - before.tv_usec + (after.tv_sec -
-			before.tv_sec) * 1000000));
+		   (long) (after.tv_usec - before.tv_usec + (after.tv_sec -
+							     before.tv_sec)
+			   * 1000000));
 	} else if (buf[0] == 'r') {
 	    (void) strcpy(tname, termname());
 	    load_term();
@@ -1051,7 +1026,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 	    load_term();
 	} else if (sscanf(buf, "d %s", capname) == 1) {
 	    struct name_table_entry const *np = _nc_find_entry(capname,
-		_nc_info_hash_table);
+							       _nc_info_hash_table);
 
 	    if (np == NULL)
 		(void) printf("No such capability as \"%s\"\n", capname);
@@ -1061,19 +1036,19 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 		    cur_term->type.Booleans[np->nte_index] = FALSE;
 		    (void)
 			printf("Boolean capability `%s' (%d) turned off.\n",
-			np->nte_name, np->nte_index);
+			       np->nte_name, np->nte_index);
 		    break;
 
 		case NUMBER:
 		    cur_term->type.Numbers[np->nte_index] = ABSENT_NUMERIC;
 		    (void) printf("Number capability `%s' (%d) set to -1.\n",
-			np->nte_name, np->nte_index);
+				  np->nte_name, np->nte_index);
 		    break;
 
 		case STRING:
 		    cur_term->type.Strings[np->nte_index] = ABSENT_STRING;
 		    (void) printf("String capability `%s' (%d) deleted.\n",
-			np->nte_name, np->nte_index);
+				  np->nte_name, np->nte_index);
 		    break;
 		}
 	    }
@@ -1110,7 +1085,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 	 * is winning.
 	 */
 	else if (sscanf(buf, "t %d", &n) == 1) {
-	    float cumtime = 0, perchar;
+	    float cumtime = 0.0, perchar;
 	    int speeds[] =
 	    {2400, 9600, 14400, 19200, 28800, 38400, 0};
 
@@ -1148,7 +1123,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 	    perchar = cumtime / n;
 
 	    (void) printf("%d moves (%ld chars) in %d msec, %f msec each:\n",
-		n, xmits, (int) cumtime, perchar);
+			  n, xmits, (int) cumtime, perchar);
 
 	    for (i = 0; speeds[i]; i++) {
 		/*
@@ -1167,7 +1142,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 
 		(void)
 		    printf("%6d bps: %3.2f char-xmits overhead; total estimated time %15.2f\n",
-		    speeds[i], overhead, totalest);
+			   speeds[i], overhead, totalest);
 	    }
 	} else if (buf[0] == 'c') {
 	    (void) printf("char padding: %d\n", SP->_char_padding);
diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c
index d01a62f7..512de68d 100644
--- a/ncurses/tty/lib_tstp.c
+++ b/ncurses/tty/lib_tstp.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,1999 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,6 @@
  *     and: Eric S. Raymond                          *
  ****************************************************************************/
 
-
 /*
 **	lib_tstp.c
 **
@@ -44,11 +43,11 @@
 #include 
 #include 
 
-#if defined(SVR4_ACTION) && !defined(_POSIX_SOURCE)
+#if SVR4_ACTION && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
 #endif
 
-MODULE_ID("$Id: lib_tstp.c,v 1.21 2000/05/20 23:28:56 tom Exp $")
+MODULE_ID("$Id: lib_tstp.c,v 1.22 2000/09/02 18:33:17 tom Exp $")
 
 #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
 #define USE_SIGTSTP 1
@@ -100,151 +99,152 @@ MODULE_ID("$Id: lib_tstp.c,v 1.21 2000/05/20 23:28:56 tom Exp $")
  */
 
 #if USE_SIGTSTP
-static void tstp(int dummy GCC_UNUSED)
+static void
+tstp(int dummy GCC_UNUSED)
 {
-	sigset_t mask, omask;
-	sigaction_t act, oact;
+    sigset_t mask, omask;
+    sigaction_t act, oact;
 
 #ifdef SIGTTOU
-	int sigttou_blocked;
+    int sigttou_blocked;
 #endif
 
-	T(("tstp() called"));
-
-	/*
-	 * The user may have changed the prog_mode tty bits, so save them.
-	 *
-	 * But first try to detect whether we still are in the foreground
-	 * process group - if not, an interactive shell may already have
-	 * taken ownership of the tty and modified the settings when our
-	 * parent was stopped before us, and we would likely pick up the
-	 * settings already modified by the shell.
-	 */
-	if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */
+    T(("tstp() called"));
+
+    /*
+     * The user may have changed the prog_mode tty bits, so save them.
+     *
+     * But first try to detect whether we still are in the foreground
+     * process group - if not, an interactive shell may already have
+     * taken ownership of the tty and modified the settings when our
+     * parent was stopped before us, and we would likely pick up the
+     * settings already modified by the shell.
+     */
+    if (SP != 0 && !SP->_endwin)	/* don't do this if we're not in curses */
 #if HAVE_TCGETPGRP
 	if (tcgetpgrp(STDIN_FILENO) == getpgrp())
 #endif
 	    def_prog_mode();
 
-	/*
-	 * Block window change and timer signals.  The latter
-	 * is because applications use timers to decide when
-	 * to repaint the screen.
-	 */
-	(void)sigemptyset(&mask);
-	(void)sigaddset(&mask, SIGALRM);
+    /*
+     * Block window change and timer signals.  The latter
+     * is because applications use timers to decide when
+     * to repaint the screen.
+     */
+    (void) sigemptyset(&mask);
+    (void) sigaddset(&mask, SIGALRM);
 #if USE_SIGWINCH
-	(void)sigaddset(&mask, SIGWINCH);
+    (void) sigaddset(&mask, SIGWINCH);
 #endif
-	(void)sigprocmask(SIG_BLOCK, &mask, &omask);
+    (void) sigprocmask(SIG_BLOCK, &mask, &omask);
 
 #ifdef SIGTTOU
-	sigttou_blocked = sigismember(&omask, SIGTTOU);
-	if (!sigttou_blocked) {
-	    (void)sigemptyset(&mask);
-	    (void)sigaddset(&mask, SIGTTOU);
-	    (void)sigprocmask(SIG_BLOCK, &mask, NULL);
-	}
+    sigttou_blocked = sigismember(&omask, SIGTTOU);
+    if (!sigttou_blocked) {
+	(void) sigemptyset(&mask);
+	(void) sigaddset(&mask, SIGTTOU);
+	(void) sigprocmask(SIG_BLOCK, &mask, NULL);
+    }
 #endif
 
-	/*
-	 * End window mode, which also resets the terminal state to the
-	 * original (pre-curses) modes.
-	 */
-	endwin();
+    /*
+     * End window mode, which also resets the terminal state to the
+     * original (pre-curses) modes.
+     */
+    endwin();
 
-	/* Unblock SIGTSTP. */
-	(void)sigemptyset(&mask);
-	(void)sigaddset(&mask, SIGTSTP);
+    /* Unblock SIGTSTP. */
+    (void) sigemptyset(&mask);
+    (void) sigaddset(&mask, SIGTSTP);
 #ifdef SIGTTOU
-	if (!sigttou_blocked) {
-            /* Unblock this too if it wasn't blocked on entry */
-	    (void)sigaddset(&mask, SIGTTOU);
-	}
+    if (!sigttou_blocked) {
+	/* Unblock this too if it wasn't blocked on entry */
+	(void) sigaddset(&mask, SIGTTOU);
+    }
 #endif
-	(void)sigprocmask(SIG_UNBLOCK, &mask, NULL);
+    (void) sigprocmask(SIG_UNBLOCK, &mask, NULL);
 
-	/* Now we want to resend SIGSTP to this process and suspend it */
-	act.sa_handler = SIG_DFL;
-	sigemptyset(&act.sa_mask);
-	act.sa_flags = 0;
+    /* Now we want to resend SIGSTP to this process and suspend it */
+    act.sa_handler = SIG_DFL;
+    sigemptyset(&act.sa_mask);
+    act.sa_flags = 0;
 #ifdef SA_RESTART
-	act.sa_flags |= SA_RESTART;
+    act.sa_flags |= SA_RESTART;
 #endif /* SA_RESTART */
-	sigaction(SIGTSTP, &act, &oact);
-	kill(getpid(), SIGTSTP);
+    sigaction(SIGTSTP, &act, &oact);
+    kill(getpid(), SIGTSTP);
 
-	/* Process gets suspended...time passes...process resumes */
+    /* Process gets suspended...time passes...process resumes */
 
-	T(("SIGCONT received"));
-	sigaction(SIGTSTP, &oact, NULL);
-	flushinp();
+    T(("SIGCONT received"));
+    sigaction(SIGTSTP, &oact, NULL);
+    flushinp();
 
-	/*
-	 * If the user modified the tty state while suspended, he wants
-	 * those changes to stick.  So save the new "default" terminal state.
-	 */
-	def_shell_mode();
+    /*
+     * If the user modified the tty state while suspended, he wants
+     * those changes to stick.  So save the new "default" terminal state.
+     */
+    def_shell_mode();
 
-	/*
-	 * This relies on the fact that doupdate() will restore the
-	 * program-mode tty state, and issue enter_ca_mode if need be.
-	 */
-	doupdate();
+    /*
+     * This relies on the fact that doupdate() will restore the
+     * program-mode tty state, and issue enter_ca_mode if need be.
+     */
+    doupdate();
 
-	/* Reset the signals. */
-	(void)sigprocmask(SIG_SETMASK, &omask, NULL);
+    /* Reset the signals. */
+    (void) sigprocmask(SIG_SETMASK, &omask, NULL);
 }
-#endif	/* USE_SIGTSTP */
+#endif /* USE_SIGTSTP */
 
-static void cleanup(int sig)
+static void
+cleanup(int sig)
 {
-	static int nested;
-
-	/*
-	 * Actually, doing any sort of I/O from within an signal handler is
-	 * "unsafe".  But we'll _try_ to clean up the screen and terminal
-	 * settings on the way out.
-	 */
-	if (!nested++
-	 && (sig == SIGINT
-	  || sig == SIGQUIT)) {
+    static int nested;
+
+    /*
+     * Actually, doing any sort of I/O from within an signal handler is
+     * "unsafe".  But we'll _try_ to clean up the screen and terminal
+     * settings on the way out.
+     */
+    if (!nested++
+	&& (sig == SIGINT
+	    || sig == SIGQUIT)) {
 #if HAVE_SIGACTION || HAVE_SIGVEC
-		sigaction_t act;
-		sigemptyset(&act.sa_mask);
-		act.sa_flags = 0;
-		act.sa_handler = SIG_IGN;
-		if (sigaction(sig, &act, (sigaction_t *)0) == 0)
+	sigaction_t act;
+	sigemptyset(&act.sa_mask);
+	act.sa_flags = 0;
+	act.sa_handler = SIG_IGN;
+	if (sigaction(sig, &act, (sigaction_t *) 0) == 0)
 #else
-		if (signal(sig, SIG_IGN) != SIG_ERR)
+	if (signal(sig, SIG_IGN) != SIG_ERR)
 #endif
-		{
-		    SCREEN *scan = _nc_screen_chain;
-		    while(scan)
-		    {
-			if (SP != 0
-			&& SP->_ofp != 0
-			&& isatty(fileno(SP->_ofp))) {
-			    SP->_cleanup = TRUE;
-			    SP->_outch = _nc_outch;
-			}
-			set_term(scan);
-			endwin();
-			if (SP)
-			    SP->_endwin = FALSE; /* in case we have an atexit! */
-			scan = scan->_next_screen;
-		    }
+	{
+	    SCREEN *scan = _nc_screen_chain;
+	    while (scan) {
+		if (SP != 0
+		    && SP->_ofp != 0
+		    && isatty(fileno(SP->_ofp))) {
+		    SP->_cleanup = TRUE;
+		    SP->_outch = _nc_outch;
 		}
+		set_term(scan);
+		endwin();
+		if (SP)
+		    SP->_endwin = FALSE;	/* in case we have an atexit! */
+		scan = scan->_next_screen;
+	    }
 	}
-	exit(EXIT_FAILURE);
+    }
+    exit(EXIT_FAILURE);
 }
 
 #if USE_SIGWINCH
-static void sigwinch(int sig GCC_UNUSED)
+static void
+sigwinch(int sig GCC_UNUSED)
 {
     SCREEN *scan = _nc_screen_chain;
-    while(scan)
-    {
+    while (scan) {
 	scan->_sig_winch = TRUE;
 	scan = scan->_next_screen;
     }
@@ -256,38 +256,40 @@ static void sigwinch(int sig GCC_UNUSED)
  * handler.
  */
 #if HAVE_SIGACTION || HAVE_SIGVEC
-static int CatchIfDefault(int sig, sigaction_t *act)
+static int
+CatchIfDefault(int sig, sigaction_t * act)
 {
-	sigaction_t old_act;
+    sigaction_t old_act;
 
-	if (sigaction(sig, (sigaction_t *)0, &old_act) == 0
-	 && (old_act.sa_handler == SIG_DFL
+    if (sigaction(sig, (sigaction_t *) 0, &old_act) == 0
+	&& (old_act.sa_handler == SIG_DFL
 #if USE_SIGWINCH
 	    || (sig == SIGWINCH && old_act.sa_handler == SIG_IGN)
 #endif
-	    )) {
-		(void)sigaction(sig, act, (sigaction_t *)0);
-		return TRUE;
-	}
-	return FALSE;
+	)) {
+	(void) sigaction(sig, act, (sigaction_t *) 0);
+	return TRUE;
+    }
+    return FALSE;
 }
 #else
-static int CatchIfDefault(int sig, RETSIGTYPE (*handler)(int))
+static int
+CatchIfDefault(int sig, RETSIGTYPE(*handler) (int))
 {
-	void	(*ohandler)(int);
+    void (*ohandler) (int);
 
-	ohandler = signal(sig, SIG_IGN);
-	if (ohandler == SIG_DFL
+    ohandler = signal(sig, SIG_IGN);
+    if (ohandler == SIG_DFL
 #if USE_SIGWINCH
-	    || (sig == SIGWINCH && ohandler == SIG_IGN)
+	|| (sig == SIGWINCH && ohandler == SIG_IGN)
 #endif
 	) {
-		signal(sig, handler);
-		return TRUE;
-	} else {
-		signal(sig, ohandler);
-		return FALSE;
-	}
+	signal(sig, handler);
+	return TRUE;
+    } else {
+	signal(sig, ohandler);
+	return FALSE;
+    }
 }
 #endif
 
@@ -302,69 +304,63 @@ static int CatchIfDefault(int sig, RETSIGTYPE (*handler)(int))
  * The XSI document implies that we shouldn't keep the SIGTSTP handler if
  * the caller later changes its mind, but that doesn't seem correct.
  */
-void _nc_signal_handler(bool enable)
+void
+_nc_signal_handler(bool enable)
 {
-#if USE_SIGTSTP		/* Xenix 2.x doesn't have SIGTSTP, for example */
-static sigaction_t act, oact;
-static int ignore;
-
-	if (!ignore)
-	{
-		if (!enable)
-		{
-			act.sa_handler = SIG_IGN;
-			sigaction(SIGTSTP, &act, &oact);
-		}
-		else if (act.sa_handler)
-		{
-			sigaction(SIGTSTP, &oact, NULL);
-		}
-		else	/*initialize */
-		{
-			sigemptyset(&act.sa_mask);
-			act.sa_flags = 0;
+#if USE_SIGTSTP			/* Xenix 2.x doesn't have SIGTSTP, for example */
+    static sigaction_t act, oact;
+    static int ignore;
+
+    if (!ignore) {
+	if (!enable) {
+	    act.sa_handler = SIG_IGN;
+	    sigaction(SIGTSTP, &act, &oact);
+	} else if (act.sa_handler) {
+	    sigaction(SIGTSTP, &oact, NULL);
+	} else {		/*initialize */
+	    sigemptyset(&act.sa_mask);
+	    act.sa_flags = 0;
 #if USE_SIGWINCH
-			act.sa_handler = sigwinch;
-			CatchIfDefault(SIGWINCH, &act);
+	    act.sa_handler = sigwinch;
+	    CatchIfDefault(SIGWINCH, &act);
 #endif
 
 #ifdef SA_RESTART
-			act.sa_flags |= SA_RESTART;
+	    act.sa_flags |= SA_RESTART;
 #endif /* SA_RESTART */
-			act.sa_handler = cleanup;
-			CatchIfDefault(SIGINT,  &act);
-			CatchIfDefault(SIGTERM, &act);
+	    act.sa_handler = cleanup;
+	    CatchIfDefault(SIGINT, &act);
+	    CatchIfDefault(SIGTERM, &act);
 
-			act.sa_handler = tstp;
-			if (!CatchIfDefault(SIGTSTP, &act))
-				ignore = TRUE;
-		}
+	    act.sa_handler = tstp;
+	    if (!CatchIfDefault(SIGTSTP, &act))
+		ignore = TRUE;
 	}
+    }
 #else /* !USE_SIGTSTP */
-	if (enable)
-	{
+    if (enable) {
 #if HAVE_SIGACTION || HAVE_SIGVEC
-		static sigaction_t act;
-		sigemptyset(&act.sa_mask);
+	static sigaction_t act;
+	sigemptyset(&act.sa_mask);
 #if USE_SIGWINCH
-		act.sa_handler = sigwinch;
-		CatchIfDefault(SIGWINCH, &act);
+	act.sa_handler = sigwinch;
+	CatchIfDefault(SIGWINCH, &act);
 #endif
 #ifdef SA_RESTART
-		act.sa_flags |= SA_RESTART;
+	act.sa_flags |= SA_RESTART;
 #endif /* SA_RESTART */
-		act.sa_handler = cleanup;
-		CatchIfDefault(SIGINT,  &act);
-		CatchIfDefault(SIGTERM, &act);
+	act.sa_handler = cleanup;
+	CatchIfDefault(SIGINT, &act);
+	CatchIfDefault(SIGTERM, &act);
 
 #else /* !(HAVE_SIGACTION || HAVE_SIGVEC) */
 
-		CatchIfDefault(SIGINT,  cleanup);
-		CatchIfDefault(SIGTERM, cleanup);
+	CatchIfDefault(SIGINT, cleanup);
+	CatchIfDefault(SIGTERM, cleanup);
 #if USE_SIGWINCH
-		CatchIfDefault(SIGWINCH, sigwinch);
+	CatchIfDefault(SIGWINCH, sigwinch);
 #endif
 #endif /* !(HAVE_SIGACTION || HAVE_SIGVEC) */
-	}
+    }
 #endif /* !USE_SIGTSTP */
 }
diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c
index a21e2a16..6d24d8dd 100644
--- a/ncurses/tty/lib_twait.c
+++ b/ncurses/tty/lib_twait.c
@@ -59,33 +59,34 @@
 # endif
 #endif
 
-MODULE_ID("$Id: lib_twait.c,v 1.37 2000/06/29 23:03:09 tom Exp $")
+MODULE_ID("$Id: lib_twait.c,v 1.39 2000/08/26 19:34:15 tom Exp $")
 
-static long _nc_gettime(bool first)
+static long
+_nc_gettime(bool first)
 {
-	long res;
+    long res;
 
 #if HAVE_GETTIMEOFDAY
 # define PRECISE_GETTIME 1
-	static struct timeval t0;
-	struct timeval t1;
-	gettimeofday(&t1, (struct timezone *)0);
-	if (first) {
-		t0 = t1;
-	}
-	res = (t1.tv_sec  - t0.tv_sec)  * 1000
-	    + (t1.tv_usec - t0.tv_usec) / 1000;
+    static struct timeval t0;
+    struct timeval t1;
+    gettimeofday(&t1, (struct timezone *) 0);
+    if (first) {
+	t0 = t1;
+    }
+    res = (t1.tv_sec - t0.tv_sec) * 1000
+	+ (t1.tv_usec - t0.tv_usec) / 1000;
 #else
 # define PRECISE_GETTIME 0
-	static time_t t0;
-	time_t t1 = time((time_t*)0);
-	if (first) {
-		t0 = t1;
-	}
-	res = (t1 - t0) * 1000;
+    static time_t t0;
+    time_t t1 = time((time_t *) 0);
+    if (first) {
+	t0 = t1;
+    }
+    res = (t1 - t0) * 1000;
 #endif
-	T(("%s time: %ld msec", first ? "get" : "elapsed", res));
-	return res;
+    T(("%s time: %ld msec", first ? "get" : "elapsed", res));
+    return res;
 }
 
 /*
@@ -101,163 +102,164 @@ static long _nc_gettime(bool first)
  * If the milliseconds given are -1, the wait blocks until activity on the
  * descriptors.
  */
-int _nc_timed_wait(int mode, int milliseconds, int *timeleft)
+int
+_nc_timed_wait(int mode, int milliseconds, int *timeleft)
 {
-int	fd;
-int	count;
+    int fd;
+    int count;
 
-int result;
+    int result;
 
 #if USE_FUNC_POLL
-struct pollfd fds[2];
+    struct pollfd fds[2];
 #elif defined(__BEOS__)
 #elif HAVE_SELECT
-static fd_set set;
+    static fd_set set;
 #endif
 
-long starttime, returntime;
+    long starttime, returntime;
 
-	T(("start twait: %d milliseconds, mode: %d", milliseconds, mode));
+    T(("start twait: %d milliseconds, mode: %d", milliseconds, mode));
 
 #if PRECISE_GETTIME
-retry:
+  retry:
 #endif
-	starttime = _nc_gettime(TRUE);
+    starttime = _nc_gettime(TRUE);
 
-	count = 0;
+    count = 0;
 
 #if USE_FUNC_POLL
-	if (mode & 1) {
-		fds[count].fd     = SP->_ifd;
-		fds[count].events = POLLIN;
-		count++;
-	}
-	if ((mode & 2)
-	 && (fd = SP->_mouse_fd) >= 0) {
-		fds[count].fd     = fd;
-		fds[count].events = POLLIN;
-		count++;
-	}
-	result = poll(fds, count, milliseconds);
+    memset(fds, 0, sizeof(fds));
+    if (mode & 1) {
+	fds[count].fd = SP->_ifd;
+	fds[count].events = POLLIN;
+	count++;
+    }
+    if ((mode & 2)
+	&& (fd = SP->_mouse_fd) >= 0) {
+	fds[count].fd = fd;
+	fds[count].events = POLLIN;
+	count++;
+    }
+    result = poll(fds, count, milliseconds);
 
 #elif defined(__BEOS__)
-	/*
-	 * BeOS's select() is declared in socket.h, so the configure script does
-	 * not see it.  That's just as well, since that function works only for
-	 * sockets.  This (using snooze and ioctl) was distilled from Be's patch
-	 * for ncurses which uses a separate thread to simulate select().
-	 *
-	 * FIXME: the return values from the ioctl aren't very clear if we get
-	 * interrupted.
-	 */
-	result = 0;
-	if (mode & 1) {
-		bigtime_t d;
-		bigtime_t useconds = milliseconds * 1000;
-		int n, howmany;
+    /*
+     * BeOS's select() is declared in socket.h, so the configure script does
+     * not see it.  That's just as well, since that function works only for
+     * sockets.  This (using snooze and ioctl) was distilled from Be's patch
+     * for ncurses which uses a separate thread to simulate select().
+     *
+     * FIXME: the return values from the ioctl aren't very clear if we get
+     * interrupted.
+     */
+    result = 0;
+    if (mode & 1) {
+	bigtime_t d;
+	bigtime_t useconds = milliseconds * 1000;
+	int n, howmany;
 
-		if (useconds == 0) /* we're here to go _through_ the loop */
-			useconds = 1;
+	if (useconds == 0)	/* we're here to go _through_ the loop */
+	    useconds = 1;
 
-		for (d = 0; d < useconds; d += 5000) {
-			n = 0;
-			howmany = ioctl(0, 'ichr', &n);
-			if (howmany >= 0 && n > 0) {
-				result = 1;
-				break;
-			}
-			if (useconds > 1)
-				snooze(5000);
-			milliseconds -= 5;
-		}
-	} else if (milliseconds > 0) {
-		snooze(milliseconds * 1000);
-		milliseconds = 0;
+	for (d = 0; d < useconds; d += 5000) {
+	    n = 0;
+	    howmany = ioctl(0, 'ichr', &n);
+	    if (howmany >= 0 && n > 0) {
+		result = 1;
+		break;
+	    }
+	    if (useconds > 1)
+		snooze(5000);
+	    milliseconds -= 5;
 	}
+    } else if (milliseconds > 0) {
+	snooze(milliseconds * 1000);
+	milliseconds = 0;
+    }
 #elif HAVE_SELECT
-	/*
-	 * select() modifies the fd_set arguments; do this in the
-	 * loop.
-	 */
-	FD_ZERO(&set);
+    /*
+     * select() modifies the fd_set arguments; do this in the
+     * loop.
+     */
+    FD_ZERO(&set);
 
-	if (mode & 1) {
-		FD_SET(SP->_ifd, &set);
-		count = SP->_ifd + 1;
-	}
-	if ((mode & 2)
-	 && (fd = SP->_mouse_fd) >= 0) {
-		FD_SET(fd, &set);
-		count = max(fd, count) + 1;
-	}
+    if (mode & 1) {
+	FD_SET(SP->_ifd, &set);
+	count = SP->_ifd + 1;
+    }
+    if ((mode & 2)
+	&& (fd = SP->_mouse_fd) >= 0) {
+	FD_SET(fd, &set);
+	count = max(fd, count) + 1;
+    }
 
-	if (milliseconds >= 0) {
-		struct timeval ntimeout;
-		ntimeout.tv_sec  = milliseconds / 1000;
-		ntimeout.tv_usec = (milliseconds % 1000) * 1000;
-		result = select(count, &set, NULL, NULL, &ntimeout);
-	} else {
-		result = select(count, &set, NULL, NULL, NULL);
-	}
+    if (milliseconds >= 0) {
+	struct timeval ntimeout;
+	ntimeout.tv_sec = milliseconds / 1000;
+	ntimeout.tv_usec = (milliseconds % 1000) * 1000;
+	result = select(count, &set, NULL, NULL, &ntimeout);
+    } else {
+	result = select(count, &set, NULL, NULL, NULL);
+    }
 #endif
 
-	returntime = _nc_gettime(FALSE);
+    returntime = _nc_gettime(FALSE);
 
-	if (milliseconds >= 0)
-		milliseconds -= (returntime - starttime);
+    if (milliseconds >= 0)
+	milliseconds -= (returntime - starttime);
 
 #if PRECISE_GETTIME
-	/*
-	 * If the timeout hasn't expired, and we've gotten no data,
-	 * this is probably a system where 'select()' needs to be left
-	 * alone so that it can complete.  Make this process sleep,
-	 * then come back for more.
-	 */
-	if (result == 0 && milliseconds > 100) {
-		napms(100);
-		milliseconds -= 100;
-		goto retry;
-	}
+    /*
+     * If the timeout hasn't expired, and we've gotten no data,
+     * this is probably a system where 'select()' needs to be left
+     * alone so that it can complete.  Make this process sleep,
+     * then come back for more.
+     */
+    if (result == 0 && milliseconds > 100) {
+	napms(100);
+	milliseconds -= 100;
+	goto retry;
+    }
 #endif
 
-	/* return approximate time left in milliseconds */
-	if (timeleft)
-		*timeleft = milliseconds;
+    /* return approximate time left in milliseconds */
+    if (timeleft)
+	*timeleft = milliseconds;
 
-	T(("end twait: returned %d (%d), remaining time %d msec",
-		result, errno, milliseconds));
+    T(("end twait: returned %d (%d), remaining time %d msec",
+       result, errno, milliseconds));
 
-	/*
-	 * Both 'poll()' and 'select()' return the number of file descriptors
-	 * that are active.  Translate this back to the mask that denotes which
-	 * file-descriptors, so that we don't need all of this system-specific
-	 * code everywhere.
-	 */
-	if (result != 0) {
-		if (result > 0) {
-			result = 0;
+    /*
+     * Both 'poll()' and 'select()' return the number of file descriptors
+     * that are active.  Translate this back to the mask that denotes which
+     * file-descriptors, so that we don't need all of this system-specific
+     * code everywhere.
+     */
+    if (result != 0) {
+	if (result > 0) {
+	    result = 0;
 #if USE_FUNC_POLL
-			for (count = 0; count < 2; count++) {
-				if ((mode & (1 << count))
-				 && (fds[count].revents & POLLIN)) {
-					result |= (1 << count);
-				}
-			}
+	    for (count = 0; count < 2; count++) {
+		if ((mode & (1 << count))
+		    && (fds[count].revents & POLLIN)) {
+		    result |= (1 << count);
+		}
+	    }
 #elif defined(__BEOS__)
-			result = 1;	/* redundant, but simple */
+	    result = 1;		/* redundant, but simple */
 #elif HAVE_SELECT
-			if ((mode & 2)
-			 && (fd = SP->_mouse_fd) >= 0
-			 && FD_ISSET(fd, &set))
-				result |= 2;
-			if ((mode & 1)
-			 && FD_ISSET(SP->_ifd, &set))
-				result |= 1;
+	    if ((mode & 2)
+		&& (fd = SP->_mouse_fd) >= 0
+		&& FD_ISSET(fd, &set))
+		result |= 2;
+	    if ((mode & 1)
+		&& FD_ISSET(SP->_ifd, &set))
+		result |= 1;
 #endif
-		}
-		else
-			result = 0;
-	}
+	} else
+	    result = 0;
+    }
 
-	return (result);
+    return (result);
 }
diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c
index 7cff22ec..5022cbdd 100644
--- a/ncurses/tty/lib_vidattr.c
+++ b/ncurses/tty/lib_vidattr.c
@@ -64,7 +64,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: lib_vidattr.c,v 1.27 2000/04/29 23:25:27 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $")
 
 #define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
 
@@ -78,7 +78,7 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.27 2000/04/29 23:25:27 tom Exp $")
 #define SetColorsIf(why,old_attr) \
 	if (can_color && (why)) { \
 		int old_pair = PAIR_NUMBER(old_attr); \
-		T(("old pair = %d -- new pair = %d", old_pair, pair)); \
+		TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \
 		if ((pair != old_pair) \
 		 || (fix_pair0 && (pair == 0)) \
 		 || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \
@@ -95,7 +95,7 @@ vidputs(attr_t newmode, int (*outc) (int))
     bool reverse = FALSE;
     bool used_ncv = FALSE;
     bool can_color = (SP == 0 || SP->_coloron);
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
 #else
 #define fix_pair0 FALSE
@@ -107,7 +107,7 @@ vidputs(attr_t newmode, int (*outc) (int))
     if (SP)
 	previous_attr = SP->_current_attr;
 
-    T(("previous attribute was %s", _traceattr(previous_attr)));
+    TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(previous_attr)));
 
 #if !USE_XMC_SUPPORT
     if ((SP != 0)
@@ -120,36 +120,29 @@ vidputs(attr_t newmode, int (*outc) (int))
      * attributes, use the colors in preference.
      */
     if (((newmode & A_COLOR) != 0
-	    || fix_pair0)
+	 || fix_pair0)
 	&& (no_color_video > 0)) {
-	/* *INDENT-OFF* */
-	static const struct {
-	    attr_t video;
-	    unsigned bit;
-	} table[] = {
-	    { A_STANDOUT,       1 },
-	    { A_UNDERLINE,      2 },
-	    { A_REVERSE,        4 },
-	    { A_BLINK,          8 },
-	    { A_DIM,            16 },
-	    { A_BOLD,           32 },
-	    { A_INVIS,          64 },
-	    { A_PROTECT,        128 },
-	    { A_ALTCHARSET,     256 },
-	};
-	/* *INDENT-ON* */
-
-	size_t n;
-	for (n = 0; n < SIZEOF(table); n++) {
-	    if ((table[n].bit & no_color_video)
-		&& (table[n].video & newmode)) {
-		used_ncv = TRUE;
-		if (table[n].video == A_REVERSE)
-		    reverse = TRUE;
-		else
-		    newmode &= ~table[n].video;
-	    }
+	/*
+	 * If we had chosen the A_xxx definitions to correspond to the
+	 * no_color_video mask, we could simply shift it up and mask off the
+	 * attributes.  But we did not (actually copied Solaris' definitions).
+	 * However, this is still simpler/faster than a lookup table.
+	 *
+	 * The 63 corresponds to A_STANDOUT, A_UNDERLINE, A_REVERSE, A_BLINK,
+	 * A_DIM, A_BOLD which are 1:1 with no_color_video.  The bits that
+	 * correspond to A_INVIS, A_PROTECT (192) must be shifted up 1 and
+	 * A_ALTCHARSET (256) down 2 to line up.  We use the NCURSES_BITS
+	 * macro so this will work properly for the wide-character layout.
+	 */
+	attr_t mask = NCURSES_BITS((no_color_video & 63)
+				   | ((no_color_video & 192) << 1)
+				   | ((no_color_video & 256) >> 2), 8);
+
+	if (mask & A_REVERSE && newmode & A_REVERSE) {
+	    reverse = TRUE;
+	    mask &= ~A_REVERSE;
 	}
+	newmode &= ~mask;
     }
 
     if (newmode == previous_attr)
@@ -172,7 +165,16 @@ vidputs(attr_t newmode, int (*outc) (int))
 	    previous_attr &= ~A_ALTCHARSET;
 	}
 	if (previous_attr) {
-	    doPut(exit_attribute_mode);
+	    if (exit_attribute_mode) {
+		doPut(exit_attribute_mode);
+	    } else {
+		if (!SP || SP->_use_rmul) {
+		    TurnOff(A_UNDERLINE, exit_underline_mode);
+		}
+		if (!SP || SP->_use_rmso) {
+		    TurnOff(A_STANDOUT, exit_standout_mode);
+		}
+	    }
 	    previous_attr &= ~A_COLOR;
 	}
 
@@ -181,21 +183,21 @@ vidputs(attr_t newmode, int (*outc) (int))
 	if (turn_on || turn_off) {
 	    TPUTS_TRACE("set_attributes");
 	    tputs(tparm(set_attributes,
-		    (newmode & A_STANDOUT) != 0,
-		    (newmode & A_UNDERLINE) != 0,
-		    (newmode & A_REVERSE) != 0,
-		    (newmode & A_BLINK) != 0,
-		    (newmode & A_DIM) != 0,
-		    (newmode & A_BOLD) != 0,
-		    (newmode & A_INVIS) != 0,
-		    (newmode & A_PROTECT) != 0,
-		    (newmode & A_ALTCHARSET) != 0), 1, outc);
+			(newmode & A_STANDOUT) != 0,
+			(newmode & A_UNDERLINE) != 0,
+			(newmode & A_REVERSE) != 0,
+			(newmode & A_BLINK) != 0,
+			(newmode & A_DIM) != 0,
+			(newmode & A_BOLD) != 0,
+			(newmode & A_INVIS) != 0,
+			(newmode & A_PROTECT) != 0,
+			(newmode & A_ALTCHARSET) != 0), 1, outc);
 	    previous_attr &= ~A_COLOR;
 	}
 	SetColorsIf((pair != 0) || fix_pair0, previous_attr);
     } else {
 
-	T(("turning %s off", _traceattr(turn_off)));
+	TR(TRACE_ATTRS, ("turning %s off", _traceattr(turn_off)));
 
 	TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
 
@@ -214,7 +216,7 @@ vidputs(attr_t newmode, int (*outc) (int))
 	}
 	SetColorsIf((pair != 0) || fix_pair0, previous_attr);
 
-	T(("turning %s on", _traceattr(turn_on)));
+	TR(TRACE_ATTRS, ("turning %s on", _traceattr(turn_on)));
 	/* *INDENT-OFF* */
 	TurnOn(A_ALTCHARSET,	enter_alt_charset_mode);
 	TurnOn(A_BLINK,		enter_blink_mode);
@@ -259,6 +261,7 @@ termattrs(void)
 {
     chtype attrs = A_NORMAL;
 
+    T((T_CALLED("termattrs()")));
     if (enter_alt_charset_mode)
 	attrs |= A_ALTCHARSET;
 
@@ -289,5 +292,5 @@ termattrs(void)
     if (SP->_coloron)
 	attrs |= A_COLOR;
 
-    return (attrs);
+    returnChar(attrs);
 }
diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c
index 1f3dd463..298c11ed 100644
--- a/ncurses/tty/tty_update.c
+++ b/ncurses/tty/tty_update.c
@@ -70,7 +70,7 @@
 
 #include 
 
-MODULE_ID("$Id: tty_update.c,v 1.141 2000/07/04 21:01:40 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.146 2000/10/07 01:11:44 tom Exp $")
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
@@ -112,15 +112,24 @@ position_check(int expected_y, int expected_x, char *legend)
 /* check to see if the real cursor position matches the virtual */
 {
     char buf[20];
+    char *s;
     int y, x;
 
     if (!_nc_tracing || (expected_y < 0 && expected_x < 0))
 	return;
 
+    _nc_flush();
     memset(buf, '\0', sizeof(buf));
     putp("\033[6n");		/* only works on ANSI-compatibles */
     _nc_flush();
-    (void) read(0, buf, sizeof(buf) - 1);
+    *(s = buf) = 0;
+    do {
+	int ask = sizeof(buf) - 1 - (s - buf);
+	int got = read(0, s, ask);
+	if (got == 0)
+	    break;
+	s += got;
+    } while (strchr(buf, 'R') == 0);
     _tracef("probe returned %s", _nc_visbuf(buf));
 
     /* try to interpret as a position report */
@@ -133,8 +142,9 @@ position_check(int expected_y, int expected_x, char *legend)
 	    expected_y = y - 1;
 	if (y - 1 != expected_y || x - 1 != expected_x) {
 	    beep();
+	    tputs(tparm("\033[%d;%dH", expected_y + 1, expected_x + 1), 1, _nc_outch);
 	    _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s",
-		y - 1, x - 1, expected_y, expected_x, legend);
+		    y - 1, x - 1, expected_y, expected_x, legend);
 	} else {
 	    _tracef("position matches OK in %s", legend);
 	}
@@ -156,7 +166,7 @@ GoTo(int const row, int const col)
     chtype oldattr = SP->_current_attr;
 
     TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)",
-	    row, col, SP->_cursrow, SP->_curscol));
+		    row, col, SP->_cursrow, SP->_curscol));
 
     position_check(SP->_cursrow, SP->_curscol, "GoTo");
 
@@ -168,7 +178,7 @@ GoTo(int const row, int const col)
     if ((oldattr & A_ALTCHARSET)
 	|| (oldattr && !move_standout_mode)) {
 	TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move",
-		oldattr, _traceattr(oldattr)));
+			   oldattr, _traceattr(oldattr)));
 	vidattr(A_NORMAL);
     }
 
@@ -187,8 +197,8 @@ PutAttrChar(chtype ch)
 	ch = ('`' | AttrOf(ch));
 
     TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)",
-	    _tracechtype(ch),
-	    SP->_cursrow, SP->_curscol));
+		       _tracechtype(ch),
+		       SP->_cursrow, SP->_curscol));
     UpdateAttrs(ch);
     data = TextOf(ch);
     if (SP->_outch != 0) {
@@ -295,7 +305,7 @@ PutCharLR(chtype const ch)
 	TPUTS_TRACE("enter_am_mode");
 	putp(enter_am_mode);
     } else if ((enter_insert_mode && exit_insert_mode)
-	|| insert_character || parm_ich) {
+	       || insert_character || parm_ich) {
 	GoTo(screen_lines - 1, screen_columns - 2);
 	callPutChar(ch);
 	GoTo(screen_lines - 1, screen_columns - 2);
@@ -361,7 +371,7 @@ can_clear_with(chtype ch)
     if (!back_color_erase && SP->_coloron) {
 	if (ch & A_COLOR)
 	    return FALSE;
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
 	if (!SP->_default_color)
 	    return FALSE;
 	if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK)
@@ -427,10 +437,11 @@ EmitRange(const chtype * ntext, int num)
 		 * don't bother moving cursor, since it can be the
 		 * last update on the line.
 		 */
-		if (runcount < num)
+		if (runcount < num) {
 		    GoTo(SP->_cursrow, SP->_curscol + runcount);
-		else
+		} else {
 		    return 1;	/* cursor stays in the middle */
+		}
 	    } else if (repeat_char && runcount > SP->_rep_cost) {
 		bool wrap_possible = (SP->_curscol + runcount >= screen_columns);
 		int rep_count = runcount;
@@ -469,15 +480,15 @@ EmitRange(const chtype * ntext, int num)
  */
 static int
 PutRange(
-    const chtype * otext,
-    const chtype * ntext,
-    int row,
-    int first, int last)
+	    const chtype * otext,
+	    const chtype * ntext,
+	    int row,
+	    int first, int last)
 {
     int j, run;
 
     TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)",
-	    otext, ntext, row, first, last));
+		       otext, ntext, row, first, last));
 
     if (otext != ntext
 	&& (last - first + 1) > SP->_inline_cost) {
@@ -597,8 +608,8 @@ doupdate(void)
 		    continue;
 		}
 
-		T(("At (%d, %d): from %s...", i, j, _traceattr(rattr)));
-		T(("...to %s", _traceattr(turnon)));
+		TR(TRACE_ATTRS, ("At (%d, %d): from %s...", i, j, _traceattr(rattr)));
+		TR(TRACE_ATTRS, ("...to %s", _traceattr(turnon)));
 
 		/*
 		 * If the attribute change location is a blank with a
@@ -628,15 +639,17 @@ doupdate(void)
 			for (; n < screen_columns; n++) {
 			    if (AttrOf(newscr->_line[m].text[n]) == rattr) {
 				end_onscreen = TRUE;
-				T(("Range attributed with %s ends at (%d, %d)",
-					_traceattr(turnon), m, n));
+				TR(TRACE_ATTRS,
+				   ("Range attributed with %s ends at (%d, %d)",
+				    _traceattr(turnon), m, n));
 				goto foundit;
 			    }
 			}
 			n = 0;
 		    }
-		    T(("Range attributed with %s ends offscreen",
-			    _traceattr(turnon)));
+		    TR(TRACE_ATTRS,
+		       ("Range attributed with %s ends offscreen",
+			_traceattr(turnon)));
 		  foundit:;
 
 		    if (end_onscreen) {
@@ -649,8 +662,8 @@ doupdate(void)
 			 * of span.
 			 */
 			while (n >= 0
-			    && TextOf(lastline[n]) == ' '
-			    && SAFE(AttrOf(lastline[n])))
+			       && TextOf(lastline[n]) == ' '
+			       && SAFE(AttrOf(lastline[n])))
 			    lastline[n--] &= ~turnon;
 
 			/* check that there's enough room at end of span */
@@ -665,8 +678,9 @@ doupdate(void)
 		if (failed) {
 		    int p, q = j;
 
-		    T(("Clearing %s beginning at (%d, %d)",
-			    _traceattr(turnon), i, j));
+		    TR(TRACE_ATTRS,
+		       ("Clearing %s beginning at (%d, %d)",
+			_traceattr(turnon), i, j));
 
 		    /* turn off new attributes over span */
 		    for (p = i; p < screen_lines; p++) {
@@ -679,8 +693,9 @@ doupdate(void)
 		    }
 		  foundend:;
 		} else {
-		    T(("Cookie space for %s found before (%d, %d)",
-			    _traceattr(turnon), i, j));
+		    TR(TRACE_ATTRS,
+		       ("Cookie space for %s found before (%d, %d)",
+			_traceattr(turnon), i, j));
 
 		    /*
 		     * back up the start of range so there's room
@@ -706,7 +721,7 @@ doupdate(void)
 
     nonempty = 0;
     if (curscr->_clear || newscr->_clear) {	/* force refresh ? */
-	T(("clearing and updating from scratch"));
+	TR(TRACE_UPDATE, ("clearing and updating from scratch"));
 	ClrUpdate();
 	curscr->_clear = FALSE;	/* reset flag */
 	newscr->_clear = FALSE;	/* reset flag */
@@ -724,7 +739,7 @@ doupdate(void)
 
 	nonempty = ClrBottom(nonempty);
 
-	T(("Transforming lines, nonempty %d", nonempty));
+	TR(TRACE_UPDATE, ("Transforming lines, nonempty %d", nonempty));
 	for (i = 0; i < nonempty; i++) {
 	    /*
 	     * Here is our line-breakout optimization.
@@ -785,10 +800,10 @@ doupdate(void)
 #if USE_TRACE_TIMES
     (void) times(&after);
     TR(TRACE_TIMES,
-	("Update cost: %ld chars, %ld clocks system time, %ld clocks user time",
-	    _nc_outchars,
-	    after.tms_stime - before.tms_stime,
-	    after.tms_utime - before.tms_utime));
+       ("Update cost: %ld chars, %ld clocks system time, %ld clocks user time",
+	_nc_outchars,
+	after.tms_stime - before.tms_stime,
+	after.tms_utime - before.tms_utime));
 #endif /* USE_TRACE_TIMES */
 
     _nc_signal_handler(TRUE);
@@ -832,11 +847,11 @@ ClrUpdate(void)
     chtype blank = ClrBlank(stdscr);
     int nonempty = min(screen_lines, newscr->_maxy + 1);
 
-    T(("ClrUpdate() called"));
+    TR(TRACE_UPDATE, ("ClrUpdate() called"));
 
     ClearScreen(blank);
 
-    T(("updating screen from scratch"));
+    TR(TRACE_UPDATE, ("updating screen from scratch"));
 
     nonempty = ClrBottom(nonempty);
 
@@ -856,14 +871,15 @@ ClrToEOL(chtype blank, bool needclear)
     int j;
 
     if (curscr != 0
-	&& SP->_cursrow >= 0
-	&& SP->_curscol >= 0) {
+	&& SP->_cursrow >= 0) {
 	for (j = SP->_curscol; j < screen_columns; j++) {
-	    chtype *cp = &(curscr->_line[SP->_cursrow].text[j]);
+	    if (j >= 0) {
+		chtype *cp = &(curscr->_line[SP->_cursrow].text[j]);
 
-	    if (*cp != blank) {
-		*cp = blank;
-		needclear = TRUE;
+		if (*cp != blank) {
+		    *cp = blank;
+		    needclear = TRUE;
+		}
 	    }
 	}
     } else {
@@ -897,11 +913,9 @@ ClrToEOS(chtype blank)
     row = SP->_cursrow;
     col = SP->_curscol;
 
-    {
-	UpdateAttrs(blank);
-	TPUTS_TRACE("clr_eos");
-	tputs(clr_eos, screen_lines - row, _nc_outch);
-    }
+    UpdateAttrs(blank);
+    TPUTS_TRACE("clr_eos");
+    tputs(clr_eos, screen_lines - row, _nc_outch);
 
     while (col < screen_columns)
 	curscr->_line[row].text[col++] = blank;
@@ -935,12 +949,14 @@ ClrBottom(int total)
 	    for (col = 0, ok = TRUE; ok && col < last; col++) {
 		ok = (newscr->_line[row].text[col] == blank);
 	    }
-	    if (!ok) break;
+	    if (!ok)
+		break;
 
 	    for (col = 0; ok && col < last; col++) {
 		ok = (curscr->_line[row].text[col] == blank);
 	    }
-	    if (!ok) top = row;
+	    if (!ok)
+		top = row;
 	}
 
 	/* don't use clr_eos for just one line if clr_eol available */
@@ -984,7 +1000,7 @@ TransformLine(int const lineno)
     int n;
     bool attrchanged = FALSE;
 
-    T(("TransformLine(%d) called", lineno));
+    TR(TRACE_UPDATE, ("TransformLine(%d) called", lineno));
 
     /* copy new hash value to old one */
     if (SP->oldhash && SP->newhash)
@@ -1066,11 +1082,11 @@ TransformLine(int const lineno)
 	     */
 	    if (TextOf(newLine[n]) == ' '
 		&& ((n > 0
-			&& xmc_turn_on(newLine[n - 1], newLine[n]))
+		     && xmc_turn_on(newLine[n - 1], newLine[n]))
 		    || (n == 0
 			&& lineno > 0
 			&& xmc_turn_on(NEW(lineno - 1, screen_columns - 1),
-			    newLine[n])))) {
+				       newLine[n])))) {
 		n = m;
 	    }
 
@@ -1082,7 +1098,7 @@ TransformLine(int const lineno)
 	     */
 	    if (TextOf(newLine[n]) != ' '
 		&& ((n + 1 < screen_columns
-			&& xmc_turn_off(newLine[n], newLine[n + 1]))
+		     && xmc_turn_off(newLine[n], newLine[n + 1]))
 		    || (n + 1 >= screen_columns
 			&& lineno + 1 < screen_lines
 			&& xmc_turn_off(newLine[n], NEW(lineno + 1, 0))))) {
@@ -1097,7 +1113,7 @@ TransformLine(int const lineno)
 
 	/* find the first differing character */
 	while (firstChar < screen_columns &&
-	    newLine[firstChar] == oldLine[firstChar])
+	       newLine[firstChar] == oldLine[firstChar])
 	    firstChar++;
 
 	/* if there wasn't one, we're done */
@@ -1143,15 +1159,15 @@ TransformLine(int const lineno)
 	    nLastChar = screen_columns - 1;
 
 	    while (nLastChar > firstChar
-		&& newLine[nLastChar] == oldLine[nLastChar])
+		   && newLine[nLastChar] == oldLine[nLastChar])
 		nLastChar--;
 
 	    if (nLastChar >= firstChar) {
 		GoTo(lineno, firstChar);
 		PutRange(oldLine, newLine, lineno, firstChar, nLastChar);
 		memcpy(oldLine + firstChar,
-		    newLine + firstChar,
-		    (nLastChar - firstChar + 1) * sizeof(chtype));
+		       newLine + firstChar,
+		       (nLastChar - firstChar + 1) * sizeof(chtype));
 	    }
 	    return;
 	}
@@ -1173,8 +1189,8 @@ TransformLine(int const lineno)
 		PutChar(newLine[firstChar]);
 	    ClrToEOL(blank, FALSE);
 	} else if ((nLastChar != oLastChar)
-		&& (newLine[nLastChar] != oldLine[oLastChar]
-		|| !(_nc_idcok && has_ic()))) {
+		   && (newLine[nLastChar] != oldLine[oLastChar]
+		       || !(_nc_idcok && has_ic()))) {
 	    GoTo(lineno, firstChar);
 	    if ((oLastChar - nLastChar) > SP->_el_cost) {
 		if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar))
@@ -1219,7 +1235,7 @@ TransformLine(int const lineno)
 		if (DelCharCost(oLastChar - nLastChar)
 		    > SP->_el_cost + nLastNonblank - (n + 1)) {
 		    if (PutRange(oldLine, newLine, lineno,
-			    n + 1, nLastNonblank))
+				 n + 1, nLastNonblank))
 			GoTo(lineno, nLastNonblank + 1);
 		    ClrToEOL(blank, FALSE);
 		} else {
@@ -1241,8 +1257,8 @@ TransformLine(int const lineno)
     /* update the code's internal representation */
     if (screen_columns > firstChar)
 	memcpy(oldLine + firstChar,
-	    newLine + firstChar,
-	    (screen_columns - firstChar) * sizeof(chtype));
+	       newLine + firstChar,
+	       (screen_columns - firstChar) * sizeof(chtype));
 }
 
 /*
@@ -1258,9 +1274,9 @@ ClearScreen(chtype blank)
     int i, j;
     bool fast_clear = (clear_screen || clr_eos || clr_eol);
 
-    T(("ClearScreen() called"));
+    TR(TRACE_UPDATE, ("ClearScreen() called"));
 
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     if (SP->_coloron
 	&& !SP->_default_color) {
 	_nc_do_color(COLOR_PAIR(SP->_current_attr), 0, FALSE, _nc_outch);
@@ -1310,7 +1326,7 @@ ClearScreen(chtype blank)
 	    curscr->_line[i].text[j] = blank;
     }
 
-    T(("screen cleared"));
+    TR(TRACE_UPDATE, ("screen cleared"));
 }
 
 /*
@@ -1323,7 +1339,7 @@ ClearScreen(chtype blank)
 static void
 InsStr(chtype * line, int count)
 {
-    T(("InsStr(%p,%d) called", line, count));
+    TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count));
 
     /* Prefer parm_ich as it has the smallest cost - no need to shift
      * the whole line on each character. */
@@ -1378,7 +1394,8 @@ DelChar(int count)
 {
     int n;
 
-    T(("DelChar(%d) called, position = (%d,%d)", count, newscr->_cury, newscr->_curx));
+    TR(TRACE_UPDATE, ("DelChar(%d) called, position = (%d,%d)", count,
+		      newscr->_cury, newscr->_curx));
 
     if (parm_dch) {
 	TPUTS_TRACE("parm_dch");
@@ -1479,7 +1496,7 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank)
     } else
 	return ERR;
 
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     if (FILL_BCE()) {
 	for (i = 0; i < n; i++) {
 	    GoTo(bot - i, 0);
@@ -1535,7 +1552,7 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank)
     } else
 	return ERR;
 
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     if (FILL_BCE()) {
 	for (i = 0; i < n; i++) {
 	    GoTo(top + i, 0);
@@ -1615,18 +1632,11 @@ _nc_scrolln(int n, int top, int bot, int maxy)
 	 * Explicitly clear if stuff pushed off top of region might
 	 * be saved by the terminal.
 	 */
-	if (non_dest_scroll_region || (memory_above && top == 0)) {
-	    for (i = 0; i < n; i++) {
-		GoTo(i, 0);
-		ClrToEOL(BLANK, FALSE);
-	    }
-	}
-
 	res = scroll_csr_forward(n, top, bot, 0, maxy, blank);
 
 	if (res == ERR && change_scroll_region) {
 	    if ((((n == 1 && scroll_forward) || parm_index)
-		    && (SP->_cursrow == bot || SP->_cursrow == bot - 1))
+		 && (SP->_cursrow == bot || SP->_cursrow == bot - 1))
 		&& save_cursor && restore_cursor) {
 		cursor_saved = TRUE;
 		TPUTS_TRACE("save_cursor");
@@ -1650,23 +1660,24 @@ _nc_scrolln(int n, int top, int bot, int maxy)
 
 	if (res == ERR && _nc_idlok)
 	    res = scroll_idl(n, top, bot - n + 1, blank);
-    } else {			/* (n < 0) - scroll down (backward) */
+
 	/*
-	 * Do explicit clear to end of region if it's possible that the
-	 * terminal might hold on to stuff we push off the end.
+	 * Clear the newly shifted-in text.
 	 */
-	if (non_dest_scroll_region || (memory_below && bot == maxy)) {
+	if (res != ERR
+	    && (non_dest_scroll_region || (memory_below && bot == maxy))) {
 	    if (bot == maxy && clr_eos) {
-		GoTo(maxy + n, 0);
+		GoTo(bot - n, 0);
 		ClrToEOS(BLANK);
-	    } else if (clr_eol) {
-		for (i = 0; i < -n; i++) {
-		    GoTo(maxy + n + i, 0);
+	    } else {
+		for (i = 0; i < n; i++) {
+		    GoTo(bot - i, 0);
 		    ClrToEOL(BLANK, FALSE);
 		}
 	    }
 	}
 
+    } else {			/* (n < 0) - scroll down (backward) */
 	res = scroll_csr_backward(-n, top, bot, 0, maxy, blank);
 
 	if (res == ERR && change_scroll_region) {
@@ -1694,6 +1705,17 @@ _nc_scrolln(int n, int top, int bot, int maxy)
 
 	if (res == ERR && _nc_idlok)
 	    res = scroll_idl(-n, bot + n + 1, top, blank);
+
+	/*
+	 * Clear the newly shifted-in text.
+	 */
+	if (res != ERR
+	    && (non_dest_scroll_region || (memory_above && top == 0))) {
+	    for (i = 0; i < -n; i++) {
+		GoTo(i + top, 0);
+		ClrToEOL(BLANK, FALSE);
+	    }
+	}
     }
 
     if (res == ERR)
@@ -1744,7 +1766,7 @@ void
 _nc_screen_wrap(void)
 {
     UpdateAttrs(A_NORMAL);
-#ifdef NCURSES_EXT_FUNCS
+#if NCURSES_EXT_FUNCS
     if (SP->_coloron
 	&& !SP->_default_color) {
 	SP->_default_color = TRUE;
@@ -1771,7 +1793,7 @@ _nc_do_xmc_glitch(attr_t previous)
 	    SP->_curscol += magic_cookie_glitch;
 	    if (SP->_curscol >= SP->_columns)
 		wrap_cursor();
-	    T(("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol));
+	    TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol));
 	}
 	chg >>= 1;
     }
diff --git a/panel/Makefile.in b/panel/Makefile.in
index e5f528d7..a33ca9c7 100644
--- a/panel/Makefile.in
+++ b/panel/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.31 2000/05/28 01:40:32 tom Exp $
+# $Id: Makefile.in,v 1.35 2000/10/14 17:57:02 Johnny.C.Lam Exp $
 ##############################################################################
 # Copyright (c) 1998-2000 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -46,7 +46,7 @@ SHELL		= /bin/sh
 THIS		= Makefile
 
 MODEL		= @DFT_LWR_MODEL@
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -54,7 +54,7 @@ libdir		= @libdir@
 includedir	= @includedir@
 datadir		= @datadir@
 
-ticdir		= $(datadir)/terminfo
+LIBTOOL		= @LIBTOOL@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -71,10 +71,11 @@ CPP		= @CPP@
 CFLAGS		= @CFLAGS@
 
 CPPFLAGS	= @CPPFLAGS@ \
-		  -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"
+		  -DHAVE_CONFIG_H
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
@@ -82,7 +83,7 @@ CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
 
-LINK		= $(CC)
+LINK		= $(LIBTOOL) $(CC)
 LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
 
 SHLIB_DIRS	= -L../lib -L$(libdir)
@@ -90,6 +91,8 @@ SHLIB_LIST	= $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
 
 MK_SHARED_LIB	= @MK_SHARED_LIB@
 
+NCURSES_MAJOR	= @NCURSES_MAJOR@
+NCURSES_MINOR	= @NCURSES_MINOR@
 REL_VERSION	= @cf_cv_rel_version@
 ABI_VERSION	= @cf_cv_abi_version@
 
@@ -111,7 +114,7 @@ install ::	$(AUTO_SRC) $(LIBRARIES)
 
 sources:	$(AUTO_SRC)
 
-$(INSTALL_PREFIX)$(libdir) :
+$(DESTDIR)$(libdir) :
 	$(srcdir)/../mkinstalldirs $@
 
 # make a copy to simplify include-paths while still keeping panel's include
@@ -127,8 +130,8 @@ PANEL_PRIV_H = \
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
diff --git a/panel/panel.priv.h b/panel/panel.priv.h
index 57bf793a..f5a4798f 100644
--- a/panel/panel.priv.h
+++ b/panel/panel.priv.h
@@ -1,4 +1,32 @@
-/* $Id: panel.priv.h,v 1.13 2000/01/15 20:39:53 juergen Exp $ */
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/* $Id: panel.priv.h,v 1.14 2000/09/02 18:22:23 tom Exp $ */
 
 #ifndef _PANEL_PRIV_H
 #define _PANEL_PRIV_H
@@ -28,7 +56,7 @@
 #  define INLINE
 #endif
 
-#ifdef USE_RCS_IDS
+#if USE_RCS_IDS
 #  define MODULE_ID(id) static const char Ident[] = id;
 #else
 #  define MODULE_ID(id) /*nothing*/
diff --git a/progs/Makefile.in b/progs/Makefile.in
index a0a296ef..b93ef8fa 100644
--- a/progs/Makefile.in
+++ b/progs/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.41 2000/07/08 01:56:25 tom Exp $
+# $Id: Makefile.in,v 1.51 2000/10/14 22:19:14 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2000 Free Software Foundation, Inc.                     #
 #                                                                            #
@@ -50,7 +50,7 @@ CF_MFLAGS 	= @cf_cv_makeflags@
 x		= @PROG_EXT@
 
 MODEL		= ../@DFT_OBJ_SUBDIR@
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -59,10 +59,11 @@ libdir		= @libdir@
 includedir	= @includedir@
 datadir		= @datadir@
 
-ticdir		= $(datadir)/terminfo
+LIBTOOL		= @LIBTOOL@
 
 INSTALL		= @INSTALL@
 INSTALL_PROGRAM	= @INSTALL_PROGRAM@
+transform	= @program_transform_name@
 
 AWK		= @AWK@
 LN_S		= @LN_S@
@@ -73,10 +74,11 @@ CFLAGS		= @CFLAGS@
 
 INCDIR		= $(srcdir)/../include
 CPPFLAGS	= -I../progs -I$(srcdir) @CPPFLAGS@ \
-		  -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"
+		  -DHAVE_CONFIG_H
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
@@ -85,10 +87,11 @@ CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
 CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
 
 LD		= @LD@
-LINK		= @LINK_PROGS@ $(CC)
+LINK		= @LINK_PROGS@ $(LIBTOOL) $(CC)
 LDFLAGS		= @EXTRA_LDFLAGS@ \
 		@PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
 
+LDFLAGS_LIBTOOL	= $(LDFLAGS)
 LDFLAGS_NORMAL	= $(LDFLAGS)
 LDFLAGS_DEBUG	= $(LDFLAGS) @CC_G_OPT@
 LDFLAGS_PROFILE	= $(LDFLAGS) -pg
@@ -101,7 +104,8 @@ LINT_OPTS	= @LINT_OPTS@
 LINT_LIBS	= -lncurses @LIBS@
 
 AUTO_SRC = \
-	termsort.c
+	termsort.c \
+	transform.h
 
 PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x
 
@@ -111,47 +115,66 @@ TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
 DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
 
 ################################################################################
-all:		$(AUTO_SRC) $(PROGS) 
+all:		$(AUTO_SRC) $(PROGS)
 
 sources:	$(AUTO_SRC)
 
-install: install.progs 
-uninstall: uninstall.progs 
+install: 	$(AUTO_SRC) install.progs
+uninstall: uninstall.progs
 
 # this line simplifies the configure-script
 libs \
 install.libs \
 uninstall.libs:
 
-install.progs: $(PROGS) $(INSTALL_PREFIX)$(bindir)
-	$(INSTALL_PROGRAM) tic$x     $(INSTALL_PREFIX)$(bindir)/tic$x
-	$(INSTALL_PROGRAM) toe$x     $(INSTALL_PREFIX)$(bindir)/toe$x
-	$(INSTALL_PROGRAM) infocmp$x $(INSTALL_PREFIX)$(bindir)/infocmp$x
-	$(INSTALL_PROGRAM) clear$x   $(INSTALL_PREFIX)$(bindir)/clear$x
-	$(INSTALL_PROGRAM) tput$x    $(INSTALL_PREFIX)$(bindir)/tput$x
-	$(INSTALL_PROGRAM) tset$x    $(INSTALL_PREFIX)$(bindir)/tset$x
-	@echo "linking captoinfo to tic"
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo$x
-	(cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic$x captoinfo$x)
-	@echo "linking infotocap to tic"
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/infotocap$x
-	(cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic$x infotocap$x)
-	@echo "linking reset to tset"
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/reset$x
-	(cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tset$x reset$x)
+TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
+
+actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
+actual_clear     = `echo clear$x|     $(TRANSFORM)`
+actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
+actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
+actual_init      = `echo init$x|      $(TRANSFORM)`
+actual_reset     = `echo reset$x|     $(TRANSFORM)`
+actual_tic       = `echo tic$x|       $(TRANSFORM)`
+actual_toe       = `echo toe$x|       $(TRANSFORM)`
+actual_tput      = `echo tput$x|      $(TRANSFORM)`
+actual_tset      = `echo tset$x|      $(TRANSFORM)`
+
+transform.h :
+	echo "#define PROG_CAPTOINFO \"$(actual_captoinfo)\"" >$@
+	echo "#define PROG_INFOTOCAP \"$(actual_infotocap)\"" >>$@
+	echo "#define PROG_RESET     \"$(actual_reset)\""     >>$@
+	echo "#define PROG_INIT      \"$(actual_init)\""      >>$@
+
+install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
+	$(LIBTOOL) $(INSTALL_PROGRAM) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
+	$(LIBTOOL) $(INSTALL_PROGRAM) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
+	$(LIBTOOL) $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
+	$(LIBTOOL) $(INSTALL_PROGRAM) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
+	$(LIBTOOL) $(INSTALL_PROGRAM) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
+	$(LIBTOOL) $(INSTALL_PROGRAM) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
+	@echo "linking $(actual_captoinfo) to $(actual_tic)"
+	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
+	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
+	@echo "linking $(actual_infotocap) to $(actual_tic)"
+	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
+	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
+	@echo "linking $(actual_reset) to $(actual_tset)"
+	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
+	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
 
 uninstall.progs:
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/tic$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/toe$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/infocmp$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/clear$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/tput$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/tset$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/infotocap$x
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/reset$x
-
-$(INSTALL_PREFIX)$(bindir) :
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
+	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
+	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
+	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
+
+$(DESTDIR)$(bindir) :
 	$(srcdir)/../mkinstalldirs $@
 
 #
@@ -162,7 +185,7 @@ DEPS_TIC = \
 	$(MODEL)/tic.o \
 	$(MODEL)/dump_entry.o
 
-tic$x: $(DEPS_TIC) $(DEPS_CURSES)
+tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
 	@ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_TOE = \
@@ -181,7 +204,7 @@ clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
 DEPS_TPUT = \
 	$(MODEL)/tput.o
 
-tput$x: $(DEPS_TPUT) $(DEPS_CURSES)
+tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
 	@ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_INFOCMP = \
@@ -195,7 +218,7 @@ DEPS_TSET = \
 	$(MODEL)/tset.o \
 	$(MODEL)/dump_entry.o
 
-tset$x: $(DEPS_TSET) $(DEPS_CURSES)
+tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
 	@ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
 
 termsort.c: $(srcdir)/MKtermsort.sh
@@ -208,8 +231,8 @@ termsort.c: $(srcdir)/MKtermsort.sh
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
@@ -218,6 +241,7 @@ mostlyclean ::
 clean :: mostlyclean
 	-rm -f $(AUTO_SRC)
 	-rm -f $(PROGS)
+	-rm -rf .libs
 
 distclean :: clean
 	-rm -f Makefile
diff --git a/progs/dump_entry.c b/progs/dump_entry.c
index 3830742f..60c88d3f 100644
--- a/progs/dump_entry.c
+++ b/progs/dump_entry.c
@@ -38,7 +38,7 @@
 #include "termsort.c"		/* this C file is generated */
 #include 	/* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.53 2000/04/15 21:23:30 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.54 2000/10/01 01:34:06 tom Exp $")
 
 #define INDENT			8
 #define DISCARD(string) string = ABSENT_STRING
@@ -641,8 +641,9 @@ fmt_entry(TERMTYPE * tterm,
 		sprintf(buffer, "%s@", name);
 		WRAP_CONCAT;
 	    } else if (outform == F_TERMCAP || outform == F_TCONVERR) {
+		int params = (i < (int) SIZEOF(parametrized)) ? parametrized[i] : 0;
 		char *srccap = _nc_tic_expand(tterm->Strings[i], TRUE, numbers);
-		char *cv = _nc_infotocap(name, srccap, parametrized[i]);
+		char *cv = _nc_infotocap(name, srccap, params);
 
 		if (cv == 0) {
 		    if (outform == F_TCONVERR) {
diff --git a/progs/infocmp.c b/progs/infocmp.c
index add5efb9..bf7ff1c5 100644
--- a/progs/infocmp.c
+++ b/progs/infocmp.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: infocmp.c,v 1.54 2000/03/19 02:56:14 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.57 2000/10/01 01:26:25 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -73,7 +73,7 @@ static const char *tversion;	/* terminfo version selected */
 static int itrace;		/* trace flag for debugging */
 static int mwidth = 60;
 static int numbers = 0;		/* format "%'char'" to/from "%{number}" */
-static int outform = F_TERMINFO;/* output format */
+static int outform = F_TERMINFO;	/* output format */
 static int sortmode;		/* sort_mode */
 
 /* main comparison mode */
@@ -90,8 +90,8 @@ static bool ignorepads;		/* ignore pad prefixes when diffing */
 static void
 ExitProgram(int code) GCC_NORETURN;
 /* prototype is to get gcc to accept the noreturn attribute */
-static void
-ExitProgram(int code)
+     static void
+       ExitProgram(int code)
 {
     while (termcount-- > 0)
 	_nc_free_termtype(&entries[termcount].tterm);
@@ -350,10 +350,10 @@ compare_predicate(int type, int idx, const char *name)
 	case C_DIFFERENCE:
 	    if (!(b1 == ABSENT_BOOLEAN && b2 == ABSENT_BOOLEAN) && b1 != b2)
 		(void) printf("\t%s: %s%s%s.\n",
-		    name,
-		    dump_boolean(b1),
-		    bool_sep,
-		    dump_boolean(b2));
+			      name,
+			      dump_boolean(b1),
+			      bool_sep,
+			      dump_boolean(b2));
 	    break;
 
 	case C_COMMON:
@@ -732,8 +732,8 @@ file_comparison(int argc, char *argv[])
 	/* maybe do use resolution */
 	if (!_nc_resolve_uses(!limited)) {
 	    (void) fprintf(stderr,
-		"There are unresolved use entries in %s:\n",
-		argv[n]);
+			   "There are unresolved use entries in %s:\n",
+			   argv[n]);
 	    for_entry_list(qp) {
 		if (qp->nuses) {
 		    (void) fputs(qp->tterm.term_names, stderr);
@@ -773,30 +773,30 @@ file_comparison(int argc, char *argv[])
     for (qp = heads[0]; qp; qp = qp->next) {
 	if (qp->ncrosslinks > 1) {
 	    (void) fprintf(stderr,
-		"%s in file 1 (%s) has %d matches in file 2 (%s):\n",
-		_nc_first_name(qp->tterm.term_names),
-		argv[0],
-		qp->ncrosslinks,
-		argv[1]);
+			   "%s in file 1 (%s) has %d matches in file 2 (%s):\n",
+			   _nc_first_name(qp->tterm.term_names),
+			   argv[0],
+			   qp->ncrosslinks,
+			   argv[1]);
 	    for (i = 0; i < qp->ncrosslinks; i++)
 		(void) fprintf(stderr,
-		    "\t%s\n",
-		    _nc_first_name((qp->crosslinks[i])->tterm.term_names));
+			       "\t%s\n",
+			       _nc_first_name((qp->crosslinks[i])->tterm.term_names));
 	}
     }
 
     for (rp = heads[1]; rp; rp = rp->next) {
 	if (rp->ncrosslinks > 1) {
 	    (void) fprintf(stderr,
-		"%s in file 2 (%s) has %d matches in file 1 (%s):\n",
-		_nc_first_name(rp->tterm.term_names),
-		argv[1],
-		rp->ncrosslinks,
-		argv[0]);
+			   "%s in file 2 (%s) has %d matches in file 1 (%s):\n",
+			   _nc_first_name(rp->tterm.term_names),
+			   argv[1],
+			   rp->ncrosslinks,
+			   argv[0]);
 	    for (i = 0; i < rp->ncrosslinks; i++)
 		(void) fprintf(stderr,
-		    "\t%s\n",
-		    _nc_first_name((rp->crosslinks[i])->tterm.term_names));
+			       "\t%s\n",
+			       _nc_first_name((rp->crosslinks[i])->tterm.term_names));
 	}
     }
 
@@ -804,13 +804,13 @@ file_comparison(int argc, char *argv[])
     for (qp = heads[0]; qp; qp = qp->next)
 	if (qp->ncrosslinks == 0)
 	    (void) printf("\t%s\n",
-		_nc_first_name(qp->tterm.term_names));
+			  _nc_first_name(qp->tterm.term_names));
 
     (void) printf("In file 2 (%s) only:\n", argv[1]);
     for (rp = heads[1]; rp; rp = rp->next)
 	if (rp->ncrosslinks == 0)
 	    (void) printf("\t%s\n",
-		_nc_first_name(rp->tterm.term_names));
+			  _nc_first_name(rp->tterm.term_names));
 
     (void) printf("The following entries are equivalent:\n");
     for (qp = heads[0]; qp; qp = qp->next) {
@@ -858,7 +858,7 @@ file_comparison(int argc, char *argv[])
 		case C_DIFFERENCE:
 		    if (itrace)
 			(void) fprintf(stderr,
-			    "infocmp: dumping differences\n");
+				       "infocmp: dumping differences\n");
 		    (void) printf("comparing %s to %s.\n", name1, name2);
 		    compare_entry(compare_predicate, &entries->tterm, quiet);
 		    break;
@@ -866,7 +866,7 @@ file_comparison(int argc, char *argv[])
 		case C_COMMON:
 		    if (itrace)
 			(void) fprintf(stderr,
-			    "infocmp: dumping common capabilities\n");
+				       "infocmp: dumping common capabilities\n");
 		    (void) printf("comparing %s to %s.\n", name1, name2);
 		    compare_entry(compare_predicate, &entries->tterm, quiet);
 		    break;
@@ -874,7 +874,7 @@ file_comparison(int argc, char *argv[])
 		case C_NAND:
 		    if (itrace)
 			(void) fprintf(stderr,
-			    "infocmp: dumping differences\n");
+				       "infocmp: dumping differences\n");
 		    (void) printf("comparing %s to %s.\n", name1, name2);
 		    compare_entry(compare_predicate, &entries->tterm, quiet);
 		    break;
@@ -924,7 +924,7 @@ usage(void)
 	,"  -w number  (width)"
     };
     const size_t first = 3;
-    const size_t last = sizeof(tbl) / sizeof(tbl[0]);
+    const size_t last = SIZEOF(tbl);
     const size_t left = (last - first + 1) / 2 + first;
     size_t n;
 
@@ -985,7 +985,7 @@ dump_initializers(TERMTYPE * term)
 	    break;
 	}
 	(void) printf("\t/* %3d: %-8s */\t%s,\n",
-	    n, ExtBoolname(term, n, boolnames), str);
+		      n, ExtBoolname(term, n, boolnames), str);
     }
     (void) printf("%s;\n", R_CURL);
 
@@ -1005,8 +1005,8 @@ dump_initializers(TERMTYPE * term)
 	    str = buf;
 	    break;
 	}
-	(void) printf("\t/* %3d: %-8s */\t%s,\n", n, ExtNumname(term, n,
-		numnames), str);
+	(void) printf("\t/* %3d: %-8s */\t%s,\n", n,
+		      ExtNumname(term, n, numnames), str);
     }
     (void) printf("%s;\n", R_CURL);
 
@@ -1027,8 +1027,8 @@ dump_initializers(TERMTYPE * term)
 	    tp = buf;
 	    *tp++ = '"';
 	    for (sp = term->Strings[n];
-		*sp != 0 && (tp - buf) < MAX_STRING - 6;
-		sp++) {
+		 *sp != 0 && (tp - buf) < MAX_STRING - 6;
+		 sp++) {
 		if (isascii(*sp) && isprint(*sp) && *sp != '\\' && *sp != '"')
 		    *tp++ = *sp;
 		else {
@@ -1046,11 +1046,11 @@ dump_initializers(TERMTYPE * term)
 	    (void) printf("%s;\n", R_CURL);
 
 	    (void) printf("static char * %s[] = %s\n",
-		name_initializer("string_ext"), L_CURL);
+			  name_initializer("string_ext"), L_CURL);
 	}
 #endif
-	(void) printf("\t/* %3d: %-8s */\t%s,\n", n, ExtStrname(term, n,
-		strnames), str);
+	(void) printf("\t/* %3d: %-8s */\t%s,\n", n,
+		      ExtStrname(term, n, strnames), str);
     }
     (void) printf("%s;\n", R_CURL);
 }
@@ -1071,26 +1071,39 @@ dump_termtype(TERMTYPE * term)
     (void) printf("#if NCURSES_XNAMES\n");
     (void) printf("\t\t(char *)0,\t/* pointer to extended string table */\n");
     (void) printf("\t\t%s,\t/* ...corresponding names */\n",
-	(NUM_STRINGS(term) != STRCOUNT)
-	? name_initializer("string_ext")
-	: "(char **)0");
+		  (NUM_STRINGS(term) != STRCOUNT)
+		  ? name_initializer("string_ext")
+		  : "(char **)0");
 
     (void) printf("\t\t%d,\t\t/* count total Booleans */\n", NUM_BOOLEANS(term));
     (void) printf("\t\t%d,\t\t/* count total Numbers */\n", NUM_NUMBERS(term));
     (void) printf("\t\t%d,\t\t/* count total Strings */\n", NUM_STRINGS(term));
 
     (void) printf("\t\t%d,\t\t/* count extensions to Booleans */\n",
-	NUM_BOOLEANS(term) - BOOLCOUNT);
+		  NUM_BOOLEANS(term) - BOOLCOUNT);
     (void) printf("\t\t%d,\t\t/* count extensions to Numbers */\n",
-	NUM_NUMBERS(term) - NUMCOUNT);
+		  NUM_NUMBERS(term) - NUMCOUNT);
     (void) printf("\t\t%d,\t\t/* count extensions to Strings */\n",
-	NUM_STRINGS(term) - STRCOUNT);
+		  NUM_STRINGS(term) - STRCOUNT);
 
     (void) printf("#endif /* NCURSES_XNAMES */\n");
 #endif /* NCURSES_XNAMES */
     (void) printf("\t%s\n", R_CURL);
 }
 
+static int
+optarg_to_number(void)
+{
+    char *temp = 0;
+    long value = strtol(optarg, &temp, 0);
+
+    if (temp == 0 || temp == optarg || *temp != 0) {
+	fprintf(stderr, "Expected a number, not \"%s\"\n", optarg);
+	exit(EXIT_FAILURE);
+    }
+    return (int) value;
+}
+
 /***************************************************************************
  *
  * Main sequence
@@ -1112,7 +1125,7 @@ main(int argc, char *argv[])
 
     if ((terminal = getenv("TERM")) == 0) {
 	(void) fprintf(stderr,
-	    "infocmp: environment variable TERM not set\n");
+		       "infocmp: environment variable TERM not set\n");
 	return EXIT_FAILURE;
     }
 
@@ -1222,7 +1235,7 @@ main(int argc, char *argv[])
 		sortmode = S_TERMCAP;
 	    else {
 		(void) fprintf(stderr,
-		    "infocmp: unknown sort mode\n");
+			       "infocmp: unknown sort mode\n");
 		return EXIT_FAILURE;
 	    }
 	    break;
@@ -1232,17 +1245,16 @@ main(int argc, char *argv[])
 	    break;
 
 	case 'v':
-	    itrace = atoi(optarg);
+	    itrace = optarg_to_number();
 	    set_trace_level(itrace);
 	    break;
 
 	case 'V':
-	    (void) fputs(NCURSES_VERSION, stdout);
-	    putchar('\n');
+	    puts(curses_version());
 	    ExitProgram(EXIT_SUCCESS);
 
 	case 'w':
-	    mwidth = atoi(optarg);
+	    mwidth = optarg_to_number();
 	    break;
 
 	case 'A':
@@ -1289,7 +1301,7 @@ main(int argc, char *argv[])
 	for (; optind < argc; optind++) {
 	    if (termcount >= MAXTERMS) {
 		(void) fprintf(stderr,
-		    "infocmp: too many terminal type arguments\n");
+			       "infocmp: too many terminal type arguments\n");
 		return EXIT_FAILURE;
 	    } else {
 		const char *directory = termcount ? restdir : firstdir;
@@ -1299,31 +1311,31 @@ main(int argc, char *argv[])
 
 		if (directory) {
 		    (void) sprintf(tfile[termcount], "%s/%c/%s",
-			directory,
-			*argv[optind], argv[optind]);
+				   directory,
+				   *argv[optind], argv[optind]);
 		    if (itrace)
 			(void) fprintf(stderr,
-			    "infocmp: reading entry %s from file %s\n",
-			    argv[optind], tfile[termcount]);
+				       "infocmp: reading entry %s from file %s\n",
+				       argv[optind], tfile[termcount]);
 
 		    status = _nc_read_file_entry(tfile[termcount],
-			&entries[termcount].tterm);
+						 &entries[termcount].tterm);
 		} else {
 		    if (itrace)
 			(void) fprintf(stderr,
-			    "infocmp: reading entry %s from system directories %s\n",
-			    argv[optind], tname[termcount]);
+				       "infocmp: reading entry %s from system directories %s\n",
+				       argv[optind], tname[termcount]);
 
 		    status = _nc_read_entry(tname[termcount],
-			tfile[termcount],
-			&entries[termcount].tterm);
+					    tfile[termcount],
+					    &entries[termcount].tterm);
 		    directory = TERMINFO;	/* for error message */
 		}
 
 		if (status <= 0) {
 		    (void) fprintf(stderr,
-			"infocmp: couldn't open terminfo file %s.\n",
-			tfile[termcount]);
+				   "infocmp: couldn't open terminfo file %s.\n",
+				   tfile[termcount]);
 		    return EXIT_FAILURE;
 		}
 		repair_acsc(&entries[termcount].tterm);
@@ -1368,10 +1380,10 @@ main(int argc, char *argv[])
 	case C_DEFAULT:
 	    if (itrace)
 		(void) fprintf(stderr,
-		    "infocmp: about to dump %s\n",
-		    tname[0]);
+			       "infocmp: about to dump %s\n",
+			       tname[0]);
 	    (void) printf("#\tReconstructed via infocmp from file: %s\n",
-		tfile[0]);
+			  tfile[0]);
 	    len = dump_entry(&entries[0].tterm, limited, numbers, NULL);
 	    putchar('\n');
 	    if (itrace)
@@ -1388,7 +1400,7 @@ main(int argc, char *argv[])
 	case C_COMMON:
 	    if (itrace)
 		(void) fprintf(stderr,
-		    "infocmp: dumping common capabilities\n");
+			       "infocmp: dumping common capabilities\n");
 	    (void) printf("comparing %s to %s.\n", tname[0], tname[1]);
 	    compare_entry(compare_predicate, &entries->tterm, quiet);
 	    break;
@@ -1396,7 +1408,7 @@ main(int argc, char *argv[])
 	case C_NAND:
 	    if (itrace)
 		(void) fprintf(stderr,
-		    "infocmp: dumping differences\n");
+			       "infocmp: dumping differences\n");
 	    (void) printf("comparing %s to %s.\n", tname[0], tname[1]);
 	    compare_entry(compare_predicate, &entries->tterm, quiet);
 	    break;
@@ -1407,7 +1419,7 @@ main(int argc, char *argv[])
 	    len = dump_entry(&entries[0].tterm, limited, numbers, use_predicate);
 	    for (i = 1; i < termcount; i++)
 		len += dump_uses(tname[i], !(outform == F_TERMCAP || outform
-			== F_TCONVERR));
+					     == F_TCONVERR));
 	    putchar('\n');
 	    if (itrace)
 		(void) fprintf(stderr, "infocmp: length %d\n", len);
@@ -1419,7 +1431,7 @@ main(int argc, char *argv[])
 	(void) fprintf(stderr, "Use `tic -[CI] ' for this.\n");
     else if (argc - optind != 2)
 	(void) fprintf(stderr,
-	    "File comparison needs exactly two file arguments.\n");
+		       "File comparison needs exactly two file arguments.\n");
     else
 	file_comparison(argc - optind, argv + optind);
 
diff --git a/progs/progs.priv.h b/progs/progs.priv.h
index 2d22c9ad..d704c098 100644
--- a/progs/progs.priv.h
+++ b/progs/progs.priv.h
@@ -30,7 +30,7 @@
  *  Author: Thomas E. Dickey  1997,1998                   *
  ****************************************************************************/
 /*
- * $Id: progs.priv.h,v 1.22 2000/04/08 23:47:39 tom Exp $
+ * $Id: progs.priv.h,v 1.24 2000/10/01 01:33:34 tom Exp $
  *
  *	progs.priv.h
  *
@@ -39,7 +39,7 @@
 
 #include 
 
-#ifdef USE_RCS_IDS
+#if USE_RCS_IDS
 #define MODULE_ID(id) static const char Ident[] = id;
 #else
 #define MODULE_ID(id) /*nothing*/
@@ -162,7 +162,7 @@ extern int optind;
 /* We use isascii only to guard against use of 7-bit ctype tables in the
  * isprint test in infocmp.
  */
-#ifndef HAVE_ISASCII
+#if !HAVE_ISASCII
 # undef isascii
 # if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127)
 #  define isascii(c) (((c) & 0xff) <= 127)
@@ -170,3 +170,5 @@ extern int optind;
 #  define isascii(c) 1	/* not really ascii anyway */
 # endif
 #endif
+
+#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
diff --git a/progs/tic.c b/progs/tic.c
index cc73a4db..620704fc 100644
--- a/progs/tic.c
+++ b/progs/tic.c
@@ -38,11 +38,13 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
+#include 
 
-MODULE_ID("$Id: tic.c,v 1.69 2000/04/08 23:53:49 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.83 2000/10/14 17:30:26 tom Exp $")
 
 const char *_nc_progname = "tic";
 
@@ -54,7 +56,7 @@ static const char *to_remove;
 static void (*save_check_termtype) (TERMTYPE *);
 static void check_termtype(TERMTYPE * tt);
 
-static const char usage_string[] = "[-h] [-v[n]] [-e names] [-CILNRTcfrswx1] source-file\n";
+static const char usage_string[] = "[-V] [-v[n]] [-e names] [-CILNRTcfrswx1] source-file\n";
 
 static void
 cleanup(void)
@@ -91,6 +93,7 @@ usage(void)
 	"  -N         disable smart defaults for source translation",
 	"  -R         restrict translation to given terminfo/termcap version",
 	"  -T         remove size-restrictions on compiled description",
+	"  -V         print version",
 #if NCURSES_XNAMES
 	"  -a         retain commented-out capabilities (sets -x also)",
 #endif
@@ -114,7 +117,7 @@ usage(void)
     size_t j;
 
     fprintf(stderr, "Usage: %s %s\n", _nc_progname, usage_string);
-    for (j = 0; j < sizeof(tbl) / sizeof(tbl[0]); j++) {
+    for (j = 0; j < SIZEOF(tbl); j++) {
 	fputs(tbl[j], stderr);
 	putc('\n', stderr);
     }
@@ -148,7 +151,7 @@ write_it(ENTRY * ep)
 		if (ch == '\\') {
 		    *d++ = *t++;
 		} else if ((ch == '%')
-		    && (*t == L_BRACE)) {
+			   && (*t == L_BRACE)) {
 		    char *v = 0;
 		    long value = strtol(t + 1, &v, 0);
 		    if (v != 0
@@ -179,7 +182,7 @@ static bool
 immedhook(ENTRY * ep GCC_UNUSED)
 /* write out entries with no use capabilities immediately to save storage */
 {
-#ifndef HAVE_BIG_CORE
+#if !HAVE_BIG_CORE
     /*
      * This is strictly a core-economy kluge.  The really clean way to handle
      * compilation is to slurp the whole file into core and then do all the
@@ -301,6 +304,24 @@ stripped(char *src)
     return 0;
 }
 
+static FILE *
+open_input(const char *filename)
+{
+    FILE *fp = fopen(filename, "r");
+    struct stat sb;
+
+    if (fp == 0) {
+	fprintf(stderr, "%s: Can't open %s\n", _nc_progname, filename);
+	exit(EXIT_FAILURE);
+    }
+    if (fstat(fileno(fp), &sb) < 0
+	|| (sb.st_mode & S_IFMT) != S_IFREG) {
+	fprintf(stderr, "%s: %s is not a file\n", _nc_progname, filename);
+	exit(EXIT_FAILURE);
+    }
+    return fp;
+}
+
 /* Parse the "-e" option-value into a list of names */
 static const char **
 make_namelist(char *src)
@@ -314,9 +335,7 @@ make_namelist(char *src)
     if (src == 0) {
 	/* EMPTY */ ;
     } else if (strchr(src, '/') != 0) {		/* a filename */
-	FILE *fp = fopen(src, "r");
-	if (fp == 0)
-	    failed(src);
+	FILE *fp = open_input(src);
 
 	for (pass = 1; pass <= 2; pass++) {
 	    nn = 0;
@@ -425,16 +444,13 @@ main(int argc, char *argv[])
 
     log_fp = stderr;
 
-    if ((_nc_progname = strrchr(argv[0], '/')) == NULL)
-	_nc_progname = argv[0];
-    else
-	_nc_progname++;
+    _nc_progname = _nc_basename(argv[0]);
 
-    if ((infodump = (strcmp(_nc_progname, "captoinfo") == 0)) != FALSE) {
+    if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) {
 	outform = F_TERMINFO;
 	sortmode = S_TERMINFO;
     }
-    if ((capdump = (strcmp(_nc_progname, "infotocap") == 0)) != FALSE) {
+    if ((capdump = (strcmp(_nc_progname, PROG_INFOTOCAP) == 0)) != FALSE) {
 	outform = F_TERMCAP;
 	sortmode = S_TERMCAP;
     }
@@ -448,7 +464,7 @@ main(int argc, char *argv[])
      * be optional.
      */
     while ((this_opt = getopt(argc, argv,
-		"0123456789CILNR:TVace:fGgo:rsvwx")) != EOF) {
+			      "0123456789CILNR:TVace:fGgo:rsvwx")) != EOF) {
 	if (isdigit(this_opt)) {
 	    switch (last_opt) {
 	    case 'v':
@@ -491,7 +507,7 @@ main(int argc, char *argv[])
 	    limited = FALSE;
 	    break;
 	case 'V':
-	    puts(NCURSES_VERSION);
+	    puts(curses_version());
 	    return EXIT_SUCCESS;
 	case 'c':
 	    check_only = TRUE;
@@ -544,7 +560,7 @@ main(int argc, char *argv[])
 	save_check_termtype = _nc_check_termtype;
 	_nc_check_termtype = check_termtype;
     }
-#ifndef HAVE_BIG_CORE
+#if !HAVE_BIG_CORE
     /*
      * Aaargh! immedhook seriously hoses us!
      *
@@ -557,7 +573,7 @@ main(int argc, char *argv[])
      */
     if (namelst && (!infodump && !capdump)) {
 	(void) fprintf(stderr,
-	    "Sorry, -e can't be used without -I or -C\n");
+		       "Sorry, -e can't be used without -I or -C\n");
 	cleanup();
 	return EXIT_FAILURE;
     }
@@ -567,10 +583,10 @@ main(int argc, char *argv[])
 	source_file = argv[optind++];
 	if (optind < argc) {
 	    fprintf(stderr,
-		"%s: Too many file names.  Usage:\n\t%s %s",
-		_nc_progname,
-		_nc_progname,
-		usage_string);
+		    "%s: Too many file names.  Usage:\n\t%s %s",
+		    _nc_progname,
+		    _nc_progname,
+		    usage_string);
 	    return EXIT_FAILURE;
 	}
     } else {
@@ -582,11 +598,13 @@ main(int argc, char *argv[])
 		if (access(termcap, F_OK) == 0) {
 		    /* file exists */
 		    source_file = termcap;
-		} else if ((tmp_fp = open_tempfile(my_tmpname)) != 0) {
+		} else if ((tmp_fp = open_tempfile(strcpy(my_tmpname,
+							  "/tmp/XXXXXX")))
+			   != 0) {
 		    source_file = my_tmpname;
 		    fprintf(tmp_fp, "%s\n", termcap);
 		    fclose(tmp_fp);
-		    tmp_fp = fopen(source_file, "r");
+		    tmp_fp = open_input(source_file);
 		    to_remove = source_file;
 		} else {
 		    failed("tmpnam");
@@ -595,41 +613,38 @@ main(int argc, char *argv[])
 	} else {
 	    /* tic */
 	    fprintf(stderr,
-		"%s: File name needed.  Usage:\n\t%s %s",
-		_nc_progname,
-		_nc_progname,
-		usage_string);
+		    "%s: File name needed.  Usage:\n\t%s %s",
+		    _nc_progname,
+		    _nc_progname,
+		    usage_string);
 	    cleanup();
 	    return EXIT_FAILURE;
 	}
     }
 
-    if (tmp_fp == 0
-	&& (tmp_fp = fopen(source_file, "r")) == 0) {
-	fprintf(stderr, "%s: Can't open %s\n", _nc_progname, source_file);
-	return EXIT_FAILURE;
-    }
+    if (tmp_fp == 0)
+	tmp_fp = open_input(source_file);
 
     if (infodump)
 	dump_init(tversion,
-	    smart_defaults
-	    ? outform
-	    : F_LITERAL,
-	    sortmode, width, debug_level, formatted);
+		  smart_defaults
+		  ? outform
+		  : F_LITERAL,
+		  sortmode, width, debug_level, formatted);
     else if (capdump)
 	dump_init(tversion,
-	    outform,
-	    sortmode, width, debug_level, FALSE);
+		  outform,
+		  sortmode, width, debug_level, FALSE);
 
     /* parse entries out of the source file */
     _nc_set_source(source_file);
-#ifndef HAVE_BIG_CORE
+#if !HAVE_BIG_CORE
     if (!(check_only || infodump || capdump))
 	_nc_set_writedir(outdir);
 #endif /* HAVE_BIG_CORE */
     _nc_read_entry_source(tmp_fp, (char *) NULL,
-	!smart_defaults, FALSE,
-	(check_only || infodump || capdump) ? NULLHOOK : immedhook);
+			  !smart_defaults, FALSE,
+			  (check_only || infodump || capdump) ? NULLHOOK : immedhook);
 
     /* do use resolution */
     if (check_only || (!infodump && !capdump) || forceresolve) {
@@ -647,9 +662,9 @@ main(int argc, char *argv[])
 
 		if (len > (infodump ? MAX_TERMINFO_LENGTH : MAX_TERMCAP_LENGTH))
 		    (void) fprintf(stderr,
-			"warning: resolved %s entry is %d bytes long\n",
-			_nc_first_name(qp->tterm.term_names),
-			len);
+				   "warning: resolved %s entry is %d bytes long\n",
+				   _nc_first_name(qp->tterm.term_names),
+				   len);
 	    }
 	}
     }
@@ -722,8 +737,8 @@ main(int argc, char *argv[])
 	int total = _nc_tic_written();
 	if (total != 0)
 	    fprintf(log_fp, "%d entries written to %s\n",
-		total,
-		_nc_tic_dir((char *) 0));
+		    total,
+		    _nc_tic_dir((char *) 0));
 	else
 	    fprintf(log_fp, "No entries written\n");
     }
@@ -742,6 +757,148 @@ TERMINAL *cur_term;		/* tweak to avoid linking lib_cur_term.c */
 #undef CUR
 #define CUR tp->
 
+/*
+ * Returns the expected number of parameters for the given capability.
+ */
+static int
+expected_params(char *name)
+{
+    /* *INDENT-OFF* */
+    static const struct {
+	const char *name;
+	int count;
+    } table[] = {
+	{ "birep",		2 },
+	{ "chr",		1 },
+	{ "colornm",		1 },
+	{ "cpi",		1 },
+	{ "csnm",		1 },
+	{ "csr",		2 },
+	{ "cub",		1 },
+	{ "cud",		1 },
+	{ "cuf",		1 },
+	{ "cup",		2 },
+	{ "cuu",		1 },
+	{ "cvr",		1 },
+	{ "cwin",		5 },
+	{ "dch",		1 },
+	{ "defc",		3 },
+	{ "dial",		1 },
+	{ "dispc",		1 },
+	{ "dl",			1 },
+	{ "ech",		1 },
+	{ "getm",		1 },
+	{ "hpa",		1 },
+	{ "ich",		1 },
+	{ "il",			1 },
+	{ "indn",		1 },
+	{ "initc",		4 },
+	{ "initp",		7 },
+	{ "lpi",		1 },
+	{ "mc5p",		1 },
+	{ "mrcup",		2 },
+	{ "mvpa",		1 },
+	{ "pfkey",		2 },
+	{ "pfloc",		2 },
+	{ "pfx",		2 },
+	{ "pfxl",		3 },
+	{ "pln",		2 },
+	{ "qdial",		1 },
+	{ "rcsd",		1 },
+	{ "rep",		2 },
+	{ "rin",		1 },
+	{ "sclk",		3 },
+	{ "scp",		1 },
+	{ "scs",		1 },
+	{ "scsd",		2 },
+	{ "setab",		1 },
+	{ "setaf",		1 },
+	{ "setb",		1 },
+	{ "setcolor",		1 },
+	{ "setf",		1 },
+	{ "sgr",		9 },
+	{ "sgr1",		6 },
+	{ "slength",		1 },
+	{ "slines",		1 },
+	{ "smgbp",		2 },
+	{ "smglp",		2 },
+	{ "smglr",		2 },
+	{ "smgrp",		1 },
+	{ "smgtb",		2 },
+	{ "smgtp",		1 },
+	{ "tsl",		1 },
+	{ "u6",			-1 },
+	{ "vpa",		1 },
+	{ "wind",		4 },
+	{ "wingo",		1 },
+    };
+    /* *INDENT-ON* */
+
+    unsigned n;
+    int result = 0;		/* function-keys, etc., use none */
+
+    for (n = 0; n < SIZEOF(table); n++) {
+	if (!strcmp(name, table[n].name)) {
+	    result = table[n].count;
+	    break;
+	}
+    }
+
+    return result;
+}
+
+/*
+ * Make a quick sanity check for the parameters which are used in the given
+ * strings.  If there are no "%p" tokens, then there should be no other "%"
+ * markers.
+ */
+static void
+check_params(TERMTYPE * tp, char *name, char *value)
+{
+    int expected = expected_params(name);
+    int actual = 0;
+    int n;
+    bool params[10];
+    char *s = value;
+
+    for (n = 0; n < 10; n++)
+	params[n] = FALSE;
+
+    while (*s != 0) {
+	if (*s == '%') {
+	    if (*++s == '\0') {
+		_nc_warning("expected character after %% in %s", name);
+		break;
+	    } else if (*s == 'p') {
+		if (*++s == '\0' || !isdigit((int) *s)) {
+		    _nc_warning("expected digit after %%p in %s", name);
+		    return;
+		} else {
+		    n = (*s - '0');
+		    if (n > actual)
+			actual = n;
+		    params[n] = TRUE;
+		}
+	    }
+	}
+	s++;
+    }
+
+    if (params[0]) {
+	_nc_warning("%s refers to parameter 0 (%%p0), which is not allowed", name);
+    }
+    if (value == set_attributes || expected < 0) {
+	;
+    } else if (expected != actual) {
+	_nc_warning("%s uses %d parameters, expected %d", name,
+		    actual, expected);
+	for (n = 1; n < actual; n++) {
+	    if (!params[n])
+		_nc_warning("%s omits parameter %d", name, n);
+	}
+    }
+}
+
 /*
  * An sgr string may contain several settings other than the one we're
  * interested in, essentially sgr0 + rmacs + whatever.  As long as the
@@ -767,20 +924,20 @@ static void
 check_sgr(TERMTYPE * tp, char *zero, int num, char *cap, const char *name)
 {
     char *test = tparm(set_attributes,
-	num == 1,
-	num == 2,
-	num == 3,
-	num == 4,
-	num == 5,
-	num == 6,
-	num == 7,
-	num == 8,
-	num == 9);
+		       num == 1,
+		       num == 2,
+		       num == 3,
+		       num == 4,
+		       num == 5,
+		       num == 6,
+		       num == 7,
+		       num == 8,
+		       num == 9);
     if (test != 0) {
 	if (PRESENT(cap)) {
 	    if (!similar_sgr(test, cap)) {
 		_nc_warning("%s differs from sgr(%d): %s", name, num,
-		    _nc_visbuf(test));
+			    _nc_visbuf(test));
 	    }
 	} else if (strcmp(test, zero)) {
 	    _nc_warning("sgr(%d) present, but not %s", num, name);
@@ -827,12 +984,12 @@ check_termtype(TERMTYPE * tp)
 			conflict = TRUE;
 		    }
 		    fprintf(stderr, "... %s is the same as %s",
-			keyname(_nc_tinfo_fkeys[j].code),
-			keyname(_nc_tinfo_fkeys[k].code));
+			    keyname(_nc_tinfo_fkeys[j].code),
+			    keyname(_nc_tinfo_fkeys[k].code));
 		    first = FALSE;
 		} else {
 		    fprintf(stderr, ", %s",
-			keyname(_nc_tinfo_fkeys[k].code));
+			    keyname(_nc_tinfo_fkeys[k].code));
 		}
 	    }
 	}
@@ -840,6 +997,12 @@ check_termtype(TERMTYPE * tp)
 	    fprintf(stderr, "\n");
     }
 
+    for (j = 0; j < NUM_STRINGS(tp); j++) {
+	char *a = tp->Strings[j];
+	if (VALID_STRING(a))
+	    check_params(tp, ExtStrname(tp, j, strnames), a);
+    }
+
     /*
      * Quick check for color.  We could also check if the ANSI versus
      * non-ANSI strings are misused.
diff --git a/progs/toe.c b/progs/toe.c
index afdf379f..b7afb676 100644
--- a/progs/toe.c
+++ b/progs/toe.c
@@ -43,7 +43,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: toe.c,v 1.22 2000/03/11 21:47:35 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.24 2000/09/09 19:52:35 tom Exp $")
 
 #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
 
@@ -87,10 +87,7 @@ main(int argc, char *argv[])
     int i, c;
     int code;
 
-    if ((_nc_progname = strrchr(argv[0], '/')) == 0)
-	_nc_progname = argv[0];
-    else
-	_nc_progname++;
+    _nc_progname = _nc_basename(argv[0]);
 
     while ((c = getopt(argc, argv, "huv:UV")) != EOF)
 	switch (c) {
@@ -107,8 +104,7 @@ main(int argc, char *argv[])
 	    invert_dependencies = TRUE;
 	    break;
 	case 'V':
-	    (void) fputs(NCURSES_VERSION, stdout);
-	    putchar('\n');
+	    puts(curses_version());
 	    ExitProgram(EXIT_SUCCESS);
 	default:
 	    (void) fprintf(stderr, "usage: toe [-huUV] [-v n] [file...]\n");
@@ -191,7 +187,7 @@ main(int argc, char *argv[])
 		if ((eargv[j] = get_directory(personal)) != 0)
 		    j++;
 	    }
-	    if ((eargv[j] = get_directory(TERMINFO)) != 0)
+	    if ((eargv[j] = get_directory(strcpy(personal, TERMINFO))) != 0)
 		j++;
 	}
 	eargv[j] = 0;
diff --git a/progs/tput.c b/progs/tput.c
index 63c6d1a5..a72a2e89 100644
--- a/progs/tput.c
+++ b/progs/tput.c
@@ -39,17 +39,27 @@
  */
 
 #include 
-#ifndef	PURE_TERMINFO
+
+#if !PURE_TERMINFO
 #include 
 #endif
+#include 
 
-MODULE_ID("$Id: tput.c,v 1.16 2000/03/19 01:08:08 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.24 2000/10/05 00:05:04 tom Exp $")
 
 #define PUTS(s)		fputs(s, stdout)
 #define PUTCHAR(c)	putchar(c)
 #define FLUSH		fflush(stdout)
 
+typedef enum {
+    Numbers = 0
+    ,Num_Str
+    ,Num_Str_Str
+} TParams;
+
 static char *prg_name;
+static bool is_init = FALSE;
+static bool is_reset = FALSE;
 
 static void
 quit(int status, const char *fmt,...)
@@ -66,38 +76,77 @@ quit(int status, const char *fmt,...)
 static void
 usage(void)
 {
-    fprintf(stderr, "usage: %s [-S] [-T term] capname\n", prg_name);
+    fprintf(stderr, "usage: %s [-V] [-S] [-T term] capname\n", prg_name);
     exit(EXIT_FAILURE);
 }
 
+static void
+check_aliases(const char *name)
+{
+    is_init = (strcmp(name, PROG_INIT) == 0);
+    is_reset = (strcmp(name, PROG_RESET) == 0);
+}
+
+/*
+ * Lookup the type of call we should make to tparm().  This ignores the actual
+ * terminfo capability (bad, because it is not extensible), but makes this
+ * code portable to platforms where sizeof(int) != sizeof(char *).
+ *
+ * FIXME: If we want extensibility, analyze the capability string as we do
+ * in tparm() to decide how to parse the varargs list.
+ */
+static TParams
+tparm_type(char *name)
+{
+#define TD(code, longname, ti, tc) {code,longname},{code,ti},{code,tc}
+    TParams result = Numbers;
+    /* *INDENT-OFF* */
+    static const struct {
+	TParams code;
+	const char *name;
+    } table[] = {
+	TD(Num_Str,	"pkey_key",	"pfkey",	"pk"),
+	TD(Num_Str,	"pkey_local",	"pfloc",	"pl"),
+	TD(Num_Str,	"pkey_xmit",	"pfx",		"px"),
+	TD(Num_Str,	"plab_norm",	"pln",		"pn"),
+	TD(Num_Str_Str, "pkey_plab",	"pfxl",		"xl"),
+    };
+    /* *INDENT-ON* */
+
+    unsigned n;
+    for (n = 0; n < SIZEOF(table); n++) {
+	if (!strcmp(name, table[n].name)) {
+	    result = table[n].code;
+	    break;
+	}
+    }
+    return result;
+}
+
 static int
 tput(int argc, char *argv[])
 {
     NCURSES_CONST char *name;
     char *s;
     int i, j, c;
-    int reset, status;
+    int status;
     FILE *f;
 
-    reset = 0;
-    name = argv[0];
-    if (strcmp(name, "reset") == 0) {
-	reset = 1;
-    }
-    if (reset || strcmp(name, "init") == 0) {
+    check_aliases(name = argv[0]);
+    if (is_reset || is_init) {
 	if (init_prog != 0) {
 	    system(init_prog);
 	}
 	FLUSH;
 
-	if (reset && reset_1string != 0) {
+	if (is_reset && reset_1string != 0) {
 	    PUTS(reset_1string);
 	} else if (init_1string != 0) {
 	    PUTS(init_1string);
 	}
 	FLUSH;
 
-	if (reset && reset_2string != 0) {
+	if (is_reset && reset_2string != 0) {
 	    PUTS(reset_2string);
 	} else if (init_2string != 0) {
 	    PUTS(init_2string);
@@ -107,12 +156,12 @@ tput(int argc, char *argv[])
 	if (set_lr_margin != 0) {
 	    PUTS(tparm(set_lr_margin, 0, columns - 1));
 	} else if (set_left_margin_parm != 0
-	    && set_right_margin_parm != 0) {
+		   && set_right_margin_parm != 0) {
 	    PUTS(tparm(set_left_margin_parm, 0));
 	    PUTS(tparm(set_right_margin_parm, columns - 1));
 	} else if (clear_margins != 0
-	    && set_left_margin != 0
-	    && set_right_margin != 0) {
+		   && set_left_margin != 0
+		   && set_right_margin != 0) {
 	    PUTS(clear_margins);
 	    if (carriage_return != 0) {
 		PUTS(carriage_return);
@@ -151,7 +200,7 @@ tput(int argc, char *argv[])
 	    }
 	}
 
-	if (reset && reset_file != 0) {
+	if (is_reset && reset_file != 0) {
 	    f = fopen(reset_file, "r");
 	    if (f == 0) {
 		quit(errno, "Can't open reset_file: '%s'", reset_file);
@@ -172,7 +221,7 @@ tput(int argc, char *argv[])
 	}
 	FLUSH;
 
-	if (reset && reset_3string != 0) {
+	if (is_reset && reset_3string != 0) {
 	    PUTS(reset_3string);
 	} else if (init_2string != 0) {
 	    PUTS(init_2string);
@@ -185,7 +234,7 @@ tput(int argc, char *argv[])
 	PUTS(longname());
 	return 0;
     }
-#ifndef	PURE_TERMINFO
+#if !PURE_TERMINFO
     {
 	const struct name_table_entry *np;
 
@@ -216,10 +265,11 @@ tput(int argc, char *argv[])
 	return (0);
     } else if ((s = tigetstr(name)) == CANCELLED_STRING) {
 	quit(4, "%s: unknown terminfo capability '%s'", prg_name, name);
-    } else if (s != 0) {
+    } else if (s != ABSENT_STRING) {
 	if (argc > 1) {
 	    int k;
-	    char * params[10];
+	    int numbers[10];
+	    char *strings[10];
 
 	    /* Nasty hack time. The tparm function needs to see numeric
 	     * parameters as numbers, not as pointers to their string
@@ -227,20 +277,31 @@ tput(int argc, char *argv[])
 	     */
 
 	    for (k = 1; k < argc; k++) {
-		if (isdigit(argv[k][0])) {
-		    long val = atol(argv[k]);
-		    params[k] = (char *)val;
-		} else {
-		    params[k] = argv[k];
-		}
+		char *tmp = 0;
+		strings[k] = argv[k];
+		numbers[k] = strtol(argv[k], &tmp, 0);
+		if (tmp == 0 || *tmp != 0)
+		    numbers[k] = 0;
+	    }
+	    for (k = argc; k <= 9; k++) {
+		numbers[k] = 0;
+		strings[k] = 0;
 	    }
-	    for (k = argc; k <= 9; k++)
-		params[k] = 0;
 
-	    s = tparm(s,
-	    	params[1], params[2], params[3],
-		params[4], params[5], params[6],
-		params[7], params[8], params[9]);
+	    switch (tparm_type(name)) {
+	    case Num_Str:
+		s = tparm(s, numbers[1], strings[2]);
+		break;
+	    case Num_Str_Str:
+		s = tparm(s, numbers[1], strings[2], strings[3]);
+		break;
+	    default:
+		s = tparm(s,
+			  numbers[1], numbers[2], numbers[3],
+			  numbers[4], numbers[5], numbers[6],
+			  numbers[7], numbers[8], numbers[9]);
+		break;
+	    }
 	}
 
 	/* use putp() in order to perform padding */
@@ -253,38 +314,47 @@ tput(int argc, char *argv[])
 int
 main(int argc, char **argv)
 {
-    char *s, *term;
-    int errret, cmdline = 1;
+    char *term;
+    int errret;
+    bool cmdline = TRUE;
     int c;
     char buf[BUFSIZ];
     int errors = 0;
 
-    prg_name = argv[0];
-    s = strrchr(prg_name, '/');
-    if (s != 0 && *++s != '\0')
-	prg_name = s;
+    check_aliases(prg_name = _nc_basename(argv[0]));
 
     term = getenv("TERM");
 
-    while ((c = getopt(argc, argv, "ST:")) != EOF)
+    while ((c = getopt(argc, argv, "ST:V")) != EOF) {
 	switch (c) {
 	case 'S':
-	    cmdline = 0;
+	    cmdline = FALSE;
 	    break;
 	case 'T':
 	    use_env(FALSE);
 	    term = optarg;
 	    break;
+	case 'V':
+	    puts(curses_version());
+	    return EXIT_SUCCESS;
 	default:
 	    usage();
 	    /* NOTREACHED */
 	}
-    argc -= optind;
-    argv += optind;
+    }
 
-    if (cmdline && argc == 0) {
-	usage();
-	/* NOTREACHED */
+    /*
+     * Modify the argument list to omit the options we processed.
+     */
+    if (is_reset || is_init) {
+	if (optind-- < argc) {
+	    argc -= optind;
+	    argv += optind;
+	}
+	argv[0] = prg_name;
+    } else {
+	argc -= optind;
+	argv += optind;
     }
 
     if (term == 0 || *term == '\0')
@@ -293,8 +363,11 @@ main(int argc, char **argv)
     if (setupterm(term, STDOUT_FILENO, &errret) != OK && errret <= 0)
 	quit(3, "unknown terminal \"%s\"", term);
 
-    if (cmdline)
+    if (cmdline) {
+	if ((argc <= 0) && !is_reset && !is_init)
+	    usage();
 	return tput(argc, argv);
+    }
 
     while (fgets(buf, sizeof(buf), stdin) != 0) {
 	char *argvec[16];	/* command, 9 parms, null, & slop */
diff --git a/progs/tset.c b/progs/tset.c
index 392aac0e..d8dbda49 100644
--- a/progs/tset.c
+++ b/progs/tset.c
@@ -101,8 +101,9 @@ char *ttyname(int fd);
 
 #include 		/* for bool typedef */
 #include 
+#include 
 
-MODULE_ID("$Id: tset.c,v 0.41 2000/03/12 00:03:00 tom Exp $")
+MODULE_ID("$Id: tset.c,v 0.47 2000/10/08 01:01:08 tom Exp $")
 
 extern char **environ;
 
@@ -113,9 +114,9 @@ const char *_nc_progname = "tset";
 
 static TTY mode, oldmode;
 
+static bool isreset = FALSE;	/* invoked as reset */
 static int terasechar = -1;	/* new erase character */
 static int intrchar = -1;	/* new interrupt character */
-static int isreset;		/* invoked as reset */
 static int tkillchar = -1;	/* new kill character */
 static int tlines, tcolumns;	/* window size */
 
@@ -233,7 +234,7 @@ typedef struct map {
     const char *porttype;	/* Port type, or "" for any. */
     const char *type;		/* Terminal type to select. */
     int conditional;		/* Baud rate conditionals bitmask. */
-    speed_t speed;		/* Baud rate to compare against. */
+    int speed;			/* Baud rate to compare against. */
 } MAP;
 
 static MAP *cur, *maplist;
@@ -260,10 +261,19 @@ static const SPEEDS speeds[] =
     {"2400", B2400},
     {"4800", B4800},
     {"9600", B9600},
+    /* sgttyb may define up to this point */
+#ifdef B19200
     {"19200", B19200},
+#endif
+#ifdef B38400
     {"38400", B38400},
+#endif
+#ifdef B19200
     {"19200", B19200},
+#endif
+#ifdef B38400
     {"38400", B38400},
+#endif
 #ifdef B19200
     {"19200", B19200},
 #else
@@ -505,10 +515,7 @@ get_termcap_entry(char *userarg)
 	goto map;
 
     if ((ttypath = ttyname(STDERR_FILENO)) != 0) {
-	if ((p = strrchr(ttypath, '/')) != 0)
-	    ++p;
-	else
-	    p = ttypath;
+	p = _nc_basename(ttypath);
 #if HAVE_GETTTYNAM
 	/*
 	 * We have the 4.3BSD library call getttynam(3); that means
@@ -582,15 +589,15 @@ get_termcap_entry(char *userarg)
     }
     /* Find the terminfo entry.  If it doesn't exist, ask the user. */
     while ((rval = setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO,
-		&errret)) != OK) {
+			     &errret)) != OK) {
 	if (errret == 0) {
 	    (void) fprintf(stderr, "tset: unknown terminal type %s\n",
-		ttype);
+			   ttype);
 	    ttype = 0;
 	} else {
 	    (void) fprintf(stderr,
-		"tset: can't initialize terminal type %s (error %d)\n",
-		ttype, errret);
+			   "tset: can't initialize terminal type %s (error %d)\n",
+			   ttype, errret);
 	    ttype = 0;
 	}
 	ttype = askuser(ttype);
@@ -683,46 +690,46 @@ reset_mode(void)
 
     mode.c_iflag &= ~(IGNBRK | PARMRK | INPCK | ISTRIP | INLCR | IGNCR
 #ifdef IUCLC
-	| IUCLC
+		      | IUCLC
 #endif
 #ifdef IXANY
-	| IXANY
+		      | IXANY
 #endif
-	| IXOFF);
+		      | IXOFF);
 
     mode.c_iflag |= (BRKINT | IGNPAR | ICRNL | IXON
 #ifdef IMAXBEL
-	| IMAXBEL
+		     | IMAXBEL
 #endif
 	);
 
     mode.c_oflag &= ~(0
 #ifdef OLCUC
-	| OLCUC
+		      | OLCUC
 #endif
 #ifdef OCRNL
-	| OCRNL
+		      | OCRNL
 #endif
 #ifdef ONOCR
-	| ONOCR
+		      | ONOCR
 #endif
 #ifdef ONLRET
-	| ONLRET
+		      | ONLRET
 #endif
 #ifdef OFILL
-	| OFILL
+		      | OFILL
 #endif
 #ifdef OFDEL
-	| OFDEL
+		      | OFDEL
 #endif
 #ifdef NLDLY
-	| NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY
+		      | NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY
 #endif
 	);
 
     mode.c_oflag |= (OPOST
 #ifdef ONLCR
-	| ONLCR
+		     | ONLCR
 #endif
 	);
 
@@ -730,22 +737,22 @@ reset_mode(void)
     mode.c_cflag |= (CS8 | CREAD);
     mode.c_lflag &= ~(ECHONL | NOFLSH
 #ifdef TOSTOP
-	| TOSTOP
+		      | TOSTOP
 #endif
 #ifdef ECHOPTR
-	| ECHOPRT
+		      | ECHOPRT
 #endif
 #ifdef XCASE
-	| XCASE
+		      | XCASE
 #endif
 	);
 
     mode.c_lflag |= (ISIG | ICANON | ECHO | ECHOE | ECHOK
 #ifdef ECHOCTL
-	| ECHOCTL
+		     | ECHOCTL
 #endif
 #ifdef ECHOKE
-	| ECHOKE
+		     | ECHOKE
 #endif
 	);
 #endif
@@ -761,6 +768,7 @@ reset_mode(void)
  * Returns a "good" value for the erase character.  This is loosely based on
  * the BSD4.4 logic.
  */
+#ifdef TERMIOS
 static int
 default_erase(void)
 {
@@ -775,6 +783,7 @@ default_erase(void)
 
     return result;
 }
+#endif
 
 /*
  * Update the values of the erase, interrupt, and kill characters in 'mode'.
@@ -954,10 +963,10 @@ set_tabs()
 /*
  * Tell the user if a control key has been changed from the default value.
  */
+#ifdef TERMIOS
 static void
 report(const char *name, int which, unsigned def)
 {
-#ifdef TERMIOS
     unsigned older, newer;
     char *p;
 
@@ -976,16 +985,16 @@ report(const char *name, int which, unsigned def)
     if (newer == 0177)
 	(void) fprintf(stderr, "delete.\n");
     else if ((p = key_backspace) != 0
-	    && newer == (unsigned char) p[0]
-	&& p[1] == '\0')
+	     && newer == (unsigned char) p[0]
+	     && p[1] == '\0')
 	(void) fprintf(stderr, "backspace.\n");
     else if (newer < 040) {
 	newer ^= 0100;
 	(void) fprintf(stderr, "control-%c (^%c).\n", newer, newer);
     } else
 	(void) fprintf(stderr, "%c.\n", newer);
-#endif
 }
+#endif
 
 /*
  * Convert the obsolete argument forms into something that getopt can handle.
@@ -1025,7 +1034,7 @@ static void
 usage(const char *pname)
 {
     (void) fprintf(stderr,
-	"usage: %s [-IQrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\n", pname);
+		   "usage: %s [-IQVrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\n", pname);
     exit(EXIT_FAILURE);
 }
 
@@ -1047,32 +1056,24 @@ main(int argc, char **argv)
     const char *p;
     const char *ttype;
 
-#ifdef TERMIOS
-    if (tcgetattr(STDERR_FILENO, &mode) < 0)
+    if (GET_TTY(STDERR_FILENO, &mode) < 0)
 	failed("standard error");
-
     oldmode = mode;
+#ifdef TERMIOS
     ospeed = cfgetospeed(&mode);
 #else
-    if (gtty(STDERR_FILENO, &mode) < 0)
-	failed("standard error");
-
-    oldmode = mode;
     ospeed = mode.sg_ospeed;
 #endif
 
-    if ((p = strrchr(*argv, '/')) != 0)
-	++p;
-    else
-	p = *argv;
-    if (!CaselessCmp(p, "reset")) {
-	isreset = 1;
+    p = _nc_basename(*argv);
+    if (!strcmp(p, PROG_RESET)) {
+	isreset = TRUE;
 	reset_mode();
     }
 
     obsolete(argv);
     noinit = noset = quiet = Sflag = sflag = showterm = 0;
-    while ((ch = getopt(argc, argv, "a:d:e:Ii:k:m:np:qQSrs")) != EOF) {
+    while ((ch = getopt(argc, argv, "a:d:e:Ii:k:m:np:qQSrsV")) != EOF) {
 	switch (ch) {
 	case 'q':		/* display term only */
 	    noset = 1;
@@ -1115,6 +1116,9 @@ main(int argc, char **argv)
 	case 's':		/* output TERM set command */
 	    sflag = 1;
 	    break;
+	case 'V':
+	    puts(curses_version());
+	    return EXIT_SUCCESS;
 	case '?':
 	default:
 	    usage(*argv);
@@ -1170,11 +1174,13 @@ main(int argc, char **argv)
 	 * If erase, kill and interrupt characters could have been
 	 * modified and not -Q, display the changes.
 	 */
+#ifdef TERMIOS
 	if (!quiet) {
 	    report("Erase", VERASE, CERASE);
 	    report("Kill", VKILL, CINTR);
 	    report("Interrupt", VINTR, CKILL);
 	}
+#endif
     }
 
     if (Sflag)
diff --git a/tack/Makefile.in b/tack/Makefile.in
index 0004447f..b2237cca 100644
--- a/tack/Makefile.in
+++ b/tack/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.19 2000/07/08 01:56:35 tom Exp $
+# $Id: Makefile.in,v 1.24 2000/10/14 22:19:37 tom Exp $
 # Makefile for tack
 #
 # The variable 'srcdir' refers to the source-distribution, and can be set with
@@ -18,7 +18,7 @@ CF_MFLAGS 	= @cf_cv_makeflags@
 x		= @PROG_EXT@
 
 MODEL		= ../@DFT_OBJ_SUBDIR@
-INSTALL_PREFIX	= @INSTALL_PREFIX@
+DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
@@ -28,7 +28,7 @@ mandir		= @mandir@/man1
 includedir	= @includedir@
 datadir		= @datadir@
 
-ticdir		= $(datadir)/terminfo
+LIBTOOL		= @LIBTOOL@
 
 INSTALL		= @INSTALL@
 INSTALL_PROGRAM	= @INSTALL_PROGRAM@
@@ -46,6 +46,7 @@ CPPFLAGS	= -DHAVE_CONFIG_H -I../tack -I$(srcdir) @CPPFLAGS@
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
@@ -54,10 +55,11 @@ CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
 CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
 
 LD		= @LD@
-LINK		= @LINK_PROGS@ $(CC)
+LINK		= @LINK_PROGS@ $(LIBTOOL) $(CC)
 LDFLAGS		= @EXTRA_LDFLAGS@ \
 		@PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
 
+LDFLAGS_LIBTOOL	= $(LDFLAGS)
 LDFLAGS_NORMAL	= $(LDFLAGS)
 LDFLAGS_DEBUG	= $(LDFLAGS) @CC_G_OPT@
 LDFLAGS_PROFILE	= $(LDFLAGS) -pg
@@ -88,17 +90,17 @@ install.libs \
 uninstall.libs:
 
 install.tack: $(PROGS) \
-	$(INSTALL_PREFIX)$(bindir) \
-	$(INSTALL_PREFIX)$(mandir)
-	$(INSTALL_PROGRAM) tack$x $(INSTALL_PREFIX)$(bindir)/tack$x
-	$(INSTALL_DATA) $(srcdir)/tack.1 $(INSTALL_PREFIX)$(mandir)/tack.1
+	$(DESTDIR)$(bindir) \
+	$(DESTDIR)$(mandir)
+	$(LIBTOOL) $(INSTALL_PROGRAM) tack$x $(DESTDIR)$(bindir)/tack$x
+	$(INSTALL_DATA) $(srcdir)/tack.1 $(DESTDIR)$(mandir)/tack.1
 
 uninstall.tack:
-	-@rm -f $(INSTALL_PREFIX)$(bindir)/tack$x
-	-@rm -f $(INSTALL_PREFIX)$(mandir)/tack.1
+	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/tack$x
+	-@rm -f $(DESTDIR)$(mandir)/tack.1
 
-$(INSTALL_PREFIX)$(bindir) \
-$(INSTALL_PREFIX)$(mandir) :
+$(DESTDIR)$(bindir) \
+$(DESTDIR)$(mandir) :
 	$(srcdir)/../mkinstalldirs $@
 
 #
@@ -133,12 +135,13 @@ tack$x: $(DEPS_TACK) $(DEPS_CURSES)
 tags:
 	ctags *.[ch]
 
-TAGS:
-	etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
 
 clean ::
 	-rm -f tags TAGS do.tic *~
 	-rm -f $(PROGS)
+	-rm -rf .libs
 
 distclean :: clean
 	-rm -f Makefile
diff --git a/tack/sysdep.c b/tack/sysdep.c
index 43ef4457..25376578 100644
--- a/tack/sysdep.c
+++ b/tack/sysdep.c
@@ -43,23 +43,37 @@
 #endif
 #endif
 
-MODULE_ID("$Id: sysdep.c,v 1.7 2000/03/04 21:02:11 tom Exp $")
+MODULE_ID("$Id: sysdep.c,v 1.9 2000/09/02 19:17:39 tom Exp $")
 
 #if DECL_ERRNO
 extern int errno;
 #endif
 
+#ifdef TERMIOS
+#define PUT_TTY(fd, buf) tcsetattr(fd, TCSAFLUSH, buf)
+#else
+#define PUT_TTY(fd, buf) stty(fd, buf)
+#endif
+
 /* globals */
 int tty_frame_size;		/* asynch frame size times 2 */
 unsigned long tty_baud_rate;	/* baud rate - bits per second */
 int not_a_tty;			/* TRUE if output is not a tty (i.e. pipe) */
 int nodelay_read;		/* TRUE if NDELAY is set */
 
+#ifdef TERMIOS
 #define TTY_IS_NOECHO	!(new_modes.c_lflag & ECHO)
 #define TTY_IS_OUT_TRANS (new_modes.c_oflag & OPOST)
 #define TTY_IS_CHAR_MODE !(new_modes.c_lflag & ICANON)
 #define TTY_WAS_CS8 ((old_modes.c_cflag & CSIZE) == CS8)
 #define TTY_WAS_XON_XOFF (old_modes.c_iflag & (IXON|IXOFF))
+#else
+#define TTY_IS_NOECHO	!(new_modes.sg_flags & (ECHO))
+#define TTY_IS_OUT_TRANS (new_modes.sg_flags & (CRMOD))
+#define TTY_IS_CHAR_MODE (new_modes.sg_flags & (RAW|CBREAK))
+#define TTY_WAS_CS8	 (old_modes.sg_flags & (PASS8))
+#define TTY_WAS_XON_XOFF (old_modes.sg_flags & (TANDEM|MDMBUF|DECCTQ))
+#endif
 
 static TTY old_modes, new_modes;
 
@@ -89,6 +103,7 @@ void
 tty_raw(int minch GCC_UNUSED, int mask)
 {				/* set tty to raw noecho */
 	new_modes = old_modes;
+#ifdef TERMIOS
 #if HAVE_SELECT
 	new_modes.c_cc[VMIN] = 1;
 #else
@@ -108,15 +123,19 @@ tty_raw(int minch GCC_UNUSED, int mask)
 	new_modes.c_iflag &=
 		~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP | INLCR | IGNCR | ICRNL |
 		IUCLC | IXON | IXANY | IXOFF);
+#else
+	new_modes.sg_flags |= RAW;
+#endif
 	if (not_a_tty)
 		return;
-	tcsetattr(fileno(stdin), TCSAFLUSH, &new_modes);
+	PUT_TTY(fileno(stdin), &new_modes);
 }
 
 void 
 tty_set(void)
 {				/* set tty to special modes */
 	new_modes = old_modes;
+#ifdef TERMIOS
 	new_modes.c_cc[VMIN] = 1;
 	new_modes.c_cc[VTIME] = 1;
 	new_modes.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
@@ -132,7 +151,7 @@ tty_set(void)
 		new_modes.c_iflag &= ~(IXON | IXOFF);
 		break;
 	case 1:
-#if sequent
+#if defined(sequent) && sequent
 		/* the sequent System V emulation is broken */
 		new_modes = old_modes;
 		new_modes.c_cc[VEOL] = 6;	/* control F  (ACK) */
@@ -159,9 +178,12 @@ tty_set(void)
 	}
 	if (!(new_modes.c_oflag & ~OPOST))
 		new_modes.c_oflag &= ~OPOST;
+#else
+	new_modes.sg_flags |= RAW;
 	if (not_a_tty)
 		return;
-	tcsetattr(fileno(stdin), TCSAFLUSH, &new_modes);
+#endif
+	PUT_TTY(fileno(stdin), &new_modes);
 }
 
 
@@ -171,7 +193,7 @@ tty_reset(void)
 	fflush(stdout);
 	if (not_a_tty)
 		return;
-	tcsetattr(fileno(stdin), TCSAFLUSH, &old_modes);
+	PUT_TTY(fileno(stdin), &old_modes);
 }
 
 
@@ -187,7 +209,7 @@ tty_init(void)
 	nodelay_read = FALSE;
 #endif
 	not_a_tty = FALSE;
-	if (tcgetattr(fileno(stdin), &old_modes) == -1) {
+	if (GET_TTY(fileno(stdin), &old_modes) == -1) {
 		if (errno == ENOTTY) {
 			tty_frame_size = 20;
 			not_a_tty = TRUE;
@@ -198,10 +220,12 @@ tty_init(void)
 	}
 	/* if TAB3 is set then setterm() wipes out tabs (ht) */
 	new_modes = old_modes;
+#ifdef TERMIOS
 #ifdef TABDLY
 	new_modes.c_oflag &= ~TABDLY;
 #endif	/* TABDLY */
-	if (tcsetattr(fileno(stdin), TCSAFLUSH, &new_modes) == -1) {
+#endif
+	if (PUT_TTY(fileno(stdin), &new_modes) == -1) {
 		printf("tcsetattr error: %d\n", errno);
 		exit(1);
 	}
@@ -211,6 +235,7 @@ tty_init(void)
 	old_modes.c_cflag |= CS7 | PARENB;
 #endif
 	catchsig();
+#ifdef TERMIOS
 	switch (old_modes.c_cflag & CSIZE) {
 #if defined(CS5) && (CS5 != 0)
 	case CS5:
@@ -236,6 +261,10 @@ tty_init(void)
 	tty_frame_size += 2 +
 		((old_modes.c_cflag & PARENB) ? 2 : 0) +
 		((old_modes.c_cflag & CSTOPB) ? 4 : 2);
+#else
+	tty_frame_size = 6 +
+		(old_modes.sg_flags & PASS8) ? 16 : 14;
+#endif
 }
 
 /*
diff --git a/test/Makefile.in b/test/Makefile.in
index 9f573ba0..4cab5742 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.58 2000/05/28 01:28:39 tom Exp $
+# $Id: Makefile.in,v 1.60 2000/10/14 22:51:19 tom Exp $
 ##############################################################################
 # Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -45,6 +45,8 @@ exec_prefix	= @exec_prefix@
 libdir		= @libdir@
 includedir	= @includedir@
 
+LIBTOOL		= @LIBTOOL@
+
 CC		= @CC@
 CPP		= @CPP@
 
@@ -53,6 +55,7 @@ CPPFLAGS	=  -I../test -I$(srcdir) @CPPFLAGS@ -DHAVE_CONFIG_H
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL	= $(CCFLAGS)
 CFLAGS_NORMAL	= $(CCFLAGS)
 CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE	= $(CCFLAGS) -pg
@@ -66,10 +69,11 @@ LOCAL_LIBS	= @TEST_DEPS@
 MATH_LIB	= @MATH_LIB@
 
 LD		= @LD@
-LINK		= @LINK_TESTS@ $(CC)
+LINK		= @LINK_TESTS@ $(LIBTOOL) $(CC)
 
 LDFLAGS		= @LD_MODEL@ @TEST_ARGS@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
 
+LDFLAGS_LIBTOOL	= $(LDFLAGS)
 LDFLAGS_NORMAL	= $(LDFLAGS)
 LDFLAGS_DEBUG	= $(LDFLAGS) @CC_G_OPT@
 LDFLAGS_PROFILE	= $(LDFLAGS) -pg
@@ -200,7 +204,7 @@ mostlyclean ::
 	-rm -f core tags TAGS *~ *.ln *.atac trace
 
 clean :: mostlyclean
-	-rm -rf *.o screendump *.lis $(TESTS)
+	-rm -rf *.o screendump *.lis $(TESTS) .libs
 
 distclean :: clean
 	-rm -f Makefile ncurses_cfg.h config.*
diff --git a/test/cardfile.c b/test/cardfile.c
index 980ffbeb..75d20776 100644
--- a/test/cardfile.c
+++ b/test/cardfile.c
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey  1999
  *
- * $Id: cardfile.c,v 1.4 2000/03/19 01:34:00 tom Exp $
+ * $Id: cardfile.c,v 1.5 2000/09/09 19:08:32 tom Exp $
  *
  * File format: text beginning in column 1 is a title; other text forms the content.
  */
@@ -72,8 +72,8 @@ strdup(char *s)
 }
 #endif /* not HAVE_STRDUP */
 
-static char *
-skip(char *buffer)
+static const char *
+skip(const char *buffer)
 {
     while (isspace(*buffer))
 	buffer++;
@@ -119,7 +119,7 @@ add_title(const char *title)
 }
 
 static void
-add_content(CARD * card, char *content)
+add_content(CARD * card, const char *content)
 {
     unsigned total, offset;
 
@@ -359,7 +359,7 @@ cardfile(char *fname)
 	doupdate();
 
 	switch (form_driver(top_card->form, ch =
-		form_virtualize(panel_window(top_card->panel)))) {
+			    form_virtualize(panel_window(top_card->panel)))) {
 	case E_OK:
 	    break;
 	case E_UNKNOWN_COMMAND:
diff --git a/test/configure b/test/configure
index 22661141..de1cf77f 100755
--- a/test/configure
+++ b/test/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13.19990117 
+# Generated automatically using autoconf version 2.13.20000819 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -335,7 +335,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13.19990117"
+    echo "configure generated by autoconf version 2.13.20000819"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -760,6 +760,7 @@ LD="ld"
 LDFLAGS_SHARED=""			
 LD_MODEL=""				
 LD_SHARED_OPTS=""			
+LIBTOOL=""				
 LIB_NAME=curses				
 LIB_PREFIX="-l"				
 LINK_TESTS=""				
@@ -787,12 +788,12 @@ fi
 if test "${with_ncurses+set}" = set; then
   withval="$with_ncurses"
   echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:791: checking for initscr" >&5
+echo "configure:792: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -834,7 +835,7 @@ else
   echo "$ac_t""no" 1>&6
 
 	 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:838: checking for Gpm_Open in -lgpm" >&5
+echo "configure:839: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -842,7 +843,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -886,6 +887,7 @@ fi
 	 	if test -f $p/include/ncurses/curses.h
 		then
 			CPPFLAGS="$CPPFLAGS -I$p/include/ncurses"
+			test $p != /usr && CPPFLAGS="$CPPFLAGS -I$p/include"
 			test $p != /usr && LIBS="-L$p/lib $LIBS"
 			break
 		elif test $p != /usr
@@ -907,12 +909,12 @@ fi
 
 
 echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:911: checking for initscr" >&5
+echo "configure:913: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -954,7 +956,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for initscr in -l$LIB_NAME""... $ac_c" 1>&6
-echo "configure:958: checking for initscr in -l$LIB_NAME" >&5
+echo "configure:960: checking for initscr in -l$LIB_NAME" >&5
 ac_lib_var=`echo $LIB_NAME'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -962,7 +964,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$LIB_NAME  $LIBS"
 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1003,7 +1005,7 @@ fi
 fi
 
 echo $ac_n "checking for form_driver in -lform""... $ac_c" 1>&6
-echo "configure:1007: checking for form_driver in -lform" >&5
+echo "configure:1009: checking for form_driver in -lform" >&5
 ac_lib_var=`echo form'_'form_driver | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1011,7 +1013,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lform  $LIBS"
 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1050,7 +1052,7 @@ else
 fi
 
 echo $ac_n "checking for menu_driver in -lmenu""... $ac_c" 1>&6
-echo "configure:1054: checking for menu_driver in -lmenu" >&5
+echo "configure:1056: checking for menu_driver in -lmenu" >&5
 ac_lib_var=`echo menu'_'menu_driver | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1058,7 +1060,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmenu  $LIBS"
 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1097,7 +1099,7 @@ else
 fi
 
 echo $ac_n "checking for new_panel in -lpanel""... $ac_c" 1>&6
-echo "configure:1101: checking for new_panel in -lpanel" >&5
+echo "configure:1103: checking for new_panel in -lpanel" >&5
 ac_lib_var=`echo panel'_'new_panel | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1105,7 +1107,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpanel  $LIBS"
 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1145,12 +1147,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1149: checking return type of signal handlers" >&5
+echo "configure:1151: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <
 #include 
@@ -1167,7 +1169,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1187,7 +1189,7 @@ EOF
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1191: checking how to run the C preprocessor" >&5
+echo "configure:1193: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1202,13 +1204,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1219,13 +1221,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1236,13 +1238,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1267,12 +1269,12 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1271: checking for ANSI C header files" >&5
+echo "configure:1273: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <
 #include 
@@ -1280,7 +1282,7 @@ else
 #include 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1297,7 +1299,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <
 EOF
@@ -1315,7 +1317,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <
 EOF
@@ -1336,7 +1338,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1347,7 +1349,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1371,12 +1373,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1375: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1377: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <
 #include 
@@ -1385,7 +1387,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1420,17 +1422,17 @@ unistd.h \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1424: checking for $ac_hdr" >&5
+echo "configure:1426: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1468,12 +1470,12 @@ wresize \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1472: checking for $ac_func" >&5
+echo "configure:1474: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1522,7 +1524,7 @@ done
 
 
 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
-echo "configure:1526: checking for function curses_version" >&5
+echo "configure:1528: checking for function curses_version" >&5
 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1531,7 +1533,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat > conftest.$ac_ext <
@@ -1543,7 +1545,7 @@ int main()
 }
 
 EOF
-if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   cf_cv_func_curses_version=yes
 
@@ -1567,13 +1569,13 @@ EOF
 
 
 echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6
-echo "configure:1571: checking if sys/time.h conflicts with sys/select.h" >&5
+echo "configure:1573: checking if sys/time.h conflicts with sys/select.h" >&5
 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sys_time_select=yes
 else
@@ -1696,7 +1698,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13.19990117"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13.20000819"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -1750,6 +1752,7 @@ s%@LD@%$LD%g
 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
 s%@LD_MODEL@%$LD_MODEL%g
 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
+s%@LIBTOOL@%$LIBTOOL%g
 s%@LIB_NAME@%$LIB_NAME%g
 s%@LIB_PREFIX@%$LIB_PREFIX%g
 s%@LINK_TESTS@%$LINK_TESTS%g
diff --git a/test/configure.in b/test/configure.in
index 35e2b47c..d61d477d 100644
--- a/test/configure.in
+++ b/test/configure.in
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 1998,1999 Free Software Foundation, Inc.                   *
+dnl Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -26,9 +26,9 @@ dnl sale, use or other dealings in this Software without prior written       *
 dnl authorization.                                                           *
 dnl***************************************************************************
 dnl
-dnl Author: Thomas E. Dickey  1996,1997,1998
+dnl Author: Thomas E. Dickey 1996,1997,1998,2000
 dnl
-dnl $Id: configure.in,v 1.29 1999/12/19 03:12:13 tom Exp $
+dnl $Id: configure.in,v 1.31 2000/10/15 18:46:17 tom Exp $
 dnl This is a simple configuration-script for the ncurses test programs that
 dnl allows the test-directory to be separately configured against a reference
 dnl system (i.e., sysvr4 curses)
@@ -36,8 +36,9 @@ dnl
 dnl If you're configuring ncurses, you shouldn't need to use this script.
 dnl It's only for testing purposes.
 dnl
-dnl dickey@clark.net (Thomas Dickey)
-AC_PREREQ(2.12)
+dnl See http://dickey.his.com/autoconf/ for additional information.
+dnl ---------------------------------------------------------------------------
+AC_PREREQ(2.13.20000819)
 AC_INIT(ncurses.c)
 AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin)
 
@@ -56,6 +57,7 @@ LD="ld"					AC_SUBST(LD)
 LDFLAGS_SHARED=""			AC_SUBST(LDFLAGS_SHARED)
 LD_MODEL=""				AC_SUBST(LD_MODEL)
 LD_SHARED_OPTS=""			AC_SUBST(LD_SHARED_OPTS)
+LIBTOOL=""				AC_SUBST(LIBTOOL)
 LIB_NAME=curses				AC_SUBST(LIB_NAME)
 LIB_PREFIX="-l"				AC_SUBST(LIB_PREFIX)
 LINK_TESTS=""				AC_SUBST(LINK_TESTS)
@@ -86,6 +88,7 @@ AC_ARG_WITH(ncurses,
 	 	if test -f $p/include/ncurses/curses.h
 		then
 			CPPFLAGS="$CPPFLAGS -I$p/include/ncurses"
+			test $p != /usr && CPPFLAGS="$CPPFLAGS -I$p/include"
 			test $p != /usr && LIBS="-L$p/lib $LIBS"
 			break
 		elif test $p != /usr
diff --git a/test/filter.c b/test/filter.c
index 5d161cb6..272f3722 100644
--- a/test/filter.c
+++ b/test/filter.c
@@ -29,7 +29,7 @@
 /*
  * Author:  Thomas E. Dickey  1998
  *
- * $Id: filter.c,v 1.3 1999/11/13 23:39:19 tom Exp $
+ * $Id: filter.c,v 1.4 2000/09/02 18:50:38 tom Exp $
  */
 #include 
 
@@ -50,60 +50,60 @@
 #define getnstr(s,n) getstr(s)
 #endif
 
-static int new_command(char *buffer, int length, attr_t underline)
+static int
+new_command(char *buffer, int length, attr_t underline)
 {
-	int code;
+    int code;
 
-	attron(A_BOLD);
-	printw("Command: ");
-	attron(underline);
-	code = getnstr(buffer, length);
-	attroff(underline);
-	attroff(A_BOLD);
-	printw("\n");
+    attron(A_BOLD);
+    printw("Command: ");
+    attron(underline);
+    code = getnstr(buffer, length);
+    attroff(underline);
+    attroff(A_BOLD);
+    printw("\n");
 
-	return code;
+    return code;
 }
 
-int main(
-	int argc GCC_UNUSED,
-	char *argv[] GCC_UNUSED)
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 {
-	SCREEN *sp;
-	char buffer[80];
-	attr_t underline;
+    SCREEN *sp;
+    char buffer[80];
+    attr_t underline;
 
-	filter();
-	sp = newterm((char *)0, stdout, stdin);
-	cbreak();
-	keypad(stdscr, TRUE);
+    filter();
+    sp = newterm((char *) 0, stdout, stdin);
+    cbreak();
+    keypad(stdscr, TRUE);
 
-	if (has_colors()) {
-		int background = COLOR_BLACK;
-		start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
-		if (use_default_colors () != ERR)
-			background = -1;
+    if (has_colors()) {
+	int background = COLOR_BLACK;
+	start_color();
+#if HAVE_USE_DEFAULT_COLORS
+	if (use_default_colors() != ERR)
+	    background = -1;
 #endif
-		init_pair(1, COLOR_CYAN, background);
-		underline = COLOR_PAIR(1);
-	} else {
-		underline = A_UNDERLINE;
-	}
+	init_pair(1, COLOR_CYAN, background);
+	underline = COLOR_PAIR(1);
+    } else {
+	underline = A_UNDERLINE;
+    }
 
-	while (new_command(buffer, sizeof(buffer)-1, underline) != ERR
-	  && strlen(buffer) != 0) {
-       		reset_shell_mode();
-		printf("\n");
-		fflush(stdout);
-		system(buffer);
-		reset_prog_mode();
-		touchwin(stdscr);
-		erase();
-		refresh();
-	}
-	printw("done");
+    while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR
+	   && strlen(buffer) != 0) {
+	reset_shell_mode();
+	printf("\n");
+	fflush(stdout);
+	system(buffer);
+	reset_prog_mode();
+	touchwin(stdscr);
+	erase();
 	refresh();
-	endwin();
-	return 0;
+    }
+    printw("done");
+    refresh();
+    endwin();
+    return 0;
 }
diff --git a/test/firework.c b/test/firework.c
index ba5cbda2..66c1227c 100644
--- a/test/firework.c
+++ b/test/firework.c
@@ -1,5 +1,5 @@
 /*
- * $Id: firework.c,v 1.16 1999/11/13 23:39:16 tom Exp $
+ * $Id: firework.c,v 1.17 2000/09/02 18:41:12 tom Exp $
  */
 #include 
 
@@ -133,7 +133,7 @@ main(
 
     if (has_colors()) {
 	start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
+#if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 	    my_bg = -1;
 #endif
diff --git a/test/gdc.c b/test/gdc.c
index ea88d6c5..df9a0c3f 100644
--- a/test/gdc.c
+++ b/test/gdc.c
@@ -6,7 +6,7 @@
  * modified 10-18-89 for curses (jrl)
  * 10-18-89 added signal handling
  *
- * $Id: gdc.c,v 1.14 2000/04/23 00:03:11 tom Exp $
+ * $Id: gdc.c,v 1.15 2000/09/02 18:40:39 tom Exp $
  */
 
 #include 
@@ -179,7 +179,7 @@ main(int argc, char *argv[])
     if (hascolor) {
 	int bg = COLOR_BLACK;
 	start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
+#if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 	    bg = -1;
 #endif
diff --git a/test/hanoi.c b/test/hanoi.c
index 23a86462..0b032f83 100644
--- a/test/hanoi.c
+++ b/test/hanoi.c
@@ -14,7 +14,7 @@
  *
  *	Date: 05.Nov.90
  *
- * $Id: hanoi.c,v 1.18 2000/04/01 20:01:08 tom Exp $
+ * $Id: hanoi.c,v 1.19 2000/09/02 18:51:16 tom Exp $
  */
 
 #include 
@@ -36,22 +36,24 @@
 #define OTHER(a,b)		(3-((a)+(b)))
 
 struct Peg {
-	size_t Length[MAXTILES];
-	int Count;
+    size_t Length[MAXTILES];
+    int Count;
 };
 
 static struct Peg Pegs[NPEGS];
-static int PegPos[] = { LEFTPEG, MIDPEG, RIGHTPEG };
-static int TileColour[] = {
-	COLOR_GREEN,	/* Length 3 */
-	COLOR_MAGENTA,	/* Length 5 */
-	COLOR_RED,	/* Length 7 */
-	COLOR_BLUE,	/* Length 9 */
-	COLOR_CYAN,	/* Length 11 */
-	COLOR_YELLOW, 	/* Length 13 */
-	COLOR_GREEN,  	/* Length 15 */
-	COLOR_MAGENTA,	/* Length 17 */
-	COLOR_RED,	/* Length 19 */
+static int PegPos[] =
+{LEFTPEG, MIDPEG, RIGHTPEG};
+static int TileColour[] =
+{
+    COLOR_GREEN,		/* Length 3 */
+    COLOR_MAGENTA,		/* Length 5 */
+    COLOR_RED,			/* Length 7 */
+    COLOR_BLUE,			/* Length 9 */
+    COLOR_CYAN,			/* Length 11 */
+    COLOR_YELLOW,		/* Length 13 */
+    COLOR_GREEN,		/* Length 15 */
+    COLOR_MAGENTA,		/* Length 17 */
+    COLOR_RED,			/* Length 19 */
 };
 static int NMoves = 0;
 
@@ -67,232 +69,235 @@ static int InvalidMove(int From, int To);
 int
 main(int argc, char **argv)
 {
-int NTiles, FromCol, ToCol;
-unsigned char AutoFlag = 0;
+    int NTiles, FromCol, ToCol;
+    unsigned char AutoFlag = 0;
 
-	switch(argc) {
-	case 1:
-		NTiles = DEFAULTTILES;
-		break;
-	case 2:
-		NTiles = atoi(argv[1]);
-		if (NTiles > MAXTILES || NTiles < MINTILES) {
-			fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
-			return EXIT_FAILURE;
-		}
-		break;
-	case 3:
-		if (strcmp(argv[2], "a")) {
-			Usage();
-			return EXIT_FAILURE;
-		}
-		NTiles = atoi(argv[1]);
-		if (NTiles > MAXTILES || NTiles < MINTILES) {
-			fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
-			return EXIT_FAILURE;
-		}
-		AutoFlag = TRUE;
-		break;
-	default:
-		Usage();
-		return EXIT_FAILURE;
+    switch (argc) {
+    case 1:
+	NTiles = DEFAULTTILES;
+	break;
+    case 2:
+	NTiles = atoi(argv[1]);
+	if (NTiles > MAXTILES || NTiles < MINTILES) {
+	    fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
+	    return EXIT_FAILURE;
+	}
+	break;
+    case 3:
+	if (strcmp(argv[2], "a")) {
+	    Usage();
+	    return EXIT_FAILURE;
 	}
+	NTiles = atoi(argv[1]);
+	if (NTiles > MAXTILES || NTiles < MINTILES) {
+	    fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
+	    return EXIT_FAILURE;
+	}
+	AutoFlag = TRUE;
+	break;
+    default:
+	Usage();
+	return EXIT_FAILURE;
+    }
 #ifdef TRACE
-	trace(TRACE_MAXIMUM);
+    trace(TRACE_MAXIMUM);
 #endif
-	initscr();
-	if (has_colors()) {
-		int i;
-		int bg = COLOR_BLACK;
-		start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
-		if (use_default_colors() == OK)
-			bg = -1;
+    initscr();
+    if (has_colors()) {
+	int i;
+	int bg = COLOR_BLACK;
+	start_color();
+#if HAVE_USE_DEFAULT_COLORS
+	if (use_default_colors() == OK)
+	    bg = -1;
 #endif
-		for (i = 0; i < 9; i++)
-			init_pair(i+1, bg, TileColour[i]);
-	}
-	cbreak();
-	if (LINES < 24) {
-		endwin();
-		fprintf(stderr, "Min screen length 24 lines\n");
-		return EXIT_FAILURE;
-	}
-	if(AutoFlag) {
-		curs_set(0);
-		leaveok(stdscr, TRUE);	/* Attempt to remove cursor */
-	}
-	InitTiles(NTiles);
-	DisplayTiles();
-	if(AutoFlag) {
-		do {
-			noecho();
-			AutoMove(0, 2, NTiles);
-		} while(!Solved(NTiles));
-		sleep(2);
-	} else {
-		echo();
-		for(;;) {
-			if(GetMove(&FromCol, &ToCol))
-				break;
-			if(InvalidMove(FromCol, ToCol)) {
-				mvaddstr(STATUSLINE, 0, "Invalid Move !!");
-				refresh();
-				beep();
-				continue;
-			}
-			MakeMove(FromCol, ToCol);
-			if(Solved(NTiles)) {
-				mvprintw(STATUSLINE, 0, "Well Done !! You did it in %d moves", NMoves);
-				refresh();
-				sleep(5);
-				break;
-			}
-		}
-	}
+	for (i = 0; i < 9; i++)
+	    init_pair(i + 1, bg, TileColour[i]);
+    }
+    cbreak();
+    if (LINES < 24) {
 	endwin();
-	return EXIT_SUCCESS;
+	fprintf(stderr, "Min screen length 24 lines\n");
+	return EXIT_FAILURE;
+    }
+    if (AutoFlag) {
+	curs_set(0);
+	leaveok(stdscr, TRUE);	/* Attempt to remove cursor */
+    }
+    InitTiles(NTiles);
+    DisplayTiles();
+    if (AutoFlag) {
+	do {
+	    noecho();
+	    AutoMove(0, 2, NTiles);
+	} while (!Solved(NTiles));
+	sleep(2);
+    } else {
+	echo();
+	for (;;) {
+	    if (GetMove(&FromCol, &ToCol))
+		break;
+	    if (InvalidMove(FromCol, ToCol)) {
+		mvaddstr(STATUSLINE, 0, "Invalid Move !!");
+		refresh();
+		beep();
+		continue;
+	    }
+	    MakeMove(FromCol, ToCol);
+	    if (Solved(NTiles)) {
+		mvprintw(STATUSLINE, 0,
+			 "Well Done !! You did it in %d moves", NMoves);
+		refresh();
+		sleep(5);
+		break;
+	    }
+	}
+    }
+    endwin();
+    return EXIT_SUCCESS;
 }
 
 static int
 InvalidMove(int From, int To)
 {
-	if(From >= NPEGS)
-		return TRUE;
-	if(From < 0)
-		return TRUE;
-	if(To >= NPEGS)
-		return TRUE;
-	if(To < 0)
-		return TRUE;
-	if(From == To)
-		return TRUE;
-	if(!Pegs[From].Count)
-		return TRUE;
-	if(Pegs[To].Count &&
-			Pegs[From].Length[Pegs[From].Count-1] >
-			Pegs[To].Length[Pegs[To].Count-1])
-		return TRUE;
-	return FALSE;
+    if (From >= NPEGS)
+	return TRUE;
+    if (From < 0)
+	return TRUE;
+    if (To >= NPEGS)
+	return TRUE;
+    if (To < 0)
+	return TRUE;
+    if (From == To)
+	return TRUE;
+    if (!Pegs[From].Count)
+	return TRUE;
+    if (Pegs[To].Count &&
+	Pegs[From].Length[Pegs[From].Count - 1] >
+	Pegs[To].Length[Pegs[To].Count - 1])
+	return TRUE;
+    return FALSE;
 }
 
 static void
 InitTiles(int NTiles)
 {
-	int Size, SlotNo;
+    int Size, SlotNo;
 
-	for(Size=NTiles*2+1, SlotNo=0; Size>=3; Size-=2)
-		Pegs[0].Length[SlotNo++] = Size;
+    for (Size = NTiles * 2 + 1, SlotNo = 0; Size >= 3; Size -= 2)
+	Pegs[0].Length[SlotNo++] = Size;
 
-	Pegs[0].Count = NTiles;
-	Pegs[1].Count = 0;
-	Pegs[2].Count = 0;
+    Pegs[0].Count = NTiles;
+    Pegs[1].Count = 0;
+    Pegs[2].Count = 0;
 }
 
 static void
 DisplayTiles(void)
 {
-	int Line, peg, SlotNo;
-	char TileBuf[BUFSIZ];
+    int Line, peg, SlotNo;
+    char TileBuf[BUFSIZ];
 
-	erase();
-	mvaddstr(1, 24, "T O W E R S   O F   H A N O I");
-	mvaddstr(3, 34, "SJR 1990");
-	mvprintw(19, 5, "Moves : %d", NMoves);
-	attrset(A_REVERSE);
-	mvaddstr(BASELINE, 8, "                                                               ");
+    erase();
+    mvaddstr(1, 24, "T O W E R S   O F   H A N O I");
+    mvaddstr(3, 34, "SJR 1990");
+    mvprintw(19, 5, "Moves : %d", NMoves);
+    attrset(A_REVERSE);
+    mvaddstr(BASELINE, 8,
+	     "                                                               ");
 
-	for(Line=TOPLINE; Line] [a]\n");
-	fprintf(stderr, "The 'a' option causes the tower to be solved automatically\n");
+    fprintf(stderr, "Usage: hanoi [] [a]\n");
+    fprintf(stderr,
+	    "The 'a' option causes the tower to be solved automatically\n");
 }
diff --git a/test/hashtest.c b/test/hashtest.c
index 514ac896..52e5c216 100644
--- a/test/hashtest.c
+++ b/test/hashtest.c
@@ -3,7 +3,7 @@
  *
  * Generate timing statistics for vertical-motion optimization.
  *
- * $Id: hashtest.c,v 1.14 1998/06/13 22:45:39 tom Exp $
+ * $Id: hashtest.c,v 1.15 2000/09/02 19:23:33 tom Exp $
  */
 
 #ifdef TRACE
@@ -11,6 +11,7 @@
 #define USE_TRACE 1
 #else
 #define Trace(p) /* nothing */
+#define USE_TRACE 0
 #endif
 
 #include 
diff --git a/test/knight.c b/test/knight.c
index ad923b42..e759d426 100644
--- a/test/knight.c
+++ b/test/knight.c
@@ -6,7 +6,7 @@
  * Eric S. Raymond  July 22 1995.  Mouse support
  * added September 20th 1995.
  *
- * $Id: knight.c,v 1.15 1999/11/13 23:39:10 tom Exp $
+ * $Id: knight.c,v 1.18 2000/10/15 18:36:34 Brian.Raiter Exp $
  */
 
 #include 
@@ -41,24 +41,22 @@
 #define CXINV(x)	(((x) - 1) / 4)
 #define CYINV(y)	(((y) - 2) / 2)
 
-typedef struct
-{
-    short	x, y;
-}
-cell;
-
-static short	board[BDEPTH][BWIDTH];	/* the squares */
-static int	rw,col;			/* current row and column */
-static int	lastrow,lastcol;   	/* last location visited */
-static cell	history[BDEPTH*BWIDTH];	/* choice history */
-static int	movecount;		/* count of moves so far */
-static WINDOW	*boardwin;		/* the board window */
-static WINDOW	*helpwin;		/* the help window */
-static WINDOW	*msgwin;		/* the message window */
-static chtype	trail = '#';		/* trail character */
-static chtype	plus = '+';		/* cursor hot-spot character */
-static chtype	minus = '-';		/* possible-move character */
-static chtype	oldch;
+typedef struct {
+    short x, y;
+} cell;
+
+static short board[BDEPTH][BWIDTH];	/* the squares */
+static int rw, col;		/* current row and column */
+static int lastrow, lastcol;	/* last location visited */
+static cell history[BDEPTH * BWIDTH + 1];	/* choice history */
+static int movecount;		/* count of moves so far */
+static WINDOW *boardwin;	/* the board window */
+static WINDOW *helpwin;		/* the help window */
+static WINDOW *msgwin;		/* the message window */
+static chtype trail = '#';	/* trail character */
+static chtype plus = '+';	/* cursor hot-spot character */
+static chtype minus = '-';	/* possible-move character */
+static chtype oldch;
 
 static void init(void);
 static void play(void);
@@ -67,11 +65,10 @@ static void drawmove(char, int, int, int, int);
 static bool evalmove(int, int);
 static bool chkmoves(void);
 static bool chksqr(int, int);
-static int  iabs(int);
+static int iabs(int);
 
-int main(
-	int argc GCC_UNUSED,
-	char *argv[] GCC_UNUSED)
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 {
     init();
 
@@ -81,321 +78,324 @@ int main(
     return EXIT_SUCCESS;
 }
 
-static void init (void)
+static void
+init(void)
 {
-    srand ((unsigned)getpid());
-    initscr ();
-    cbreak ();			/* immediate char return */
-    noecho ();			/* no immediate echo */
+    srand((unsigned) getpid());
+    initscr();
+    cbreak();			/* immediate char return */
+    noecho();			/* no immediate echo */
     boardwin = newwin(BDEPTH * 2 + 1, BWIDTH * 4 + 1, BOARDY, BOARDX);
     helpwin = newwin(0, 0, INSTRY, INSTRX);
-    msgwin = newwin(1, INSTRX-1, NOTIFYY, 0);
+    msgwin = newwin(1, INSTRX - 1, NOTIFYY, 0);
     scrollok(msgwin, TRUE);
     keypad(boardwin, TRUE);
 
-    if (has_colors())
-    {
+    if (has_colors()) {
 	int bg = COLOR_BLACK;
 
 	start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
+#if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 	    bg = -1;
 #endif
 
-	(void) init_pair(TRAIL_COLOR, COLOR_CYAN,  bg);
-	(void) init_pair(PLUS_COLOR,  COLOR_RED,   bg);
+	(void) init_pair(TRAIL_COLOR, COLOR_CYAN, bg);
+	(void) init_pair(PLUS_COLOR, COLOR_RED, bg);
 	(void) init_pair(MINUS_COLOR, COLOR_GREEN, bg);
 
 	trail |= COLOR_PAIR(TRAIL_COLOR);
-	plus  |= COLOR_PAIR(PLUS_COLOR);
+	plus |= COLOR_PAIR(PLUS_COLOR);
 	minus |= COLOR_PAIR(MINUS_COLOR);
     }
-
 #ifdef NCURSES_MOUSE_VERSION
-    (void) mousemask(BUTTON1_CLICKED, (mmask_t *)NULL);
-#endif /* NCURSES_MOUSE_VERSION*/
+    (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL);
+#endif /* NCURSES_MOUSE_VERSION */
 
     oldch = minus;
 }
 
-static void help1(void)
+static void
+help1(void)
 /* game explanation -- initial help screen */
 {
-    (void)waddstr(helpwin, "Knight's move is a solitaire puzzle.  Your\n");
-    (void)waddstr(helpwin, "objective is to visit each square of the  \n");
-    (void)waddstr(helpwin, "chessboard exactly once by making knight's\n");
-    (void)waddstr(helpwin, "moves (one square right or left followed  \n");
-    (void)waddstr(helpwin, "by two squares up or down, or two squares \n");
-    (void)waddstr(helpwin, "right or left followed by one square up or\n");
-    (void)waddstr(helpwin, "down).  You may start anywhere.\n\n");
-
-    (void)waddstr(helpwin, "Use arrow keys to move the cursor around.\n");
-    (void)waddstr(helpwin, "When you want to move your knight to the \n");
-    (void)waddstr(helpwin, "cursor location, press  or Enter.\n");
-    (void)waddstr(helpwin, "Illegal moves will be rejected with an  \n");
-    (void)waddstr(helpwin, "audible beep.\n\n");
-    (void)waddstr(helpwin, "The program will detect if you solve the\n");
-    (void)waddstr(helpwin, "puzzle; also inform you when you run out\n");
-    (void)waddstr(helpwin, "of legal moves.\n\n");
-
-    (void)mvwaddstr(helpwin, NOTIFYY-INSTRY, 0,
-		    "Press `?' to go to keystroke help."); 
+    (void) waddstr(helpwin, "Knight's move is a solitaire puzzle.  Your\n");
+    (void) waddstr(helpwin, "objective is to visit each square of the  \n");
+    (void) waddstr(helpwin, "chessboard exactly once by making knight's\n");
+    (void) waddstr(helpwin, "moves (one square right or left followed  \n");
+    (void) waddstr(helpwin, "by two squares up or down, or two squares \n");
+    (void) waddstr(helpwin, "right or left followed by one square up or\n");
+    (void) waddstr(helpwin, "down).  You may start anywhere.\n\n");
+
+    (void) waddstr(helpwin, "Use arrow keys to move the cursor around.\n");
+    (void) waddstr(helpwin, "When you want to move your knight to the \n");
+    (void) waddstr(helpwin, "cursor location, press  or Enter.\n");
+    (void) waddstr(helpwin, "Illegal moves will be rejected with an  \n");
+    (void) waddstr(helpwin, "audible beep.\n\n");
+    (void) waddstr(helpwin, "The program will detect if you solve the\n");
+    (void) waddstr(helpwin, "puzzle; also inform you when you run out\n");
+    (void) waddstr(helpwin, "of legal moves.\n\n");
+
+    (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0,
+		     "Press `?' to go to keystroke help.");
 }
 
-static void help2(void)
+static void
+help2(void)
 /* keystroke help screen */
 {
-    (void)waddstr(helpwin, "Possible moves are shown with `-'.\n\n");
-
-    (void)waddstr(helpwin, "You can move around with the arrow keys or\n");
-    (void)waddstr(helpwin, "with the rogue/hack movement keys.  Other\n");
-    (void)waddstr(helpwin, "commands allow you to undo moves or redraw.\n");
-    (void)waddstr(helpwin, "Your mouse may work; try left-button to\n");
-    (void)waddstr(helpwin, "move to the square under the pointer.\n\n");
-
-    (void)waddstr(helpwin, "x,q -- exit             y k u    7 8 9\n");
-    (void)waddstr(helpwin, "r -- redraw screen       \\|/      \\|/ \n");
-    (void)waddstr(helpwin, "u -- undo move          h-+-l    4-+-6\n");
-    (void)waddstr(helpwin, "                         /|\\      /|\\ \n");
-    (void)waddstr(helpwin, "                        b j n    1 2 3\n");
-
-    (void)waddstr(helpwin,"\nYou can place your knight on the selected\n");
-    (void)waddstr(helpwin, "square with spacebar, Enter, or the keypad\n");
-    (void)waddstr(helpwin, "center key.  You can quit with `x' or `q'.\n");
-
-    (void)mvwaddstr(helpwin, NOTIFYY-INSTRY, 0,
-		    "Press `?' to go to game explanation"); 
+    (void) waddstr(helpwin, "Possible moves are shown with `-'.\n\n");
+
+    (void) waddstr(helpwin, "You can move around with the arrow keys or\n");
+    (void) waddstr(helpwin, "with the rogue/hack movement keys.  Other\n");
+    (void) waddstr(helpwin, "commands allow you to undo moves or redraw.\n");
+    (void) waddstr(helpwin, "Your mouse may work; try left-button to\n");
+    (void) waddstr(helpwin, "move to the square under the pointer.\n\n");
+
+    (void) waddstr(helpwin, "x,q -- exit             y k u    7 8 9\n");
+    (void) waddstr(helpwin, "r -- redraw screen       \\|/      \\|/ \n");
+    (void) waddstr(helpwin, "bksp -- undo move       h-+-l    4-+-6\n");
+    (void) waddstr(helpwin, "                         /|\\      /|\\ \n");
+    (void) waddstr(helpwin, "                        b j n    1 2 3\n");
+
+    (void) waddstr(helpwin, "\nYou can place your knight on the selected\n");
+    (void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n");
+    (void) waddstr(helpwin, "center key.  You can quit with `x' or `q'.\n");
+
+    (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0,
+		     "Press `?' to go to game explanation");
 }
 
-static void play (void)
+static void
+play(void)
 /* play the game */
 {
-    bool		keyhelp; /* TRUE if keystroke help is up */
-    int	c, ny = 0, nx = 0;
+    bool keyhelp;		/* TRUE if keystroke help is up */
+    int c, ny = 0, nx = 0;
     int i, j, count;
 
     do {
-	   /* clear screen and draw board */
-	   werase(boardwin);
-	   werase(helpwin);
-	   werase(msgwin);
-	   dosquares();
-	   help1();
-	   wnoutrefresh(stdscr);
-	   wnoutrefresh(helpwin);
-	   wnoutrefresh(msgwin);
-	   wnoutrefresh(boardwin);
-	   doupdate();
-
-	   for (i = 0; i < BDEPTH; i++)
-	       for (j = 0; j < BWIDTH; j++)
-	       {
-		   board[i][j] = FALSE;
-		   cellmove(i, j);
-		   waddch(boardwin, minus);
-	       }
-	   memset(history, '\0', sizeof(history));
-	   history[0].y = history[0].x = -1;
-	   lastrow = lastcol = -2;
-	   movecount = 1;
-	   keyhelp = FALSE;
-
-	   for (;;)
-	   {
-	       if (rw != lastrow || col != lastcol)
-	       {
-		   if (lastrow >= 0 && lastcol >= 0)
-		   {
-		       cellmove(lastrow, lastcol);
-		       if (board[lastrow][lastcol])
-			   waddch(boardwin, trail);
-		       else
-			   waddch(boardwin, oldch);
-		   }
-
-		   cellmove(rw, col);
-		   oldch = winch(boardwin);
-
-		   lastrow = rw;
-		   lastcol= col;
-	       }
-	       cellmove(rw, col);
-	       waddch(boardwin, plus);
-	       cellmove(rw, col);
-
-	       wrefresh(msgwin);
-
-	       c = wgetch(boardwin);
-
-	       werase(msgwin);
-
-	       switch (c)
-	       {
-	       case 'k': case '8':
-	       case KEY_UP:
-		   ny = rw+BDEPTH-1; nx = col;
-		   break;
-	       case 'j': case '2':
-	       case KEY_DOWN:
-		   ny = rw+1;        nx = col;
-		   break;
-	       case 'h': case '4':
-	       case KEY_LEFT:
-		   ny = rw;          nx = col+BWIDTH-1;
-		   break;
-	       case 'l': case '6':
-	       case KEY_RIGHT:
-		   ny = rw;          nx = col+1;
-		   break;
-	       case 'y': case '7':
-	       case KEY_A1:
-		   ny = rw+BDEPTH-1; nx = col+BWIDTH-1;
-		   break;
-	       case 'b': case '1':
-	       case KEY_C1:
-		   ny = rw+1;        nx = col+BWIDTH-1;
-		   break;
-	       case 'u': case '9':
-	       case KEY_A3:
-		   ny = rw+BDEPTH-1; nx = col+1;
-		   break;
-	       case 'n': case '3':
-	       case KEY_C3:
-		   ny = rw+1;        nx = col+1;
-		   break;
+	/* clear screen and draw board */
+	werase(boardwin);
+	werase(helpwin);
+	werase(msgwin);
+	dosquares();
+	help1();
+	wnoutrefresh(stdscr);
+	wnoutrefresh(helpwin);
+	wnoutrefresh(msgwin);
+	wnoutrefresh(boardwin);
+	doupdate();
+
+	for (i = 0; i < BDEPTH; i++)
+	    for (j = 0; j < BWIDTH; j++) {
+		board[i][j] = FALSE;
+		cellmove(i, j);
+		waddch(boardwin, minus);
+	    }
+	memset(history, '\0', sizeof(history));
+	history[0].y = history[0].x = -1;
+	lastrow = lastcol = -2;
+	movecount = 1;
+	keyhelp = FALSE;
+
+	for (;;) {
+	    if (rw != lastrow || col != lastcol) {
+		if (lastrow >= 0 && lastcol >= 0) {
+		    cellmove(lastrow, lastcol);
+		    if (board[lastrow][lastcol])
+			waddch(boardwin, trail);
+		    else
+			waddch(boardwin, oldch);
+		}
+
+		cellmove(rw, col);
+		oldch = winch(boardwin);
+
+		lastrow = rw;
+		lastcol = col;
+	    }
+	    cellmove(rw, col);
+	    waddch(boardwin, plus);
+	    cellmove(rw, col);
+
+	    wrefresh(msgwin);
+
+	    c = wgetch(boardwin);
+
+	    werase(msgwin);
+
+	    switch (c) {
+	    case 'k':
+	    case '8':
+	    case KEY_UP:
+		ny = rw + BDEPTH - 1;
+		nx = col;
+		break;
+	    case 'j':
+	    case '2':
+	    case KEY_DOWN:
+		ny = rw + 1;
+		nx = col;
+		break;
+	    case 'h':
+	    case '4':
+	    case KEY_LEFT:
+		ny = rw;
+		nx = col + BWIDTH - 1;
+		break;
+	    case 'l':
+	    case '6':
+	    case KEY_RIGHT:
+		ny = rw;
+		nx = col + 1;
+		break;
+	    case 'y':
+	    case '7':
+	    case KEY_A1:
+		ny = rw + BDEPTH - 1;
+		nx = col + BWIDTH - 1;
+		break;
+	    case 'b':
+	    case '1':
+	    case KEY_C1:
+		ny = rw + 1;
+		nx = col + BWIDTH - 1;
+		break;
+	    case 'u':
+	    case '9':
+	    case KEY_A3:
+		ny = rw + BDEPTH - 1;
+		nx = col + 1;
+		break;
+	    case 'n':
+	    case '3':
+	    case KEY_C3:
+		ny = rw + 1;
+		nx = col + 1;
+		break;
 
 #ifdef NCURSES_MOUSE_VERSION
-	       case KEY_MOUSE:
-		   {
-		       MEVENT	myevent;
-
-		       getmouse(&myevent);
-		       if (myevent.y >= CY(0) && myevent.y <= CY(BDEPTH)
-			   && myevent.x >= CX(0) && myevent.x <= CX(BWIDTH))
-		       {
-			   nx = CXINV(myevent.x);
-			   ny = CYINV(myevent.y);
-			   ungetch('\n');
-			   break;
-		       }
-		       else
-		       {
-			   beep();
-			   continue;
-		       }
-		   }
+	    case KEY_MOUSE:
+		{
+		    MEVENT myevent;
+
+		    getmouse(&myevent);
+		    if (myevent.y >= CY(0) && myevent.y <= CY(BDEPTH)
+			&& myevent.x >= CX(0) && myevent.x <= CX(BWIDTH)) {
+			nx = CXINV(myevent.x);
+			ny = CYINV(myevent.y);
+			ungetch('\n');
+			break;
+		    } else {
+			beep();
+			continue;
+		    }
+		}
 #endif /* NCURSES_MOUSE_VERSION */
 
-	       case KEY_B2:
-	       case '\n':
-	       case ' ':
-		   if (evalmove(rw, col))
-		   {
-		       drawmove(trail,
-				history[movecount-1].y, history[movecount-1].x,
-				rw, col);
-		       history[movecount].y = rw; 
-		       history[movecount].x = col; 
-		       movecount++;
-
-		       if (!chkmoves()) 
-			   goto dropout;
-		   }
-		   else
-		       beep();
-		   break;
-
-	       case KEY_REDO:
-	       case '\f':
-	       case 'r':
-		   clearok(curscr, TRUE);
-		   wnoutrefresh(stdscr);
-		   wnoutrefresh(boardwin);
-		   wnoutrefresh(msgwin);
-		   wnoutrefresh(helpwin);
-		   doupdate();
-		   break;
-
-	       case KEY_UNDO:
-	       case KEY_BACKSPACE:
-	       case '\b':
-		   if (movecount == 1)
-		   {
-		       ny = lastrow;
-		       nx = lastcol;
-		       waddstr(msgwin, "\nNo previous move.");
-		       beep();
-		   }
-		   else
-		   {
-		       int oldy = history[movecount-1].y;
-		       int oldx = history[movecount-1].x;
-
-		       board[oldy][oldx] = FALSE;
-		       --movecount;
-		       ny = history[movecount-1].y;
-		       nx = history[movecount-1].x;
-		       drawmove(' ', oldy, oldx, ny, nx);
-
-		       /* avoid problems if we just changed the current cell */
-		       cellmove(lastrow, lastcol);
-		       oldch = winch(boardwin);
-		   }
-		   break;
-
-	       case 'q':
-	       case 'x':
-		   goto dropout;
-
-	       case '?':
-		   werase(helpwin);
-		   if (keyhelp)
-		   {
-		       help1();
-		       keyhelp = FALSE;
-		   }
-		   else
-		   {
-		       help2();
-		       keyhelp = TRUE;
-		   }
-		   wrefresh(helpwin);
-		   break;
-
-	       default:
-		   beep();
-		   break;
-	       }
-
-	       col = nx % BWIDTH;
-	       rw = ny % BDEPTH;
-	   }
-
-       dropout:
-	   count = 0;
-	   for (i = 0; i < BDEPTH; i++)
-	       for (j = 0; j < BWIDTH; j++)
-		   if (board[i][j] != 0)
-		       count += 1;
-	   if (count == (BWIDTH * BDEPTH))
-	       wprintw(msgwin, "\nYou won.  Care to try again? ");
-	   else
-	       wprintw(msgwin, "\n%d squares filled.  Try again? ", count);
-       } while
-	   (tolower(wgetch(msgwin)) == 'y');
+	    case KEY_B2:
+	    case '\n':
+	    case ' ':
+		if (evalmove(rw, col)) {
+		    drawmove(trail,
+			     history[movecount - 1].y,
+			     history[movecount - 1].x,
+			     rw, col);
+		    history[movecount].y = rw;
+		    history[movecount].x = col;
+		    movecount++;
+
+		    if (!chkmoves())
+			goto dropout;
+		} else
+		    beep();
+		break;
+
+	    case KEY_REDO:
+	    case '\f':
+	    case 'r':
+		clearok(curscr, TRUE);
+		wnoutrefresh(stdscr);
+		wnoutrefresh(boardwin);
+		wnoutrefresh(msgwin);
+		wnoutrefresh(helpwin);
+		doupdate();
+		break;
+
+	    case KEY_UNDO:
+	    case KEY_BACKSPACE:
+	    case '\b':
+		if (movecount == 1) {
+		    ny = lastrow;
+		    nx = lastcol;
+		    waddstr(msgwin, "\nNo previous move.");
+		    beep();
+		} else {
+		    int oldy = history[movecount - 1].y;
+		    int oldx = history[movecount - 1].x;
+
+		    board[oldy][oldx] = FALSE;
+		    --movecount;
+		    ny = history[movecount - 1].y;
+		    nx = history[movecount - 1].x;
+		    drawmove(' ', oldy, oldx, ny, nx);
+
+		    /* avoid problems if we just changed the current cell */
+		    cellmove(lastrow, lastcol);
+		    oldch = winch(boardwin);
+		}
+		break;
+
+	    case 'q':
+	    case 'x':
+		goto dropout;
+
+	    case '?':
+		werase(helpwin);
+		if (keyhelp) {
+		    help1();
+		    keyhelp = FALSE;
+		} else {
+		    help2();
+		    keyhelp = TRUE;
+		}
+		wrefresh(helpwin);
+		break;
+
+	    default:
+		beep();
+		break;
+	    }
+
+	    col = nx % BWIDTH;
+	    rw = ny % BDEPTH;
+	}
+
+      dropout:
+	count = 0;
+	for (i = 0; i < BDEPTH; i++)
+	    for (j = 0; j < BWIDTH; j++)
+		if (board[i][j] != 0)
+		    count += 1;
+	if (count == (BWIDTH * BDEPTH))
+	    wprintw(msgwin, "\nYou won.  Care to try again? ");
+	else
+	    wprintw(msgwin, "\n%d squares filled.  Try again? ", count);
+    } while
+	(tolower(wgetch(msgwin)) == 'y');
 }
 
-static void dosquares (void)
+static void
+dosquares(void)
 {
     int i, j;
 
     mvaddstr(0, 20, "KNIGHT'S MOVE -- a logical solitaire");
 
-    move(BOARDY,BOARDX);
+    move(BOARDY, BOARDX);
     waddch(boardwin, ACS_ULCORNER);
-    for (j = 0; j < 7; j++)
-    {
+    for (j = 0; j < 7; j++) {
 	waddch(boardwin, ACS_HLINE);
 	waddch(boardwin, ACS_HLINE);
 	waddch(boardwin, ACS_HLINE);
@@ -406,21 +406,18 @@ static void dosquares (void)
     waddch(boardwin, ACS_HLINE);
     waddch(boardwin, ACS_URCORNER);
 
-    for (i = 1; i < BDEPTH; i++)
-    {
+    for (i = 1; i < BDEPTH; i++) {
 	move(BOARDY + i * 2 - 1, BOARDX);
-	waddch(boardwin, ACS_VLINE); 
-	for (j = 0; j < BWIDTH; j++)
-	{
+	waddch(boardwin, ACS_VLINE);
+	for (j = 0; j < BWIDTH; j++) {
 	    waddch(boardwin, ' ');
 	    waddch(boardwin, ' ');
 	    waddch(boardwin, ' ');
 	    waddch(boardwin, ACS_VLINE);
 	}
 	move(BOARDY + i * 2, BOARDX);
-	waddch(boardwin, ACS_LTEE); 
-	for (j = 0; j < BWIDTH - 1; j++)
-	{
+	waddch(boardwin, ACS_LTEE);
+	for (j = 0; j < BWIDTH - 1; j++) {
 	    waddch(boardwin, ACS_HLINE);
 	    waddch(boardwin, ACS_HLINE);
 	    waddch(boardwin, ACS_HLINE);
@@ -434,8 +431,7 @@ static void dosquares (void)
 
     move(BOARDY + i * 2 - 1, BOARDX);
     waddch(boardwin, ACS_VLINE);
-    for (j = 0; j < BWIDTH; j++)
-    {
+    for (j = 0; j < BWIDTH; j++) {
 	waddch(boardwin, ' ');
 	waddch(boardwin, ' ');
 	waddch(boardwin, ' ');
@@ -444,8 +440,7 @@ static void dosquares (void)
 
     move(BOARDY + i * 2, BOARDX);
     waddch(boardwin, ACS_LLCORNER);
-    for (j = 0; j < BWIDTH - 1; j++)
-    {
+    for (j = 0; j < BWIDTH - 1; j++) {
 	waddch(boardwin, ACS_HLINE);
 	waddch(boardwin, ACS_HLINE);
 	waddch(boardwin, ACS_HLINE);
@@ -457,35 +452,57 @@ static void dosquares (void)
     waddch(boardwin, ACS_LRCORNER);
 }
 
-static void mark_possibles(int prow, int pcol, chtype mark)
+static void
+mark_possibles(int prow, int pcol, chtype mark)
 {
-    if (chksqr(prow+2,pcol+1)){cellmove(prow+2,pcol+1);waddch(boardwin,mark);};
-    if (chksqr(prow+2,pcol-1)){cellmove(prow+2,pcol-1);waddch(boardwin,mark);};
-    if (chksqr(prow-2,pcol+1)){cellmove(prow-2,pcol+1);waddch(boardwin,mark);};
-    if (chksqr(prow-2,pcol-1)){cellmove(prow-2,pcol-1);waddch(boardwin,mark);};
-    if (chksqr(prow+1,pcol+2)){cellmove(prow+1,pcol+2);waddch(boardwin,mark);};
-    if (chksqr(prow+1,pcol-2)){cellmove(prow+1,pcol-2);waddch(boardwin,mark);};
-    if (chksqr(prow-1,pcol+2)){cellmove(prow-1,pcol+2);waddch(boardwin,mark);};
-    if (chksqr(prow-1,pcol-2)){cellmove(prow-1,pcol-2);waddch(boardwin,mark);};
+    if (chksqr(prow + 2, pcol + 1)) {
+	cellmove(prow + 2, pcol + 1);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow + 2, pcol - 1)) {
+	cellmove(prow + 2, pcol - 1);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow - 2, pcol + 1)) {
+	cellmove(prow - 2, pcol + 1);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow - 2, pcol - 1)) {
+	cellmove(prow - 2, pcol - 1);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow + 1, pcol + 2)) {
+	cellmove(prow + 1, pcol + 2);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow + 1, pcol - 2)) {
+	cellmove(prow + 1, pcol - 2);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow - 1, pcol + 2)) {
+	cellmove(prow - 1, pcol + 2);
+	waddch(boardwin, mark);
+    };
+    if (chksqr(prow - 1, pcol - 2)) {
+	cellmove(prow - 1, pcol - 2);
+	waddch(boardwin, mark);
+    };
 }
 
-static void drawmove(char tchar, int oldy, int oldx, int row, int column)
+static void
+drawmove(char tchar, int oldy, int oldx, int row, int column)
 /* place the stars, update board & currents */
 {
-    if (movecount <= 1)
-    {
+    if (movecount <= 1) {
 	int i, j;
 
 	for (i = 0; i < BDEPTH; i++)
-	    for (j = 0; j < BWIDTH; j++)
-	    {
+	    for (j = 0; j < BWIDTH; j++) {
 		cellmove(i, j);
 		if (winch(boardwin) == minus)
 		    waddch(boardwin, movecount ? ' ' : minus);
 	    }
-    }
-    else
-    {
+    } else {
 	cellmove(oldy, oldx);
 	waddch(boardwin, '\b');
 	waddch(boardwin, tchar);
@@ -494,8 +511,7 @@ static void drawmove(char tchar, int oldy, int oldx, int row, int column)
 	mark_possibles(oldy, oldx, ' ');
     }
 
-    if (row != -1 && column != -1)
-    {
+    if (row != -1 && column != -1) {
 	cellmove(row, column);
 	waddch(boardwin, '\b');
 	waddch(boardwin, trail);
@@ -508,57 +524,67 @@ static void drawmove(char tchar, int oldy, int oldx, int row, int column)
     wprintw(msgwin, "\nMove %d", movecount);
 }
 
-static bool evalmove(int row, int column)
+static bool
+evalmove(int row, int column)
 /* evaluate move */
 {
     if (movecount == 1)
-	return(TRUE);
-    else if (board[row][column] == TRUE)
-    {
+	return (TRUE);
+    else if (board[row][column] == TRUE) {
 	waddstr(msgwin, "\nYou've already been there.");
-	return(FALSE);
-    }
-    else
-    {
-	int	rdif = iabs(row  - history[movecount-1].y);
-	int	cdif = iabs(column - history[movecount-1].x);
+	return (FALSE);
+    } else {
+	int rdif = iabs(row - history[movecount - 1].y);
+	int cdif = iabs(column - history[movecount - 1].x);
 
-	if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1)))
-	{
+	if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1))) {
 	    waddstr(msgwin, "\nThat's not a legal knight's move.");
-	    return(FALSE);
+	    return (FALSE);
 	}
     }
 
-    return(TRUE);
+    return (TRUE);
 }
 
-static bool chkmoves (void)
+static bool
+chkmoves(void)
 /* check to see if valid moves are available */
 {
-    if (chksqr(rw+2,col+1)) return(TRUE);
-    if (chksqr(rw+2,col-1)) return(TRUE);
-    if (chksqr(rw-2,col+1)) return(TRUE);
-    if (chksqr(rw-2,col-1)) return(TRUE);
-    if (chksqr(rw+1,col+2)) return(TRUE);
-    if (chksqr(rw+1,col-2)) return(TRUE);
-    if (chksqr(rw-1,col+2)) return(TRUE);
-    if (chksqr(rw-1,col-2)) return(TRUE);
+    if (chksqr(rw + 2, col + 1))
+	return (TRUE);
+    if (chksqr(rw + 2, col - 1))
+	return (TRUE);
+    if (chksqr(rw - 2, col + 1))
+	return (TRUE);
+    if (chksqr(rw - 2, col - 1))
+	return (TRUE);
+    if (chksqr(rw + 1, col + 2))
+	return (TRUE);
+    if (chksqr(rw + 1, col - 2))
+	return (TRUE);
+    if (chksqr(rw - 1, col + 2))
+	return (TRUE);
+    if (chksqr(rw - 1, col - 2))
+	return (TRUE);
     return (FALSE);
 }
 
-static int iabs(int num)
+static int
+iabs(int num)
 {
-	if (num < 0) return (-num);
-		else return (num);
+    if (num < 0)
+	return (-num);
+    else
+	return (num);
 }
 
-static bool chksqr (int r1, int c1)
+static bool
+chksqr(int r1, int c1)
 {
     if ((r1 < 0) || (r1 > BDEPTH - 1))
-	return(FALSE);
+	return (FALSE);
     if ((c1 < 0) || (c1 > BWIDTH - 1))
-	return(FALSE);
+	return (FALSE);
     return ((!board[r1][c1]) ? TRUE : FALSE);
 }
 
diff --git a/test/ncurses.c b/test/ncurses.c
index 4bd8552e..ad1aa01c 100644
--- a/test/ncurses.c
+++ b/test/ncurses.c
@@ -39,7 +39,7 @@ DESCRIPTION
 AUTHOR
    Author: Eric S. Raymond  1993
 
-$Id: ncurses.c,v 1.130 2000/07/07 11:05:16 tom Exp $
+$Id: ncurses.c,v 1.138 2000/09/17 01:24:00 tom Exp $
 
 ***************************************************************************/
 
@@ -92,7 +92,7 @@ static int save_trace = TRACE_ORDINARY | TRACE_CALLS;
 extern int _nc_tracing;
 #endif
 
-#if !HAVE_NAPMS
+#if !defined(HAVE_NAPMS)
 #define HAVE_NAPMS 1
 #endif
 
@@ -198,7 +198,7 @@ mouse_decode(MEVENT const *ep)
     static char buf[80];
 
     (void) sprintf(buf, "id %2d  at (%2d, %2d, %2d) state %4lx = {",
-	ep->id, ep->x, ep->y, ep->z, ep->bstate);
+		   ep->id, ep->x, ep->y, ep->z, ep->bstate);
 
 #define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");}
     SHOW(BUTTON1_RELEASED, "release-1");
@@ -347,21 +347,43 @@ getch_test(void)
 }
 
 static int
-show_attr(int row, int skip, chtype attr, const char *name, bool once)
+show_attr(int row, int skip, chtype attr, const char *name)
 {
+    static const char *string = "abcde fghij klmno pqrst uvwxy z";
     int ncv = tigetnum("ncv");
 
     mvprintw(row, 8, "%s mode:", name);
     mvprintw(row, 24, "|");
     if (skip)
 	printw("%*s", skip, " ");
-    if (once)
-	attron(attr);
-    else
-	attrset(attr);
-    addstr("abcde fghij klmno pqrst uvwxy z");
-    if (once)
-	attroff(attr);
+    attrset(attr);
+    /*
+     * If we're to write a string in the alternate character set, it is not
+     * sufficient to just set A_ALTCHARSET.  We have to perform the mapping
+     * that corresponds.  This is not needed for vt100-compatible devices
+     * because the acs_map[] is 1:1, but for PC-style devices such as Linux
+     * console, the acs_map[] is scattered about the range.
+     *
+     * The addch/addstr functions do not themselves do this mapping, since it
+     * is possible to turn off the A_ALTCHARSET flag for the characters which
+     * are added, and it would be an unexpected result to have the mapped
+     * characters visible on the screen.
+     *
+     * This example works because the indices into acs_map[] are mostly from
+     * the lowercase characters.
+     */
+    if (attr & A_ALTCHARSET) {
+	const char *s = string;
+	while (*s) {
+	    int ch = *s++;
+	    if ((ch = acs_map[ch]) == 0)
+		ch = ' ';
+	    addch(ch);
+	}
+    } else {
+	addstr(string);
+    }
+    attroff(attr);
     if (skip)
 	printw("%*s", skip, " ");
     printw("|");
@@ -398,7 +420,7 @@ show_attr(int row, int skip, chtype attr, const char *name, bool once)
 }
 
 static bool
-attr_getc(int *skip, int *fg, int *bg)
+attr_getc(int *skip, int *fg, int *bg, int *ac)
 {
     int ch = Getchar();
 
@@ -411,6 +433,12 @@ attr_getc(int *skip, int *fg, int *bg)
 	return TRUE;
     } else if (has_colors()) {
 	switch (ch) {
+	case 'a':
+	    *ac = 0;
+	    break;
+	case 'A':
+	    *ac = A_ALTCHARSET;
+	    break;
 	case 'f':
 	    *fg = (*fg + 1);
 	    break;
@@ -435,6 +463,18 @@ attr_getc(int *skip, int *fg, int *bg)
 	if (*bg < 0)
 	    *bg = COLORS - 1;
 	return TRUE;
+    } else {
+	switch (ch) {
+	case 'a':
+	    *ac = 0;
+	    break;
+	case 'A':
+	    *ac = A_ALTCHARSET;
+	    break;
+	default:
+	    return FALSE;
+	}
+	return TRUE;
     }
     return FALSE;
 }
@@ -447,6 +487,7 @@ attr_test(void)
     int skip = tigetnum("xmc");
     int fg = COLOR_BLACK;	/* color pair 0 is special */
     int bg = COLOR_BLACK;
+    int ac = 0;
     bool *pairs = (bool *) calloc(COLOR_PAIRS, sizeof(bool));
     pairs[0] = TRUE;
 
@@ -472,28 +513,31 @@ attr_test(void)
 
 	mvaddstr(0, 20, "Character attribute test display");
 
-	row = show_attr(row, n, A_STANDOUT, "STANDOUT", TRUE);
-	row = show_attr(row, n, A_REVERSE, "REVERSE", TRUE);
-	row = show_attr(row, n, A_BOLD, "BOLD", TRUE);
-	row = show_attr(row, n, A_UNDERLINE, "UNDERLINE", TRUE);
-	row = show_attr(row, n, A_DIM, "DIM", TRUE);
-	row = show_attr(row, n, A_BLINK, "BLINK", TRUE);
-	row = show_attr(row, n, A_PROTECT, "PROTECT", TRUE);
-	row = show_attr(row, n, A_INVIS, "INVISIBLE", TRUE);
-	row = show_attr(row, n, A_NORMAL, "NORMAL", FALSE);
+	row = show_attr(row, n, ac | A_STANDOUT, "STANDOUT");
+	row = show_attr(row, n, ac | A_REVERSE, "REVERSE");
+	row = show_attr(row, n, ac | A_BOLD, "BOLD");
+	row = show_attr(row, n, ac | A_UNDERLINE, "UNDERLINE");
+	row = show_attr(row, n, ac | A_DIM, "DIM");
+	row = show_attr(row, n, ac | A_BLINK, "BLINK");
+	row = show_attr(row, n, ac | A_PROTECT, "PROTECT");
+	row = show_attr(row, n, ac | A_INVIS, "INVISIBLE");
+	row = show_attr(row, n, ac | A_NORMAL, "NORMAL");
 
 	mvprintw(row, 8,
-	    "This terminal does %shave the magic-cookie glitch",
-	    tigetnum("xmc") > -1 ? "" : "not ");
+		 "This terminal does %shave the magic-cookie glitch",
+		 tigetnum("xmc") > -1 ? "" : "not ");
 	mvprintw(row + 1, 8,
-	    "Enter a digit to set gaps on each side of displayed attributes");
+		 "Enter a digit to set gaps on each side of displayed attributes");
 	mvprintw(row + 2, 8,
-	    "^L = repaint");
+		 "^L = repaint");
 	if (has_colors())
-	    printw(".  f/F/b/F toggle colors (now %d/%d)", fg, bg);
+	    printw(".  f/F/b/F toggle colors (now %d/%d), a/A altcharset (%d)",
+		   fg, bg, ac != 0);
+	else
+	    printw(".  a/A altcharset (%d)", ac != 0);
 
 	refresh();
-    } while (attr_getc(&n, &fg, &bg));
+    } while (attr_getc(&n, &fg, &bg, &ac));
 
     free((char *) pairs);
     bkgdset(A_NORMAL | BLANK);
@@ -554,9 +598,9 @@ color_test(void)
 	top = (COLORS > 8) ? 0 : base * (COLORS + 3);
 	clrtobot();
 	(void) mvprintw(top + 1, 0,
-	    "%dx%d matrix of foreground/background colors, bright *%s*\n",
-	    COLORS, COLORS,
-	    base ? "on" : "off");
+			"%dx%d matrix of foreground/background colors, bright *%s*\n",
+			COLORS, COLORS,
+			base ? "on" : "off");
 	for (i = 0; i < COLORS; i++)
 	    show_color_name(top + 2, (i + 1) * width, i);
 	for (i = 0; i < COLORS; i++)
@@ -627,9 +671,9 @@ color_edit(void)
 
 	for (i = 0; i < max_colors; i++) {
 	    mvprintw(2 + i, 0, "%c %-8s:",
-		(i == current ? '>' : ' '),
-		(i < (int) SIZEOF(color_names)
-		    ? color_names[i] : ""));
+		     (i == current ? '>' : ' '),
+		     (i < (int) SIZEOF(color_names)
+		      ? color_names[i] : ""));
 	    attrset(COLOR_PAIR(i));
 	    addstr("        ");
 	    attrset(A_NORMAL);
@@ -666,9 +710,9 @@ color_edit(void)
 	}
 
 	mvaddstr(max_colors + 3, 0,
-	    "Use up/down to select a color, left/right to change fields.");
+		 "Use up/down to select a color, left/right to change fields.");
 	mvaddstr(max_colors + 4, 0,
-	    "Modify field by typing nnn=, nnn-, or nnn+.  ? for help.");
+		 "Modify field by typing nnn=, nnn-, or nnn+.  ? for help.");
 
 	move(2 + current, 0);
 
@@ -882,7 +926,7 @@ show_upper_chars(int first)
     erase();
     attron(A_BOLD);
     mvprintw(0, 20, "Display of %s Character Codes %d to %d",
-	C1 ? "C1" : "GR", first, last);
+	     C1 ? "C1" : "GR", first, last);
     attroff(A_BOLD);
     refresh();
 
@@ -983,9 +1027,9 @@ acs_display(void)
 	    break;
 	}
 	mvprintw(LINES - 3, 0,
-	    "Note: ANSI terminals may not display C1 characters.");
+		 "Note: ANSI terminals may not display C1 characters.");
 	mvprintw(LINES - 2, 0,
-	    "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit");
+		 "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit");
 	refresh();
     } while ((c = Getchar()) != 'x' && c != 'q');
 
@@ -1064,7 +1108,7 @@ test_sgr_attributes(void)
 
 	bkgdset(normal);
 	mvprintw(LINES - 2, 1, "%s background. ", pass == 0 ? "Dark" :
-	    "Light");
+		 "Light");
 	clrtoeol();
 	Pause();
     }
@@ -1146,7 +1190,7 @@ newwin_legend(FRAME * curp)
 	{
 	    "^R = restore window", 0
 	},
-#ifdef HAVE_WRESIZE
+#if HAVE_WRESIZE
 	{
 	    "^X = resize", 0
 	},
@@ -1196,8 +1240,8 @@ transient(FRAME * curp, NCURSES_CONST char *msg)
 
     move(LINES - 1, 0);
     printw("%s characters are echoed, window should %sscroll.",
-	HaveKeypad(curp) ? "Non-arrow" : "All other",
-	HaveScroll(curp) ? "" : "not ");
+	   HaveKeypad(curp) ? "Non-arrow" : "All other",
+	   HaveScroll(curp) ? "" : "not ");
     clrtoeol();
 }
 
@@ -1477,7 +1521,7 @@ acs_and_scroll(void)
 	    }
 	    break;
 
-#ifdef HAVE_WRESIZE
+#if HAVE_WRESIZE
 	case CTRL('X'):	/* resize window */
 	    if (current) {
 		pair *tmp, ul, lr;
@@ -1585,8 +1629,8 @@ acs_and_scroll(void)
 	wrefresh(usescr);
     } while
 	((c = wGetchar(usescr)) != QUIT
-	&& !((c == ESCAPE) && (usescr->_use_keypad))
-	&& (c != ERR));
+	 && !((c == ESCAPE) && (usescr->_use_keypad))
+	 && (c != ERR));
 
   breakout:
     while (current != 0)
@@ -1739,38 +1783,38 @@ demo_panels(void)
 	PANEL *p5;
 
 	p1 = mkpanel(COLOR_RED,
-	    LINES / 2 - 2,
-	    COLS / 8 + 1,
-	    0,
-	    0);
+		     LINES / 2 - 2,
+		     COLS / 8 + 1,
+		     0,
+		     0);
 	set_panel_userptr(p1, "p1");
 
 	p2 = mkpanel(COLOR_GREEN,
-	    LINES / 2 + 1,
-	    COLS / 7,
-	    LINES / 4,
-	    COLS / 10);
+		     LINES / 2 + 1,
+		     COLS / 7,
+		     LINES / 4,
+		     COLS / 10);
 	set_panel_userptr(p2, "p2");
 
 	p3 = mkpanel(COLOR_YELLOW,
-	    LINES / 4,
-	    COLS / 10,
-	    LINES / 2,
-	    COLS / 9);
+		     LINES / 4,
+		     COLS / 10,
+		     LINES / 2,
+		     COLS / 9);
 	set_panel_userptr(p3, "p3");
 
 	p4 = mkpanel(COLOR_BLUE,
-	    LINES / 2 - 2,
-	    COLS / 8,
-	    LINES / 2 - 2,
-	    COLS / 3);
+		     LINES / 2 - 2,
+		     COLS / 8,
+		     LINES / 2 - 2,
+		     COLS / 3);
 	set_panel_userptr(p4, "p4");
 
 	p5 = mkpanel(COLOR_MAGENTA,
-	    LINES / 2 - 2,
-	    COLS / 8,
-	    LINES / 2,
-	    COLS / 2 - 2);
+		     LINES / 2 - 2,
+		     COLS / 8,
+		     LINES / 2,
+		     COLS / 2 - 2);
 	set_panel_userptr(p5, "p5");
 
 	fill_panel(p1);
@@ -1943,6 +1987,7 @@ demo_panels(void)
 
 #define GRIDSIZE	3
 
+static bool pending_pan = FALSE;
 static bool show_panner_legend = TRUE;
 
 static int
@@ -1950,10 +1995,10 @@ panner_legend(int line)
 {
     static const char *const legend[] =
     {
-	"Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags)",
-	"Use ! to shell-out.  Toggle legend:?, timer:t, scroll mark:s.",
+	"Use arrow keys (or U,D,L,R) to pan, q to quit, ! to shell-out.",
 	"Use +,- (or j,k) to grow/shrink the panner vertically.",
-	"Use <,> (or h,l) to grow/shrink the panner horizontally."
+	"Use <,> (or h,l) to grow/shrink the panner horizontally.",
+	"Number repeats.  Toggle legend:?, timer:t, scroll mark:s."
     };
     int n = (SIZEOF(legend) - (LINES - line));
     if (line < LINES && (n >= 0)) {
@@ -1982,8 +2027,8 @@ panner_v_cleanup(int from_y, int from_x, int to_y)
 
 static void
 panner(WINDOW *pad,
-    int top_x, int top_y, int porty, int portx,
-    int (*pgetc) (WINDOW *))
+       int top_x, int top_y, int porty, int portx,
+       int (*pgetc) (WINDOW *))
 {
 #if HAVE_GETTIMEOFDAY
     struct timeval before, after;
@@ -2205,29 +2250,31 @@ panner(WINDOW *pad,
 	mvaddch(porty - 1, top_x - 1, ACS_LLCORNER);
 	mvaddch(porty - 1, portx - 1, ACS_LRCORNER);
 
+	if (!pending_pan) {
 #if HAVE_GETTIMEOFDAY
-	gettimeofday(&before, 0);
+	    gettimeofday(&before, 0);
 #endif
-	wnoutrefresh(stdscr);
+	    wnoutrefresh(stdscr);
 
-	pnoutrefresh(pad,
-	    basey, basex,
-	    top_y, top_x,
-	    porty - (pxmax > portx) - 1,
-	    portx - (pymax > porty) - 1);
+	    pnoutrefresh(pad,
+			 basey, basex,
+			 top_y, top_x,
+			 porty - (pxmax > portx) - 1,
+			 portx - (pymax > porty) - 1);
 
-	doupdate();
+	    doupdate();
 #if HAVE_GETTIMEOFDAY
-	if (timing) {
-	    double elapsed;
-	    gettimeofday(&after, 0);
-	    elapsed = (after.tv_sec + after.tv_usec / 1.0e6)
-		- (before.tv_sec + before.tv_usec / 1.0e6);
-	    move(LINES - 1, COLS - 20);
-	    printw("Secs: %2.03f", elapsed);
-	    refresh();
-	}
+	    if (timing) {
+		double elapsed;
+		gettimeofday(&after, 0);
+		elapsed = (after.tv_sec + after.tv_usec / 1.0e6)
+		    - (before.tv_sec + before.tv_usec / 1.0e6);
+		move(LINES - 1, COLS - 20);
+		printw("Secs: %2.03f", elapsed);
+		refresh();
+	    }
 #endif
+	}
 
     } while
 	((c = pgetc(pad)) != KEY_EXIT);
@@ -2235,44 +2282,73 @@ panner(WINDOW *pad,
     scrollok(stdscr, TRUE);	/* reset to driver's default */
 }
 
-static
-int
+static int
 padgetch(WINDOW *win)
 {
+    static int count;
+    static int last;
     int c;
 
-    switch (c = wGetchar(win)) {
-    case '!':
-	ShellOut(FALSE);
-	return KEY_REFRESH;
-    case CTRL('r'):
-	endwin();
-	refresh();
-	return KEY_REFRESH;
-    case CTRL('l'):
-	return KEY_REFRESH;
-    case 'U':
-	return (KEY_UP);
-    case 'D':
-	return (KEY_DOWN);
-    case 'R':
-	return (KEY_RIGHT);
-    case 'L':
-	return (KEY_LEFT);
-    case '+':
-	return (KEY_IL);
-    case '-':
-	return (KEY_DL);
-    case '>':
-	return (KEY_IC);
-    case '<':
-	return (KEY_DC);
-    case ERR:			/* FALLTHRU */
-    case 'q':
-	return (KEY_EXIT);
-    default:
-	return (c);
+    if ((pending_pan = (count > 0)) != FALSE) {
+	count--;
+	pending_pan = (count != 0);
+    } else {
+	for (;;) {
+	    switch (c = wGetchar(win)) {
+	    case '!':
+		ShellOut(FALSE);
+		c = KEY_REFRESH;
+	    case CTRL('r'):
+		endwin();
+		refresh();
+		c = KEY_REFRESH;
+		break;
+	    case CTRL('l'):
+		c = KEY_REFRESH;
+		break;
+	    case 'U':
+		c = KEY_UP;
+		break;
+	    case 'D':
+		c = KEY_DOWN;
+		break;
+	    case 'R':
+		c = KEY_RIGHT;
+		break;
+	    case 'L':
+		c = KEY_LEFT;
+		break;
+	    case '+':
+		c = KEY_IL;
+		break;
+	    case '-':
+		c = KEY_DL;
+		break;
+	    case '>':
+		c = KEY_IC;
+		break;
+	    case '<':
+		c = KEY_DC;
+		break;
+	    case ERR:		/* FALLTHRU */
+	    case 'q':
+		count = 0;
+		c = KEY_EXIT;
+		break;
+	    default:
+		if (c >= '0' && c <= '9') {
+		    count = count * 10 + (c - '0');
+		    continue;
+		}
+		break;
+	    }
+	    last = c;
+	    break;
+	}
+	if (count > 0)
+	    count--;
     }
+    return (last);
 }
 
 #define PAD_HIGH 200
@@ -2379,7 +2455,7 @@ flushinp_test(WINDOW *win)
 
     mvwaddstr(win, 2, 1, "Type random keys for 5 seconds.");
     mvwaddstr(win, 3, 1,
-	"These should be discarded (not echoed) after the subwindow goes away.");
+	      "These should be discarded (not echoed) after the subwindow goes away.");
     wrefresh(win);
 
     for (i = 0; i < 5; i++) {
@@ -2396,11 +2472,11 @@ flushinp_test(WINDOW *win)
     napms(1000);
 
     mvwaddstr(win, 2, 1,
-	"If you were still typing when the window timer expired,");
+	      "If you were still typing when the window timer expired,");
     mvwaddstr(win, 3, 1,
-	"or else you typed nothing at all while it was running,");
+	      "or else you typed nothing at all while it was running,");
     mvwaddstr(win, 4, 1,
-	"test was invalid.  You'll see garbage or nothing at all. ");
+	      "test was invalid.  You'll see garbage or nothing at all. ");
     mvwaddstr(win, 6, 1, "Press a key");
     wmove(win, 9, 10);
     wrefresh(win);
@@ -2408,7 +2484,7 @@ flushinp_test(WINDOW *win)
     wGetchar(win);
     flushinp();
     mvwaddstr(win, 12, 0,
-	"If you see any key other than what you typed, flushinp() is broken.");
+	      "If you see any key other than what you typed, flushinp() is broken.");
     Continue(win);
 
     wmove(win, 9, 10);
@@ -2417,7 +2493,7 @@ flushinp_test(WINDOW *win)
     wmove(win, 12, 0);
     clrtoeol();
     waddstr(win,
-	"What you typed should now have been deleted; if not, wdelch() failed.");
+	    "What you typed should now have been deleted; if not, wdelch() failed.");
     Continue(win);
 
     cbreak();
@@ -2483,7 +2559,7 @@ menu_test(void)
     mvaddstr(2, 0, "  Use up and down arrow to move the select bar.");
     mvaddstr(3, 0, "  'n' and 'p' act like arrows.");
     mvaddstr(4, 0,
-	"  'b' and 'f' scroll up/down (page), 'u' and 'd' (line).");
+	     "  'b' and 'f' scroll up/down (page), 'u' and 'd' (line).");
     mvaddstr(5, 0, "  Press return to exit.");
     refresh();
 
@@ -2512,7 +2588,7 @@ menu_test(void)
     }
 
     (void) mvprintw(LINES - 2, 0,
-	"You chose: %s\n", item_name(current_item(m)));
+		    "You chose: %s\n", item_name(current_item(m)));
     (void) addstr("Press any key to continue...");
     wGetchar(stdscr);
 
@@ -2548,6 +2624,7 @@ static struct {
 	T_TBL(TRACE_ICALLS),
 	T_TBL(TRACE_CCALLS),
 	T_TBL(TRACE_DATABASE),
+	T_TBL(TRACE_ATTRS),
 	T_TBL(TRACE_MAXIMUM),
     {
 	(char *) 0, 0
@@ -2677,7 +2754,7 @@ trace_set(void)
     _tracef("trace level interactively set to %s", tracetrace(_nc_tracing));
 
     (void) mvprintw(LINES - 2, 0,
-	"Trace level is %s\n", tracetrace(_nc_tracing));
+		    "Trace level is %s\n", tracetrace(_nc_tracing));
     (void) addstr("Press any key to continue...");
     wGetchar(stdscr);
 
@@ -3447,9 +3524,9 @@ main(int argc, char *argv[])
     (void) printf("Welcome to %s.  Press ? for help.\n", curses_version());
 #elif defined(NCURSES_VERSION_MAJOR) && defined(NCURSES_VERSION_MINOR) && defined(NCURSES_VERSION_PATCH)
     (void) printf("Welcome to ncurses %d.%d.%d.  Press ? for help.\n",
-	NCURSES_VERSION_MAJOR,
-	NCURSES_VERSION_MINOR,
-	NCURSES_VERSION_PATCH);
+		  NCURSES_VERSION_MAJOR,
+		  NCURSES_VERSION_MINOR,
+		  NCURSES_VERSION_PATCH);
 #else
     (void) puts("Welcome to ncurses.  Press ? for help.");
 #endif
diff --git a/test/railroad.c b/test/railroad.c
index d3dc2eae..90eac981 100644
--- a/test/railroad.c
+++ b/test/railroad.c
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey  2000
  *
- * $Id: railroad.c,v 1.1 2000/01/15 02:41:27 tom Exp $
+ * $Id: railroad.c,v 1.4 2000/10/15 00:21:33 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -39,6 +39,11 @@
 #include 
 #include 
 
+static char *wipeit;
+static char *moveit;
+static int length;
+static int height;
+
 static char *finisC;
 static char *finisS;
 static char *finisU;
@@ -68,7 +73,7 @@ PutChar(int ch)
 {
     putchar(ch);
     fflush(stdout);
-    napms(50);			/* not really termcap... */
+    napms(moveit ? 10 : 50);	/* not really termcap... */
 }
 
 static void
@@ -104,33 +109,54 @@ Underline(int flag)
 static void
 ShowSign(char *string)
 {
+    char *base = string;
     int ch, first, last;
 
+    if (moveit != 0) {
+	tputs(tgoto(moveit, 0, height - 1), 1, outc);
+	tputs(wipeit, 1, outc);
+    }
+
     while (*string != 0) {
 	ch = *string;
-	last = ch;
-	if (isalpha(ch)) {
-	    first = isupper(ch) ? 'A' : 'a';
-	} else if (isdigit(ch)) {
-	    first = '0';
+	if (moveit != 0) {
+	    for (first = length - 2; first >= (string - base); first--) {
+		if (first < length - 1) {
+		    tputs(tgoto(moveit, first + 1, height - 1), 1, outc);
+		    PutChar(' ');
+		}
+		tputs(tgoto(moveit, first, height - 1), 1, outc);
+		PutChar(ch);
+	    }
 	} else {
-	    first = ch;
-	}
-	if (first < last) {
-	    Underline(1);
-	    while (first < last) {
-		PutChar(first);
-		Backup();
-		first++;
+	    last = ch;
+	    if (isalpha(ch)) {
+		first = isupper(ch) ? 'A' : 'a';
+	    } else if (isdigit(ch)) {
+		first = '0';
+	    } else {
+		first = ch;
+	    }
+	    if (first < last) {
+		Underline(1);
+		while (first < last) {
+		    PutChar(first);
+		    Backup();
+		    first++;
+		}
+		Underline(0);
 	    }
-	    Underline(0);
 	}
+	if (moveit != 0)
+	    Backup();
 	StandOut(1);
 	PutChar(ch);
 	StandOut(0);
 	fflush(stdout);
 	string++;
     }
+    if (moveit != 0)
+	tputs(wipeit, 1, outc);
     putchar('\n');
 }
 
@@ -153,7 +179,7 @@ onsig(int n GCC_UNUSED)
 static void
 railroad(char **args)
 {
-    char *name = getenv("TERM");
+    NCURSES_CONST char *name = getenv("TERM");
     char buffer[1024];
     char area[1024], *ap = area;
     int j;
@@ -161,6 +187,22 @@ railroad(char **args)
     if (name == 0)
 	name = "dumb";
     if (tgetent(buffer, name)) {
+
+	wipeit = tgetstr("ce", &ap);
+	height = tgetnum("li");
+	length = tgetnum("co");
+	moveit = tgetstr("cm", &ap);
+
+	if (wipeit == 0
+	    || moveit == 0
+	    || height <= 0
+	    || length <= 0) {
+	    wipeit = 0;
+	    moveit = 0;
+	    height = 0;
+	    length = 0;
+	}
+
 	startS = tgetstr("so", &ap);
 	finisS = tgetstr("se", &ap);
 
@@ -186,9 +228,7 @@ railroad(char **args)
 }
 
 int
-main(
-    int argc,
-    char *argv[])
+main(int argc, char *argv[])
 {
     if (argc > 1) {
 	railroad(argv + 1);
diff --git a/test/rain.c b/test/rain.c
index 262f87d2..a7771b09 100644
--- a/test/rain.c
+++ b/test/rain.c
@@ -1,5 +1,5 @@
 /*
- * $Id: rain.c,v 1.14 1999/11/13 23:39:07 tom Exp $
+ * $Id: rain.c,v 1.15 2000/09/02 18:41:22 tom Exp $
  */
 #include 
 
@@ -42,7 +42,7 @@ float c;
     if (has_colors()) {
 	int bg = COLOR_BLACK;
 	start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
+#if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 		bg = -1;
 #endif
diff --git a/test/tclock.c b/test/tclock.c
index 838f45e7..9f846554 100644
--- a/test/tclock.c
+++ b/test/tclock.c
@@ -128,7 +128,7 @@ main(
 
     if (has_colors()) {
 	start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
+#if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 	    my_bg = -1;
 #endif
diff --git a/test/test.priv.h b/test/test.priv.h
index affed8d7..58bbd162 100644
--- a/test/test.priv.h
+++ b/test/test.priv.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            *
@@ -29,12 +29,35 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey  1996                        *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.16 2000/04/15 17:52:08 tom Exp $ */
+/* $Id: test.priv.h,v 1.19 2000/09/02 19:31:58 tom Exp $ */
+
 #if HAVE_CONFIG_H
 #include 
+#else
+#define HAVE_CURSES_VERSION 0
+#define HAVE_RESIZETERM 0
+#define HAVE_USE_DEFAULT_COLORS 0
+#define HAVE_WRESIZE 0
+#endif
+
+#ifndef HAVE_NC_ALLOC_H
+#define HAVE_NC_ALLOC_H 0
+#endif
+
+#ifndef HAVE_LOCALE_H
+#define HAVE_LOCALE_H 0
+#endif
+
+#ifndef NCURSES_NOMACROS
+#define NCURSES_NOMACROS 0
+#endif
+
+#ifndef NEED_PTEM_H
+#define NEED_PTEM_H 0
 #endif
 
 #include 
+#include 
 #include 
 
 #if HAVE_UNISTD_H
@@ -43,7 +66,7 @@
 
 #include 
 
-#ifdef NCURSES_NOMACROS
+#if NCURSES_NOMACROS
 #include 
 #endif
 
diff --git a/test/view.c b/test/view.c
index f4c2f067..4c1344cb 100644
--- a/test/view.c
+++ b/test/view.c
@@ -23,7 +23,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.29 2000/05/21 01:43:03 tom Exp $
+ * $Id: view.c,v 1.31 2000/09/02 18:14:52 tom Exp $
  */
 
 #include 
@@ -53,7 +53,7 @@
 static RETSIGTYPE finish(int sig) GCC_NORETURN;
 static void show_all(void);
 
-#if defined(SIGWINCH) && defined(TIOCGWINSZ) && defined(HAVE_RESIZETERM)
+#if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZETERM
 #define CAN_RESIZE 1
 #else
 #define CAN_RESIZE 0
@@ -433,7 +433,7 @@ show_all(void)
     scrollok(stdscr, FALSE);	/* prevent screen from moving */
     for (i = 1; i < LINES; i++) {
 	move(i, 0);
-	printw("%3d:", (lptr + i - lines));
+	printw("%3ld:", (long) (lptr + i - lines));
 	clrtoeol();
 	if ((s = lptr[i - 1]) != 0) {
 	    int len = ch_len(s);
diff --git a/test/worm.c b/test/worm.c
index 43a898f8..142982ae 100644
--- a/test/worm.c
+++ b/test/worm.c
@@ -34,7 +34,7 @@ Options:
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
-  $Id: worm.c,v 1.30 2000/04/15 17:51:56 tom Exp $
+  $Id: worm.c,v 1.31 2000/09/02 18:41:01 tom Exp $
 */
 
 #include 
@@ -251,7 +251,7 @@ main(int argc, char *argv[])
     if (has_colors()) {
 	int bg = COLOR_BLACK;
 	start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
+#if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 	    bg = -1;
 #endif
diff --git a/test/xmas.c b/test/xmas.c
index 57d42923..d99b8219 100644
--- a/test/xmas.c
+++ b/test/xmas.c
@@ -92,7 +92,7 @@
 /******************************************************************************/
 
 /*
- * $Id: xmas.c,v 1.13 1999/11/13 23:39:01 tom Exp $
+ * $Id: xmas.c,v 1.15 2000/09/02 18:45:53 tom Exp $
  */
 #include 
 
@@ -103,17 +103,36 @@
 static int my_bg = COLOR_BLACK;
 static int y_pos, x_pos;
 
-static WINDOW
-	*treescrn, *treescrn2,*treescrn3, *treescrn4,*treescrn5, *treescrn6,
-	*treescrn7, *treescrn8,
-	*dotdeer0,
-	*stardeer0,
-	*lildeer0, *lildeer1, *lildeer2, *lildeer3,
-	*middeer0, *middeer1, *middeer2, *middeer3,
-	*bigdeer0, *bigdeer1, *bigdeer2, *bigdeer3, *bigdeer4,
-	*lookdeer0, *lookdeer1, *lookdeer2, *lookdeer3, *lookdeer4,
-	*w_holiday,
-	*w_del_msg;
+static WINDOW *treescrn;
+static WINDOW *treescrn2;
+static WINDOW *treescrn3;
+static WINDOW *treescrn4;
+static WINDOW *treescrn5;
+static WINDOW *treescrn6;
+static WINDOW *treescrn7;
+static WINDOW *treescrn8;
+static WINDOW *dotdeer0;
+static WINDOW *stardeer0;
+static WINDOW *lildeer0;
+static WINDOW *lildeer1;
+static WINDOW *lildeer2;
+static WINDOW *lildeer3;
+static WINDOW *middeer0;
+static WINDOW *middeer1;
+static WINDOW *middeer2;
+static WINDOW *middeer3;
+static WINDOW *bigdeer0;
+static WINDOW *bigdeer1;
+static WINDOW *bigdeer2;
+static WINDOW *bigdeer3;
+static WINDOW *bigdeer4;
+static WINDOW *lookdeer0;
+static WINDOW *lookdeer1;
+static WINDOW *lookdeer2;
+static WINDOW *lookdeer3;
+static WINDOW *lookdeer4;
+static WINDOW *w_holiday;
+static WINDOW *w_del_msg;
 
 static int boxit(void);
 static int seas(void);
@@ -129,923 +148,916 @@ static int strng4(void);
 static int strng5(void);
 static int reindeer(void);
 static int blinkit(void);
-static RETSIGTYPE done(int sig) GCC_NORETURN ;
 
-static void
-set_color(WINDOW *win, chtype color)
+static RETSIGTYPE
+done(int sig) GCC_NORETURN;
+
+     static void
+       set_color(WINDOW *win, chtype color)
 {
-	if (has_colors()) {
-		static bool *pairs;
-		int n = (color + 1);
-		if (pairs == 0)
-			pairs = (bool *)calloc(COLORS+1, sizeof(bool));
-		if (!pairs[n]) {
-			init_pair(n, color, my_bg);
-			pairs[n] = TRUE;
-		}
-		wattroff(win, A_COLOR);
-		wattron(win, COLOR_PAIR(n));
+    if (has_colors()) {
+	static bool *pairs;
+	int n = (color + 1);
+	if (pairs == 0)
+	    pairs = (bool *) calloc(COLORS + 1, sizeof(bool));
+	if (!pairs[n]) {
+	    init_pair(n, color, my_bg);
+	    pairs[n] = TRUE;
 	}
+	wattroff(win, A_COLOR);
+	wattron(win, COLOR_PAIR(n));
+    }
 }
 
 static void
 unset_color(WINDOW *win)
 {
-	if (has_colors())
-		wattrset(win, COLOR_PAIR(0));
+    if (has_colors())
+	wattrset(win, COLOR_PAIR(0));
 }
 
 static void
 look_out(int msecs)
 {
-	napms(msecs);
-	if (getch() != ERR) {
-		beep();
-		done(0);
-	}
+    napms(msecs);
+    if (getch() != ERR) {
+	beep();
+	done(0);
+    }
 }
 
-int main(
-	int argc GCC_UNUSED,
-	char **argv GCC_UNUSED)
+int
+main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
 {
-int loopy;
-
-	initscr();
-	noecho();
-	nonl();
-	refresh();
-	signal(SIGINT,done);
-	signal(SIGTERM,done);
+    int loopy;
+
+    initscr();
+    noecho();
+    nonl();
+    refresh();
+    signal(SIGINT, done);
+    signal(SIGTERM, done);
 #if !defined	DOS && !defined OS2
-	signal(SIGHUP,done);
-	signal(SIGQUIT,done);
+    signal(SIGHUP, done);
+    signal(SIGQUIT, done);
 #endif
-	if (has_colors()) {
-		start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
-		if (use_default_colors() == OK)
-			my_bg = -1;
+    if (has_colors()) {
+	start_color();
+#if HAVE_USE_DEFAULT_COLORS
+	if (use_default_colors() == OK)
+	    my_bg = -1;
 #endif
-	}
-	curs_set(0);
-
-	treescrn = newwin(16,27,3,53);
-	treescrn2 = newwin(16,27,3,53);
-	treescrn3 = newwin(16,27,3,53);
-	treescrn4 = newwin(16,27,3,53);
-	treescrn5 = newwin(16,27,3,53);
-	treescrn6 = newwin(16,27,3,53);
-	treescrn7 = newwin(16,27,3,53);
-	treescrn8 = newwin(16,27,3,53);
-
-	dotdeer0 = newwin(3,71,0,8);
-
-	stardeer0 = newwin(4,56,0,8);
-
-	lildeer0 = newwin(7,53,0,8);
-	lildeer1 = newwin(2,4,0,0);
-	lildeer2 = newwin(2,4,0,0);
-	lildeer3 = newwin(2,4,0,0);
-
-	middeer0 = newwin(15,42,0,8);
-	middeer1 = newwin(3,7,0,0);
-	middeer2 = newwin(3,7,0,0);
-	middeer3 = newwin(3,7,0,0);
-
-	bigdeer0 = newwin(10,23,0,0);
-	bigdeer1 = newwin(10,23,0,0);
-	bigdeer2 = newwin(10,23,0,0);
-	bigdeer3 = newwin(10,23,0,0);
-	bigdeer4 = newwin(10,23,0,0);
-
-	lookdeer0 = newwin(10,25,0,0);
-	lookdeer1 = newwin(10,25,0,0);
-	lookdeer2 = newwin(10,25,0,0);
-	lookdeer3 = newwin(10,25,0,0);
-	lookdeer4 = newwin(10,25,0,0);
-
-	w_holiday = newwin(1,26,3,27);
-
-	w_del_msg = newwin(1,19,23,60);
-
-	mvwaddstr(w_del_msg,0,0,"Hit any key to quit");
-
-	mvwaddstr(w_holiday,0,0,"H A P P Y  H O L I D A Y S");
-
-	/* set up the windows for our various reindeer */
-
-	/* lildeer1 */
-	mvwaddch(lildeer1,0,0,(chtype)'V');
-	mvwaddch(lildeer1,1,0,(chtype)'@');
-	mvwaddch(lildeer1,1,1,(chtype)'<');
-	mvwaddch(lildeer1,1,2,(chtype)'>');
-	mvwaddch(lildeer1,1,3,(chtype)'~');
-
-	/* lildeer2 */
-	mvwaddch(lildeer2,0,0,(chtype)'V');
-	mvwaddch(lildeer2,1,0,(chtype)'@');
-	mvwaddch(lildeer2,1,1,(chtype)'|');
-	mvwaddch(lildeer2,1,2,(chtype)'|');
-	mvwaddch(lildeer2,1,3,(chtype)'~');
-
-	/* lildeer3 */
-	mvwaddch(lildeer3,0,0,(chtype)'V');
-	mvwaddch(lildeer3,1,0,(chtype)'@');
-	mvwaddch(lildeer3,1,1,(chtype)'>');
-	mvwaddch(lildeer3,1,2,(chtype)'<');
-	mvwaddch(lildeer2,1,3,(chtype)'~');
-
-
-	/* middeer1 */
-	mvwaddch(middeer1,0,2,(chtype)'y');
-	mvwaddch(middeer1,0,3,(chtype)'y');
-	mvwaddch(middeer1,1,2,(chtype)'0');
-	mvwaddch(middeer1,1,3,(chtype)'(');
-	mvwaddch(middeer1,1,4,(chtype)'=');
-	mvwaddch(middeer1,1,5,(chtype)')');
-	mvwaddch(middeer1,1,6,(chtype)'~');
-	mvwaddch(middeer1,2,3,(chtype)'\\');
-	mvwaddch(middeer1,2,4,(chtype)'/');
-
-	/* middeer2 */
-	mvwaddch(middeer2,0,2,(chtype)'y');
-	mvwaddch(middeer2,0,3,(chtype)'y');
-	mvwaddch(middeer2,1,2,(chtype)'0');
-	mvwaddch(middeer2,1,3,(chtype)'(');
-	mvwaddch(middeer2,1,4,(chtype)'=');
-	mvwaddch(middeer2,1,5,(chtype)')');
-	mvwaddch(middeer2,1,6,(chtype)'~');
-	mvwaddch(middeer2,2,3,(chtype)'|');
-	mvwaddch(middeer2,2,5,(chtype)'|');
-
-	/* middeer3 */
-	mvwaddch(middeer3,0,2,(chtype)'y');
-	mvwaddch(middeer3,0,3,(chtype)'y');
-	mvwaddch(middeer3,1,2,(chtype)'0');
-	mvwaddch(middeer3,1,3,(chtype)'(');
-	mvwaddch(middeer3,1,4,(chtype)'=');
-	mvwaddch(middeer3,1,5,(chtype)')');
-	mvwaddch(middeer3,1,6,(chtype)'~');
-	mvwaddch(middeer3,2,2,(chtype)'/');
-	mvwaddch(middeer3,2,6,(chtype)'\\');
-
-
-	/* bigdeer1 */
-	mvwaddch(bigdeer1,0,17,(chtype)'\\');
-	mvwaddch(bigdeer1,0,18,(chtype)'/');
-	mvwaddch(bigdeer1,0,20,(chtype)'\\');
-	mvwaddch(bigdeer1,0,21,(chtype)'/');
-	mvwaddch(bigdeer1,1,18,(chtype)'\\');
-	mvwaddch(bigdeer1,1,20,(chtype)'/');
-	mvwaddch(bigdeer1,2,19,(chtype)'|');
-	mvwaddch(bigdeer1,2,20,(chtype)'_');
-	mvwaddch(bigdeer1,3,18,(chtype)'/');
-	mvwaddch(bigdeer1,3,19,(chtype)'^');
-	mvwaddch(bigdeer1,3,20,(chtype)'0');
-	mvwaddch(bigdeer1,3,21,(chtype)'\\');
-	mvwaddch(bigdeer1,4,17,(chtype)'/');
-	mvwaddch(bigdeer1,4,18,(chtype)'/');
-	mvwaddch(bigdeer1,4,19,(chtype)'\\');
-	mvwaddch(bigdeer1,4,22,(chtype)'\\');
-	mvwaddstr(bigdeer1,5,7,"^~~~~~~~~//  ~~U");
-	mvwaddstr(bigdeer1,6,7,"( \\_____( /");
-	mvwaddstr(bigdeer1,7,8,"( )    /");
-	mvwaddstr(bigdeer1,8,9,"\\\\   /");
-	mvwaddstr(bigdeer1,9,11,"\\>/>");
-
-	/* bigdeer2 */
-	mvwaddch(bigdeer2,0,17,(chtype)'\\');
-	mvwaddch(bigdeer2,0,18,(chtype)'/');
-	mvwaddch(bigdeer2,0,20,(chtype)'\\');
-	mvwaddch(bigdeer2,0,21,(chtype)'/');
-	mvwaddch(bigdeer2,1,18,(chtype)'\\');
-	mvwaddch(bigdeer2,1,20,(chtype)'/');
-	mvwaddch(bigdeer2,2,19,(chtype)'|');
-	mvwaddch(bigdeer2,2,20,(chtype)'_');
-	mvwaddch(bigdeer2,3,18,(chtype)'/');
-	mvwaddch(bigdeer2,3,19,(chtype)'^');
-	mvwaddch(bigdeer2,3,20,(chtype)'0');
-	mvwaddch(bigdeer2,3,21,(chtype)'\\');
-	mvwaddch(bigdeer2,4,17,(chtype)'/');
-	mvwaddch(bigdeer2,4,18,(chtype)'/');
-	mvwaddch(bigdeer2,4,19,(chtype)'\\');
-	mvwaddch(bigdeer2,4,22,(chtype)'\\');
-	mvwaddstr(bigdeer2,5,7,"^~~~~~~~~//  ~~U");
-	mvwaddstr(bigdeer2,6,7,"(( )____( /");
-	mvwaddstr(bigdeer2,7,7,"( /      |");
-	mvwaddstr(bigdeer2,8,8,"\\/      |");
-	mvwaddstr(bigdeer2,9,9,"|>     |>");
-
-	/* bigdeer3 */
-	mvwaddch(bigdeer3,0,17,(chtype)'\\');
-	mvwaddch(bigdeer3,0,18,(chtype)'/');
-	mvwaddch(bigdeer3,0,20,(chtype)'\\');
-	mvwaddch(bigdeer3,0,21,(chtype)'/');
-	mvwaddch(bigdeer3,1,18,(chtype)'\\');
-	mvwaddch(bigdeer3,1,20,(chtype)'/');
-	mvwaddch(bigdeer3,2,19,(chtype)'|');
-	mvwaddch(bigdeer3,2,20,(chtype)'_');
-	mvwaddch(bigdeer3,3,18,(chtype)'/');
-	mvwaddch(bigdeer3,3,19,(chtype)'^');
-	mvwaddch(bigdeer3,3,20,(chtype)'0');
-	mvwaddch(bigdeer3,3,21,(chtype)'\\');
-	mvwaddch(bigdeer3,4,17,(chtype)'/');
-	mvwaddch(bigdeer3,4,18,(chtype)'/');
-	mvwaddch(bigdeer3,4,19,(chtype)'\\');
-	mvwaddch(bigdeer3,4,22,(chtype)'\\');
-	mvwaddstr(bigdeer3,5,7,"^~~~~~~~~//  ~~U");
-	mvwaddstr(bigdeer3,6,6,"( ()_____( /");
-	mvwaddstr(bigdeer3,7,6,"/ /       /");
-	mvwaddstr(bigdeer3,8,5,"|/          \\");
-	mvwaddstr(bigdeer3,9,5,"/>           \\>");
-
-	/* bigdeer4 */
-	mvwaddch(bigdeer4,0,17,(chtype)'\\');
-	mvwaddch(bigdeer4,0,18,(chtype)'/');
-	mvwaddch(bigdeer4,0,20,(chtype)'\\');
-	mvwaddch(bigdeer4,0,21,(chtype)'/');
-	mvwaddch(bigdeer4,1,18,(chtype)'\\');
-	mvwaddch(bigdeer4,1,20,(chtype)'/');
-	mvwaddch(bigdeer4,2,19,(chtype)'|');
-	mvwaddch(bigdeer4,2,20,(chtype)'_');
-	mvwaddch(bigdeer4,3,18,(chtype)'/');
-	mvwaddch(bigdeer4,3,19,(chtype)'^');
-	mvwaddch(bigdeer4,3,20,(chtype)'0');
-	mvwaddch(bigdeer4,3,21,(chtype)'\\');
-	mvwaddch(bigdeer4,4,17,(chtype)'/');
-	mvwaddch(bigdeer4,4,18,(chtype)'/');
-	mvwaddch(bigdeer4,4,19,(chtype)'\\');
-	mvwaddch(bigdeer4,4,22,(chtype)'\\');
-	mvwaddstr(bigdeer4,5,7,"^~~~~~~~~//  ~~U");
-	mvwaddstr(bigdeer4,6,6,"( )______( /");
-	mvwaddstr(bigdeer4,7,5,"(/          \\");
-	mvwaddstr(bigdeer4,8,0,"v___=             ----^");
-
-
-	/* lookdeer1 */
-	mvwaddstr(lookdeer1,0,16,"\\/     \\/");
-	mvwaddstr(lookdeer1,1,17,"\\Y/ \\Y/");
-	mvwaddstr(lookdeer1,2,19,"\\=/");
-	mvwaddstr(lookdeer1,3,17,"^\\o o/^");
-	mvwaddstr(lookdeer1,4,17,"//( )");
-	mvwaddstr(lookdeer1,5,7,"^~~~~~~~~// \\O/");
-	mvwaddstr(lookdeer1,6,7,"( \\_____( /");
-	mvwaddstr(lookdeer1,7,8,"( )    /");
-	mvwaddstr(lookdeer1,8,9,"\\\\   /");
-	mvwaddstr(lookdeer1,9,11,"\\>/>");
-
-	/* lookdeer2 */
-	mvwaddstr(lookdeer2,0,16,"\\/     \\/");
-	mvwaddstr(lookdeer2,1,17,"\\Y/ \\Y/");
-	mvwaddstr(lookdeer2,2,19,"\\=/");
-	mvwaddstr(lookdeer2,3,17,"^\\o o/^");
-	mvwaddstr(lookdeer2,4,17,"//( )");
-	mvwaddstr(lookdeer2,5,7,"^~~~~~~~~// \\O/");
-	mvwaddstr(lookdeer2,6,7,"(( )____( /");
-	mvwaddstr(lookdeer2,7,7,"( /      |");
-	mvwaddstr(lookdeer2,8,8,"\\/      |");
-	mvwaddstr(lookdeer2,9,9,"|>     |>");
-
-	/* lookdeer3 */
-	mvwaddstr(lookdeer3,0,16,"\\/     \\/");
-	mvwaddstr(lookdeer3,1,17,"\\Y/ \\Y/");
-	mvwaddstr(lookdeer3,2,19,"\\=/");
-	mvwaddstr(lookdeer3,3,17,"^\\o o/^");
-	mvwaddstr(lookdeer3,4,17,"//( )");
-	mvwaddstr(lookdeer3,5,7,"^~~~~~~~~// \\O/");
-	mvwaddstr(lookdeer3,6,6,"( ()_____( /");
-	mvwaddstr(lookdeer3,7,6,"/ /       /");
-	mvwaddstr(lookdeer3,8,5,"|/          \\");
-	mvwaddstr(lookdeer3,9,5,"/>           \\>");
-
-	/* lookdeer4 */
-	mvwaddstr(lookdeer4,0,16,"\\/     \\/");
-	mvwaddstr(lookdeer4,1,17,"\\Y/ \\Y/");
-	mvwaddstr(lookdeer4,2,19,"\\=/");
-	mvwaddstr(lookdeer4,3,17,"^\\o o/^");
-	mvwaddstr(lookdeer4,4,17,"//( )");
-	mvwaddstr(lookdeer4,5,7,"^~~~~~~~~// \\O/");
-	mvwaddstr(lookdeer4,6,6,"( )______( /");
-	mvwaddstr(lookdeer4,7,5,"(/          \\");
-	mvwaddstr(lookdeer4,8,0,"v___=             ----^");
-
-
+    }
+    curs_set(0);
+
+    treescrn = newwin(16, 27, 3, 53);
+    treescrn2 = newwin(16, 27, 3, 53);
+    treescrn3 = newwin(16, 27, 3, 53);
+    treescrn4 = newwin(16, 27, 3, 53);
+    treescrn5 = newwin(16, 27, 3, 53);
+    treescrn6 = newwin(16, 27, 3, 53);
+    treescrn7 = newwin(16, 27, 3, 53);
+    treescrn8 = newwin(16, 27, 3, 53);
+
+    dotdeer0 = newwin(3, 71, 0, 8);
+
+    stardeer0 = newwin(4, 56, 0, 8);
+
+    lildeer0 = newwin(7, 53, 0, 8);
+    lildeer1 = newwin(2, 4, 0, 0);
+    lildeer2 = newwin(2, 4, 0, 0);
+    lildeer3 = newwin(2, 4, 0, 0);
+
+    middeer0 = newwin(15, 42, 0, 8);
+    middeer1 = newwin(3, 7, 0, 0);
+    middeer2 = newwin(3, 7, 0, 0);
+    middeer3 = newwin(3, 7, 0, 0);
+
+    bigdeer0 = newwin(10, 23, 0, 0);
+    bigdeer1 = newwin(10, 23, 0, 0);
+    bigdeer2 = newwin(10, 23, 0, 0);
+    bigdeer3 = newwin(10, 23, 0, 0);
+    bigdeer4 = newwin(10, 23, 0, 0);
+
+    lookdeer0 = newwin(10, 25, 0, 0);
+    lookdeer1 = newwin(10, 25, 0, 0);
+    lookdeer2 = newwin(10, 25, 0, 0);
+    lookdeer3 = newwin(10, 25, 0, 0);
+    lookdeer4 = newwin(10, 25, 0, 0);
+
+    w_holiday = newwin(1, 26, 3, 27);
+
+    w_del_msg = newwin(1, 19, 23, 60);
+
+    mvwaddstr(w_del_msg, 0, 0, "Hit any key to quit");
+
+    mvwaddstr(w_holiday, 0, 0, "H A P P Y  H O L I D A Y S");
+
+    /* set up the windows for our various reindeer */
+
+    /* lildeer1 */
+    mvwaddch(lildeer1, 0, 0, (chtype) 'V');
+    mvwaddch(lildeer1, 1, 0, (chtype) '@');
+    mvwaddch(lildeer1, 1, 1, (chtype) '<');
+    mvwaddch(lildeer1, 1, 2, (chtype) '>');
+    mvwaddch(lildeer1, 1, 3, (chtype) '~');
+
+    /* lildeer2 */
+    mvwaddch(lildeer2, 0, 0, (chtype) 'V');
+    mvwaddch(lildeer2, 1, 0, (chtype) '@');
+    mvwaddch(lildeer2, 1, 1, (chtype) '|');
+    mvwaddch(lildeer2, 1, 2, (chtype) '|');
+    mvwaddch(lildeer2, 1, 3, (chtype) '~');
+
+    /* lildeer3 */
+    mvwaddch(lildeer3, 0, 0, (chtype) 'V');
+    mvwaddch(lildeer3, 1, 0, (chtype) '@');
+    mvwaddch(lildeer3, 1, 1, (chtype) '>');
+    mvwaddch(lildeer3, 1, 2, (chtype) '<');
+    mvwaddch(lildeer2, 1, 3, (chtype) '~');
+
+    /* middeer1 */
+    mvwaddch(middeer1, 0, 2, (chtype) 'y');
+    mvwaddch(middeer1, 0, 3, (chtype) 'y');
+    mvwaddch(middeer1, 1, 2, (chtype) '0');
+    mvwaddch(middeer1, 1, 3, (chtype) '(');
+    mvwaddch(middeer1, 1, 4, (chtype) '=');
+    mvwaddch(middeer1, 1, 5, (chtype) ')');
+    mvwaddch(middeer1, 1, 6, (chtype) '~');
+    mvwaddch(middeer1, 2, 3, (chtype) '\\');
+    mvwaddch(middeer1, 2, 4, (chtype) '/');
+
+    /* middeer2 */
+    mvwaddch(middeer2, 0, 2, (chtype) 'y');
+    mvwaddch(middeer2, 0, 3, (chtype) 'y');
+    mvwaddch(middeer2, 1, 2, (chtype) '0');
+    mvwaddch(middeer2, 1, 3, (chtype) '(');
+    mvwaddch(middeer2, 1, 4, (chtype) '=');
+    mvwaddch(middeer2, 1, 5, (chtype) ')');
+    mvwaddch(middeer2, 1, 6, (chtype) '~');
+    mvwaddch(middeer2, 2, 3, (chtype) '|');
+    mvwaddch(middeer2, 2, 5, (chtype) '|');
+
+    /* middeer3 */
+    mvwaddch(middeer3, 0, 2, (chtype) 'y');
+    mvwaddch(middeer3, 0, 3, (chtype) 'y');
+    mvwaddch(middeer3, 1, 2, (chtype) '0');
+    mvwaddch(middeer3, 1, 3, (chtype) '(');
+    mvwaddch(middeer3, 1, 4, (chtype) '=');
+    mvwaddch(middeer3, 1, 5, (chtype) ')');
+    mvwaddch(middeer3, 1, 6, (chtype) '~');
+    mvwaddch(middeer3, 2, 2, (chtype) '/');
+    mvwaddch(middeer3, 2, 6, (chtype) '\\');
+
+    /* bigdeer1 */
+    mvwaddch(bigdeer1, 0, 17, (chtype) '\\');
+    mvwaddch(bigdeer1, 0, 18, (chtype) '/');
+    mvwaddch(bigdeer1, 0, 20, (chtype) '\\');
+    mvwaddch(bigdeer1, 0, 21, (chtype) '/');
+    mvwaddch(bigdeer1, 1, 18, (chtype) '\\');
+    mvwaddch(bigdeer1, 1, 20, (chtype) '/');
+    mvwaddch(bigdeer1, 2, 19, (chtype) '|');
+    mvwaddch(bigdeer1, 2, 20, (chtype) '_');
+    mvwaddch(bigdeer1, 3, 18, (chtype) '/');
+    mvwaddch(bigdeer1, 3, 19, (chtype) '^');
+    mvwaddch(bigdeer1, 3, 20, (chtype) '0');
+    mvwaddch(bigdeer1, 3, 21, (chtype) '\\');
+    mvwaddch(bigdeer1, 4, 17, (chtype) '/');
+    mvwaddch(bigdeer1, 4, 18, (chtype) '/');
+    mvwaddch(bigdeer1, 4, 19, (chtype) '\\');
+    mvwaddch(bigdeer1, 4, 22, (chtype) '\\');
+    mvwaddstr(bigdeer1, 5, 7, "^~~~~~~~~//  ~~U");
+    mvwaddstr(bigdeer1, 6, 7, "( \\_____( /");
+    mvwaddstr(bigdeer1, 7, 8, "( )    /");
+    mvwaddstr(bigdeer1, 8, 9, "\\\\   /");
+    mvwaddstr(bigdeer1, 9, 11, "\\>/>");
+
+    /* bigdeer2 */
+    mvwaddch(bigdeer2, 0, 17, (chtype) '\\');
+    mvwaddch(bigdeer2, 0, 18, (chtype) '/');
+    mvwaddch(bigdeer2, 0, 20, (chtype) '\\');
+    mvwaddch(bigdeer2, 0, 21, (chtype) '/');
+    mvwaddch(bigdeer2, 1, 18, (chtype) '\\');
+    mvwaddch(bigdeer2, 1, 20, (chtype) '/');
+    mvwaddch(bigdeer2, 2, 19, (chtype) '|');
+    mvwaddch(bigdeer2, 2, 20, (chtype) '_');
+    mvwaddch(bigdeer2, 3, 18, (chtype) '/');
+    mvwaddch(bigdeer2, 3, 19, (chtype) '^');
+    mvwaddch(bigdeer2, 3, 20, (chtype) '0');
+    mvwaddch(bigdeer2, 3, 21, (chtype) '\\');
+    mvwaddch(bigdeer2, 4, 17, (chtype) '/');
+    mvwaddch(bigdeer2, 4, 18, (chtype) '/');
+    mvwaddch(bigdeer2, 4, 19, (chtype) '\\');
+    mvwaddch(bigdeer2, 4, 22, (chtype) '\\');
+    mvwaddstr(bigdeer2, 5, 7, "^~~~~~~~~//  ~~U");
+    mvwaddstr(bigdeer2, 6, 7, "(( )____( /");
+    mvwaddstr(bigdeer2, 7, 7, "( /      |");
+    mvwaddstr(bigdeer2, 8, 8, "\\/      |");
+    mvwaddstr(bigdeer2, 9, 9, "|>     |>");
+
+    /* bigdeer3 */
+    mvwaddch(bigdeer3, 0, 17, (chtype) '\\');
+    mvwaddch(bigdeer3, 0, 18, (chtype) '/');
+    mvwaddch(bigdeer3, 0, 20, (chtype) '\\');
+    mvwaddch(bigdeer3, 0, 21, (chtype) '/');
+    mvwaddch(bigdeer3, 1, 18, (chtype) '\\');
+    mvwaddch(bigdeer3, 1, 20, (chtype) '/');
+    mvwaddch(bigdeer3, 2, 19, (chtype) '|');
+    mvwaddch(bigdeer3, 2, 20, (chtype) '_');
+    mvwaddch(bigdeer3, 3, 18, (chtype) '/');
+    mvwaddch(bigdeer3, 3, 19, (chtype) '^');
+    mvwaddch(bigdeer3, 3, 20, (chtype) '0');
+    mvwaddch(bigdeer3, 3, 21, (chtype) '\\');
+    mvwaddch(bigdeer3, 4, 17, (chtype) '/');
+    mvwaddch(bigdeer3, 4, 18, (chtype) '/');
+    mvwaddch(bigdeer3, 4, 19, (chtype) '\\');
+    mvwaddch(bigdeer3, 4, 22, (chtype) '\\');
+    mvwaddstr(bigdeer3, 5, 7, "^~~~~~~~~//  ~~U");
+    mvwaddstr(bigdeer3, 6, 6, "( ()_____( /");
+    mvwaddstr(bigdeer3, 7, 6, "/ /       /");
+    mvwaddstr(bigdeer3, 8, 5, "|/          \\");
+    mvwaddstr(bigdeer3, 9, 5, "/>           \\>");
+
+    /* bigdeer4 */
+    mvwaddch(bigdeer4, 0, 17, (chtype) '\\');
+    mvwaddch(bigdeer4, 0, 18, (chtype) '/');
+    mvwaddch(bigdeer4, 0, 20, (chtype) '\\');
+    mvwaddch(bigdeer4, 0, 21, (chtype) '/');
+    mvwaddch(bigdeer4, 1, 18, (chtype) '\\');
+    mvwaddch(bigdeer4, 1, 20, (chtype) '/');
+    mvwaddch(bigdeer4, 2, 19, (chtype) '|');
+    mvwaddch(bigdeer4, 2, 20, (chtype) '_');
+    mvwaddch(bigdeer4, 3, 18, (chtype) '/');
+    mvwaddch(bigdeer4, 3, 19, (chtype) '^');
+    mvwaddch(bigdeer4, 3, 20, (chtype) '0');
+    mvwaddch(bigdeer4, 3, 21, (chtype) '\\');
+    mvwaddch(bigdeer4, 4, 17, (chtype) '/');
+    mvwaddch(bigdeer4, 4, 18, (chtype) '/');
+    mvwaddch(bigdeer4, 4, 19, (chtype) '\\');
+    mvwaddch(bigdeer4, 4, 22, (chtype) '\\');
+    mvwaddstr(bigdeer4, 5, 7, "^~~~~~~~~//  ~~U");
+    mvwaddstr(bigdeer4, 6, 6, "( )______( /");
+    mvwaddstr(bigdeer4, 7, 5, "(/          \\");
+    mvwaddstr(bigdeer4, 8, 0, "v___=             ----^");
+
+    /* lookdeer1 */
+    mvwaddstr(lookdeer1, 0, 16, "\\/     \\/");
+    mvwaddstr(lookdeer1, 1, 17, "\\Y/ \\Y/");
+    mvwaddstr(lookdeer1, 2, 19, "\\=/");
+    mvwaddstr(lookdeer1, 3, 17, "^\\o o/^");
+    mvwaddstr(lookdeer1, 4, 17, "//( )");
+    mvwaddstr(lookdeer1, 5, 7, "^~~~~~~~~// \\O/");
+    mvwaddstr(lookdeer1, 6, 7, "( \\_____( /");
+    mvwaddstr(lookdeer1, 7, 8, "( )    /");
+    mvwaddstr(lookdeer1, 8, 9, "\\\\   /");
+    mvwaddstr(lookdeer1, 9, 11, "\\>/>");
+
+    /* lookdeer2 */
+    mvwaddstr(lookdeer2, 0, 16, "\\/     \\/");
+    mvwaddstr(lookdeer2, 1, 17, "\\Y/ \\Y/");
+    mvwaddstr(lookdeer2, 2, 19, "\\=/");
+    mvwaddstr(lookdeer2, 3, 17, "^\\o o/^");
+    mvwaddstr(lookdeer2, 4, 17, "//( )");
+    mvwaddstr(lookdeer2, 5, 7, "^~~~~~~~~// \\O/");
+    mvwaddstr(lookdeer2, 6, 7, "(( )____( /");
+    mvwaddstr(lookdeer2, 7, 7, "( /      |");
+    mvwaddstr(lookdeer2, 8, 8, "\\/      |");
+    mvwaddstr(lookdeer2, 9, 9, "|>     |>");
+
+    /* lookdeer3 */
+    mvwaddstr(lookdeer3, 0, 16, "\\/     \\/");
+    mvwaddstr(lookdeer3, 1, 17, "\\Y/ \\Y/");
+    mvwaddstr(lookdeer3, 2, 19, "\\=/");
+    mvwaddstr(lookdeer3, 3, 17, "^\\o o/^");
+    mvwaddstr(lookdeer3, 4, 17, "//( )");
+    mvwaddstr(lookdeer3, 5, 7, "^~~~~~~~~// \\O/");
+    mvwaddstr(lookdeer3, 6, 6, "( ()_____( /");
+    mvwaddstr(lookdeer3, 7, 6, "/ /       /");
+    mvwaddstr(lookdeer3, 8, 5, "|/          \\");
+    mvwaddstr(lookdeer3, 9, 5, "/>           \\>");
+
+    /* lookdeer4 */
+    mvwaddstr(lookdeer4, 0, 16, "\\/     \\/");
+    mvwaddstr(lookdeer4, 1, 17, "\\Y/ \\Y/");
+    mvwaddstr(lookdeer4, 2, 19, "\\=/");
+    mvwaddstr(lookdeer4, 3, 17, "^\\o o/^");
+    mvwaddstr(lookdeer4, 4, 17, "//( )");
+    mvwaddstr(lookdeer4, 5, 7, "^~~~~~~~~// \\O/");
+    mvwaddstr(lookdeer4, 6, 6, "( )______( /");
+    mvwaddstr(lookdeer4, 7, 5, "(/          \\");
+    mvwaddstr(lookdeer4, 8, 0, "v___=             ----^");
 
 	/***********************************************/
-	cbreak();
-	nodelay(stdscr,TRUE);
-	for (;;) {
-	  clear();
-	  werase(treescrn);
-	  touchwin(w_del_msg);
-	  touchwin(treescrn);
-	  werase(treescrn2);
-	  touchwin(treescrn2);
-	  werase(treescrn8);
-	  touchwin(treescrn8);
-	  refresh();
-	  look_out(150);
-	  boxit();
-	  refresh();
-	  look_out(150);
-	  seas();
-	  refresh();
-	  look_out(150);
-	  greet();
-	  refresh();
-	  look_out(150);
-	  fromwho();
-	  refresh();
-	  look_out(150);
-	  tree();
-	  look_out(150);
-	  balls();
-	  look_out(150);
-	  star();
-	  look_out(150);
-	  strng1();
-	  strng2();
-	  strng3();
-	  strng4();
-	  strng5();
-
+    cbreak();
+    nodelay(stdscr, TRUE);
+    for (;;) {
+	clear();
+	werase(treescrn);
+	touchwin(w_del_msg);
+	touchwin(treescrn);
+	werase(treescrn2);
+	touchwin(treescrn2);
+	werase(treescrn8);
+	touchwin(treescrn8);
+	refresh();
+	look_out(150);
+	boxit();
+	refresh();
+	look_out(150);
+	seas();
+	refresh();
+	look_out(150);
+	greet();
+	refresh();
+	look_out(150);
+	fromwho();
+	refresh();
+	look_out(150);
+	tree();
+	look_out(150);
+	balls();
+	look_out(150);
+	star();
+	look_out(150);
+	strng1();
+	strng2();
+	strng3();
+	strng4();
+	strng5();
 
 	/* set up the windows for our blinking trees */
 	/* **************************************** */
 	/* treescrn3 */
 
-	   overlay(treescrn, treescrn3);
+	overlay(treescrn, treescrn3);
 
-	   /*balls*/
-	   mvwaddch(treescrn3, 4, 18, ' ');
-	   mvwaddch(treescrn3, 7, 6, ' ');
-	   mvwaddch(treescrn3, 8, 19, ' ');
-	   mvwaddch(treescrn3, 11, 22, ' ');
+	/*balls */
+	mvwaddch(treescrn3, 4, 18, ' ');
+	mvwaddch(treescrn3, 7, 6, ' ');
+	mvwaddch(treescrn3, 8, 19, ' ');
+	mvwaddch(treescrn3, 11, 22, ' ');
 
-	   /*star*/
-	   mvwaddch(treescrn3, 0, 12, '*');
+	/*star */
+	mvwaddch(treescrn3, 0, 12, '*');
 
-	   /*strng1*/
-	   mvwaddch(treescrn3, 3, 11, ' ');
+	/*strng1 */
+	mvwaddch(treescrn3, 3, 11, ' ');
 
-	   /*strng2*/
-	   mvwaddch(treescrn3, 5, 13, ' ');
-	   mvwaddch(treescrn3, 6, 10, ' ');
+	/*strng2 */
+	mvwaddch(treescrn3, 5, 13, ' ');
+	mvwaddch(treescrn3, 6, 10, ' ');
 
-	   /*strng3*/
-	   mvwaddch(treescrn3, 7, 16, ' ');
-	   mvwaddch(treescrn3, 7, 14, ' ');
+	/*strng3 */
+	mvwaddch(treescrn3, 7, 16, ' ');
+	mvwaddch(treescrn3, 7, 14, ' ');
 
-	           /*strng4*/
-	   mvwaddch(treescrn3, 10, 13, ' ');
-	   mvwaddch(treescrn3, 10, 10, ' ');
-	   mvwaddch(treescrn3, 11, 8, ' ');
-
-	           /*strng5*/
-	   mvwaddch(treescrn3, 11, 18, ' ');
-	   mvwaddch(treescrn3, 12, 13, ' ');
+	/*strng4 */
+	mvwaddch(treescrn3, 10, 13, ' ');
+	mvwaddch(treescrn3, 10, 10, ' ');
+	mvwaddch(treescrn3, 11, 8, ' ');
 
+	/*strng5 */
+	mvwaddch(treescrn3, 11, 18, ' ');
+	mvwaddch(treescrn3, 12, 13, ' ');
 
 	/* treescrn4 */
 
-	   overlay(treescrn, treescrn4);
-
-	   /*balls*/
-	   mvwaddch(treescrn4, 3, 9, ' ');
-	   mvwaddch(treescrn4, 4, 16, ' ');
-	   mvwaddch(treescrn4, 7, 6, ' ');
-	   mvwaddch(treescrn4, 8, 19, ' ');
-	   mvwaddch(treescrn4, 11, 2, ' ');
-	   mvwaddch(treescrn4, 12, 23, ' ');
+	overlay(treescrn, treescrn4);
 
-	   /*star*/
-	   wstandout(treescrn4);
-	   mvwaddch(treescrn4, 0, 12, '*');
-	   wstandend(treescrn4);
+	/*balls */
+	mvwaddch(treescrn4, 3, 9, ' ');
+	mvwaddch(treescrn4, 4, 16, ' ');
+	mvwaddch(treescrn4, 7, 6, ' ');
+	mvwaddch(treescrn4, 8, 19, ' ');
+	mvwaddch(treescrn4, 11, 2, ' ');
+	mvwaddch(treescrn4, 12, 23, ' ');
 
-	   /*strng1*/
-	   mvwaddch(treescrn4, 3, 13, ' ');
+	/*star */
+	wstandout(treescrn4);
+	mvwaddch(treescrn4, 0, 12, '*');
+	wstandend(treescrn4);
 
-	   /*strng2*/
+	/*strng1 */
+	mvwaddch(treescrn4, 3, 13, ' ');
 
-	   /*strng3*/
-	   mvwaddch(treescrn4, 7, 15, ' ');
-	   mvwaddch(treescrn4, 8, 11, ' ');
+	/*strng2 */
 
-	   /*strng4*/
-	   mvwaddch(treescrn4, 9, 16, ' ');
-	   mvwaddch(treescrn4, 10, 12, ' ');
-	   mvwaddch(treescrn4, 11, 8, ' ');
+	/*strng3 */
+	mvwaddch(treescrn4, 7, 15, ' ');
+	mvwaddch(treescrn4, 8, 11, ' ');
 
-	   /*strng5*/
-	   mvwaddch(treescrn4, 11, 18, ' ');
-	   mvwaddch(treescrn4, 12, 14, ' ');
+	/*strng4 */
+	mvwaddch(treescrn4, 9, 16, ' ');
+	mvwaddch(treescrn4, 10, 12, ' ');
+	mvwaddch(treescrn4, 11, 8, ' ');
 
+	/*strng5 */
+	mvwaddch(treescrn4, 11, 18, ' ');
+	mvwaddch(treescrn4, 12, 14, ' ');
 
 	/* treescrn5 */
 
-	   overlay(treescrn, treescrn5);
+	overlay(treescrn, treescrn5);
 
-	   /*balls*/
-	   mvwaddch(treescrn5, 3, 15, ' ');
-	   mvwaddch(treescrn5, 10, 20, ' ');
-	   mvwaddch(treescrn5, 12, 1, ' ');
+	/*balls */
+	mvwaddch(treescrn5, 3, 15, ' ');
+	mvwaddch(treescrn5, 10, 20, ' ');
+	mvwaddch(treescrn5, 12, 1, ' ');
 
-	   /*star*/
-	   mvwaddch(treescrn5, 0, 12, '*');
+	/*star */
+	mvwaddch(treescrn5, 0, 12, '*');
 
-	   /*strng1*/
-	   mvwaddch(treescrn5, 3, 11, ' ');
+	/*strng1 */
+	mvwaddch(treescrn5, 3, 11, ' ');
 
-	   /*strng2*/
-	   mvwaddch(treescrn5, 5, 12, ' ');
+	/*strng2 */
+	mvwaddch(treescrn5, 5, 12, ' ');
 
-	   /*strng3*/
-	   mvwaddch(treescrn5, 7, 14, ' ');
-	   mvwaddch(treescrn5, 8, 10, ' ');
+	/*strng3 */
+	mvwaddch(treescrn5, 7, 14, ' ');
+	mvwaddch(treescrn5, 8, 10, ' ');
 
-	   /*strng4*/
-	   mvwaddch(treescrn5, 9, 15, ' ');
-	   mvwaddch(treescrn5, 10, 11, ' ');
-	   mvwaddch(treescrn5, 11, 7, ' ');
+	/*strng4 */
+	mvwaddch(treescrn5, 9, 15, ' ');
+	mvwaddch(treescrn5, 10, 11, ' ');
+	mvwaddch(treescrn5, 11, 7, ' ');
 
-	   /*strng5*/
-	   mvwaddch(treescrn5, 11, 17, ' ');
-	   mvwaddch(treescrn5, 12, 13, ' ');
+	/*strng5 */
+	mvwaddch(treescrn5, 11, 17, ' ');
+	mvwaddch(treescrn5, 12, 13, ' ');
 
 	/* treescrn6 */
 
-	   overlay(treescrn, treescrn6);
+	overlay(treescrn, treescrn6);
 
-	   /*balls*/
-	   mvwaddch(treescrn6, 6, 7, ' ');
-	   mvwaddch(treescrn6, 7, 18, ' ');
-	   mvwaddch(treescrn6, 10, 4, ' ');
-	   mvwaddch(treescrn6, 11, 23, ' ');
+	/*balls */
+	mvwaddch(treescrn6, 6, 7, ' ');
+	mvwaddch(treescrn6, 7, 18, ' ');
+	mvwaddch(treescrn6, 10, 4, ' ');
+	mvwaddch(treescrn6, 11, 23, ' ');
 
-	   /*star*/
-	   wstandout(treescrn6);
-	   mvwaddch(treescrn6, 0, 12, '*');
-	   wstandend(treescrn6);
+	/*star */
+	wstandout(treescrn6);
+	mvwaddch(treescrn6, 0, 12, '*');
+	wstandend(treescrn6);
 
-	   /*strng1*/
+	/*strng1 */
 
-	   /*strng2*/
-	   mvwaddch(treescrn6, 5, 11, ' ');
+	/*strng2 */
+	mvwaddch(treescrn6, 5, 11, ' ');
 
-	   /*strng3*/
-	   mvwaddch(treescrn6, 7, 13, ' ');
-	   mvwaddch(treescrn6, 8, 9, ' ');
+	/*strng3 */
+	mvwaddch(treescrn6, 7, 13, ' ');
+	mvwaddch(treescrn6, 8, 9, ' ');
 
-	   /*strng4*/
-	   mvwaddch(treescrn6, 9, 14, ' ');
-	   mvwaddch(treescrn6, 10, 10, ' ');
-	   mvwaddch(treescrn6, 11, 6, ' ');
+	/*strng4 */
+	mvwaddch(treescrn6, 9, 14, ' ');
+	mvwaddch(treescrn6, 10, 10, ' ');
+	mvwaddch(treescrn6, 11, 6, ' ');
 
-	   /*strng5*/
-	   mvwaddch(treescrn6, 11, 16, ' ');
-	   mvwaddch(treescrn6, 12, 12, ' ');
+	/*strng5 */
+	mvwaddch(treescrn6, 11, 16, ' ');
+	mvwaddch(treescrn6, 12, 12, ' ');
 
 	/* treescrn7 */
 
-	   overlay(treescrn, treescrn7);
-
-	   /*balls*/
-	   mvwaddch(treescrn7, 3, 15, ' ');
-	   mvwaddch(treescrn7, 6, 7, ' ');
-	   mvwaddch(treescrn7, 7, 18, ' ');
-	   mvwaddch(treescrn7, 10, 4, ' ');
-	   mvwaddch(treescrn7, 11, 22, ' ');
+	overlay(treescrn, treescrn7);
 
-	   /*star*/
-	   mvwaddch(treescrn7, 0, 12, '*');
+	/*balls */
+	mvwaddch(treescrn7, 3, 15, ' ');
+	mvwaddch(treescrn7, 6, 7, ' ');
+	mvwaddch(treescrn7, 7, 18, ' ');
+	mvwaddch(treescrn7, 10, 4, ' ');
+	mvwaddch(treescrn7, 11, 22, ' ');
 
-	   /*strng1*/
-	   mvwaddch(treescrn7, 3, 12, ' ');
+	/*star */
+	mvwaddch(treescrn7, 0, 12, '*');
 
-	   /*strng2*/
-	   mvwaddch(treescrn7, 5, 13, ' ');
-	   mvwaddch(treescrn7, 6, 9, ' ');
+	/*strng1 */
+	mvwaddch(treescrn7, 3, 12, ' ');
 
-	   /*strng3*/
-	   mvwaddch(treescrn7, 7, 15, ' ');
-	   mvwaddch(treescrn7, 8, 11, ' ');
+	/*strng2 */
+	mvwaddch(treescrn7, 5, 13, ' ');
+	mvwaddch(treescrn7, 6, 9, ' ');
 
-	   /*strng4*/
-	   mvwaddch(treescrn7, 9, 16, ' ');
-	   mvwaddch(treescrn7, 10, 12, ' ');
-	   mvwaddch(treescrn7, 11, 8, ' ');
+	/*strng3 */
+	mvwaddch(treescrn7, 7, 15, ' ');
+	mvwaddch(treescrn7, 8, 11, ' ');
 
-	   /*strng5*/
-	   mvwaddch(treescrn7, 11, 18, ' ');
-	   mvwaddch(treescrn7, 12, 14, ' ');
+	/*strng4 */
+	mvwaddch(treescrn7, 9, 16, ' ');
+	mvwaddch(treescrn7, 10, 12, ' ');
+	mvwaddch(treescrn7, 11, 8, ' ');
 
+	/*strng5 */
+	mvwaddch(treescrn7, 11, 18, ' ');
+	mvwaddch(treescrn7, 12, 14, ' ');
 
-	   look_out(150);
-	   reindeer();
+	look_out(150);
+	reindeer();
 
-	   touchwin(w_holiday);
-	   wrefresh(w_holiday);
-	   wrefresh(w_del_msg);
+	touchwin(w_holiday);
+	wrefresh(w_holiday);
+	wrefresh(w_del_msg);
 
-	   look_out(500);
-	   for(loopy = 0;loopy < 100;loopy++) {
-	    	blinkit();
-	   }
+	look_out(500);
+	for (loopy = 0; loopy < 100; loopy++) {
+	    blinkit();
+	}
 
 #ifdef NOLOOP
-	   done(0);
+	done(0);
 #endif
-	}
-	/*NOTREACHED*/
+    }
+    /*NOTREACHED */
 }
 
-static int boxit(void)
+static int
+boxit(void)
 {
- int x = 0;
+    int x = 0;
 
-	while(x < 20) {
-	  mvaddch(x, 7, '|');
-	  ++x;
-	}
+    while (x < 20) {
+	mvaddch(x, 7, '|');
+	++x;
+    }
 
-	x = 8;
+    x = 8;
 
-	while(x < 80) {
-	  mvaddch(19, x, '_');
-	  ++x;
-	}
+    while (x < 80) {
+	mvaddch(19, x, '_');
+	++x;
+    }
 
-	x = 0;
+    x = 0;
 
-	while(x < 80) {
-	  mvaddch(22, x, '_');
-	  ++x;
-	}
+    while (x < 80) {
+	mvaddch(22, x, '_');
+	++x;
+    }
 
-	return( 0 );
+    return (0);
 }
 
-static int seas(void)
+static int
+seas(void)
 {
-	mvaddch(4, 1, 'S');
-	mvaddch(6, 1, 'E');
-	mvaddch(8, 1, 'A');
-	mvaddch(10, 1, 'S');
-	mvaddch(12, 1, 'O');
-	mvaddch(14, 1, 'N');
-	mvaddch(16, 1, '`');
-	mvaddch(18, 1, 'S');
-
-	return( 0 );
+    mvaddch(4, 1, 'S');
+    mvaddch(6, 1, 'E');
+    mvaddch(8, 1, 'A');
+    mvaddch(10, 1, 'S');
+    mvaddch(12, 1, 'O');
+    mvaddch(14, 1, 'N');
+    mvaddch(16, 1, '`');
+    mvaddch(18, 1, 'S');
+
+    return (0);
 }
 
-
-static int greet(void)
+static int
+greet(void)
 {
-	mvaddch(3, 5, 'G');
-	mvaddch(5, 5, 'R');
-	mvaddch(7, 5, 'E');
-	mvaddch(9, 5, 'E');
-	mvaddch(11, 5, 'T');
-	mvaddch(13, 5, 'I');
-	mvaddch(15, 5, 'N');
-	mvaddch(17, 5, 'G');
-	mvaddch(19, 5, 'S');
-
-	return( 0 );
+    mvaddch(3, 5, 'G');
+    mvaddch(5, 5, 'R');
+    mvaddch(7, 5, 'E');
+    mvaddch(9, 5, 'E');
+    mvaddch(11, 5, 'T');
+    mvaddch(13, 5, 'I');
+    mvaddch(15, 5, 'N');
+    mvaddch(17, 5, 'G');
+    mvaddch(19, 5, 'S');
+
+    return (0);
 }
 
-
-static int fromwho(void)
+static int
+fromwho(void)
 {
-	mvaddstr(21, 13, FROMWHO);
-	return( 0 );
+    mvaddstr(21, 13, FROMWHO);
+    return (0);
 }
 
-static int tree(void)
+static int
+tree(void)
 {
-	set_color(treescrn, COLOR_GREEN);
-	mvwaddch(treescrn, 1, 11, (chtype)'/');
-	mvwaddch(treescrn, 2, 11, (chtype)'/');
-	mvwaddch(treescrn, 3, 10, (chtype)'/');
-	mvwaddch(treescrn, 4, 9, (chtype)'/');
-	mvwaddch(treescrn, 5, 9, (chtype)'/');
-	mvwaddch(treescrn, 6, 8, (chtype)'/');
-	mvwaddch(treescrn, 7, 7, (chtype)'/');
-	mvwaddch(treescrn, 8, 6, (chtype)'/');
-	mvwaddch(treescrn, 9, 6, (chtype)'/');
-	mvwaddch(treescrn, 10, 5, (chtype)'/');
-	mvwaddch(treescrn, 11, 3, (chtype)'/');
-	mvwaddch(treescrn, 12, 2, (chtype)'/');
-
-	mvwaddch(treescrn, 1, 13, (chtype)'\\');
-	mvwaddch(treescrn, 2, 13, (chtype)'\\');
-	mvwaddch(treescrn, 3, 14, (chtype)'\\');
-	mvwaddch(treescrn, 4, 15, (chtype)'\\');
-	mvwaddch(treescrn, 5, 15, (chtype)'\\');
-	mvwaddch(treescrn, 6, 16, (chtype)'\\');
-	mvwaddch(treescrn, 7, 17, (chtype)'\\');
-	mvwaddch(treescrn, 8, 18, (chtype)'\\');
-	mvwaddch(treescrn, 9, 18, (chtype)'\\');
-	mvwaddch(treescrn, 10, 19, (chtype)'\\');
-	mvwaddch(treescrn, 11, 21, (chtype)'\\');
-	mvwaddch(treescrn, 12, 22, (chtype)'\\');
-
-	mvwaddch(treescrn, 4, 10, (chtype)'_');
-	mvwaddch(treescrn, 4, 14, (chtype)'_');
-	mvwaddch(treescrn, 8, 7, (chtype)'_');
-	mvwaddch(treescrn, 8, 17, (chtype)'_');
-
-	mvwaddstr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
-
-	mvwaddstr(treescrn, 14, 11, "| |");
-	mvwaddstr(treescrn, 15, 11, "|_|");
-
-	unset_color(treescrn);
-	wrefresh(treescrn);
-	wrefresh(w_del_msg);
-
-	return( 0 );
+    set_color(treescrn, COLOR_GREEN);
+    mvwaddch(treescrn, 1, 11, (chtype) '/');
+    mvwaddch(treescrn, 2, 11, (chtype) '/');
+    mvwaddch(treescrn, 3, 10, (chtype) '/');
+    mvwaddch(treescrn, 4, 9, (chtype) '/');
+    mvwaddch(treescrn, 5, 9, (chtype) '/');
+    mvwaddch(treescrn, 6, 8, (chtype) '/');
+    mvwaddch(treescrn, 7, 7, (chtype) '/');
+    mvwaddch(treescrn, 8, 6, (chtype) '/');
+    mvwaddch(treescrn, 9, 6, (chtype) '/');
+    mvwaddch(treescrn, 10, 5, (chtype) '/');
+    mvwaddch(treescrn, 11, 3, (chtype) '/');
+    mvwaddch(treescrn, 12, 2, (chtype) '/');
+
+    mvwaddch(treescrn, 1, 13, (chtype) '\\');
+    mvwaddch(treescrn, 2, 13, (chtype) '\\');
+    mvwaddch(treescrn, 3, 14, (chtype) '\\');
+    mvwaddch(treescrn, 4, 15, (chtype) '\\');
+    mvwaddch(treescrn, 5, 15, (chtype) '\\');
+    mvwaddch(treescrn, 6, 16, (chtype) '\\');
+    mvwaddch(treescrn, 7, 17, (chtype) '\\');
+    mvwaddch(treescrn, 8, 18, (chtype) '\\');
+    mvwaddch(treescrn, 9, 18, (chtype) '\\');
+    mvwaddch(treescrn, 10, 19, (chtype) '\\');
+    mvwaddch(treescrn, 11, 21, (chtype) '\\');
+    mvwaddch(treescrn, 12, 22, (chtype) '\\');
+
+    mvwaddch(treescrn, 4, 10, (chtype) '_');
+    mvwaddch(treescrn, 4, 14, (chtype) '_');
+    mvwaddch(treescrn, 8, 7, (chtype) '_');
+    mvwaddch(treescrn, 8, 17, (chtype) '_');
+
+    mvwaddstr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
+
+    mvwaddstr(treescrn, 14, 11, "| |");
+    mvwaddstr(treescrn, 15, 11, "|_|");
+
+    unset_color(treescrn);
+    wrefresh(treescrn);
+    wrefresh(w_del_msg);
+
+    return (0);
 }
 
-
-static int balls(void)
+static int
+balls(void)
 {
-	overlay(treescrn, treescrn2);
-
-	set_color(treescrn2, COLOR_BLUE);
-	mvwaddch(treescrn2, 3, 9, (chtype)'@');
-	mvwaddch(treescrn2, 3, 15, (chtype)'@');
-	mvwaddch(treescrn2, 4, 8, (chtype)'@');
-	mvwaddch(treescrn2, 4, 16, (chtype)'@');
-	mvwaddch(treescrn2, 5, 7, (chtype)'@');
-	mvwaddch(treescrn2, 5, 17, (chtype)'@');
-	mvwaddch(treescrn2, 7, 6, (chtype)'@');
-	mvwaddch(treescrn2, 7, 18, (chtype)'@');
-	mvwaddch(treescrn2, 8, 5, (chtype)'@');
-	mvwaddch(treescrn2, 8, 19, (chtype)'@');
-	mvwaddch(treescrn2, 10, 4, (chtype)'@');
-	mvwaddch(treescrn2, 10, 20, (chtype)'@');
-	mvwaddch(treescrn2, 11, 2, (chtype)'@');
-	mvwaddch(treescrn2, 11, 22, (chtype)'@');
-	mvwaddch(treescrn2, 12, 1, (chtype)'@');
-	mvwaddch(treescrn2, 12, 23, (chtype)'@');
-
-	unset_color(treescrn2);
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    overlay(treescrn, treescrn2);
+
+    set_color(treescrn2, COLOR_BLUE);
+    mvwaddch(treescrn2, 3, 9, (chtype) '@');
+    mvwaddch(treescrn2, 3, 15, (chtype) '@');
+    mvwaddch(treescrn2, 4, 8, (chtype) '@');
+    mvwaddch(treescrn2, 4, 16, (chtype) '@');
+    mvwaddch(treescrn2, 5, 7, (chtype) '@');
+    mvwaddch(treescrn2, 5, 17, (chtype) '@');
+    mvwaddch(treescrn2, 7, 6, (chtype) '@');
+    mvwaddch(treescrn2, 7, 18, (chtype) '@');
+    mvwaddch(treescrn2, 8, 5, (chtype) '@');
+    mvwaddch(treescrn2, 8, 19, (chtype) '@');
+    mvwaddch(treescrn2, 10, 4, (chtype) '@');
+    mvwaddch(treescrn2, 10, 20, (chtype) '@');
+    mvwaddch(treescrn2, 11, 2, (chtype) '@');
+    mvwaddch(treescrn2, 11, 22, (chtype) '@');
+    mvwaddch(treescrn2, 12, 1, (chtype) '@');
+    mvwaddch(treescrn2, 12, 23, (chtype) '@');
+
+    unset_color(treescrn2);
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-static int star(void)
+static int
+star(void)
 {
-	wattrset(treescrn2, A_BOLD | A_BLINK);
-	set_color(treescrn2, COLOR_YELLOW);
+    wattrset(treescrn2, A_BOLD | A_BLINK);
+    set_color(treescrn2, COLOR_YELLOW);
 
-	mvwaddch(treescrn2, 0, 12, (chtype)'*');
-	wstandend(treescrn2);
+    mvwaddch(treescrn2, 0, 12, (chtype) '*');
+    wstandend(treescrn2);
 
-	unset_color(treescrn2);
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    unset_color(treescrn2);
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-static int strng1(void)
+static int
+strng1(void)
 {
-	wattrset(treescrn2, A_BOLD | A_BLINK);
-	set_color(treescrn2, COLOR_WHITE);
+    wattrset(treescrn2, A_BOLD | A_BLINK);
+    set_color(treescrn2, COLOR_WHITE);
 
-	mvwaddch(treescrn2, 3, 13, (chtype)'\'');
-	mvwaddch(treescrn2, 3, 12, (chtype)':');
-	mvwaddch(treescrn2, 3, 11, (chtype)'.');
+    mvwaddch(treescrn2, 3, 13, (chtype) '\'');
+    mvwaddch(treescrn2, 3, 12, (chtype) ':');
+    mvwaddch(treescrn2, 3, 11, (chtype) '.');
 
-	wattroff(treescrn2, A_BOLD | A_BLINK);
-	unset_color(treescrn2);
+    wattroff(treescrn2, A_BOLD | A_BLINK);
+    unset_color(treescrn2);
 
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-static int strng2(void)
+static int
+strng2(void)
 {
-	wattrset(treescrn2, A_BOLD | A_BLINK);
-	set_color(treescrn2, COLOR_WHITE);
-
-	mvwaddch(treescrn2, 5, 14, (chtype)'\'');
-	mvwaddch(treescrn2, 5, 13, (chtype)':');
-	mvwaddch(treescrn2, 5, 12, (chtype)'.');
-	mvwaddch(treescrn2, 5, 11, (chtype)',');
-	mvwaddch(treescrn2, 6, 10, (chtype)'\'');
-	mvwaddch(treescrn2, 6, 9, (chtype)':');
-
-	wattroff(treescrn2, A_BOLD | A_BLINK);
-	unset_color(treescrn2);
-
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    wattrset(treescrn2, A_BOLD | A_BLINK);
+    set_color(treescrn2, COLOR_WHITE);
+
+    mvwaddch(treescrn2, 5, 14, (chtype) '\'');
+    mvwaddch(treescrn2, 5, 13, (chtype) ':');
+    mvwaddch(treescrn2, 5, 12, (chtype) '.');
+    mvwaddch(treescrn2, 5, 11, (chtype) ',');
+    mvwaddch(treescrn2, 6, 10, (chtype) '\'');
+    mvwaddch(treescrn2, 6, 9, (chtype) ':');
+
+    wattroff(treescrn2, A_BOLD | A_BLINK);
+    unset_color(treescrn2);
+
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-static int strng3(void)
+static int
+strng3(void)
 {
-	wattrset(treescrn2, A_BOLD | A_BLINK);
-	set_color(treescrn2, COLOR_WHITE);
-
-	mvwaddch(treescrn2, 7, 16, (chtype)'\'');
-	mvwaddch(treescrn2, 7, 15, (chtype)':');
-	mvwaddch(treescrn2, 7, 14, (chtype)'.');
-	mvwaddch(treescrn2, 7, 13, (chtype)',');
-	mvwaddch(treescrn2, 8, 12, (chtype)'\'');
-	mvwaddch(treescrn2, 8, 11, (chtype)':');
-	mvwaddch(treescrn2, 8, 10, (chtype)'.');
-	mvwaddch(treescrn2, 8, 9, (chtype)',');
-
-	wattroff(treescrn2, A_BOLD | A_BLINK);
-	unset_color(treescrn2);
-
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    wattrset(treescrn2, A_BOLD | A_BLINK);
+    set_color(treescrn2, COLOR_WHITE);
+
+    mvwaddch(treescrn2, 7, 16, (chtype) '\'');
+    mvwaddch(treescrn2, 7, 15, (chtype) ':');
+    mvwaddch(treescrn2, 7, 14, (chtype) '.');
+    mvwaddch(treescrn2, 7, 13, (chtype) ',');
+    mvwaddch(treescrn2, 8, 12, (chtype) '\'');
+    mvwaddch(treescrn2, 8, 11, (chtype) ':');
+    mvwaddch(treescrn2, 8, 10, (chtype) '.');
+    mvwaddch(treescrn2, 8, 9, (chtype) ',');
+
+    wattroff(treescrn2, A_BOLD | A_BLINK);
+    unset_color(treescrn2);
+
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-static int strng4(void)
+static int
+strng4(void)
 {
-	wattrset(treescrn2, A_BOLD | A_BLINK);
-	set_color(treescrn2, COLOR_WHITE);
-
-	mvwaddch(treescrn2, 9, 17, (chtype)'\'');
-	mvwaddch(treescrn2, 9, 16, (chtype)':');
-	mvwaddch(treescrn2, 9, 15, (chtype)'.');
-	mvwaddch(treescrn2, 9, 14, (chtype)',');
-	mvwaddch(treescrn2, 10, 13, (chtype)'\'');
-	mvwaddch(treescrn2, 10, 12, (chtype)':');
-	mvwaddch(treescrn2, 10, 11, (chtype)'.');
-	mvwaddch(treescrn2, 10, 10, (chtype)',');
-	mvwaddch(treescrn2, 11, 9, (chtype)'\'');
-	mvwaddch(treescrn2, 11, 8, (chtype)':');
-	mvwaddch(treescrn2, 11, 7, (chtype)'.');
-	mvwaddch(treescrn2, 11, 6, (chtype)',');
-	mvwaddch(treescrn2, 12, 5, (chtype)'\'');
-
-	wattroff(treescrn2, A_BOLD | A_BLINK);
-	unset_color(treescrn2);
-
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    wattrset(treescrn2, A_BOLD | A_BLINK);
+    set_color(treescrn2, COLOR_WHITE);
+
+    mvwaddch(treescrn2, 9, 17, (chtype) '\'');
+    mvwaddch(treescrn2, 9, 16, (chtype) ':');
+    mvwaddch(treescrn2, 9, 15, (chtype) '.');
+    mvwaddch(treescrn2, 9, 14, (chtype) ',');
+    mvwaddch(treescrn2, 10, 13, (chtype) '\'');
+    mvwaddch(treescrn2, 10, 12, (chtype) ':');
+    mvwaddch(treescrn2, 10, 11, (chtype) '.');
+    mvwaddch(treescrn2, 10, 10, (chtype) ',');
+    mvwaddch(treescrn2, 11, 9, (chtype) '\'');
+    mvwaddch(treescrn2, 11, 8, (chtype) ':');
+    mvwaddch(treescrn2, 11, 7, (chtype) '.');
+    mvwaddch(treescrn2, 11, 6, (chtype) ',');
+    mvwaddch(treescrn2, 12, 5, (chtype) '\'');
+
+    wattroff(treescrn2, A_BOLD | A_BLINK);
+    unset_color(treescrn2);
+
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-static int strng5(void)
+static int
+strng5(void)
 {
-	wattrset(treescrn2, A_BOLD | A_BLINK);
-	set_color(treescrn2, COLOR_WHITE);
-
-	mvwaddch(treescrn2, 11, 19, (chtype)'\'');
-	mvwaddch(treescrn2, 11, 18, (chtype)':');
-	mvwaddch(treescrn2, 11, 17, (chtype)'.');
-	mvwaddch(treescrn2, 11, 16, (chtype)',');
-	mvwaddch(treescrn2, 12, 15, (chtype)'\'');
-	mvwaddch(treescrn2, 12, 14, (chtype)':');
-	mvwaddch(treescrn2, 12, 13, (chtype)'.');
-	mvwaddch(treescrn2, 12, 12, (chtype)',');
-
-	wattroff(treescrn2, A_BOLD | A_BLINK);
-	unset_color(treescrn2);
-
-	/* save a fully lit tree */
-	overlay(treescrn2, treescrn);
-
-	wrefresh(treescrn2);
-	wrefresh(w_del_msg);
-	return( 0 );
+    wattrset(treescrn2, A_BOLD | A_BLINK);
+    set_color(treescrn2, COLOR_WHITE);
+
+    mvwaddch(treescrn2, 11, 19, (chtype) '\'');
+    mvwaddch(treescrn2, 11, 18, (chtype) ':');
+    mvwaddch(treescrn2, 11, 17, (chtype) '.');
+    mvwaddch(treescrn2, 11, 16, (chtype) ',');
+    mvwaddch(treescrn2, 12, 15, (chtype) '\'');
+    mvwaddch(treescrn2, 12, 14, (chtype) ':');
+    mvwaddch(treescrn2, 12, 13, (chtype) '.');
+    mvwaddch(treescrn2, 12, 12, (chtype) ',');
+
+    wattroff(treescrn2, A_BOLD | A_BLINK);
+    unset_color(treescrn2);
+
+    /* save a fully lit tree */
+    overlay(treescrn2, treescrn);
+
+    wrefresh(treescrn2);
+    wrefresh(w_del_msg);
+    return (0);
 }
 
-
-
-static int blinkit(void)
+static int
+blinkit(void)
 {
-static int cycle;
+    static int cycle;
 
-	if(cycle > 4) {
-	  cycle = 0;
-	}
+    if (cycle > 4) {
+	cycle = 0;
+    }
 
+    touchwin(treescrn8);
 
-	touchwin(treescrn8);
-
-	switch(cycle) {
-	  case 0:
-	             overlay(treescrn3, treescrn8);
-	             wrefresh(treescrn8);
-	             wrefresh(w_del_msg);
-	             break;
-	  case 1:
-	             overlay(treescrn4, treescrn8);
-	             wrefresh(treescrn8);
-	             wrefresh(w_del_msg);
-	             break;
-	  case 2:
-	             overlay(treescrn5, treescrn8);
-	             wrefresh(treescrn8);
-	             wrefresh(w_del_msg);
-	             break;
-	  case 3:
-	             overlay(treescrn6, treescrn8);
-	             wrefresh(treescrn8);
-	             wrefresh(w_del_msg);
-	             break;
-	  case 4:
-	             overlay(treescrn7, treescrn8);
-	             wrefresh(treescrn8);
-	             wrefresh(w_del_msg);
-	             break;
-	}
-	 touchwin(treescrn8);
+    switch (cycle) {
+    case 0:
+	overlay(treescrn3, treescrn8);
+	wrefresh(treescrn8);
+	wrefresh(w_del_msg);
+	break;
+    case 1:
+	overlay(treescrn4, treescrn8);
+	wrefresh(treescrn8);
+	wrefresh(w_del_msg);
+	break;
+    case 2:
+	overlay(treescrn5, treescrn8);
+	wrefresh(treescrn8);
+	wrefresh(w_del_msg);
+	break;
+    case 3:
+	overlay(treescrn6, treescrn8);
+	wrefresh(treescrn8);
+	wrefresh(w_del_msg);
+	break;
+    case 4:
+	overlay(treescrn7, treescrn8);
+	wrefresh(treescrn8);
+	wrefresh(w_del_msg);
+	break;
+    }
+    touchwin(treescrn8);
 
-	 /*ALL ON***************************************************/
+    /*ALL ON************************************************** */
 
-	 overlay(treescrn, treescrn8);
-	 wrefresh(treescrn8);
-	 wrefresh(w_del_msg);
+    overlay(treescrn, treescrn8);
+    wrefresh(treescrn8);
+    wrefresh(w_del_msg);
 
-	++cycle;
-	return( 0 );
+    ++cycle;
+    return (0);
 }
 
 static void
 deer_step(WINDOW *win, int y, int x)
 {
-	    mvwin(win, y, x);
-	    wrefresh(win);
-	    wrefresh(w_del_msg);
-	    look_out(5);
+    mvwin(win, y, x);
+    wrefresh(win);
+    wrefresh(w_del_msg);
+    look_out(5);
 }
 
-static int reindeer(void)
+static int
+reindeer(void)
 {
- int looper;
- y_pos = 0;
-
+    int looper;
+    y_pos = 0;
 
-	for(x_pos = 70; x_pos > 62; x_pos--) {
-	  if(x_pos < 62) {
+    for (x_pos = 70; x_pos > 62; x_pos--) {
+	if (x_pos < 62) {
 	    y_pos = 1;
-	  }
-	  for(looper = 0; looper < 4; looper++) {
-	    mvwaddch(dotdeer0, y_pos, x_pos, (chtype)'.');
+	}
+	for (looper = 0; looper < 4; looper++) {
+	    mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '.');
 	    wrefresh(dotdeer0);
 	    wrefresh(w_del_msg);
 	    werase(dotdeer0);
 	    wrefresh(dotdeer0);
 	    wrefresh(w_del_msg);
 	    look_out(50);
-	  }
 	}
+    }
 
-	y_pos = 2;
+    y_pos = 2;
 
-	for(; x_pos > 50; x_pos--) {
-	  for(looper = 0; looper < 4; looper++) {
+    for (; x_pos > 50; x_pos--) {
+	for (looper = 0; looper < 4; looper++) {
 
-	    if(x_pos < 56) {
-	      y_pos = 3;
+	    if (x_pos < 56) {
+		y_pos = 3;
 
-	      mvwaddch(stardeer0, y_pos, x_pos, (chtype)'*');
-	      wrefresh(stardeer0);
-	      wrefresh(w_del_msg);
-	      werase(stardeer0);
-	      wrefresh(stardeer0);
-	      wrefresh(w_del_msg);
+		mvwaddch(stardeer0, y_pos, x_pos, (chtype) '*');
+		wrefresh(stardeer0);
+		wrefresh(w_del_msg);
+		werase(stardeer0);
+		wrefresh(stardeer0);
+		wrefresh(w_del_msg);
 	    } else {
-	      mvwaddch(dotdeer0, y_pos, x_pos, (chtype)'*');
-	      wrefresh(dotdeer0);
-	      wrefresh(w_del_msg);
-	      werase(dotdeer0);
-	      wrefresh(dotdeer0);
-	      wrefresh(w_del_msg);
+		mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '*');
+		wrefresh(dotdeer0);
+		wrefresh(w_del_msg);
+		werase(dotdeer0);
+		wrefresh(dotdeer0);
+		wrefresh(w_del_msg);
 	    }
-	  }
 	}
+    }
 
-	x_pos = 58;
+    x_pos = 58;
 
-	for(y_pos = 2; y_pos < 5; y_pos++) {
+    for (y_pos = 2; y_pos < 5; y_pos++) {
 
-	  touchwin(lildeer0);
-	  wrefresh(lildeer0);
-	  wrefresh(w_del_msg);
+	touchwin(lildeer0);
+	wrefresh(lildeer0);
+	wrefresh(w_del_msg);
 
-	  for(looper = 0; looper < 4; looper++) {
+	for (looper = 0; looper < 4; looper++) {
 	    deer_step(lildeer3, y_pos, x_pos);
 	    deer_step(lildeer2, y_pos, x_pos);
 	    deer_step(lildeer1, y_pos, x_pos);
@@ -1057,19 +1069,18 @@ static int reindeer(void)
 	    wrefresh(w_del_msg);
 
 	    x_pos -= 2;
-	  }
 	}
+    }
 
+    x_pos = 35;
 
-	x_pos = 35;
+    for (y_pos = 5; y_pos < 10; y_pos++) {
 
-	for(y_pos = 5; y_pos < 10; y_pos++) {
-
-	  touchwin(middeer0);
-	  wrefresh(middeer0);
-	  wrefresh(w_del_msg);
+	touchwin(middeer0);
+	wrefresh(middeer0);
+	wrefresh(w_del_msg);
 
-	  for(looper = 0; looper < 2; looper++) {
+	for (looper = 0; looper < 2; looper++) {
 	    deer_step(middeer3, y_pos, x_pos);
 	    deer_step(middeer2, y_pos, x_pos);
 	    deer_step(middeer1, y_pos, x_pos);
@@ -1081,40 +1092,40 @@ static int reindeer(void)
 	    wrefresh(w_del_msg);
 
 	    x_pos -= 3;
-	  }
 	}
+    }
 
-	look_out(300);
+    look_out(300);
 
-	y_pos = 1;
+    y_pos = 1;
 
-	for(x_pos = 8; x_pos < 16; x_pos++) {
-	    deer_step(bigdeer4, y_pos, x_pos);
-	    deer_step(bigdeer3, y_pos, x_pos);
-	    deer_step(bigdeer2, y_pos, x_pos);
-	    deer_step(bigdeer1, y_pos, x_pos);
-	    deer_step(bigdeer2, y_pos, x_pos);
-	    deer_step(bigdeer3, y_pos, x_pos);
-	    deer_step(bigdeer4, y_pos, x_pos);
-	    deer_step(bigdeer0, y_pos, x_pos);
-	}
+    for (x_pos = 8; x_pos < 16; x_pos++) {
+	deer_step(bigdeer4, y_pos, x_pos);
+	deer_step(bigdeer3, y_pos, x_pos);
+	deer_step(bigdeer2, y_pos, x_pos);
+	deer_step(bigdeer1, y_pos, x_pos);
+	deer_step(bigdeer2, y_pos, x_pos);
+	deer_step(bigdeer3, y_pos, x_pos);
+	deer_step(bigdeer4, y_pos, x_pos);
+	deer_step(bigdeer0, y_pos, x_pos);
+    }
 
-	  --x_pos;
+    --x_pos;
 
-	  for(looper = 0; looper < 6; looper++) {
-	    deer_step(lookdeer4, y_pos, x_pos);
-	    deer_step(lookdeer3, y_pos, x_pos);
-	    deer_step(lookdeer2, y_pos, x_pos);
-	    deer_step(lookdeer1, y_pos, x_pos);
-	    deer_step(lookdeer2, y_pos, x_pos);
-	    deer_step(lookdeer3, y_pos, x_pos);
-	    deer_step(lookdeer4, y_pos, x_pos);
-	  }
+    for (looper = 0; looper < 6; looper++) {
+	deer_step(lookdeer4, y_pos, x_pos);
+	deer_step(lookdeer3, y_pos, x_pos);
+	deer_step(lookdeer2, y_pos, x_pos);
+	deer_step(lookdeer1, y_pos, x_pos);
+	deer_step(lookdeer2, y_pos, x_pos);
+	deer_step(lookdeer3, y_pos, x_pos);
+	deer_step(lookdeer4, y_pos, x_pos);
+    }
 
-	  deer_step(lookdeer0, y_pos, x_pos);
+    deer_step(lookdeer0, y_pos, x_pos);
 
-	for(; y_pos < 10; y_pos++) {
-	  for(looper = 0; looper < 2; looper++) {
+    for (; y_pos < 10; y_pos++) {
+	for (looper = 0; looper < 2; looper++) {
 	    deer_step(bigdeer4, y_pos, x_pos);
 	    deer_step(bigdeer3, y_pos, x_pos);
 	    deer_step(bigdeer2, y_pos, x_pos);
@@ -1122,27 +1133,28 @@ static int reindeer(void)
 	    deer_step(bigdeer2, y_pos, x_pos);
 	    deer_step(bigdeer3, y_pos, x_pos);
 	    deer_step(bigdeer4, y_pos, x_pos);
-	  }
-	  deer_step(bigdeer0, y_pos, x_pos);
 	}
+	deer_step(bigdeer0, y_pos, x_pos);
+    }
 
-	--y_pos;
+    --y_pos;
 
-	deer_step(lookdeer3, y_pos, x_pos);
-	return( 0 );
+    deer_step(lookdeer3, y_pos, x_pos);
+    return (0);
 }
 
-static RETSIGTYPE done(int sig GCC_UNUSED)
+static RETSIGTYPE
+done(int sig GCC_UNUSED)
 {
-	signal(SIGINT,done);
-	signal(SIGTERM,done);
+    signal(SIGINT, done);
+    signal(SIGTERM, done);
 #if !defined	DOS && !defined OS2
-	signal(SIGHUP,done);
-	signal(SIGQUIT,done);
+    signal(SIGHUP, done);
+    signal(SIGQUIT, done);
 #endif
-	move(LINES-1,0);
-	refresh();
-	endwin();
-	curs_set(1);
-	exit(EXIT_SUCCESS);
+    move(LINES - 1, 0);
+    refresh();
+    endwin();
+    curs_set(1);
+    exit(EXIT_SUCCESS);
 }