diff options
author | peter <peter@FreeBSD.org> | 2002-05-21 05:30:25 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-05-21 05:30:25 +0000 |
commit | 3af3b9c011ffdac94d334751c373be3ad6313419 (patch) | |
tree | 99b740ddb82010e652c5f3f3936960192d49fd76 /contrib/ncurses | |
parent | 0e8bf3d65e0e53dbc974ec0b172bcc16b84793d4 (diff) | |
parent | 9a7523d4b2c09cefef7372e8a011b8d54fb07e5e (diff) | |
download | FreeBSD-src-3af3b9c011ffdac94d334751c373be3ad6313419.zip FreeBSD-src-3af3b9c011ffdac94d334751c373be3ad6313419.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r97049,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/ncurses')
277 files changed, 24153 insertions, 5940 deletions
diff --git a/contrib/ncurses/INSTALL b/contrib/ncurses/INSTALL index 591738b..7255dff 100644 --- a/contrib/ncurses/INSTALL +++ b/contrib/ncurses/INSTALL @@ -1,4 +1,4 @@ --- $Id: INSTALL,v 1.47 2000/11/05 01:57:24 tom Exp $ +-- $Id: INSTALL,v 1.52 2002/01/12 22:56:44 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -277,7 +277,9 @@ SUMMARY OF CONFIGURE OPTIONS: Use only built-in data. The ncurses libraries normally read terminfo and termcap data from disk. You can configure ncurses to have a built-in database, aka "fallback" entries. Embedded applications may - have no need for an external database. + have no need for an external database. Some, but not all of the + programs are useful in this configuration, e.g., reset and tput versus + infocmp and tic. --disable-ext-funcs Disable function-extensions. Configure ncurses without the functions @@ -464,6 +466,41 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-bool=TYPE + If --without-cxx is specified, override the type used for the "bool" + declared in curses.h (normally the type is automatically chosen to + correspond with that in <stdbool.h>, or defaults to platform-specific + sizes). + + --with-build-cc=XXX + If cross-compiling, specify a host C compiler, which is needed to + compile a few utilties which generate source modules for ncurses. + If you do not give this option, the configure script checks if the + $BUILD_CC variable is set, and otherwise defaults to gcc or cc. + + --with-build-cflags=XXX + If cross-compiling, specify the host C compiler-flags. You might need + to do this if the target compiler has unusual flags which confuse the + host compiler. + + --with-build-ldflags=XXX + If cross-compiling, specify the host linker-flags. You might need to + do this if the target linker has unusual flags which confuse the host + compiler. + + --with-build-libs=XXX + If cross-compiling, the host libraries. You might need to do this if + the target environment requires unusual libraries. + + --with-caps=XXX + Specify an alternate terminfo capabilities file, which makes the + configure script look for "include/Caps.XXX". A few systems, e.g., + AIX 4.x use the same overall file-format as ncurses for terminfo + data, but use different alignments within the tables to support + legacy applications. For those systems, you can configure ncurses + to use a terminfo database which is compatible with the native + applications. + --with-database=XXX Specify the terminfo source file to install. Usually you will wish to install ncurses' default (misc/terminfo.src). Certain systems @@ -586,6 +623,10 @@ SUMMARY OF CONFIGURE OPTIONS: (libtinfo). This is done to accommodate applications that use only the latter. The terminfo library is about half the size of the total. + --with-termpath=XXX + Specify a search-list of termcap files which will be compiled into the + ncurses library (default: /etc/termcap:/usr/share/misc/termcap) + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. diff --git a/contrib/ncurses/MANIFEST b/contrib/ncurses/MANIFEST index f958ac4..4559e55 100644 --- a/contrib/ncurses/MANIFEST +++ b/contrib/ncurses/MANIFEST @@ -312,28 +312,41 @@ ./doc/html/index.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html +./doc/html/man/curs_add_wch.3x.html +./doc/html/man/curs_add_wchstr.3x.html ./doc/html/man/curs_addch.3x.html ./doc/html/man/curs_addchstr.3x.html ./doc/html/man/curs_addstr.3x.html +./doc/html/man/curs_addwstr.3x.html ./doc/html/man/curs_attr.3x.html ./doc/html/man/curs_beep.3x.html ./doc/html/man/curs_bkgd.3x.html +./doc/html/man/curs_bkgrnd.3x.html ./doc/html/man/curs_border.3x.html +./doc/html/man/curs_border_set.3x.html ./doc/html/man/curs_clear.3x.html ./doc/html/man/curs_color.3x.html ./doc/html/man/curs_delch.3x.html ./doc/html/man/curs_deleteln.3x.html ./doc/html/man/curs_extend.3x.html +./doc/html/man/curs_get_wch.3x.html +./doc/html/man/curs_get_wstr.3x.html +./doc/html/man/curs_getcchar.3x.html ./doc/html/man/curs_getch.3x.html ./doc/html/man/curs_getstr.3x.html ./doc/html/man/curs_getyx.3x.html +./doc/html/man/curs_in_wch.3x.html +./doc/html/man/curs_in_wchstr.3x.html ./doc/html/man/curs_inch.3x.html ./doc/html/man/curs_inchstr.3x.html ./doc/html/man/curs_initscr.3x.html ./doc/html/man/curs_inopts.3x.html +./doc/html/man/curs_ins_wch.3x.html +./doc/html/man/curs_ins_wstr.3x.html ./doc/html/man/curs_insch.3x.html ./doc/html/man/curs_insstr.3x.html ./doc/html/man/curs_instr.3x.html +./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html @@ -466,13 +479,20 @@ ./form/llib-lform ./form/modules ./include/Caps +./include/Caps.aix4 +./include/Caps.keys +./include/Caps.osf1r5 +./include/Caps.uwin ./include/MKhashsize.sh +./include/MKkey_defs.sh ./include/MKncurses_def.sh ./include/MKparametrized.sh ./include/MKterm.h.awk.in ./include/Makefile.in ./include/capdefaults.c ./include/curses.h.in +./include/curses.tail +./include/curses.wide ./include/edit_cfg.sh ./include/headers ./include/nc_alloc.h @@ -489,28 +509,41 @@ ./man/Makefile.in ./man/captoinfo.1m ./man/clear.1 +./man/curs_add_wch.3x +./man/curs_add_wchstr.3x ./man/curs_addch.3x ./man/curs_addchstr.3x ./man/curs_addstr.3x +./man/curs_addwstr.3x ./man/curs_attr.3x ./man/curs_beep.3x ./man/curs_bkgd.3x +./man/curs_bkgrnd.3x ./man/curs_border.3x +./man/curs_border_set.3x ./man/curs_clear.3x ./man/curs_color.3x ./man/curs_delch.3x ./man/curs_deleteln.3x ./man/curs_extend.3x +./man/curs_get_wch.3x +./man/curs_get_wstr.3x +./man/curs_getcchar.3x ./man/curs_getch.3x ./man/curs_getstr.3x ./man/curs_getyx.3x +./man/curs_in_wch.3x +./man/curs_in_wchstr.3x ./man/curs_inch.3x ./man/curs_inchstr.3x ./man/curs_initscr.3x ./man/curs_inopts.3x +./man/curs_ins_wch.3x +./man/curs_ins_wstr.3x ./man/curs_insch.3x ./man/curs_insstr.3x ./man/curs_instr.3x +./man/curs_inwstr.3x ./man/curs_kernel.3x ./man/curs_mouse.3x ./man/curs_move.3x @@ -753,9 +786,11 @@ ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses +./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk ./ncurses/tinfo/MKfallback.sh +./ncurses/tinfo/MKkeys_list.sh ./ncurses/tinfo/MKnames.awk ./ncurses/tinfo/README ./ncurses/tinfo/access.c @@ -773,7 +808,6 @@ ./ncurses/tinfo/getenv_num.c ./ncurses/tinfo/home_terminfo.c ./ncurses/tinfo/init_keytry.c -./ncurses/tinfo/keys.list ./ncurses/tinfo/lib_acs.c ./ncurses/tinfo/lib_baudrate.c ./ncurses/tinfo/lib_cur_term.c @@ -811,6 +845,8 @@ ./ncurses/trace/trace_buf.c ./ncurses/trace/trace_tries.c ./ncurses/trace/trace_xnames.c +./ncurses/trace/varargs.c +./ncurses/trace/visbuf.c ./ncurses/tty/MKexpanded.sh ./ncurses/tty/hardscroll.c ./ncurses/tty/hashmap.c @@ -821,6 +857,22 @@ ./ncurses/tty/tty_display.h ./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c +./ncurses/widechar/lib_box_set.c +./ncurses/widechar/lib_cchar.c +./ncurses/widechar/lib_erasewchar.c +./ncurses/widechar/lib_get_wch.c +./ncurses/widechar/lib_get_wstr.c +./ncurses/widechar/lib_hline_set.c +./ncurses/widechar/lib_in_wch.c +./ncurses/widechar/lib_in_wchnstr.c +./ncurses/widechar/lib_ins_nwstr.c +./ncurses/widechar/lib_ins_wch.c +./ncurses/widechar/lib_inwstr.c +./ncurses/widechar/lib_unget_wch.c +./ncurses/widechar/lib_vid_attr.c +./ncurses/widechar/lib_vline_set.c +./ncurses/widechar/lib_wacs.c +./ncurses/widechar/lib_wunctrl.c ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel diff --git a/contrib/ncurses/Makefile.glibc b/contrib/ncurses/Makefile.glibc index 780650a..2535e9f 100644 --- a/contrib/ncurses/Makefile.glibc +++ b/contrib/ncurses/Makefile.glibc @@ -219,12 +219,14 @@ libncurses-routines = \ trace/trace_buf \ trace/trace_tries \ trace/trace_xnames \ + trace/varargs \ + trace/visbuf \ tty/hardscroll \ tty/hashmap \ tty/lib_mvcur \ tty/lib_tstp \ - tty/lib_vidattr \ tty/lib_twait \ + tty/lib_vidattr \ tty/tty_update \ unctrl diff --git a/contrib/ncurses/Makefile.in b/contrib/ncurses/Makefile.in index 9489e9f..7a30d32 100644 --- a/contrib/ncurses/Makefile.in +++ b/contrib/ncurses/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.20 2000/08/19 19:11:56 tom Exp $ +# $Id: Makefile.in,v 1.22 2001/10/27 18:17:22 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -69,7 +69,7 @@ preinstall : @ echo ' lib directory: '$(libdir) @ echo ' include directory: '$(includedir) @ echo ' man directory: '$(mandir) - @ echo ' terminfo directory: '$(ticdir) +@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir) @ echo '' @ test "$(includedir)" = "$(prefix)/include" || \ echo '** Include-directory is not in a standard location' @@ -87,6 +87,7 @@ clean \ distclean \ mostlyclean \ realclean \ +depend \ sources \ uninstall \ install :: diff --git a/contrib/ncurses/NEWS b/contrib/ncurses/NEWS index 099c5a7..5b564bf 100644 --- a/contrib/ncurses/NEWS +++ b/contrib/ncurses/NEWS @@ -1,4 +1,4 @@ --- $Id: NEWS,v 1.626 2001/05/13 00:11:58 tom Exp $ +-- $Id: NEWS,v 1.686 2002/05/18 21:26:10 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,659 @@ 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. +20020518 + + fix lib_pad.c for case of drawing a double-width character which + falls off the left margin of the pad (patch by Kriang Lerdsuwanakij + <lerdsuwa@users.sourceforge.net>) + + modify configure script to work around broken gcc 3.1 "--version" + option, which adds unnecessary trash to the requested information. + + adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP + (reported by Ben Decker <deckerben@freenet.de>). + +20020511 + + implement vid_puts(), vid_attr(), term_attrs() based on the narrow- + character versions as well. + + implement erasewchar(), killwchar() based on erasechar() and + killchar(). + + modify erasechar() and killchar() to return ERR if the value was + VDISABLE. + + correct a bug in wresize() in handling subwindows (based on patch by + Roger Gammans <rgammans@computer-surgery.co.uk>, report by Scott Beck + <scott@gossamer-threads.com>). + + improve test/tclock.c by making the second-hand update more often + if gettimeofday() is available. + +20020429 + + workaround for Solaris sed with MKlib_gen.sh (reported by Andy + Tsouladze <andyt@mypoints.com>). + +20020427 + + correct return-value from getcchar(), making it consistent with + Solaris and Tru64. + + reorder loops that generate makefile rules for different models vs + subsets so configure --with-termlib works again. This was broken by + logic added to avoid duplicate rules in changes to accommodate cygwin + dll's (reported by George.R.Goffe@seagate.com). + + update config.guess, config.sub + +20020421 + + modify ifdef's in write_entry.c to allow use of symbolic links on + platforms with no hard links, e.g., BeOS. + + modify a few includes to allow compile with BeOS, which has stdbool.h + with a conflicting definition for 'bool' versus its OS.h definition. + + amend MKlib_gen.sh to work with gawk, which defines 'func' as an + alias for 'function'. + +20020420 + + correct form of prototype for ripoffline(). + + modify MKlib_gen.sh to test that all functions marked as implemented + can be linked. + +20020413 + + add manpages: curs_get_wstr.3x, curs_in_wchstr.3x + + implement wgetn_wstr(). + + implement win_wchnstr(). + + remove redefinition of unget_wch() in lib_gen.c (reported by + Jungshik Shin <jshin@jtan.com>). + +20020406 + + modified several of the test programs to allow them to compile with + vendor curses implementations (Solaris, AIX). + +20020323 + + modified test/configure to allow configuring against ncursesw. + + change WACS_xxx definition to use address, to work like Tru64 curses. + +20020317 + + add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate + effect of echo/noecho and meta modes. + + add 'A' test to ncurses.c to demonstrate wget_wch() and related + functions. + + add manpage: curs_get_wch.3x + + implement unget_wch(). + + implement wget_wch(). + +20020310 + + regenerated html manpages. + + add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x + + implement wins_wch(). + + implement win_wch(). + + implement wins_nwstr(), wins_wstr(). + +20020309 + + add manpages: curs_addwstr.3x, curs_winwstr.3x + + implement winnwstr(), winwstr(). + +20020223 + + add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x + + document wunctrl, key_name. + + implement key_name(). + + remove const's in lib_box.c incorrectly leftover after splitting off + lib_box_set.c + + update llib-lncurses, llib-ncursesw, fix configure script related to these. + +20020218 + + remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted + in spurious symlinks on install. + +20020216 + + implement whline_set(), wvline_set(), add manpage curs_border_set. + + add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of + box() and box_set() functions. + + add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr() + given UTF-8 string equivalents of WACS_xxx symbols. + + minor fixes to several manpages based on groff -ww output. + + add descriptions of external variables of termcap interface to + the manpage (report by Bruce Evans <bde@zeta.org.au>). + > patches by Bernhard Rosenkraenzer: + + correct configure option --with-bool, which was executed as + --with-ospeed. + + add quotes for parameters of --with-bool and --with-ospeed configure + options. + > patch by Sven Verdoolaege (report by Gerhard Haering + <haering_linux@gmx.de>): + + correct typos in definitions of several wide-character macros: + waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr, + mvwaddwstr. + + pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition + of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris + +20020209 + + implement wide-acs characters for UTF-8 locales. When in UTF-8 + locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c + to demonstrate. + + correct prototype in keybound manpage (noted from a Debian mailing + list item). + +20020202 + + add several cases to the wscanw() example in testcurs.c, showing the + format. + + implement a simple vsscanf() fallback function which uses the %n + conversion to help parse the input data (prompted by discussion with + Albert Chin-A-Young). + + modify mk-1st.awk and test/Makefile.in to add $(LDFLAGS) when making + shared libraries, and to use $(CFLAGS) when linking test programs + (patch by Albert Chin-A-Young). + + add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). + + add entrypoints to resizeterm.c which provide better control over the + process: is_term_resized() and resize_term(). The latter restores + the original design of resizeterm() before KEY_RESIZE was added in + 970906. Do this to accommodate 20010922 changes to view.c, but allow + for programs with their own sigwinch handler, such as lynx (reported + by Russell Ruby <russ@math.orst.edu>). + +20020127 + + fix a typo in change to mk-1st.awk, which broke the shared-library + makefile rules (reported by Martin Mokrejs). + +20020126 + + update config.guess, config.sub + + finish changes needed to build dll's on cygwin. + + fix a typo in mvwchat() macro (reported by Cy <yam@homerow.net). + +20020119 + + add case in lib_baudrate.c for B921600 (patch by Andrey A Chernov). + + correct missing sed-editing stage in manpage installs which is used + to rename manpages, broken in 20010324 fix for Debian #89939 (Debian + #78866). + + remove -L$(libdir) from linker flags, probably not needed any more + since HPUX is handled properly (reported by NIIBE Yutaka + <gniibe@m17n.org>). + + add configure check for mbstate_t, needed for wide-character + configuration. On some platforms we must include <wchar.h> to + define this (reported by Daniel Jacobowitz). + + incorporate some of the changes needed to build dll's on cygwin. + +20020112a + + workaround for awk did not work with mawk, adjusted shell script. + +20020112 + + add Caps.osf1r5, as an example. + + modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without picking + up extraneous trailing blanks (adapted from patch by Daniel + Jacobowitz <dmj+@andrew.cmu.edu>). + + modify generated curses.h to ifdef-out prototypes for extensions if + they are disabled, and to define curses_version() as a string in that + case. This is needed to make the programs such as tic build in that + configuration. + + modified generated headers.sh to remove a gzip'd version of the + target file if it exists, in case non-gzip'd manpages are installed + into a directory where gzip'd ones exist. In that case, the latter + would be found. + + corrected a redundant initialization of signal handlers from 20010922 + changes. + + clarified bug-reporting address in terminfo.src (report by John H + DuBois III <spcecdt@armory.com>). + > several fixes from Robert Joop: + + do not use "-v" option of awk in MKkey_defs.sh because it does not + work with SunOS nawk. + + modify definitions for libutf8 in curses.h to avoid redefinition + warnings for mblen + + quoted references to compiler in shell command in misc/Makefile, in + case it uses multiple tokens. + +20011229 + + restore special case from 20010922 changes to omit SA_RESTART when + setting up SIGWINCH handler, which is needed to allow wgetch() to be + interrupted by that signal. + + update configure macro CF_WITH_PATHLIST, to omit some double quotes + not needed with autoconf 2.52 + + revert configure script to autoconf 2.13 patched with + autoconf-2.13-19990117.patch.gz (or later) + from + ftp://invisible-island.net/autoconf/ + because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0 + (report by David Ellement <ellement@sdd.hp.com>). This also fixes a + different problem configuring with Mac OS X (reported by Marc Smith + <marc.a.smith@home.com>). + +20011222 + + modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from + term.h + + move prototype for _nc_vsscanf() into curses.h.in to omit + HAVE_VSSCANF symbol from curses.h, which was dependent upon the + ncurses_cfg.h file which is not installed. + + use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c, + to work with broken linker configuration, e.g., cygwin (report by + Robert Joop <rj@rainbow.in-berlin.de>). + + make napms() call _nc_timed_wait() rather than poll() or select(), + to work around broken implementations of these on cygwin. + +20011218 + + drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete + by Sven Verdoolaege's rewrite of wide-character support. This makes + libncursesw incompatible again, but makes the header files almost the + same as in the narrow-character configuration. + + simplify definitions that combine wide/narrow versions of bkgd, etc., + to eliminate differences between the wide/narrow versions of curses.h + + correct typo in configure macro CF_FUNC_VSSCANF + + correct location of call to _nc_keypad() from 20011215 changes which + prevented keypad() from being disabled (reported by Lars Hecking). + +20011215 + + rewrote ncurses 'a' test to exercise wgetch() and keypad() functions + better, e.g., by adding a 'w' command to create new windows which + may have different keypad() settings. + + corrected logic of keypad() by adding internal screen state to track + whether the terminal's keypad-mode has been set. Use this in + wgetch() to update the keypad-mode according to whether the + associated window's keypad-mode has been set with keypad(). This + corrects a related problem restoring terminal state after handling + SIGTSTP (reported by Mike Castle). + + regenerate configure using patch for autoconf 2.52 + autoconf-2.52-patch.gz + at + ftp://invisible-island.net/autoconf/ + + update config.guess, config.sub from + http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + + minor changes to quoting in configure script to allow it to work + with autoconf 2.52 + +20011208 + + modify final checks in lib_setup.c for line and col values, making + them independent. + + modify acs_map[] if configure --broken-linker is specified, to make + it use a function rather than an array (prompted by an incorrect + implementation in cygwin package). + + correct spelling of configure option --enable-colorfgbg, which + happened to work if --with-develop was set (noted in cygwin package + for ncurses). + + modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop + 6 update 1 C++ 5.2 (patch by Sullivan N Beck <sbeck@cise.ufl.edu>). + + add configure checks to see if ncurses' fallback vsscanf() will + compile either of the special cases for FILE structs, and if not, + force it to the case which simply returns an error (report by + Sullivan N Beck <sbeck@cise.ufl.edu> indicates that Solaris 8 with + 64-bits does not allow access to FILE's fields). + + modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in + the ncurses library if no better substitute for this can be found + in the C++ runtime. + + modify the build to name dynamic libraries according to the + convention used on OS X and Darwin. Rather than something like + libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib. + There are a few additional minor fixes, such as setting the library + version and compatibility version numbers (patch by Jason Evans + <jevans@apple.com>). + + use 'sh' to run mkinstalldirs, to work around problems with buggy + versions of 'make' on OS/2 (report by John Polterak <jp@eyup.org>). + + correct typo in manpage description of curs_set() (Debian #121548). + + replace the configure script existence-check for mkstemp() by one + that checks if the function works, needed for older glibc and + AmigaOS. + +20011201 + + modify script that generates fallbacks.c to compile a temporary + copy of the terminfo source in case the host does not contain all of + the entries requested for fallbacks (request by Greg Roelofs). + + modify configure script to accommodate systems such as Mac OS X whose + <stdbool.h> header defines a 'bool' type inconsistent with ncurses, + which normally makes 'bool' consistent with C++. Include <stdbool.h> + from curses.h to force consistent usage, define a new type + NCURSES_BOOL and related that to the exported 'bool' as either a + typedef or definition, according to whether <stdbool.h> is present + (based on a bug report for tin 1.5.9 by Aaron Adams <adamsa@mac.com>). + +20011124 + + added/updated terminfo entries for M$ telnet and KDE konsole -TD + +20011117 + + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries + (Benjamin C W Sittler). + + add putty terminfo entry -TD + + if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since + this may not otherwise be defined to make test/view.c compile. + +20011110 + + review/correct several missing/generated items in curses.wide, sorted + the lists to make subsequent diff's easier to track. + +20011103 + + add manual pages for add_wch(), echo_wchar(), getcchar(), + mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar(). + + implement wecho_wchar() + + modify _tracedump() to handle wide-characters by mapping them to '?' + and control-characters to '.', to make the trace file readable. Also + dynamically allocate the buffer used by _tracedump() for formatting + the results. + + modify T_CALLED/T_RETURN macros to ease balancing call/return lines + in a trace by using curly braces. + + implement _nc_viscbuf(), for tracing cchar_t arrays. + + correct trace-calls in setcchar() and getcchar() functions, which + traced the return values but not the entry to each function. + + correct usage message in test/view.c, which still mentioned -u flag. + +20011027 + + modify configure script to allow building with termcap only, or with + fallbacks only. In this case, we do not build tic and toe. + + add configure --with-termpath option, to override default TERMPATH + value of /etc/termcap:/usr/share/misc/termcap. + + cosmetic change to tack: make menu descriptions agree with menu + titles. + +20011020 + + rewrote limit-checks in wscrl() and associated _nc_scroll_window(), + to ensure that if the parameter of wscrl() is larger than the size of + the scrolling region, then the scrolling region will be cleared + (report by Ben Kohlen <bckohlen@yahoo.com>). + + add trace/varargs.c, using this to trace parameters in lib_printw.c + + implement _tracecchar_t2() and _tracecchar_t(). + + split-out trace/visbuf.c + + correct typo in lib_printw.c changes from 20010922 (report by Mike + Castle). + +20011013 + + modify run_tic.sh to check if the build is a cross-compile. In that + case, do not use the build's tic to install the terminfo database + (report by Rafael Rodriguez Velilla <rrv@tid.es>). + + modify mouse click resolution so that mouseinterval(-1) will disable + it, e.g., to handle touchscreens via a slow connection (request by + Byron Stanoszek <gandalf@winds.org>). + + correct mouseinterval() default value shown in curs_mouse.3x + + remove conflicting definition of mouse_trafo() (reported by Lars + Hecking, using gcc 2.95.3). + +20011001 + + simpler fix for signal_name(), to replace the one overlooked in + 20010929 (reported by Larry Virden). + +20010929 + + add -i option to view.c, to test ncurses' check for non-default + signal handler for SIGINT, etc. + + add cases for shared-libraries on Darwin/OS X (patch by Rob Braun + <bbraun@synack.net>). + + modify tset to restore original I/O modes if an error is encountered. + Also modify to use buffered stderr consistently rather than mixing + with write(). + + change signal_name() function to use if-then-else rather than case + statement, since signal-values aren't really integers (reported by + Larry Virden). + + add limit checks in wredrawln(), fixing a problem where lynx was + repainting a pad which was much larger than the screen. + +20010922 + + fix: PutRange() was counting the second part of a wide character as + part of a run, resulting in a cursor position that was one too far + (patch by Sven Verdoolaege). + + modify resizeterm() to not queue a KEY_RESIZE if there was no + SIGWINCH, thereby separating the two styles of SIGWINCH handling + in test/view.c + + simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH. + + eliminate several static buffers in the terminfo compiler, using + allocated buffers. + + modify MKkeyname.awk so that keyname() does not store its result into + a static buffer that is overwritten by the next call. + + reorganize the output of infocmp -E and -e options to compile cleanly + with gcc -Wwrite-strings warnings. + + remove redefinition of chgat/wchgat/mvwchgat from curses.wide + +20010915 + + add label to test/view.c, showing the name of the last key or signal + that made the screen repaint, to make it clearer when a sigwinch + does this. + + use ExitProgram() consistently in the test-programs to make it + simpler to test leaks with dmalloc, etc. + + move hashtab static data out of hashmap.c into SCREEN struct. + + make NO_LEAK code compile with revised WINDOWLIST structs. + +20010908 + + modify tgetent() to check if exit_attribute_mode resets the alternate + character set, and if so, attempt to adjust the copy of the termcap + "me" string which it will return to eliminate that part. In + particular, 'screen' would lose track of line-drawing characters + (report by Frederic L W Meunier <0@pervalidus.net>, analysis by + Michael Schroeder). + +20010901 + + specify DOCTYPE in html manpages. + + add missing macros for several "generated" functions: attr_get(), + attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and + mouse_trafo(). + + modify view.c to agree with non-experimental status of ncurses' + sigwinch handler: + + change the sense of the -r option, making it default to ncurses' + sigwinch handler. + + add a note explaining what functions are unsafe in a signal + handler. + + add a -c option, to set color display, for testing. + + unset $data variable in MKterminfo.sh script, to address potential + infinite loop if shell malfunction (report by Samuel Mikes + <smikes@cubane.com>, for bash 2.05.0 on a Linux 2.0.36 system). + + change kbs in mach terminfo entries to ^? (Marcus Brinkmann + <Marcus.Brinkmann@ruhr-uni-bochum.de>). + + correct logic for COLORFGBG environment variable: if rxvt is compiled + with xpm support, the variable has three fields, making it slightly + incompatible with itself. In either case, the background color is + the last field. + +20010825 + + move calls to def_shell_mode() and def_prog_mode() before loop with + callbacks in lib_set_term.c, since the c++ demo otherwise initialized + the tty modes before saving them (patch by John David Anglin + <dave@hiauly1.hia.nrc.ca>). + + duplicate logic used to initialize trace in newterm(), in initscr() + to avoid confusing trace of initscr(). + + simplify allocation of WINDOW and WINDOWLIST structs by making the + first a part of the second rather than storing a pointer. This saves + a call to malloc for each window (discussion with Philippe Blain). + + remove unused variable 'used_ncv' from lib_vidattr.c (Philippe + Blain). + + modify c++/Makefile.in to accommodate archive programs that are + different for C++ than for C, and add cases for vendor's C++ + compilers on Solaris and IRIX (report by Albert Chin-A-Young). + + correct manpage description of criteria for deciding if the terminal + supports xterm mouse controls. + + add several configure script options to aid with cross-compiling: + --with-build-cc, --with-build-cflags, --with-build-ldflags, and + --with-build-libs (request by Greg Roelofs). + + change criteria for deciding if configure is cross-compiling from + host/build mismatch to host/target mismatch (request by Greg Roelofs + <greg.roelofs@philips.com>). + + correct logic for infocmp -e and -E options which writes the data for + the ext_Names[] array. This is needed if one constructs a fallback + table for a terminfo entry which uses extended termcap names, e.g., + AX in a color xterm. + + fix undefined NCURSES_PATHSEP when configure --disable-database + option is given. + +20010811 + + fix for VALID_BOOLEAN() macro when char is not signed. + + modify 'clean' rule for C++ binding to work with Sun compiler, which + caches additional information in a subdirectory of the objects. + + added llib-ncursesw. + +20010804 + + add Caps.keys example for experimental extended function keys + (adapted from a patch by Ilya Zakharevich). + + correct parameter types of vidputs() and vidattr() to agree with + header files (report by William P Setzer). + + fix typos in several man-pages (patch by William P Setzer). + + remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure + macro, which made ncurses C++ binding fail to build with other + C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young). + + workaround for bug in HPUX 11.x C compiler: add a blank after + NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young) + + ignore blank lines in Caps* files in MKkey_defs.sh script (report by + Albert Chin-A-Young). + + correct definition of key_end in Caps.aix4, which left KEY_END + undefined (report by Albert Chin-A-Young). + + remove a QNX-specific fallback prototype for vsscanf(), which is + obsolete with QNX RTP. + + review/fix some of the T() and TR() macro calls, having noticed that + there was no data for delwin() in a trace of dialog because there was + no returnVoid call for wtimeout(). Also, traces in lib_twait.c are + now selected under TRACE_IEVENT rather than TRACE_CALLS. + +20010728 + + add a _nc_access() check before opening files listed via $TERMPATH. + + using modified man2html, regenerate some of the html manpages to fix + broken HREF's where the link was hyphenated. + +20010721 + + add some limit/pointer checks to -S option of tputs. + + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries + (Benjamin C W Sittler). + + add a note in curs_termcap.3x regarding a defect in the XSI + description of tgetent (based on a discussion with Urs Jansen + regarding the HPUX 11.x implementation, whose termcap interface is + not compatible with existing termcap programs). + + modify manhtml rule in dist.mk to preserve copyright notice on the + generated files, as well as to address HTML style issues reported by + tidy and weblint. Regenerated/updated corresponding html files. + + comment out use of Protected_Character and related rarely used + attributes in ncurses Ada95 test/demo to compile with wide-character + configuration. + +20010714 + + implement a simple example in C++ demo to test scanw(). + + corrected stdio function used to implement scanw() in cursesw.cc + + correct definition of RemAttr() macro from 20010602 changes, which + caused C++ SillyDemo to not show line-drawing characters. + + modify C++ binding, adding getKey() which can be overridden by user + to substitute functions other than getch() for keyboard processing + of forms and menus (patch by Juergen Pfeifer). + +20010707 + + fix some of the trace calls which needed modification to work with + new wide-character structures. + + modify magic-cookie code in tty_update.c to compile with new + wide-character structures (report by <George.R.Goffe@seagate.com>). + + ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if + compiling for wide-character configuration. + + make addwnstr() handle non-spacing characters (patch by Sven + Verdoolaege). + +20010630 + + add configure check to define _GNU_SOURCE, needed to prop up glibc + header files. + + split-out include/curses.wide to solve spurious redefinitions caused + by defining _GNU_SOURCE, and move includes for <signal.h> before + <curses.h> to work around misdefinition of ERR in glibc 2.1.3 header + file. + + extended ospeed change to NetBSD and OpenBSD -TD + + modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it + work properly for termcap applications (patch by Andrey A Chernov). + +20010623 + + correct an overlooked CharOf/UChar instance (reports by Eugene Lee + <eugene@anime.net>, Sven Verdoolaege). + + correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege) + +20010618 + + change overlooked several CharOf/UChar instances. + > several patches from Sven Verdoolaege: + + correct a typo in wunctrl(), which made it appear that botwc() was + needed (no such function: use btowc()). + + reimplement wide-character demo in test/view.c, using new functions. + + implement getcchar(), setcchar(), wadd_wchnstr() and related macros. + + fix a syntax problem with do/if/while in PUTC macro (curses.priv.h). + +20010616 + + add parentheses in macros for malloc in test.priv.h, fixes an + expression in view.c (report by Wolfgang Gutjahr <gutw@knapp.co.at>). + + add Caps.uwin, as an example. + + change the way curses.h is generated, making the list of function + key definitions extracted from the Caps file. + + add #undef's before possible redefinition of ERR and OK in curses.h + + modify logic in tic, toe, tput and tset which checks for basename of + argv[0] to work properly on systems such as OS/2 which have + case-independent filenames and/or program suffixes, e.g., ".ext". + +20010609 + + add a configure check, if --enable-widec is specified, for putwc(), + which may be in libutf8. + + remove some unnecessary text from curs_extend.3x and + default_colors.3x which caused man-db to make incorrect symbolic + links (Debian bug report #99550). + + add configure check if cast for _IO_va_list is needed to compile + C++ vscan code (Debian bug report #97945). + > several patches from Sven Verdoolaege: + + correct code that used non-standard auto-initialization of a struct, + which gcc allows (report by Larry Virden). + + use putwc() in PUTC() macro. + + make addstr() work for the special case where the codeset is + non-stateful (eg. UTF-8), as well as stateful codesets. + +20010603 + + correct loop expression in NEXT_CHAR macro for lib_addstr.c changes + from 20010602 (report by Mike Castle). + +20010602 + + modify mvcur() to avoid emitting newline characters when nonl() mode + is set. Normally this is not a problem since the actual terminal + mode is set to suppress nl/crlf translations, however it is useful to + allow the caller to manipulate the terminal mode to avoid staircasing + effects after spawning a process which writes messages (for lynx + 2.8.4) -TD + > several patches from Sven Verdoolaege <skimo@kotnet.org>: + + remove redundant type-conversion in fifo_push() + + correct definition of addwstr() macro in curses.h.in + + remove _nc_utf8_outch() + + rename most existing uses of CharOf() to UChar(), e.g., where it is + used to prevent sign-extension in ctype macros. + + change some chtype's to attr_t's where the corresponding variables + are used to manipulate attributes. + + UpdateAttr() was applied to both attributes (attr_t) and characters + (chtype). Modify macro and calls to it to make these distinct. + + add CharEq() macro, use in places where wide-character configuration + implementation uses a struct for cchar_t. + + moved struct ldat into curses.priv.h, to hide implementation details. + + change CharOf() macro to use it for masking A_CHARTEXT data from + chtype's. + + add L() macro to curses.priv.h, for long-character literals. + + replace several assignments from struct ldat entries to chtype or + char values with combinations of CharOf() and AttrOf() macros. + + add/use intermediate ChAttrOf() and ChCharOf() macros where we know + we are using chtype data. + + add/use lowlevel attribute manipulation macros AddAttr(), RemAttr() + and SetAttr(). + + add/use SetChar() macro, to change a cchar_t based on a character and + attributes. + + convert most internal use of chtype to NCURSES_CH_T, to simplify use + of cchar_t for wide-character configuration. Similarly, use ARG_CH_T + where a pointer would be more useful. + + add stubs for tracing cchar_t values. + + add/use macro ISBLANK() + + add/use constructors for cchar_t's: NewChar(), NewChar2(). + + add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate + passing cchar_t's by address. + + add/use PUTC_DATA, PUTC() macros. + + for wide-character configuration, move the window background data to + the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED + is defined or not, the offsets in the struct will not change. + + modify addch() to work with wide-characters. + + mark several wide-character functions as generated in curses.h.in + + implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(), + wborder_set() and waddnwstr(). + +20010526 + + add experimental --with-caps=XXX option to customize to similar + terminfo database formats such as AIX 4.x + + add Caps.aix4 as an example. + + modify Caps to add columns for the the KEY_xxx symbols. + + modify configure --with-widec to suppress overwrite of libcurses.so + and curses.h + + add checks to toe.c to avoid being confused by files and directories + where we would expect the reverse, e.g., source-files in the + top-level terminfo levels as is the case for AIX. + +20010519 + + add top-level 'depend' rule for the C sources, assuming that the + makedepend program is available. As a side-effect, this makes + the generated sources, as in "make sources" (prompted by a report + by Mike Castle that "make -j" fails because the resulting parallel + processes race to generate ncurses/names.c). + + modify configure script so that --disable-overwrite option's action + to add a symbolic link for libcurses applies to the static library as + well as the shared library when both are configured (report by Felix + Natter <f.natter@ndh.net>). + + add ELKS terminfo entries (Federico Bianchi + <bianchi@www.arte.unipi.it>) + + add u6 (CSR) to Eterm (Michael Jennings). + 20010512 + modify test/ncurses.c to work with xterm-256color, which has fewer color pairs than colors*colors (report by David Ellement @@ -45,7 +698,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. a directory outside the source tree (patch by Sven Verdoolaege <skimo@kotnet.org>). > fix 2 bugs in test/bs.c (patch by Erik Sigra <sigra@home.se>): - + no ships were ever placed in the last row or in the last column. + + no ships were ever placed in the last row or in the last column. This made the game very easy to win, because you never had to waste any shots there, but the computer did. + the squares around a sunken ship that belonged to the player were not @@ -53,7 +706,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. player. 20010331 - + add some examples of customizing screen's terminfo: + + add some examples of customizing screen's terminfo: screen.xterm-xfree86, screen.xterm-r6, screen.teraterm -TD + modify screen's terminfo entry to match the khome/kend in screen 3.09.08 (Debian bug report #92215). @@ -180,7 +833,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. termcap.h, which matches X/Open. > patch by Juergen Pfeifer: + a revised version of the Ada enhancements sent in by "H. - Nanosecond", aka Eugene V. Melaragno <aldomel@ix.netcom.com>. This + Nanosecond", aka Eugene V Melaragno <aldomel@ix.netcom.com>. This patch includes - small fixes to the existing ncurses binding - addition of some more low-level functions to the binding, including @@ -202,8 +855,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + alter logic to set default for --disable-overwrite option to set it to 'yes' if the --prefix/$prefix value is not /usr/local, thereby accommodating the most common cause of problems: gcc's nonstandard - search rules. Other locations such as /usr/local/ncurses will default - to overwriting (report by Lars Hecking <lhecking@nmrc.ie>). + search rules. Other locations such as /usr/local/ncurses will + default to overwriting (report by Lars Hecking <lhecking@nmrc.ie>). 20001118 + modify default for --disable-overwrite configure option to disable @@ -341,7 +994,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 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 <jouko@solutions.fi>). + used for strcat/strcpy (report by Jouko Pynnonen + <jouko@solutions.fi>). 20000930 + modify several descriptions, including those for setaf, setab, in @@ -384,6 +1038,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 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. + + some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH + handler is setup. Separated the old/new sigaction data for SIGTSTP + from the other signals. 20000917 + add S0, E0 extensions to screen's terminfo entry, which is another @@ -428,8 +1085,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + 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). + 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 @@ -715,8 +1372,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which broke check for screen's AX capability (reported by Valeriy E Ushakov <uwe@ptc.spbu.ru>). - + change man2html rule in dist.mk to workaround bug in some man-programs - that ignores locale when rendering hyphenation. + + change man2html rule in dist.mk to workaround bug in some + man-programs that ignores locale when rendering hyphenation. + change web- and ftp-site to dickey.his.com 20000429 @@ -1267,7 +1924,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 990821 pre-release + updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO + minor corrections to beterm terminfo entry. - + modify lib_setup.c to reject values of $TERM which have a '/' in them. + + modify lib_setup.c to reject values of $TERM which have a '/' in + them. + add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more than one is on BeOS. That would break a switch statement. + add configure macro CF_LINK_FUNCS to detect and work around BeOS's @@ -1293,11 +1951,11 @@ Changes since 1.9.9e are recorded by Thomas Dickey. wrefresh(). Whenever a window changes its background attribute to something different than newscr's background attribute, the whole window is touched to force a copy to newscr. This is an unwanted - side-effect of wrefresh() and it is actually not necessary. A changed - background attribute affects only further outputs of background it - doesn't mean anything to the current content of the window. So there - is no need to force a copy. (reported by Frank Heckenbach - <frank@g-n-u.de>). + side-effect of wrefresh() and it is actually not necessary. A + changed background attribute affects only further outputs of + background it doesn't mean anything to the current content of the + window. So there is no need to force a copy. (reported by Frank + Heckenbach <frank@g-n-u.de>). + an upward compatible enhancement of the NCursesPad class in the C++ binding. It allows one to add a "viewport" window to a pad and then to use panning to view the pad through the viewport window. @@ -1344,7 +2002,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. settings in cur_term, which happens when curses and termcap calls are mixed (from report by Bjorn Helgaas <helgaas@dhc.net>). + suppress initialization of key-tries in _nc_keypad() if we are only - disabling keypad mode, e.g., in endwin() called when keypad() was not. + disabling keypad mode, e.g., in endwin() called when keypad() was + not. + modify the Ada95 makefile to ensure that always the Ada files from the development tree are used for building and not the eventually installed ones (patch by Juergen Pfeifer). @@ -1402,8 +2061,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add a null-pointer check for SP in lib_vidattr.c to logic that checks for magic cookies. + improve fallback declaration of 'bool' when the --without-cxx option - is given, by using a 'char' on i386 and related hosts (from discussion - with Alexander Lukyanov). + is given, by using a 'char' on i386 and related hosts (from + discussion with Alexander Lukyanov). 990605 pre-release + include time.h in lib_napms.c if nanosleep is used (patch by @@ -1454,7 +2113,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. > patch by Juergen Pfeifer: + modify menu creation to not inherit status flag from the default menu which says that the associated marker string has been allocated and - should be freed (bug reported by Marek Paliwoda" <paliwoda@kki.net.pl>) + should be freed (bug reported by Marek Paliwoda" + <paliwoda@kki.net.pl>) 990327 pre-release (alpha.gnu.org:/gnu/ncurses-5.0-beta1.tar.gz) + minor fixes to xterm-xfree86 terminfo entry - TD. @@ -1714,7 +2374,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Otherwise, a relative path in $TERMINFO would confuse tic (from a Debian bug report). + correct/update ncsa terminfo entry (report by Larry Virden). - + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur changes + + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur + changes + add Mathew Vernon's mach console entries to terminfo.src + more changes, moving functions, as part of Alexander's restructuring. + modify configure script for GNU/Hurd share-library support, introduce @@ -1838,8 +2499,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. with --srcdir option. + modify infocmp "-r" option to remove limit on formatted termcap output, which makes it more like Solaris' version. - + modify captoinfo to treat no-argument case more like Solaris' version, - which uses the contents of $TERMCAP as the entry to format. + + modify captoinfo to treat no-argument case more like Solaris' + version, which uses the contents of $TERMCAP as the entry to format. + modify mk-2nd.awk to handle subdirectories, e.g., ncurses/tty (patch by Alexander V Lukyanov). @@ -1910,8 +2571,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + improve integration of hashmap scrolling code, by adding oldhash and newhash data to SP struct. + invoke del_curterm from delscreen. - + modify del_curterm to set cur_term to null if it matches the function's - parameter which is deleted. + + modify del_curterm to set cur_term to null if it matches the + function's parameter which is deleted. + modify lib_doupdate to prefer parm_ich to the enter_insert_mode and exit_insert_mode combination, adjusting InsCharCost to check enter_insert_mode, exit_insert_mode and insert_padding. Add @@ -1919,8 +2580,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. to the SP struct. 980912 - + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for consistent - treatment. + + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for + consistent treatment. + modify ncurses to restore output to unbuffered on endwin, and resume buffering in refresh (see lib_set_term.c and NC_BUFFERED macro). + corrected HTML version numbers (according to the W3C validator, they @@ -1960,8 +2621,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Jaeger). 980815 - + modify lib_setup.c to eliminate unneeded include of <sys/ioctl.h> when - termios is not used (patch by Todd C Miller). + + modify lib_setup.c to eliminate unneeded include of <sys/ioctl.h> + when termios is not used (patch by Todd C Miller). + add function _nc_doalloc, to ensure that failed realloc calls do not leak memory (reported by Todd C Miller). + improved ncsa-telnet terminfo entry. @@ -2010,8 +2671,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. the search path to /usr/lib (reported by Dan Nelson). + add -soname option when building shared libraries on OpenBSD 2.x (request by QingLong). - + add configure options --with-manpage-format and --with-manpage-renames - (request by QingLong). + + add configure options --with-manpage-format and + --with-manpage-renames (request by QingLong). + correct conversion of CANCELLED_NUMERIC in write_object(), which was omitting the high-order byte, producing a 254 in the compiled terminfo. @@ -2333,7 +2994,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + workaround a quoting problem on SunOS with tar-copy.sh + correct init_pair() calls in worm.c to work when use_default_colors() is not available. - + include <sys/types.h> in CF_SYS_TIME_SELECT to work with FreeBSD 2.1.5 + + include <sys/types.h> in CF_SYS_TIME_SELECT to work with FreeBSD + 2.1.5 + add ncv capability to FreeBSD console (cons25w), making reverse work with color. + correct sense of configure-test for sys/time.h inclusion with @@ -2344,8 +3006,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + remove shared-library loader flags from test/Makefile.in, etc. + simplify test/configure.in using new version of autoconf to create test/ncurses_cfg.h - + suppress suffix rules in test/Makefile.in, provide explicit dependency - to work with --srcdir option and less capable 'make' programs. + + suppress suffix rules in test/Makefile.in, provide explicit + dependency to work with --srcdir option and less capable 'make' + programs. > adapted from patch for QNX by Xiaodan Tang: + initialize %P and %g variables set/used in tparm, and also ensure that empty strings don't return a null result from tparam_internal @@ -2598,7 +3261,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. NeXT (reported by Francisco A. Tomei Torres). 971101 - + force mandatory padding in bell and flash_screen, as specified in XSI. + + force mandatory padding in bell and flash_screen, as specified in + XSI. + don't allow padding_baud_rate to override mandatory delays (reported by Daniel Weaver). + modify delay_output() to use _nc_timed_wait() if no baudrate has been @@ -2732,8 +3396,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add configure script to generate c++/etip.h + add configure --with-develop option, to enable by default most of the experimental options (requested by Alexander V. Lukyanov). - + rename 'deinstall' to 'uninstall', following GNU convention (suggested - by Alexander V. Lukyanov). + + rename 'deinstall' to 'uninstall', following GNU convention + (suggested by Alexander V. Lukyanov). > patches by Alexander V. Lukyanov: + modify tactics 2 and 5 in onscreen_mvcur(), to allow them on the last line of the screen, since carriage return will not cause a newline. @@ -2826,7 +3490,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + #undef unctrl to avoid symbol conflict in port to RTEMS (reported by Chris Johns <cjohns@plessey.com.au>) > patches by Juergen Pfeifer: - + simplified, made minor corrections to Ada95 binding to form fieldtype. + + simplified, made minor corrections to Ada95 binding to form + fieldtype. + The C++ binding has been enhanced: + Improve NCursesWindow class: added additional methods to cover more ncurses functionality. Make refresh() and noutrefresh() @@ -3231,7 +3896,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + restore original behavior in ncurses 'g' test, i.e., explicitly set the keypad mode rather than use the default, since it confuses people. - + rewrote the newdemo banner so it's readable (reported by Hugh Daniel). + + rewrote the newdemo banner so it's readable (reported by Hugh + Daniel). + tidy up exit from hashtest (reported by Hugh Daniel). + restore check for ^Q in ncurses 'g' test broken in 970510 (reported by Hugh Daniel) @@ -3295,8 +3961,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 970517 + suppress check for pre-existing ncurses header if the --prefix option is specified. - + add configure options "--with-system-type" and "--with-system-release" - to assist in checking the generated makefiles. + + add configure options "--with-system-type" and + "--with-system-release" to assist in checking the generated + makefiles. + add configure option "--enable-rpath" to allow installers to specify that programs linked against shared libraries will have their library path embedded, allowing installs into nonstandard locations. @@ -3335,12 +4002,13 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify ncurses 'g' test to allow mouse input + modify default xterm description to include mouse. + modify configure script to add -Wwrite-strings if gcc warnings are - enabled while configuring --enable-const (and fixed related warnings). + enabled while configuring --enable-const (and fixed related + warnings). + add toggle, status display for keypad mode to ncurses 'g' test to verify that keypad and scrollok are not inherited from parent window during a call to newwin. - + correction to MKexpanded.sh to make it work when configure --srcdir is - used (reported by H.J.Lu). + + correction to MKexpanded.sh to make it work when configure --srcdir + is used (reported by H.J.Lu). + revise test for bool-type, ensuring that it checks if builtin.h is available before including it, adding test for sizeof(bool) equal to sizeof(short), and warning user if the size cannot be determined @@ -3360,8 +4028,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 970505 4.1 pre-release + regenerate the misc directory html dumps without the link list, which is not useful. - + correct dependency in form directory makefile which caused unnecessary - recompiles. + + correct dependency in form directory makefile which caused + unnecessary recompiles. + correct substitution for ABI_VERSION in test-makefile + modify install rules for shared-library targets to remove the target before installing, since some install programs do not properly handle @@ -3469,8 +4137,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + check for C++ builtin.h header + correct computation of absolute-path for $INSTALL that dropped "-c" parameter from the expression. - + rename config.h to ncurses_cfg.h to avoid naming-conflict when ncurses - is integrated into larger systems (from diffs by H.J.Lu for libc). + + rename config.h to ncurses_cfg.h to avoid naming-conflict when + ncurses is integrated into larger systems (from diffs by H.J.Lu for + libc). + correct inequality in lib_doupdate.c that caused a single-char to not be updated when the char on the right-margin was not blank, idcok() was true (patch by Alexander V. Lukyanov 970124, also reported by @@ -3841,7 +4510,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. handle displays wider than 128 chars (Juergen Pfeifer). + correct typo curs_outopts.3x (Juergen Pfeifer). + correct limit-checking in wenclose() (Juergen Pfeifer). - + correction to Peter Wemm's newwin change (Thomas Fehr <fehr@suse.de>). + + correction to Peter Wemm's newwin change (Thomas Fehr + <fehr@suse.de>). + corrections to logic that combines colors and attributes; they must not be OR'd (Juergen Pfeifer, extending from report/patch by Rick Marshall). @@ -4066,8 +4736,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Ju"rgen Fluk <louis@dachau.marco.de>) + corrected calls on _nc_render so that background character is set as per XSI. - + corrected wbkgdset macro (XSI allows background character to be null), - and tests that use it. + + corrected wbkgdset macro (XSI allows background character to be + null), and tests that use it. + more corrections to terminfo (xterm & rxvt) + undid change to mcprint prototype (cannot use size_t in curses.h because not all systems declare it in the headers that we can safely @@ -4135,8 +4805,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. msgwin needed scrollok set. + corrected last change to IDcTransformLine logic to avoid conflict between PutRange and InsStr - + modified run_tic.sh to not use /usr/tmp (reported by David MacKenzie), - and further revised it and aclocal.m4 to use $TMPDIR if set. + + modified run_tic.sh to not use /usr/tmp (reported by David + MacKenzie), and further revised it and aclocal.m4 to use $TMPDIR if + set. + corrected off-by-one in RoomFor call in read_entry.c 960622 - snapshot @@ -4204,8 +4875,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + corrected ifdef for BROKEN_LINKER in MKnames.awk.in + corrected missing INSTALL_DATA in misc/Makefile.in + flush output when changing cursor-visibility (Rick Marshall) - + fix a minor bug in the _nc_ripoff() routine and improve error checking - when creating the label window (Juergen Pfeifer). + + fix a minor bug in the _nc_ripoff() routine and improve error + checking when creating the label window (Juergen Pfeifer). + enhancement to the control over the new PC-style soft key format. allow caller now to select whether or not one wants to have the index-line; see curs_slk.3x for documentation (Juergen Pfeifer). @@ -4308,7 +4979,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + autogenerate development header-dependencies (config.h, *.priv.h) + corrected single-column formatting of "use=" (e.g., in tic) + modify tic to read full terminfo-names - + corrected divide-by-zero that caused hang (or worse) when redirecting output + + corrected divide-by-zero that caused hang (or worse) when redirecting + output + modify tic to generate directories only as-needed (and corrected instance of use of data from function that had already returned). @@ -4517,10 +5189,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. takes a trace mask argument. The trace masks, defined in curses.h, are as follows: - #define TRACE_DISABLE 0x00 /* turn off tracing */ - #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ - #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ - #define TRACE_MAXIMUM 0x0f /* maximum trace level */ + #define TRACE_DISABLE 0x00 /* turn off tracing */ + #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ + #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ + #define TRACE_MAXIMUM 0x0f /* maximum trace level */ More trace masks may be added, or these may be changed, in future releases. * The pad code has been improved and the pad test code in test/ncurses.c has @@ -4808,7 +5480,7 @@ available separately from netcom.com:pub/zmbenhal/ * New scrolling code. * fixed bug that reversed the sense of nl() and nonl(). -#### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### +#### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### * more support for color and graphics see test/ for examples. * fixed various files to allow correct update after shelling out. * more fixes for updates. diff --git a/contrib/ncurses/aclocal.m4 b/contrib/ncurses/aclocal.m4 index 382aa10..bd1df26 100644 --- a/contrib/ncurses/aclocal.m4 +++ b/contrib/ncurses/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2000 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2000,2001,2002 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,1999,2000 +dnl Author: Thomas E. Dickey 1996,1997,1998,1999,2000,2001 dnl -dnl $Id: aclocal.m4,v 1.248 2001/04/21 19:40:04 tom Exp $ +dnl $Id: aclocal.m4,v 1.280 2002/04/27 19:31:30 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl See http://dickey.his.com/autoconf/ for additional information. @@ -58,33 +58,46 @@ AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. AC_DEFUN([CF_ADD_CFLAGS], [ +cf_new_cflags= +cf_new_cppflags= for cf_add_cflags in $1 do case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi case "$CPPFLAGS" in - *$cf_add_cflags) + *$cf_add_cflags) #(vi ;; - *) - CPPFLAGS="$CPPFLAGS $cf_add_cflags" + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; *) - CFLAGS="$CFLAGS $cf_add_cflags" + cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac done + +if test -n "$cf_new_cflags" ; then + ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + ])dnl dnl --------------------------------------------------------------------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ -AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) -AC_CACHE_VAL(cf_cv_ansi_cc,[ +AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -120,7 +133,6 @@ done CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) -AC_MSG_RESULT($cf_cv_ansi_cc) if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then @@ -155,6 +167,9 @@ 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_CHECK_HEADER(stdbool.h, + cf_cv_header_stdbool_h=1, + cf_cv_header_stdbool_h=0) AC_MSG_CHECKING([for builtin bool type]) AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ AC_TRY_COMPILE([ @@ -172,6 +187,9 @@ fi dnl --------------------------------------------------------------------------- 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. +dnl +dnl If the current compiler is C rather than C++, we get the bool definition +dnl from <stdbool.h>. AC_DEFUN([CF_BOOL_SIZE], [ AC_MSG_CHECKING([for size of bool]) @@ -180,6 +198,9 @@ AC_CACHE_VAL(cf_cv_type_of_bool,[ AC_TRY_RUN([ #include <stdlib.h> #include <stdio.h> + +#if defined(__cplusplus) + #ifdef HAVE_GXX_BUILTIN_H #include <g++/builtin.h> #elif HAVE_GPP_BUILTIN_H @@ -187,6 +208,15 @@ AC_CACHE_VAL(cf_cv_type_of_bool,[ #elif HAVE_BUILTIN_H #include <builtin.h> #endif + +#else + +#if $cf_cv_header_stdbool_h +#include <stdbool.h> +#endif + +#endif + main() { FILE *fp = fopen("cf_test.out", "w"); @@ -203,15 +233,21 @@ main() exit(0); } ], - [cf_cv_type_of_bool=`cat cf_test.out`], + [cf_cv_type_of_bool=`cat cf_test.out` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi], [cf_cv_type_of_bool=unknown], [cf_cv_type_of_bool=unknown]) ]) rm -f cf_test.out AC_MSG_RESULT($cf_cv_type_of_bool) if test "$cf_cv_type_of_bool" = unknown ; then - AC_MSG_WARN(Assuming unsigned for type of bool) - cf_cv_type_of_bool=unsigned + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool) + cf_cv_type_of_bool=$NCURSES_BOOL fi ])dnl dnl --------------------------------------------------------------------------- @@ -310,7 +346,7 @@ test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && AC_MSG_RESULT("Configuring for $cf_cv_system_name") +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) @@ -322,14 +358,10 @@ dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it dnl ourselves. dnl -dnl (I would use AC_CACHE_CHECK here, but it will not work when called in a -dnl loop from CF_SYS_ERRLIST). -dnl dnl $1 = the name to check AC_DEFUN([CF_CHECK_ERRNO], [ -AC_MSG_CHECKING(if external $1 is declared) -AC_CACHE_VAL(cf_cv_dcl_$1,[ +AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include <stdlib.h> @@ -338,16 +370,12 @@ AC_CACHE_VAL(cf_cv_dcl_$1,[ #include <sys/types.h> #include <errno.h> ], [long x = (long) $1], - [eval 'cf_cv_dcl_'$1'=yes'], - [eval 'cf_cv_dcl_'$1'=no']) + [cf_cv_dcl_$1=yes], + [cf_cv_dcl_$1=no]) ]) -eval 'cf_result=$cf_cv_dcl_'$1 -AC_MSG_RESULT($cf_result) - -if test "$cf_result" = no ; then - eval 'cf_result=DECL_'$1 - CF_UPPER(cf_result,$cf_result) +if test "$cf_cv_dcl_$1" = no ; then + CF_UPPER(cf_result,decl_$1) AC_DEFINE_UNQUOTED($cf_result) fi @@ -361,22 +389,18 @@ dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], [ -AC_MSG_CHECKING(if external $1 exists) -AC_CACHE_VAL(cf_cv_have_$1,[ +AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ AC_TRY_LINK([ #undef $1 extern $2 $1; ], [$1 = 2], - [eval 'cf_cv_have_'$1'=yes'], - [eval 'cf_cv_have_'$1'=no'])]) - -eval 'cf_result=$cf_cv_have_'$1 -AC_MSG_RESULT($cf_result) + [cf_cv_have_$1=yes], + [cf_cv_have_$1=no]) +]) -if test "$cf_result" = yes ; then - eval 'cf_result=HAVE_'$1 - CF_UPPER(cf_result,$cf_result) +if test "$cf_cv_have_$1" = yes ; then + CF_UPPER(cf_result,have_$1) AC_DEFINE_UNQUOTED($cf_result) fi @@ -425,11 +449,12 @@ AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(strstream.h) AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[ - for cf_vscan_func in strstream stdio + for cf_vscan_func in strstream strstream_cast stdio do case $cf_vscan_func in #(vi stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; + strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; esac AC_TRY_LINK([ #include <stdio.h> @@ -443,25 +468,25 @@ AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[ int scanw(const char* fmt, ...) { int result = -1; -#if defined(__GNUG__) char buf[BUFSIZ]; va_list args; va_start(args, fmt); #if defined(USE_STDIO_VSCAN) - if (::vscanf(fmt, args) != -1) + if (::vsscanf(buf, fmt, args) != -1) result = 0; #elif defined(USE_STRSTREAM_VSCAN) strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN_CAST) + strstreambuf ss(buf, sizeof(buf)); if (ss.vscan(fmt, (_IO_va_list)args) != -1) result = 0; #else #error case $cf_vscan_func failed #endif va_end(args); -#else -#error sorry, we only know about the GNU compiler case -#endif return result; } ],[int tmp, foo = scanw("%d", &tmp)], @@ -483,6 +508,10 @@ strstream) AC_DEFINE(CPP_HAS_VSCAN_FUNC) AC_DEFINE(USE_STRSTREAM_VSCAN) ;; +strstream_cast) + AC_DEFINE(CPP_HAS_VSCAN_FUNC) + AC_DEFINE(USE_STRSTREAM_VSCAN_CAST) + ;; esac ])dnl dnl --------------------------------------------------------------------------- @@ -495,7 +524,11 @@ DIRS_TO_MAKE="lib" for cf_item in $cf_list_models do CF_OBJ_SUBDIR($cf_item,cf_subdir) - DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" done for cf_dir in $DIRS_TO_MAKE do @@ -621,6 +654,49 @@ tcgetattr(1, &foo);], test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR) ])dnl dnl --------------------------------------------------------------------------- +dnl Check for vsscanf() function, which is in c9x but generally not in earlier +dnl versions of C. It is in the GNU C library, and can often be simulated by +dnl other functions. +AC_DEFUN([CF_FUNC_VSSCANF], +[ +AC_CACHE_CHECK(for vsscanf function or workaround,cf_cv_func_vsscanf,[ +AC_TRY_LINK([ +#include <stdarg.h> +#include <stdio.h>],[ + va_list ap; + vsscanf("from", "%d", ap)],[cf_cv_func_vsscanf=vsscanf],[ +AC_TRY_LINK([ +#include <stdarg.h> +#include <stdio.h>],[ + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (vfscanf(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=vfscanf],[ +AC_TRY_LINK([ +#include <stdarg.h> +#include <stdio.h>],[ + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (_doscan(&strbuf, "%d", ap))],[cf_cv_func_vsscanf=_doscan],[ +cf_cv_func_vsscanf=no])])])]) + +case $cf_cv_func_vsscanf in #(vi +vsscanf) AC_DEFINE(HAVE_VSSCANF);; #(vi +vfscanf) AC_DEFINE(HAVE_VFSCANF);; #(vi +_doscan) AC_DEFINE(HAVE__DOSCAN);; +esac + +])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. @@ -790,6 +866,34 @@ case $cf_cv_gnat_version in esac ]) dnl --------------------------------------------------------------------------- +dnl Check if we must define _GNU_SOURCE to get a reasonable value for +dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect +dnl (or misfeature) of glibc2, which breaks portability of many applications, +dnl since it is interwoven with GNU extensions. +dnl +dnl Well, yes we could work around it... +AC_DEFUN([CF_GNU_SOURCE], +[ +AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ +AC_TRY_COMPILE([#include <sys/types.h>],[ +#ifndef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_gnu_source=no], + [cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + AC_TRY_COMPILE([#include <sys/types.h>],[ +#ifdef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_gnu_source=no], + [cf_cv_gnu_source=yes]) + CPPFLAGS="$cf_save" + ]) +]) +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" +])dnl +dnl --------------------------------------------------------------------------- dnl If we're trying to use g++, test if libg++ is installed (a rather common dnl problem :-). If we have the compiler but no library, we'll be able to dnl configure, but won't be able to build the c++ demo program. @@ -874,6 +978,25 @@ AC_MSG_RESULT($cf_cv_have_isascii) test "$cf_cv_have_isascii" = yes && AC_DEFINE(HAVE_ISASCII) ])dnl dnl --------------------------------------------------------------------------- +dnl Check for libutf8 +AC_DEFUN([CF_LIBUTF8], +[ +AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[ + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +AC_TRY_LINK([ +#include <libutf8.h>],[putwc(0,0);], + [cf_cv_libutf8=yes], + [cf_cv_libutf8=no]) + LIBS="$cf_save_LIBS" +]) + +if test "$cf_cv_libutf8" = yes ; then + AC_DEFINE(HAVE_LIBUTF8_H) + LIBS="-lutf8 $LIBS" +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Compute the library-prefix for the given host system dnl $1 = variable to set AC_DEFUN([CF_LIB_PREFIX], @@ -906,43 +1029,70 @@ for cf_dir in $SRC_SUBDIRS do if test -f $srcdir/$cf_dir/modules; then - cf_libs_to_make= + IMPORT_LIB= + SHARED_LIB= + LIBS_TO_MAKE= for cf_item in $CF_LIST_MODELS do CF_LIB_SUFFIX($cf_item,cf_suffix) if test $cf_item = shared ; then if test "$cf_cv_do_symlinks" = yes ; then case "$cf_cv_shlib_version" in #(vi - rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi - abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + rel) #(vi + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; + esac + ;; + abi) + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + esac + ;; esac fi + # cygwin needs import library, and has unique naming convention + if test $cf_cv_shlib_version = cygdll ; then + SHARED_LIB="../lib/${cf_prefix}${cf_dir}\$(ABI_VERSION).dll" + IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a" + LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)" + continue fi - cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}" + fi + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" done if test $cf_dir = ncurses ; then + cf_subsets="$LIB_SUBSETS" case "$LIB_SUBSETS" in #(vi termlib+*) #(vi ;; *) #(vi - cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g` - cf_libs_to_make="$cf_item $cf_libs_to_make" + cf_item=`echo $LIBS_TO_MAKE |sed -e s/$LIB_NAME/$TINFO_NAME/g` + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" ;; esac + else + cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib //'` fi - sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \ + sed -e "s@\@LIBS_TO_MAKE\@@$LIBS_TO_MAKE@" \ + -e "s@\@IMPORT_LIB\@@$IMPORT_LIB@" \ + -e "s@\@SHARED_LIB\@@$SHARED_LIB@" \ $cf_dir/Makefile >$cf_dir/Makefile.out mv $cf_dir/Makefile.out $cf_dir/Makefile $AWK -f $srcdir/mk-0th.awk \ - name=$cf_dir \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - for cf_item in $CF_LIST_MODELS + for cf_subset in $cf_subsets do - echo 'Appending rules for '$cf_item' model ('$cf_dir')' + cf_subdirs= + for cf_item in $CF_LIST_MODELS + do + echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" CF_UPPER(CF_ITEM,$cf_item) CF_LIB_SUFFIX($cf_item,cf_suffix) CF_OBJ_SUBDIR($cf_item,cf_subdir) @@ -962,8 +1112,6 @@ do cf_depend="$cf_depend $cf_reldir/curses.priv.h" fi - for cf_subset in $LIB_SUBSETS - do $AWK -f $srcdir/mk-1st.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -973,6 +1121,7 @@ do suffix=$cf_suffix \ subset=$cf_subset \ ShlibVer=$cf_cv_shlib_version \ + ShlibVerInfix=$cf_cv_shlib_version_infix \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ @@ -980,7 +1129,11 @@ do depend="$cf_depend" \ target="$target" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - test $cf_dir = ncurses && WITH_OVERWRITE=no + for cf_subdir2 in $cf_subdirs lib + do + test $cf_subdir = $cf_subdir2 && break + done + test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \ $AWK -f $srcdir/mk-2nd.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -990,6 +1143,7 @@ do srcdir=$srcdir \ echo=$WITH_ECHO \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile + cf_subdirs="$cf_subdirs $cf_subdir" done done fi @@ -1045,11 +1199,11 @@ done cat >> Makefile <<CF_EOF -install.data \ +install.data \\ uninstall.data :: - cd misc && \$(MAKE) \$(CF_MFLAGS) \[$]@ +$MAKE_TERMINFO cd misc && \$(MAKE) \$(CF_MFLAGS) \[$]@ -install.man \ +install.man \\ uninstall.man :: cd man && \$(MAKE) \$(CF_MFLAGS) \[$]@ @@ -1064,7 +1218,7 @@ if test -d tack ; then if test -f $srcdir/$tack.h; then cat >> Makefile <<CF_EOF -install.man \ +install.man \\ uninstall.man :: cd tack && \$(MAKE) \$(CF_MFLAGS) \[$]@ CF_EOF @@ -1148,6 +1302,9 @@ test "\$NAME" = "curses.h" && NAME=ncurses.h CF_EOF fi cat >>headers.sh <<CF_EOF +# Just in case someone gzip'd manpages, remove the conflicting copy. +test -f \$DST/\$NAME.gz && rm -f \$DST/\$NAME.gz + eval \$PRG \$TMPSRC \$DST/\$NAME rm -f \$TMPSRC \$TMPSED CF_EOF @@ -1159,7 +1316,7 @@ do if test -f $srcdir/$cf_dir/headers; then cat >>$cf_dir/Makefile <<CF_EOF \$(DESTDIR)\$(includedir) : - \$(srcdir)/../mkinstalldirs \[$]@ + sh \$(srcdir)/../mkinstalldirs \[$]@ install \\ install.libs \\ @@ -1191,6 +1348,17 @@ CF_EOF test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile done fi + + if test -f $srcdir/$cf_dir/modules; then + if test "$cf_dir" != "c++" ; then + cat >>$cf_dir/Makefile <<"CF_EOF" +depend : $(AUTO_SRC) + makedepend -- $(CPPFLAGS) -- $(C_SRC) + +# DO NOT DELETE THIS LINE -- make depend depends on it. +CF_EOF + fi + fi done ])dnl @@ -1209,6 +1377,8 @@ AC_DEFUN([CF_LIB_SUFFIX], profile) $2='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) $2='.dll' ;; + darwin*) $2='.dylib' ;; hpux*) $2='.sl' ;; *) $2='.so' ;; esac @@ -1285,7 +1455,12 @@ EOF LIBS="$cf_saveLIBS" ]) AC_MSG_RESULT($cf_cv_link_dataonly) -test "$cf_cv_link_dataonly" = no && AC_DEFINE(BROKEN_LINKER) + +if test "$cf_cv_link_dataonly" = no ; then + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 +fi + ])dnl dnl --------------------------------------------------------------------------- dnl Most Unix systems have both link and symlink, a few don't have symlink. @@ -1349,12 +1524,12 @@ dnl (GNU 'make' does both, something POSIX 'make', which happens to make the dnl $(MAKEFLAGS) variable incompatible because it adds the assignments :-) AC_DEFUN([CF_MAKEFLAGS], [ -AC_MSG_CHECKING([for makeflags variable]) -AC_CACHE_VAL(cf_cv_makeflags,[ +AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ cf_cv_makeflags='' for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)' do cat >cf_makeflags.tmp <<CF_EOF +SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF @@ -1374,8 +1549,9 @@ CF_EOF ;; esac done - rm -f cf_makeflags.tmp]) -AC_MSG_RESULT($cf_cv_makeflags) + rm -f cf_makeflags.tmp +]) + AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- @@ -1416,10 +1592,10 @@ AC_MSG_CHECKING(format of man-pages) AC_ARG_WITH(manpage-format, [ --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and optionally formatted, e.g., gzip,formatted], - [cf_manpage_form=$withval], - [cf_manpage_form=unknown]) + [MANPAGE_FORMAT=$withval], + [MANPAGE_FORMAT=unknown]) -case ".$cf_manpage_form" in +case ".$MANPAGE_FORMAT" in .gzip|.compress|.BSDI|.normal|.formatted) # (vi ;; .unknown|.) # (vi @@ -1428,7 +1604,7 @@ case ".$cf_manpage_form" in fi # look for the 'date' man-page (it's most likely to be installed!) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" - cf_manpage_form=unknown + MANPAGE_FORMAT=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 @@ -1436,15 +1612,15 @@ case ".$cf_manpage_form" in 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;; + *.gz) MANPAGE_FORMAT=gzip;; + *.Z) MANPAGE_FORMAT=compress;; + *.0) MANPAGE_FORMAT=BSDI,formatted;; + *) MANPAGE_FORMAT=normal;; esac break fi done - if test "$cf_manpage_form" != "unknown" ; then + if test "$MANPAGE_FORMAT" != "unknown" ; then break fi done @@ -1455,7 +1631,7 @@ case ".$cf_manpage_form" in ;; esac -AC_MSG_RESULT($cf_manpage_form) +AC_MSG_RESULT($MANPAGE_FORMAT) ])dnl dnl --------------------------------------------------------------------------- dnl The Debian people have their own naming convention for manpages. This @@ -1467,37 +1643,40 @@ AC_MSG_CHECKING(for manpage renaming) AC_ARG_WITH(manpage-renames, [ --with-manpage-renames specify manpage-renaming], - [cf_manpage_renames=$withval], - [cf_manpage_renames=yes]) + [MANPAGE_RENAMES=$withval], + [MANPAGE_RENAMES=yes]) -case ".$cf_manpage_renames" in #(vi +case ".$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 + MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames else - cf_manpage_renames=no + MANPAGE_RENAMES=no fi ;; esac -if test "$cf_manpage_renames" != no ; then - if test ! -f $cf_manpage_renames ; then - AC_MSG_ERROR(not a filename: $cf_manpage_renames) +if test "$MANPAGE_RENAMES" != no ; then + if test -f $srcdir/man/$MANPAGE_RENAMES ; then + MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES + elif test ! -f $MANPAGE_RENAMES ; then + AC_MSG_ERROR(not a filename: $MANPAGE_RENAMES) fi test ! -d man && mkdir man # Construct a sed-script to perform renaming within man-pages - if test -n "$cf_manpage_renames" ; then + if test -n "$MANPAGE_RENAMES" ; then test ! -d man && mkdir man - $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed + sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed fi fi -AC_MSG_RESULT($cf_manpage_renames) +AC_MSG_RESULT($MANPAGE_RENAMES) +AC_SUBST(MANPAGE_RENAMES) ])dnl dnl --------------------------------------------------------------------------- dnl Some people expect each tool to make all aliases for manpages in the @@ -1509,10 +1688,10 @@ AC_MSG_CHECKING(for manpage symlinks) AC_ARG_WITH(manpage-symlinks, [ --with-manpage-symlinks specify manpage-symlinks], - [cf_manpage_symlinks=$withval], - [cf_manpage_symlinks=yes]) + [MANPAGE_SYMLINKS=$withval], + [MANPAGE_SYMLINKS=yes]) -AC_MSG_RESULT($cf_manpage_symlinks) +AC_MSG_RESULT($MANPAGE_SYMLINKS) ])dnl dnl --------------------------------------------------------------------------- dnl This option causes manpages to be run through tbl(1) to generate tables @@ -1523,10 +1702,10 @@ 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]) + [MANPAGE_TBL=$withval], + [MANPAGE_TBL=no]) -AC_MSG_RESULT($cf_manpage_tbl) +AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- dnl Try to determine if the man-pages on the system are compressed, and if @@ -1546,7 +1725,7 @@ CF_MANPAGE_TBL cf_prefix="$prefix" fi - case "$cf_manpage_form" in # (vi + case "$MANPAGE_FORMAT" in # (vi *formatted*) # (vi cf_subdir='$mandir/cat' cf_format=yes @@ -1563,8 +1742,9 @@ cat >man/edit_man.sh <<CF_EOF # this script is generated by the configure-script prefix="$cf_prefix" datadir="$datadir" +NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="`cd $srcdir && pwd`/mkinstalldirs" +MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs" INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" @@ -1600,13 +1780,13 @@ case \$i in #(vi continue fi CF_EOF -if test "$cf_manpage_symlinks" = yes ; then +if test "$MANPAGE_SYMLINKS" = yes ; then cat >>man/edit_man.sh <<CF_EOF aliases=\`sed -f \$srcdir/manlinks.sed \$inalias | sort -u\` CF_EOF fi -if test "$cf_manpage_renames" = no ; then +if test "$MANPAGE_RENAMES" = no ; then cat >>man/edit_man.sh <<CF_EOF # perform program transformations for section 1 man pages if test \$section = 1 ; then @@ -1617,7 +1797,7 @@ cat >>man/edit_man.sh <<CF_EOF CF_EOF else cat >>man/edit_man.sh <<CF_EOF - target=\`grep "^\$source" $cf_manpage_renames | $AWK '{print \[$]2}'\` + target=\`grep "^\$source" $MANPAGE_RENAMES | $AWK '{print \[$]2}'\` if test -z "\$target" ; then echo '? missing rename for '\$source target="\$source" @@ -1638,6 +1818,7 @@ CF_EOF cat >>man/edit_man.sh <<CF_EOF sed -e "s,@DATADIR@,\$datadir," \\ -e "s,@TERMINFO@,\$TERMINFO," \\ + -e "s,@NCURSES_OSPEED@,\$NCURSES_OSPEED," \\ CF_EOF ifelse($1,,,[ for cf_name in $1 @@ -1648,10 +1829,16 @@ cat >>man/edit_man.sh <<CF_EOF CF_EOF done ]) +if test -f $MANPAGE_RENAMES ; then +cat >>man/edit_man.sh <<CF_EOF + < \$i | sed -f edit_man.sed >\$TMP +CF_EOF +else cat >>man/edit_man.sh <<CF_EOF < \$i >\$TMP CF_EOF -if test $cf_manpage_tbl = yes ; then +fi +if test $MANPAGE_TBL = yes ; then cat >>man/edit_man.sh <<CF_EOF tbl \$TMP >\$TMP.out mv \$TMP.out \$TMP @@ -1669,7 +1856,7 @@ cat >>man/edit_man.sh <<CF_EOF mv \$TMP.out \$TMP CF_EOF fi -case "$cf_manpage_form" in #(vi +case "$MANPAGE_FORMAT" in #(vi *compress*) #(vi cat >>man/edit_man.sh <<CF_EOF if test \$verb = installing ; then @@ -1781,6 +1968,37 @@ ifelse($1,,[ fi ]) dnl --------------------------------------------------------------------------- +dnl Check if mbstate_t is declared, and if so, which header file. +AC_DEFUN([CF_MBSTATE_T], +[ +# This is needed on Tru64 5.0 to declare mbstate_t +AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_mbstate_t,[ +AC_TRY_COMPILE([ +#include <stdlib.h> +#ifdef HAVE_LIBUTF8_H +#include <libutf8.h> +#endif], + [mbstate_t state], + [cf_cv_mbstate_t=no], + [AC_TRY_COMPILE([ +#include <stdlib.h> +#include <wchar.h> +#ifdef HAVE_LIBUTF8_H +#include <libutf8.h> +#endif], + [mbstate_t value], + [cf_cv_mbstate_t=yes], + [cf_cv_mbstate_t=unknown])])]) + +if test "$cf_cv_mbstate_t" = yes ; then + AC_DEFINE(NEED_WCHAR_H) +fi + +if test "$cf_cv_mbstate_t" != unknown ; then + AC_DEFINE(HAVE_MBSTATE_T) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. AC_DEFUN([CF_MIXEDCASE_FILENAMES], @@ -1798,6 +2016,54 @@ AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) ])dnl dnl --------------------------------------------------------------------------- +dnl Check for a working mkstemp. This creates two files, checks that they are +dnl successfully created and distinct (AmigaOS apparently fails on the last). +AC_DEFUN([CF_MKSTEMP],[ +AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ +rm -f conftest* +AC_TRY_RUN([ +#include <sys/types.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +int main() +{ + char *tmpl = "conftestXXXXXX"; + char name[2][80]; + int n; + int result = 0; + int fd; + struct stat sb; + + umask(077); + for (n = 0; n < 2; ++n) { + strcpy(name[n], tmpl); + if ((fd = mkstemp(name[n])) >= 0) { + if (!strcmp(name[n], tmpl) + || stat(name[n], &sb) != 0 + || (sb.st_mode & S_IFMT) != S_IFREG + || (sb.st_mode & 077) != 0) { + result = 1; + } + close(fd); + } + } + if (result == 0 + && !strcmp(name[0], name[1])) + result = 1; + exit(result); +} +],[cf_cv_func_mkstemp=yes +],[cf_cv_func_mkstemp=no +],[AC_CHECK_FUNC(mkstemp) +]) +]) +if test "$cf_cv_func_mkstemp" = yes ; then + AC_DEFINE(HAVE_MKSTEMP) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Compute the object-directory name from the given model name AC_DEFUN([CF_OBJ_SUBDIR], [ @@ -1806,7 +2072,13 @@ AC_DEFUN([CF_OBJ_SUBDIR], normal) $2='objects' ;; debug) $2='obj_g' ;; profile) $2='obj_p' ;; - shared) $2='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + $2='objects' ;; + *) + $2='obj_s' ;; + esac esac ])dnl dnl --------------------------------------------------------------------------- @@ -1823,11 +2095,13 @@ ifelse($1,,,[$1=$PATHSEP]) dnl --------------------------------------------------------------------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the -dnl result begins with 'NONE'. This is necessary to workaround autoconf's +dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ case ".[$]$1" in #(vi -./*) #(vi +.\[$]\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; .[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX ;; @@ -1843,7 +2117,7 @@ case ".[$]$1" in #(vi $1=`echo [$]$1 | sed -e s@NONE@$ac_default_prefix@` ;; *) - AC_ERROR(expected a pathname, not "[$]$1") + ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl @@ -1867,6 +2141,7 @@ cygwin*) ;; esac AC_SUBST(PROG_EXT) +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -1933,12 +2208,16 @@ dnl dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi dnl version when making symbolic links. dnl +dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library +dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix +dnl (ex: libncurses.so.<ver>). +dnl dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - LOCAL_LDFLAGS= - LOCAL_LDFLAGS2= + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" @@ -1979,10 +2258,25 @@ AC_DEFUN([CF_SHARED_OPTS], CFLAGS="$cf_save_CFLAGS" fi + cf_cv_shlib_version_infix=no + case $cf_cv_system_name in beos*) MK_SHARED_LIB='$(CC) -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; + cygwin*) + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + ;; + darwin*) + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $[@]` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $[@]' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi + cf_cv_shlib_version_infix=yes + ;; hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then @@ -2010,8 +2304,8 @@ AC_DEFUN([CF_SHARED_OPTS], ;; linux*|gnu*) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + 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," @@ -2033,8 +2327,8 @@ AC_DEFUN([CF_SHARED_OPTS], 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,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + 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 @@ -2050,16 +2344,16 @@ AC_DEFUN([CF_SHARED_OPTS], # tested with OSF/1 V3.2 and 'cc' # 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 $[@]`' + MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $[@]`' case $host_os in osf4*) - MK_SHARED_LIB="${MK_SHARED_LIB} -msym" + 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,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-rpath" @@ -2097,7 +2391,7 @@ AC_DEFUN([CF_SHARED_OPTS], MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-R" @@ -2282,11 +2576,11 @@ do fi done AC_MSG_RESULT($cf_cv_src_modules) -TEST_ARGS="-L${LIB_DIR} -L\$(libdir) $TEST_ARGS" +TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" AC_SUBST(TEST_DEPS) AC_SUBST(TEST_ARGS) -PROG_ARGS="-L${LIB_DIR} -L\$(libdir) $PROG_ARGS" +PROG_ARGS="-L${LIB_DIR} $PROG_ARGS" AC_SUBST(PROG_ARGS) SRC_SUBDIRS="man include" @@ -2294,7 +2588,8 @@ for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS misc test" +SRC_SUBDIRS="$SRC_SUBDIRS test" +test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= @@ -2434,7 +2729,8 @@ NCURSES_PATCH="`egrep '^NCURSES_PATCH[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0 cf_cv_abi_version=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} dnl Show the computed version, for logging -AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)) +cf_cv_timestamp=`date` +AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)) dnl We need these values in the generated headers AC_SUBST(NCURSES_MAJOR) AC_SUBST(NCURSES_MINOR) @@ -2444,6 +2740,7 @@ AC_SUBST(cf_cv_rel_version) AC_SUBST(cf_cv_abi_version) AC_SUBST(cf_cv_cc_bool_type) AC_SUBST(cf_cv_builtin_bool) +AC_SUBST(cf_cv_header_stdbool_h) AC_SUBST(cf_cv_type_of_bool)dnl ])dnl dnl --------------------------------------------------------------------------- @@ -2571,57 +2868,9 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl Compute the shift-mask that we'll use for wide-character indices. We use -dnl all but the index portion of chtype for storing attributes. -AC_DEFUN([CF_WIDEC_SHIFT], -[ -AC_REQUIRE([CF_TYPEOF_CHTYPE]) -AC_MSG_CHECKING([for number of bits in chtype]) -AC_CACHE_VAL(cf_cv_shift_limit,[ - AC_TRY_RUN([ -#include <stdio.h> -int main() -{ - FILE *fp = fopen("cf_test.out", "w"); - if (fp != 0) { - int n; - unsigned TYPEOF_CHTYPE x = 1L; - for (n = 0; ; n++) { - unsigned long y = (x >> n); - if (y != 1 || x == 0) - break; - x <<= 1; - } - fprintf(fp, "%d", n); - fclose(fp); - } - exit(0); -} - ], - [cf_cv_shift_limit=`cat cf_test.out`], - [cf_cv_shift_limit=32], - [cf_cv_shift_limit=32]) - rm -f cf_test.out - ]) -AC_MSG_RESULT($cf_cv_shift_limit) -AC_SUBST(cf_cv_shift_limit) - -AC_MSG_CHECKING([for width of character-index]) -AC_CACHE_VAL(cf_cv_widec_shift,[ -if test ".$with_widec" = ".yes" ; then - cf_attrs_width=39 - if ( expr $cf_cv_shift_limit \> $cf_attrs_width >/dev/null ) - then - cf_cv_widec_shift=`expr 16 + $cf_cv_shift_limit - $cf_attrs_width` - else - cf_cv_widec_shift=16 - fi -else - cf_cv_widec_shift=8 -fi -]) -AC_MSG_RESULT($cf_cv_widec_shift) -AC_SUBST(cf_cv_widec_shift) +dnl Use AC_VERBOSE w/o the warnings +AC_DEFUN([CF_VERBOSE], +[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG ])dnl dnl --------------------------------------------------------------------------- dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just @@ -2648,13 +2897,14 @@ dnl $2 = help-text dnl $3 = environment variable to set dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message +dnl $6 = flag to tell if we want to define or substitute dnl AC_DEFUN([CF_WITH_PATHLIST],[ AC_REQUIRE([CF_PATHSEP]) AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl +ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do @@ -2664,6 +2914,18 @@ do done IFS="$ac_save_ifs" -eval $3="$cf_dst_path" +ifelse($6,define,[ +# Strip single quotes from the value, e.g., when it was supplied as a literal +# for $4 or $5. +case $cf_dst_path in #(vi +\'*) + cf_dst_path=`echo $cf_dst_path |sed -e s/\'// -e s/\'\$//` + ;; +esac +cf_dst_path=`echo "$cf_dst_path" | sed -e 's/\\\\/\\\\\\\\/g'` +]) + +eval '$3="$cf_dst_path"' AC_SUBST($3)dnl + ])dnl diff --git a/contrib/ncurses/c++/Makefile.in b/contrib/ncurses/c++/Makefile.in index 96f338f..9555320 100644 --- a/contrib/ncurses/c++/Makefile.in +++ b/contrib/ncurses/c++/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.58 2001/04/21 21:31:08 tom Exp $ +# $Id: Makefile.in,v 1.64 2002/01/19 20:25:31 NIIBE.Yutaka Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 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"), # @@ -55,6 +55,9 @@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ AR_OPTS = @AR_OPTS@ + +CXX_AR = @CXX_AR@ +CXX_AR_OPTS = @CXX_AR_OPTS@ RANLIB = @RANLIB@ CXX = @CXX@ @@ -88,9 +91,9 @@ LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ -LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) -l$(LIBROOT)@LIB_SUFFIX@ +LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ -LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) ../lib/$(LIBNAME) +LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib ../lib/$(LIBNAME) LINK_NORMAL = $(LINK_FLAGS) LINK_DEBUG = $(LINK_FLAGS) LINK_PROFILE = $(LINK_FLAGS) @@ -117,6 +120,8 @@ all :: demo$x sources : $(AUTO_SRC) +depend : + # Build a conventional library for installing, since a shared library would # pull in all of the ncurses libraries (panel, menu, form, ncurses) as direct # dependencies. @@ -131,7 +136,7 @@ LIB_OBJS = \ $(MODEL)/cursesmain.o ../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) - $(AR) $(AR_OPTS) $@ $? + $(CXX_AR) $(CXX_AR_OPTS) $@ $? $(RANLIB) $@ ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) @@ -154,7 +159,7 @@ etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ install \ install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir) @@ -165,9 +170,10 @@ uninstall.libs:: -$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ii *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace clean :: mostlyclean + -rm -rf $(MODEL)/SunWS_cache -$(LIBTOOL) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:.o=.lo) $(OBJS_DEMO) -rm -rf .libs diff --git a/contrib/ncurses/c++/cursesf.cc b/contrib/ncurses/c++/cursesf.cc index 35e01ee..f25d2d5 100644 --- a/contrib/ncurses/c++/cursesf.cc +++ b/contrib/ncurses/c++/cursesf.cc @@ -35,7 +35,7 @@ #include "cursesf.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesf.cc,v 1.13 2001/03/24 20:03:51 tom Exp $") +MODULE_ID("$Id: cursesf.cc,v 1.14 2001/07/14 20:54:43 juergen Exp $") NCursesFormField::~NCursesFormField () { if (field) @@ -267,7 +267,7 @@ NCursesForm::operator()(void) { show(); refresh(); - while (((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) { + while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { switch((err=driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); diff --git a/contrib/ncurses/c++/cursesf.h b/contrib/ncurses/c++/cursesf.h index 3dc2e95..e3655f2 100644 --- a/contrib/ncurses/c++/cursesf.h +++ b/contrib/ncurses/c++/cursesf.h @@ -31,7 +31,7 @@ * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $Id: cursesf.h,v 1.15 2001/03/24 21:41:23 tom Exp $ +// $Id: cursesf.h,v 1.16 2001/07/15 00:02:53 tom Exp $ #ifndef NCURSES_CURSESF_H_incl #define NCURSES_CURSESF_H_incl 1 @@ -265,7 +265,7 @@ public: OnError(::set_field_buffer(field,buffer,val)); } - // Retrieve the value of a fields buffer. The defaukt buffer is nr. 0 + // Retrieve the value of a fields buffer. The default buffer is nr. 0 inline char* value(int buffer = 0) const { return ::field_buffer(field,buffer); } diff --git a/contrib/ncurses/c++/cursesm.cc b/contrib/ncurses/c++/cursesm.cc index 410cdbc..d9b0a63 100644 --- a/contrib/ncurses/c++/cursesm.cc +++ b/contrib/ncurses/c++/cursesm.cc @@ -35,7 +35,7 @@ #include "cursesm.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesm.cc,v 1.15 2001/03/24 20:03:56 tom Exp $") +MODULE_ID("$Id: cursesm.cc,v 1.16 2001/07/14 20:54:43 juergen Exp $") NCursesMenuItem::~NCursesMenuItem() { if (item) @@ -290,9 +290,9 @@ NCursesMenu::operator()(void) { post(); show(); refresh(); - - while (!b_action && ((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) { - + + while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { + switch((err=driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); diff --git a/contrib/ncurses/c++/cursesmain.cc b/contrib/ncurses/c++/cursesmain.cc index 03f61bc..6b34b52 100644 --- a/contrib/ncurses/c++/cursesmain.cc +++ b/contrib/ncurses/c++/cursesmain.cc @@ -34,7 +34,7 @@ #include "internal.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesmain.cc,v 1.7 2001/03/24 21:25:47 tom Exp $") +MODULE_ID("$Id: cursesmain.cc,v 1.8 2001/07/14 20:54:43 juergen Exp $") /* This is the default implementation of main() for a NCursesApplication. * You only have to instantiate a static NCursesApplication object in your @@ -45,7 +45,13 @@ int main(int argc, char* argv[]) NCursesApplication* A = NCursesApplication::getApplication(); if (!A) return(1); - A->handleArgs(argc,argv); - ::endwin(); - return((*A)()); + else { + int res; + + A->handleArgs(argc,argv); + ::endwin(); + res = (*A)(); + ::endwin(); + return(res); + } } diff --git a/contrib/ncurses/c++/cursesp.cc b/contrib/ncurses/c++/cursesp.cc index bfd4d9f..7fb5e51 100644 --- a/contrib/ncurses/c++/cursesp.cc +++ b/contrib/ncurses/c++/cursesp.cc @@ -35,7 +35,7 @@ #include "cursesp.h" #include <string.h> -MODULE_ID("$Id: cursesp.cc,v 1.18 2001/03/24 20:04:04 tom Exp $") +MODULE_ID("$Id: cursesp.cc,v 1.19 2001/07/14 20:54:43 juergen Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -122,3 +122,8 @@ NCursesPanel::centertext(int row,const char *label) { OnError(addstr(row, x, label, width())); } } + +int +NCursesPanel::getKey(void) { + return getch(); +} diff --git a/contrib/ncurses/c++/cursesp.h b/contrib/ncurses/c++/cursesp.h index b56580a..1a656f5 100644 --- a/contrib/ncurses/c++/cursesp.h +++ b/contrib/ncurses/c++/cursesp.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +34,7 @@ #ifndef NCURSES_CURSESP_H_incl #define NCURSES_CURSESP_H_incl 1 -// $Id: cursesp.h,v 1.14 2001/03/24 21:41:35 tom Exp $ +// $Id: cursesp.h,v 1.15 2001/07/14 20:56:18 juergen Exp $ #include <cursesw.h> @@ -79,6 +79,9 @@ protected: // If err is equal to the curses error indicator ERR, an error handler // is called. + // Get a keystroke. Default implementation calls getch() + virtual int getKey(void); + public: NCursesPanel(int lines, int cols, diff --git a/contrib/ncurses/c++/cursesw.cc b/contrib/ncurses/c++/cursesw.cc index 463554b..fb6bd8b1 100644 --- a/contrib/ncurses/c++/cursesw.cc +++ b/contrib/ncurses/c++/cursesw.cc @@ -25,7 +25,7 @@ #include "internal.h" #include "cursesw.h" -MODULE_ID("$Id: cursesw.cc,v 1.21 2001/04/07 22:11:39 tom Exp $") +MODULE_ID("$Id: cursesw.cc,v 1.24 2001/12/08 21:02:33 tom Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -36,6 +36,14 @@ MODULE_ID("$Id: cursesw.cc,v 1.21 2001/04/07 22:11:39 tom Exp $") long NCursesWindow::count = 0L; bool NCursesWindow::b_initialized = FALSE; +/* + * The ncurses library has a fallback for vsscanf(), which may work... + */ +#if !(USE_STRSTREAM_VSCAN || USE_STRSTREAM_VSCAN_CAST) +# undef USE_STDIO_VSCAN +# define USE_STDIO_VSCAN 1 +#endif + #if defined(__GNUG__) # ifndef _IO_va_list # define _IO_va_list char * @@ -46,23 +54,25 @@ int NCursesWindow::scanw(const char* fmt, ...) { int result = ERR; -#if defined(__GNUG__) char buf[BUFSIZ]; if (::wgetnstr(w, buf, sizeof(buf)) != ERR) { va_list args; va_start(args, fmt); #if USE_STDIO_VSCAN - if (::vscanf(fmt, args) != -1) + if (::vsscanf(buf, fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN /* powerpc, os390 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) result = OK; -#elif USE_STRSTREAM_VSCAN /* pre-gcc 3.0 */ +#elif USE_STRSTREAM_VSCAN_CAST /* pre-gcc 3.0 */ strstreambuf ss(buf, sizeof(buf)); if (ss.vscan(fmt, (_IO_va_list)args) != -1) result = OK; #endif va_end(args); } -#endif return result; } @@ -71,7 +81,6 @@ int NCursesWindow::scanw(int y, int x, const char* fmt, ...) { int result = ERR; -#if defined(__GNUG__) char buf[BUFSIZ]; if (::wmove(w, y, x) != ERR) { @@ -79,9 +88,13 @@ NCursesWindow::scanw(int y, int x, const char* fmt, ...) va_list args; va_start(args, fmt); #if USE_STDIO_VSCAN - if (::vscanf(fmt, args) != -1) + if (::vsscanf(buf, fmt, args) != -1) result = OK; -#elif USE_STRSTREAM_VSCAN /* pre-gcc 3.0 */ +#elif USE_STRSTREAM_VSCAN /* powerpc, os390 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN_CAST /* pre-gcc 3.0 */ strstreambuf ss(buf, sizeof(buf)); if (ss.vscan(fmt, (_IO_va_list)args) != -1) result = OK; @@ -89,7 +102,6 @@ NCursesWindow::scanw(int y, int x, const char* fmt, ...) va_end(args); } } -#endif return result; } diff --git a/contrib/ncurses/c++/cursesw.h b/contrib/ncurses/c++/cursesw.h index dcaadd9..5383399 100644 --- a/contrib/ncurses/c++/cursesw.h +++ b/contrib/ncurses/c++/cursesw.h @@ -30,13 +30,13 @@ #ifndef NCURSES_CURSESW_H_incl #define NCURSES_CURSESW_H_incl 1 -// $Id: cursesw.h,v 1.25 2001/04/07 22:44:07 tom Exp $ +// $Id: cursesw.h,v 1.28 2001/07/15 01:17:56 tom Exp $ #include <etip.h> #include <stdio.h> #include <stdarg.h> -#if HAVE_STRSTREAM_H && USE_STRSTREAM_VSCAN +#if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) #include <strstream.h> #endif @@ -752,7 +752,7 @@ public: int cols, // number of columns int begin_y, // absolute or relative int begin_x, // origins: - char absrel = 'a');// if `a', by & bx are + char absrel = 'a');// if `a', begin_y & begin_x are // absolute screen pos, else if `r', they are relative to par origin NCursesWindow(NCursesWindow& par,// parent window @@ -778,7 +778,7 @@ public: // lowlevel ripoffline() function because it uses the internal // implementation that allows to remove more than just a single line. // This function must be called before any other ncurses function. The - // creation of the window is defered until ncurses gets initialized. + // creation of the window is deferred until ncurses gets initialized. // The initialization function is then called. // ------------------------------------------------------------------------- @@ -796,7 +796,7 @@ public: static int NumberOfColors(); // Number of available colors - int colors() const { return NumberOfColors(); } + int colors() const { return NumberOfColors(); } // Number of available colors // ------------------------------------------------------------------------- @@ -820,25 +820,25 @@ public: int maxy() const { return w->_maxy; } // Largest y coord in window - short getcolor() const; + short getcolor() const; // Actual color pair - short foreground() const { return getcolor(0); } + short foreground() const { return getcolor(0); } // Actual foreground color - short background() const { return getcolor(1); } + short background() const { return getcolor(1); } // Actual background color - int setpalette(short fore, short back); + int setpalette(short fore, short back); // Set color palette entry - int setcolor(short pair); + int setcolor(short pair); // Set actually used palette entry // ------------------------------------------------------------------------- // window positioning // ------------------------------------------------------------------------- - virtual int mvwin(int begin_y, int begin_x) { + virtual int mvwin(int begin_y, int begin_x) { return ::mvwin(w,begin_y,begin_x); } // Move window to new position with the new position as top left corner. // This is virtual because it is redefined in NCursesPanel. @@ -887,8 +887,7 @@ public: // as described above. int scanw(const char* fmt, ...) - // Perform a scanw function from the window. This only works if you're - // using the GNU C++ compiler. + // Perform a scanw function from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 2, 3))); #else @@ -897,7 +896,7 @@ public: int scanw(int y, int x, const char* fmt, ...) // Move the cursor to the requested position and then perform a scanw - // from the window. This nly works if you're using the GNU C++ compiler. + // from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 4, 5))); #else @@ -930,7 +929,7 @@ public: int printw(const char* fmt, ...) // Do a formatted print to the window. -#if __GNUG__ >= 2 +#if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 2, 3))); #else ; @@ -938,7 +937,7 @@ public: int printw(int y, int x, const char * fmt, ...) // Move the cursor and then do a formatted print to the window. -#if __GNUG__ >= 2 +#if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 4, 5))); #else ; @@ -1021,7 +1020,7 @@ public: int box(chtype vert=0, chtype hor=0) { return ::wborder(w, vert, vert, hor, hor, 0, 0 ,0, 0); } // Draw a box around the window with the given vertical and horizontal - // drawing characters. If you specifiy a zero as character, curses will try + // drawing characters. If you specify a zero as character, curses will try // to find a "nice" character. int border(chtype left=0, chtype right=0, diff --git a/contrib/ncurses/c++/demo.cc b/contrib/ncurses/c++/demo.cc index 8db7000..56573cd 100644 --- a/contrib/ncurses/c++/demo.cc +++ b/contrib/ncurses/c++/demo.cc @@ -6,7 +6,7 @@ * Demo code for NCursesMenu and NCursesForm written by * Juergen Pfeifer <juergen.pfeifer@gmx.net> * - * $Id: demo.cc,v 1.20 2001/01/28 02:26:27 tom Exp $ + * $Id: demo.cc,v 1.21 2001/07/15 01:15:26 tom Exp $ */ #include "cursesapp.h" @@ -19,7 +19,7 @@ extern "C" unsigned int sleep(unsigned int); -#undef index // needed for NeXT +#undef index // needed for NeXT // // ------------------------------------------------------------------------- @@ -140,7 +140,7 @@ template<class T> class MyAction : public NCursesUserItem<T> { public: MyAction (const char* p_name, - const T* p_UserData) + const T* p_UserData) : NCursesUserItem<T>(p_name, (const char*)0, p_UserData) {}; @@ -170,7 +170,7 @@ class Label : public NCursesFormField { public: Label(const char* title, - int row, int col) + int row, int col) : NCursesFormField(1,(int)::strlen(title),row,col) { set_value(title); options_off(O_EDIT|O_ACTIVE); @@ -293,18 +293,18 @@ public: for (int i=0; i < PADSIZE; i++) { for (int j=0; j < PADSIZE; j++) { - if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { - if (i==0 || j==0) - FP.addch('+'); - else - FP.addch((chtype)('A' + (gridcount++ % 26))); - } - else if (i % GRIDSIZE == 0) - FP.addch('-'); - else if (j % GRIDSIZE == 0) - FP.addch('|'); - else - FP.addch(' '); + if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { + if (i==0 || j==0) + FP.addch('+'); + else + FP.addch((chtype)('A' + (gridcount++ % 26))); + } + else if (i % GRIDSIZE == 0) + FP.addch('-'); + else if (j % GRIDSIZE == 0) + FP.addch('|'); + else + FP.addch(' '); } } @@ -324,6 +324,49 @@ public: options_off(O_SELECTABLE); } }; + +// +// ------------------------------------------------------------------------- +// +class ScanAction : public NCursesMenuItem +{ +public: + ScanAction(const char* s) : NCursesMenuItem(s) { + } + + bool action() { + NCursesPanel *std = new NCursesPanel(); + + NCursesPanel *w = new NCursesPanel(std->lines() - 2, std->cols() - 2, 1, 1); + w->box(); + w->refresh(); + + NCursesPanel *s = new NCursesPanel(w->lines() - 6, w->cols() - 6, 3, 3); + s->scrollok(TRUE); + ::echo(); + + s->printw("Enter decimal integers. The running total will be shown\n"); + int value = -1; + int result = 0; + while (value != 0) { + value = 0; + s->scanw("%d", &value); + if (value != 0) { + s->printw("%d: ", result += value); + } + s->refresh(); + } + s->printw("\nPress any key to continue..."); + s->getch(); + + delete s; + delete w; + delete std; + ::noecho(); + return FALSE; + } +}; + // // ------------------------------------------------------------------------- // @@ -346,7 +389,7 @@ public: I[2] = new MyAction<UserData> ("Silly", u); I[3] = new FormAction("Form"); I[4] = new PadAction("Pad"); - I[5] = new PassiveItem("Six"); + I[5] = new ScanAction("Scan"); I[6] = new QuitItem(); I[7] = new NCursesMenuItem(); // Terminating empty item diff --git a/contrib/ncurses/c++/edit_cfg.sh b/contrib/ncurses/c++/edit_cfg.sh index e2f828a..e0c1822 100755 --- a/contrib/ncurses/c++/edit_cfg.sh +++ b/contrib/ncurses/c++/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.10 2001/04/07 22:45:11 tom Exp $ +# $Id: edit_cfg.sh,v 1.12 2001/12/08 20:44:59 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 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"), # @@ -47,8 +47,8 @@ for name in \ HAVE_STRSTREAM_H \ HAVE_TYPEINFO \ HAVE_VALUES_H \ - USE_STDIO_VSCAN \ - USE_STRSTREAM_VSCAN + USE_STRSTREAM_VSCAN \ + USE_STRSTREAM_VSCAN_CAST do mv $2 $2.bak if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) diff --git a/contrib/ncurses/c++/etip.h.in b/contrib/ncurses/c++/etip.h.in index d3421d2..85e4df2 100644 --- a/contrib/ncurses/c++/etip.h.in +++ b/contrib/ncurses/c++/etip.h.in @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $Id: etip.h.in,v 1.18 2001/04/07 22:45:04 tom Exp $ +// $Id: etip.h.in,v 1.22 2001/12/08 21:26:49 tom Exp $ #ifndef NCURSES_ETIP_H_incl #define NCURSES_ETIP_H_incl 1 @@ -73,14 +73,14 @@ #define CPP_HAS_PARAM_INIT 0 #endif -#ifndef USE_STDIO_VSCAN -#define USE_STDIO_VSCAN 0 -#endif - #ifndef USE_STRSTREAM_VSCAN #define USE_STRSTREAM_VSCAN 0 #endif +#ifndef USE_STRSTREAM_VSCAN_CAST +#define USE_STRSTREAM_VSCAN_CAST 0 +#endif + #ifdef __GNUG__ # if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) # if HAVE_TYPEINFO @@ -274,8 +274,12 @@ inline void THROW(const NCursesException *e) { throw *e; #endif #elif defined(__SUNPRO_CC) +# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) genericerror(1, ((e != 0) ? (char *)(e->message) : "")); #else + throw *e; +#endif +#else if (e) cerr << e->message << endl; exit(0); diff --git a/contrib/ncurses/config.guess b/contrib/ncurses/config.guess index 71de137..ff40ddb 100755 --- a/contrib/ncurses/config.guess +++ b/contrib/ncurses/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-03-16' +timestamp='2002-03-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,8 +24,9 @@ timestamp='2001-03-16' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner <bothner@cygnus.com>. -# Please send patches to <config-patches@gnu.org>. +# Originally written by Per Bothner <per@bothner.com>. +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -52,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -95,25 +96,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c - for c in cc gcc c89 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 c99 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then - CC_FOR_BUILD="$c"; break - fi - done - rm -f $dummy.c $dummy.o $dummy.rel + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found + CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac +esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi @@ -127,29 +128,30 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-unknown ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. - case "${UNAME_MACHINE}" in - i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then @@ -171,6 +173,45 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -204,6 +245,7 @@ main: jsr \$26,exit .end main EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in @@ -225,6 +267,9 @@ EOF 2-307) UNAME_MACHINE="alphaev67" ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; esac fi rm -f $dummy.s $dummy @@ -242,29 +287,11 @@ EOF Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -314,7 +341,7 @@ EOF echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) @@ -328,9 +355,6 @@ EOF aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -357,18 +381,6 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -385,6 +397,7 @@ EOF echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ @@ -412,6 +425,9 @@ EOF rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -459,7 +475,7 @@ EOF ????????: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:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) @@ -472,6 +488,7 @@ EOF exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <sys/systemcfg.h> @@ -493,7 +510,7 @@ EOF fi exit 0 ;; *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else @@ -533,10 +550,8 @@ EOF 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - case "${HPUX_REV}" in - 11.[0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 @@ -545,12 +560,13 @@ EOF case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac - fi ;; - esac - if [ "${HP_ARCH}" = "" ]; then - sed 's/^ //' << EOF >$dummy.c + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include <stdlib.h> @@ -583,10 +599,10 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy - fi ;; + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; @@ -595,6 +611,7 @@ EOF echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <unistd.h> int @@ -630,7 +647,7 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) @@ -639,7 +656,7 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -649,9 +666,6 @@ EOF parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -670,16 +684,14 @@ EOF C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' @@ -693,19 +705,13 @@ EOF CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -717,9 +723,6 @@ EOF *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; @@ -729,6 +732,9 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -754,103 +760,49 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) - cat >$dummy.c <<EOF -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ -int main (int argc, char *argv[]) { -#else -int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) - # Determine Lib Version - cat >$dummy.c <<EOF -#include <features.h> -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unknown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then LIBC="libc1" ; fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) - cat <<EOF >$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) UNAME_MACHINE="alpha" ;; - 1-0) UNAME_MACHINE="alphaev5" ;; - 1-1) UNAME_MACHINE="alphaev56" ;; - 1-101) UNAME_MACHINE="alphapca56" ;; - 2-303) UNAME_MACHINE="alphaev6" ;; - 2-307) UNAME_MACHINE="alphaev67" ;; - esac - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) @@ -876,78 +828,67 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; - i?86:Linux:*:*) + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_supported_emulations=`cd /; ld --help 2>&1 \ - | sed -ne '/supported emulations:/!d + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g - s/.*supported emulations: *// + s/.*supported targets: *// s/ .*// p'` - case "$ld_supported_emulations" in - i?86linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) + case "$ld_supported_targets" in + elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - i?86coff) + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - esac - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; esac # Determine whether the default compiler is a.out or elf - cat >$dummy.c <<EOF -#include <features.h> -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) + i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, @@ -955,7 +896,7 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -963,16 +904,15 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; - i?86:*:3.2:*) + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL @@ -990,7 +930,7 @@ EOF echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i?86:*DOS:*:*) + i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) @@ -1018,7 +958,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1029,13 +969,13 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) @@ -1044,7 +984,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) @@ -1064,8 +1004,8 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -1077,6 +1017,10 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; @@ -1115,15 +1059,17 @@ EOF echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo `uname -p`-${UNAME_MACHINE}-nto-qnx + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[KW]:NONSTOP_KERNEL:*:*) + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1146,7 +1092,7 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i?86:OS/2:*:*) + i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx @@ -1169,11 +1115,18 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_ # include <sys/types.h> diff --git a/contrib/ncurses/config.sub b/contrib/ncurses/config.sub index 9df4e53..299f3f4 100755 --- a/contrib/ncurses/config.sub +++ b/contrib/ncurses/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-03-09' +timestamp='2002-04-26' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -29,7 +29,8 @@ timestamp='2001-03-09' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Please send patches to <config-patches@gnu.org>. +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -117,7 +118,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -157,6 +158,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -215,24 +224,36 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ - | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ - | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | sh[34] \ - | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp10 | pdp11 \ - | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr | openrisc) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 | mipsisa64 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -240,13 +261,13 @@ case $basic_machine in basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[234567]86 | x86_64) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -255,30 +276,45 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ - | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ - | [cjt]90-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-* | x86_64-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -341,6 +377,10 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -361,16 +401,8 @@ case $basic_machine in basic_machine=c38-convex os=-bsd ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [cjt]90) - basic_machine=${basic_machine}-cray + cray | j90) + basic_machine=j90-cray os=-unicos ;; crds | unos) @@ -385,6 +417,14 @@ case $basic_machine in decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -505,19 +545,19 @@ case $basic_machine in basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -565,14 +605,6 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -587,6 +619,10 @@ case $basic_machine in basic_machine=m68k-rom68k os=-coff ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; msdos) basic_machine=i386-pc os=-msdos @@ -666,6 +702,10 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -691,7 +731,7 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexgen) + pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) @@ -700,7 +740,7 @@ case $basic_machine in pentiumii | pentium2) basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) @@ -724,6 +764,16 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; @@ -741,6 +791,12 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi @@ -752,7 +808,7 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -810,7 +866,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -818,8 +874,16 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; t3e) - basic_machine=t3e-cray + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) @@ -832,6 +896,10 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -878,13 +946,17 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - xmp) - basic_machine=xmp-cray - os=-unicos + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt ;; xps | xps100) basic_machine=xps100-honeywell ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim @@ -905,13 +977,6 @@ case $basic_machine in op60c) basic_machine=hppa1.1-oki ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; romp) basic_machine=romp-ibm ;; @@ -931,10 +996,13 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4) + sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; - sparc | sparcv9) + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -956,6 +1024,9 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -1012,16 +1083,19 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in - x86-* | i[34567]86-*) + x86-* | i*86-*) ;; *) os=-nto$os @@ -1068,12 +1142,18 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; + -nova*) + os=-rtmk-nova + ;; -ns2 ) os=-nextstep2 ;; @@ -1148,6 +1228,7 @@ case $basic_machine in arm*-semi) os=-aout ;; + # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; @@ -1178,6 +1259,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or32-*) + os=-coff + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -1325,7 +1409,7 @@ case $basic_machine in -ptx*) vendor=sequent ;; - -vxsim* | -vxworks*) + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) @@ -1340,6 +1424,9 @@ case $basic_machine in -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff --git a/contrib/ncurses/configure b/contrib/ncurses/configure index d8e599b..59cd609 100755 --- a/contrib/ncurses/configure +++ b/contrib/ncurses/configure @@ -1,11 +1,11 @@ #! /bin/sh -# From configure.in Revision: 1.233 +# From configure.in Revision: 1.267 # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13.20000819 +# Generated automatically using autoconf version 2.13.20020210 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -189,19 +189,23 @@ cat <<EOF --enable and --with options recognized: --with-system-type=XXX test: override derived host system-type --enable-add-ons=DIR... used to check if we are a glibc add-on. + --with-build-cc=XXX if cross-compiling, the host C compiler (\$BUILD_CC) + --with-build-cflags=XXX if cross-compiling, the host C compiler-flags + --with-build-ldflags=XXX if cross-compiling, the host linker-flags + --with-build-libs=XXX if cross-compiling, the host libraries --without-cxx do not adjust ncurses bool to match C++ --without-cxx-binding do not build C++ binding and demo --without-ada suppress check for Ada95, don't build demo --without-progs suppress build with programs (e.g., tic) --without-curses-h install curses.h as ncurses.h only - --with-install-prefix prefixes actual install-location + --with-install-prefix prefixes actual install-location (\$DESTDIR) Options to Specify the Libraries Built/Used: +EOF +cat <<EOF --with-libtool generate libraries with libtool --with-shared generate shared-libraries --with-normal generate normal-libraries (default) --with-debug generate debug-libraries (default) -EOF -cat <<EOF --with-profile generate profile-libraries --with-termlib generate separate terminfo library --with-dbmalloc test: use Conor Cahill's dbmalloc library @@ -210,26 +214,28 @@ cat <<EOF --enable-rpath use rpath option when generating shared libraries --with-shlib-version=X Specify rel or abi version for shared libs Fine-Tuning Your Configuration: +EOF +cat <<EOF --disable-overwrite leave out the link to -lcurses - --disable-database use only built-in data + --disable-database do not use terminfo, only fallbacks/termcap --with-database=XXX specify terminfo source to install --with-fallbacks=XXX specify list of fallback terminal descriptions -EOF -cat <<EOF --with-terminfo-dirs=XXX specify list of terminfo directories (default: DATADIR/terminfo) --with-default-terminfo-dir=DIR default terminfo directory (default: DATADIR/terminfo) --disable-big-core assume machine has little memory --enable-termcap compile in termcap fallback support + --with-termpath=XXX specify list of termcap files (default: /etc/termcap:/usr/share/misc/termcap) --enable-getcap fast termcap load, no xrefs to terminfo --enable-getcap-cache cache translated termcaps in ~/.terminfo --enable-symlinks make tic use symbolic links not hard links +EOF +cat <<EOF --enable-broken_linker compile with broken-linker support code + --with-bool=TYPE override fallback type of bool variable --with-ospeed=TYPE override type of ospeed variable --enable-bsdpad recognize BSD-style prefix padding --with-rcs-ids compile-in RCS identifiers Options to Specify How Manpages are Installed: -EOF -cat <<EOF --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and optionally formatted, e.g., gzip,formatted --with-manpage-renames specify manpage-renaming @@ -237,33 +243,36 @@ cat <<EOF --with-manpage-tbl specify manpage processing with tbl Extensions: --disable-ext-funcs disable function-extensions +EOF +cat <<EOF --enable-const compile with extra/non-standard const --enable-no-padding compile with \$NCURSES_NO_PADDING code --enable-sigwinch compile with SIGWINCH handler --enable-tcap-names compile with user-definable terminal capabilities Development Code: --with-develop enable all development options -EOF -cat <<EOF --enable-colorfgbg compile with \$COLORFGBG code --enable-hard-tabs compile with hard-tabs code --disable-root-environ limit environment when running as root --enable-xmc-glitch compile with limited support for xmc Experimental Code: --disable-assumed-color do not assume anything about default-colors +EOF +cat <<EOF --disable-hashmap compile without hashmap scrolling-optimization --enable-safe-sprintf compile with experimental safe-sprintf code --disable-scroll-hints compile without scroll-hints code --enable-widec compile with experimental wide-char/UTF-8 code + --with-caps=alt compile with experimental alternate Caps file Testing/development Options: --enable-echo build: display "compiling" commands (default) -EOF -cat <<EOF --enable-warnings build: turn on GCC compiler warnings --enable-assertions test: turn on generation of assertion code --disable-leaks test: suppress permanent memory-leaks --enable-expanded test: generate functions for certain macros --disable-macros test: use functions rather than macros +EOF +cat <<EOF Ada95 Binding Options: --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake) --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/lib/ada/adainclude) @@ -418,7 +427,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13.20000819" + echo "configure generated by autoconf version 2.13.20020210" exit 0 ;; -with-* | --with-*) @@ -614,7 +623,9 @@ NCURSES_MINOR="`egrep '^NCURSES_MINOR[ ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9] NCURSES_PATCH="`egrep '^NCURSES_PATCH[ ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" cf_cv_abi_version=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} -echo "$ac_t""Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)" 1>&6 +cf_cv_timestamp=`date` +echo "$ac_t""Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" 1>&6 + @@ -672,7 +683,7 @@ 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:676: checking host system type" >&5 +echo "configure:687: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -693,7 +704,7 @@ 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:697: checking target system type" >&5 +echo "configure:708: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -711,7 +722,7 @@ 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:715: checking build system type" >&5 +echo "configure:726: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -752,7 +763,7 @@ fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$ac_t"""Configuring for $cf_cv_system_name"" 1>&6 +test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6 if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6 @@ -804,7 +815,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location echo $ac_n "checking for prefix""... $ac_c" 1>&6 -echo "configure:808: checking for prefix" >&5 +echo "configure:819: checking for prefix" >&5 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in # non-vendor systems don't have a conflict @@ -819,7 +830,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:823: checking for default include-directory" >&5 +echo "configure:834: checking for default include-directory" >&5 test -n "$verbose" && echo 1>&6 for cf_symbol in \ $includedir \ @@ -849,7 +860,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:853: checking for $ac_word" >&5 +echo "configure:864: 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 @@ -879,7 +890,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:883: checking for $ac_word" >&5 +echo "configure:894: 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 @@ -930,7 +941,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:934: checking for $ac_word" >&5 +echo "configure:945: 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 @@ -962,7 +973,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:966: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:977: 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. @@ -973,12 +984,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 977 "configure" +#line 988 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:993: \"$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 @@ -1004,12 +1015,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:1008: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1019: 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:1013: checking whether we are using GNU C" >&5 +echo "configure:1024: 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 @@ -1018,7 +1029,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1022: \"$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:1033: \"$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 @@ -1037,7 +1048,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:1041: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1052: 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 @@ -1068,18 +1079,34 @@ else fi fi +GCC_VERSION=none if test "$GCC" = yes ; then echo $ac_n "checking version of gcc""... $ac_c" 1>&6 -echo "configure:1074: checking version of gcc" >&5 - eval "$CC --version" -fi -if test "$host" != $build; then - for ac_prog in $CC gcc cc +echo "configure:1086: checking version of gcc" >&5 + GCC_VERSION="`${CC} --version|head -1`" + echo "$ac_t""$GCC_VERSION" 1>&6 +fi + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the target +# compiler, etc., but we need a host compiler to generate parts of the source. +BUILD_CC='$(CC)' +BUILD_CFLAGS='$(CFLAGS)' +BUILD_LDFLAGS='$(LDFLAGS)' +BUILD_LIBS='$(LIBS)' +if test "$host_alias" != "$target_alias" ; then + +# Check whether --with-build-cc or --without-build-cc was given. +if test "${with_build_cc+set}" = set; then + withval="$with_build_cc" + BUILD_CC="$withval" +else + 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:1083: checking for $ac_word" >&5 +echo "configure:1110: 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 @@ -1108,12 +1135,37 @@ fi test -n "$BUILD_CC" && break done -else - BUILD_CC="$CC" fi + +# Check whether --with-build-cflags or --without-build-cflags was given. +if test "${with_build_cflags+set}" = set; then + withval="$with_build_cflags" + BUILD_CFLAGS="$withval" +fi + + +# Check whether --with-build-ldflags or --without-build-ldflags was given. +if test "${with_build_ldflags+set}" = set; then + withval="$with_build_ldflags" + BUILD_LDFLAGS="$withval" +fi + + +# Check whether --with-build-libs or --without-build-libs was given. +if test "${with_build_libs+set}" = set; then + withval="$with_build_libs" + BUILD_LIBS="$withval" +fi + +fi + + + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1117: checking how to run the C preprocessor" >&5 +echo "configure:1169: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1128,13 +1180,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1132 "configure" +#line 1184 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1190: \"$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 : @@ -1145,13 +1197,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1149 "configure" +#line 1201 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1207: \"$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 : @@ -1162,13 +1214,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1166 "configure" +#line 1218 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1224: \"$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 : @@ -1194,13 +1246,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:1198: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1250: 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 <<EOF -#line 1204 "configure" +#line 1256 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -1218,7 +1270,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 1222 "configure" +#line 1274 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -1240,7 +1292,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:1244: checking for POSIXized ISC" >&5 +echo "configure:1296: 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 @@ -1262,7 +1314,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:1266: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:1318: 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 @@ -1286,26 +1338,39 @@ for cf_arg in "-DCC_HAS_PROTOS" \ -Xc do +cf_new_cflags= +cf_new_cppflags= for cf_add_cflags in $cf_arg do case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi case "$CPPFLAGS" in - *$cf_add_cflags) + *$cf_add_cflags) #(vi ;; - *) - CPPFLAGS="$CPPFLAGS $cf_add_cflags" + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; *) - CFLAGS="$CFLAGS $cf_add_cflags" + cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac done +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + + cat > conftest.$ac_ext <<EOF -#line 1309 "configure" +#line 1374 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -1321,7 +1386,7 @@ int main() { struct s2 {int (*f) (double a);}; ; return 0; } EOF -if { (eval echo configure:1325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ansi_cc="$cf_arg"; break else @@ -1340,24 +1405,37 @@ echo "$ac_t""$cf_cv_ansi_cc" 1>&6 if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then +cf_new_cflags= +cf_new_cppflags= for cf_add_cflags in $cf_cv_ansi_cc do case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi case "$CPPFLAGS" in - *$cf_add_cflags) + *$cf_add_cflags) #(vi ;; - *) - CPPFLAGS="$CPPFLAGS $cf_add_cflags" + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; *) - CFLAGS="$CFLAGS $cf_add_cflags" + cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac done +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + + else cat >> confdefs.h <<\EOF #define CC_HAS_PROTOS 1 @@ -1392,6 +1470,10 @@ cygwin*) ;; esac +test -n "$PROG_EXT" && cat >> confdefs.h <<EOF +#define PROG_EXT "$PROG_EXT" +EOF + case "$cf_cv_system_name" in @@ -1402,7 +1484,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:1406: checking for $ac_word" >&5 +echo "configure:1488: 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 @@ -1439,7 +1521,7 @@ esac echo $ac_n "checking if you want to ensure bool is consistent with C++""... $ac_c" 1>&6 -echo "configure:1443: checking if you want to ensure bool is consistent with C++" >&5 +echo "configure:1525: 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 @@ -1459,7 +1541,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:1463: checking for $ac_word" >&5 +echo "configure:1545: 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 @@ -1491,7 +1573,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1495: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1577: 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. @@ -1502,12 +1584,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1506 "configure" +#line 1588 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1593: \"$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 @@ -1533,12 +1615,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:1537: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1619: 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:1542: checking whether we are using GNU C++" >&5 +echo "configure:1624: 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 @@ -1547,7 +1629,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1551: \"$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:1633: \"$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 @@ -1566,7 +1648,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:1570: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1652: 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 @@ -1599,18 +1681,23 @@ fi fi +GXX_VERSION=none if test "$GXX" = yes; then - case "`${CXX-g++} --version`" in + echo $ac_n "checking version of g++""... $ac_c" 1>&6 +echo "configure:1688: checking version of g++" >&5 + GXX_VERSION="`${CXX-g++} --version|head -1`" + echo "$ac_t""$GXX_VERSION" 1>&6 + case $GXX_VERSION in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no cf_cxx_library=no - echo No: templates do not work + echo "configure: warning: templates do not work" 1>&2 ;; esac fi echo $ac_n "checking if you want to build C++ binding and demo""... $ac_c" 1>&6 -echo "configure:1614: checking if you want to build C++ binding and demo" >&5 +echo "configure:1701: 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 @@ -1623,7 +1710,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:1627: checking if you want to build with Ada95" >&5 +echo "configure:1714: 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 @@ -1636,7 +1723,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:1640: checking if you want to build programs such as tic" >&5 +echo "configure:1727: 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 @@ -1649,7 +1736,7 @@ 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:1653: checking if you wish to install curses.h" >&5 +echo "configure:1740: 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 @@ -1691,7 +1778,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:1695: checking for $ac_word" >&5 +echo "configure:1782: 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 @@ -1721,7 +1808,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1725: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1812: 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 @@ -1759,7 +1846,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:1763: checking for a BSD compatible install" >&5 +echo "configure:1850: 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 @@ -1822,7 +1909,7 @@ case $INSTALL in esac echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:1826: checking for long file names" >&5 +echo "configure:1913: 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 @@ -1867,7 +1954,7 @@ fi echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6 -echo "configure:1871: checking if filesystem supports mixed-case filenames" >&5 +echo "configure:1958: 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 @@ -1890,7 +1977,7 @@ EOF echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1894: checking whether ln -s works" >&5 +echo "configure:1981: 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 @@ -1913,7 +2000,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:1917: checking for $ac_word" >&5 +echo "configure:2004: 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 @@ -1945,7 +2032,7 @@ 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:1949: checking for $ac_word" >&5 +echo "configure:2036: 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 @@ -1977,7 +2064,7 @@ 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:1981: checking for $ac_word" >&5 +echo "configure:2068: 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 @@ -2027,7 +2114,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:2031: checking for $ac_word" >&5 +echo "configure:2118: 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 @@ -2061,7 +2148,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:2065: checking for $ac_word" >&5 +echo "configure:2152: 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 @@ -2097,7 +2184,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:2101: checking for loader (symbol LD)" >&5 +echo "configure:2188: checking for loader (symbol LD)" >&5 test -z "$LD" && LD=ld echo "$ac_t""$LD" 1>&6 @@ -2111,7 +2198,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:2115: checking for archiver (symbol AR)" >&5 +echo "configure:2202: checking for archiver (symbol AR)" >&5 test -z "$AR" && AR=ar echo "$ac_t""$AR" 1>&6 @@ -2125,7 +2212,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:2129: checking for archiver options (symbol AR_OPTS)" >&5 +echo "configure:2216: checking for archiver options (symbol AR_OPTS)" >&5 test -z "$AR_OPTS" && AR_OPTS=rv echo "$ac_t""$AR_OPTS" 1>&6 @@ -2137,7 +2224,7 @@ AR_OPTS=${cf_cv_subst_AR_OPTS} echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6 -echo "configure:2141: checking for makeflags variable" >&5 +echo "configure:2228: checking for makeflags variable" >&5 if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2146,6 +2233,7 @@ else for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)' do cat >cf_makeflags.tmp <<CF_EOF +SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF @@ -2166,14 +2254,16 @@ CF_EOF esac done rm -f cf_makeflags.tmp + fi 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:2177: checking if you have specified an install-prefix" >&5 +echo "configure:2267: 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 @@ -2198,7 +2288,7 @@ echo "$ac_t""$DESTDIR" 1>&6 cf_list_models="" echo $ac_n "checking if you want to build libraries with libtool""... $ac_c" 1>&6 -echo "configure:2202: checking if you want to build libraries with libtool" >&5 +echo "configure:2292: checking if you want to build libraries with libtool" >&5 # Check whether --with-libtool or --without-libtool was given. if test "${with_libtool+set}" = set; then @@ -2218,7 +2308,7 @@ fi echo $ac_n "checking if you want to build shared libraries""... $ac_c" 1>&6 -echo "configure:2222: checking if you want to build shared libraries" >&5 +echo "configure:2312: 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 @@ -2232,7 +2322,7 @@ 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:2236: checking if you want to build static libraries" >&5 +echo "configure:2326: 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 @@ -2246,7 +2336,7 @@ 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:2250: checking if you want to build debug libraries" >&5 +echo "configure:2340: 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 @@ -2260,7 +2350,7 @@ 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:2264: checking if you want to build profiling libraries" >&5 +echo "configure:2354: 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 @@ -2276,7 +2366,7 @@ test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" ############################################################################### echo $ac_n "checking for specified models""... $ac_c" 1>&6 -echo "configure:2280: checking for specified models" >&5 +echo "configure:2370: 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 @@ -2284,7 +2374,7 @@ 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:2288: checking for default model" >&5 +echo "configure:2378: checking for default model" >&5 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'` echo "$ac_t""$DFT_LWR_MODEL" 1>&6 @@ -2317,7 +2407,7 @@ LIB_SUFFIX= ############################################################################### echo $ac_n "checking if you want to build a separate terminfo library""... $ac_c" 1>&6 -echo "configure:2321: checking if you want to build a separate terminfo library" >&5 +echo "configure:2411: 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 @@ -2331,7 +2421,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:2335: checking if you want to link with dbmalloc for testing" >&5 +echo "configure:2425: 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 @@ -2344,7 +2434,7 @@ fi echo "$ac_t""$with_dbmalloc" 1>&6 if test "$with_dbmalloc" = yes ; then echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6 -echo "configure:2348: checking for debug_malloc in -ldbmalloc" >&5 +echo "configure:2438: 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 @@ -2352,7 +2442,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldbmalloc $LIBS" cat > conftest.$ac_ext <<EOF -#line 2356 "configure" +#line 2446 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2363,7 +2453,7 @@ int main() { debug_malloc() ; return 0; } EOF -if { (eval echo configure:2367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2457: \"$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 @@ -2393,7 +2483,7 @@ fi fi echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6 -echo "configure:2397: checking if you want to link with dmalloc for testing" >&5 +echo "configure:2487: 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 @@ -2406,7 +2496,7 @@ fi echo "$ac_t""$with_dmalloc" 1>&6 if test "$with_dmalloc" = yes ; then echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6 -echo "configure:2410: checking for dmalloc_debug in -ldmalloc" >&5 +echo "configure:2500: 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 @@ -2414,7 +2504,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldmalloc $LIBS" cat > conftest.$ac_ext <<EOF -#line 2418 "configure" +#line 2508 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2425,7 +2515,7 @@ int main() { dmalloc_debug() ; return 0; } EOF -if { (eval echo configure:2429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2519: \"$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 @@ -2456,7 +2546,7 @@ fi SHLIB_LIST="" echo $ac_n "checking if you want to link with the gpm mouse library""... $ac_c" 1>&6 -echo "configure:2460: checking if you want to link with the gpm mouse library" >&5 +echo "configure:2550: 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 @@ -2469,7 +2559,7 @@ fi echo "$ac_t""$with_gpm" 1>&6 if test "$with_gpm" = yes ; then echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:2473: checking for Gpm_Open in -lgpm" >&5 +echo "configure:2563: 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 @@ -2477,7 +2567,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <<EOF -#line 2481 "configure" +#line 2571 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2488,7 +2578,7 @@ int main() { Gpm_Open() ; return 0; } EOF -if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2582: \"$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 @@ -2514,17 +2604,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2518: checking for $ac_hdr" >&5 +echo "configure:2608: 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 -#line 2523 "configure" +#line 2613 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2618: \"$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* @@ -2572,7 +2662,7 @@ fi echo $ac_n "checking for default loader flags""... $ac_c" 1>&6 -echo "configure:2576: checking for default loader flags" >&5 +echo "configure:2666: checking for default loader flags" >&5 case $DFT_LWR_MODEL in libtool) LD_MODEL='' ;; normal) LD_MODEL='' ;; @@ -2583,7 +2673,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:2587: checking if rpath option should be used" >&5 +echo "configure:2677: checking if rpath option should be used" >&5 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then @@ -2597,15 +2687,15 @@ echo "$ac_t""$cf_cv_ld_rpath" 1>&6 - LOCAL_LDFLAGS= - LOCAL_LDFLAGS2= + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" 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:2609: checking if release/abi version should be used for shared libs" >&5 +echo "configure:2699: 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 @@ -2636,20 +2726,20 @@ fi if test "$GCC" = yes then echo $ac_n "checking which $CC option to use""... $ac_c" 1>&6 -echo "configure:2640: checking which $CC option to use" >&5 +echo "configure:2730: 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 <<EOF -#line 2646 "configure" +#line 2736 "configure" #include "confdefs.h" #include <stdio.h> int main() { int x = 1 ; return 0; } EOF -if { (eval echo configure:2653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* break else @@ -2662,10 +2752,25 @@ rm -f conftest* CFLAGS="$cf_save_CFLAGS" fi + cf_cv_shlib_version_infix=no + case $cf_cv_system_name in beos*) MK_SHARED_LIB='$(CC) -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; + cygwin*) + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + ;; + darwin*) + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $@` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $@' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi + cf_cv_shlib_version_infix=yes + ;; hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then @@ -2693,8 +2798,8 @@ rm -f conftest* ;; linux*|gnu*) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + 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," @@ -2716,8 +2821,8 @@ rm -f conftest* 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,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + 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 @@ -2733,16 +2838,16 @@ rm -f conftest* # tested with OSF/1 V3.2 and 'cc' # 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 $@`' + MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`' case $host_os in osf4*) - MK_SHARED_LIB="${MK_SHARED_LIB} -msym" + 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,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-rpath" @@ -2780,7 +2885,7 @@ rm -f conftest* MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-R" @@ -2817,18 +2922,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:2821: checking if we need a space after rpath option" >&5 +echo "configure:2926: checking if we need a space after rpath option" >&5 cf_save_LIBS="$LIBS" LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" cat > conftest.$ac_ext <<EOF -#line 2825 "configure" +#line 2930 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_rpath_space=no else @@ -2867,7 +2972,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:2871: checking if you wish to install ncurses overwriting curses" >&5 +echo "configure:2976: 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 @@ -2880,7 +2985,7 @@ fi echo "$ac_t""$with_overwrite" 1>&6 echo $ac_n "checking if external terminfo-database is used""... $ac_c" 1>&6 -echo "configure:2884: checking if external terminfo-database is used" >&5 +echo "configure:2989: checking if external terminfo-database is used" >&5 # Check whether --enable-database or --disable-database was given. if test "${enable_database+set}" = set; then @@ -2902,13 +3007,21 @@ os2*) #(vi esac + + case $cf_cv_system_name in + os2*) PATHSEP=';' ;; + *) PATHSEP=':' ;; + 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:2912: checking which terminfo source-file will be installed" >&5 +echo "configure:3025: 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 @@ -2920,7 +3033,7 @@ fi fi echo $ac_n "checking for list of fallback descriptions""... $ac_c" 1>&6 -echo "configure:2924: checking for list of fallback descriptions" >&5 +echo "configure:3037: checking for list of fallback descriptions" >&5 # Check whether --with-fallbacks or --without-fallbacks was given. if test "${with_fallbacks+set}" = set; then @@ -2934,23 +3047,14 @@ echo "$ac_t""$with_fallback" 1>&6 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` +MAKE_TERMINFO= 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" + MAKE_TERMINFO="#" else echo $ac_n "checking for list of terminfo directories""... $ac_c" 1>&6 -echo "configure:2946: checking for list of terminfo directories" >&5 - - case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; - esac - - - +echo "configure:3058: checking for list of terminfo directories" >&5 @@ -2959,16 +3063,18 @@ if test "${with_terminfo_dirs+set}" = set; then withval="$with_terminfo_dirs" : else - withval="${TERMINFO_DIRS-${datadir}/terminfo}" + withval=${TERMINFO_DIRS-${datadir}/terminfo} fi -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do case ".$cf_src_path" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; @@ -2984,7 +3090,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { echo "configure: error: expected a pathname, not \"$cf_src_path\"" 1>&2; exit 1; } ;; esac @@ -2993,7 +3099,10 @@ esac done IFS="$ac_save_ifs" -eval TERMINFO_DIRS="$cf_dst_path" + + +eval 'TERMINFO_DIRS="$cf_dst_path"' + echo "$ac_t""$TERMINFO_DIRS" 1>&6 test -n "$TERMINFO_DIRS" && cat >> confdefs.h <<EOF @@ -3002,7 +3111,7 @@ EOF echo $ac_n "checking for default terminfo directory""... $ac_c" 1>&6 -echo "configure:3006: checking for default terminfo directory" >&5 +echo "configure:3115: 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 @@ -3013,7 +3122,9 @@ else fi case ".$withval" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; @@ -3029,7 +3140,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; } ;; esac @@ -3045,10 +3156,11 @@ fi + ### use option --disable-big-core to make tic run on small machines ### We need 4Mb, check if we can allocate 50% more than that. echo $ac_n "checking if big-core option selected""... $ac_c" 1>&6 -echo "configure:3052: checking if big-core option selected" >&5 +echo "configure:3164: 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 @@ -3059,7 +3171,7 @@ else with_big_core=no else cat > conftest.$ac_ext <<EOF -#line 3063 "configure" +#line 3175 "configure" #include "confdefs.h" #include <stdlib.h> @@ -3072,7 +3184,7 @@ int main() { exit(s == 0); } EOF -if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3188: \"$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 @@ -3094,7 +3206,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:3098: checking if you want termcap-fallback support" >&5 +echo "configure:3210: checking if you want termcap-fallback support" >&5 # Check whether --enable-termcap or --disable-termcap was given. if test "${enable_termcap+set}" = set; then @@ -3107,15 +3219,81 @@ fi echo "$ac_t""$with_termcap" 1>&6 if test "$with_termcap" != "yes" ; then + 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 + fi cat >> confdefs.h <<\EOF #define PURE_TERMINFO 1 EOF else +cat >> confdefs.h <<\EOF +#define USE_TERMCAP 1 +EOF + +echo $ac_n "checking for list of termcap files""... $ac_c" 1>&6 +echo "configure:3239: checking for list of termcap files" >&5 + + + +# Check whether --with-termpath or --without-termpath was given. +if test "${with_termpath+set}" = set; then + withval="$with_termpath" + : +else + withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} +fi + +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +cf_dst_path= +for cf_src_path in $withval +do + +case ".$cf_src_path" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(vi + eval cf_src_path="$cf_src_path" + case ".$cf_src_path" in #(vi + .NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@` + ;; + esac + ;; #(vi +.NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@` + ;; +*) + { echo "configure: error: expected a pathname, not \"$cf_src_path\"" 1>&2; exit 1; } + ;; +esac + + test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:" + cf_dst_path="${cf_dst_path}${cf_src_path}" +done +IFS="$ac_save_ifs" + + + +eval 'TERMPATH="$cf_dst_path"' + + +echo "$ac_t""$TERMPATH" 1>&6 +test -n "$TERMPATH" && cat >> confdefs.h <<EOF +#define TERMPATH "$TERMPATH" +EOF + + ### 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:3119: checking if fast termcap-loader is needed" >&5 +echo "configure:3297: checking if fast termcap-loader is needed" >&5 # Check whether --enable-getcap or --disable-getcap was given. if test "${enable_getcap+set}" = set; then @@ -3132,7 +3310,7 @@ EOF echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6 -echo "configure:3136: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "configure:3314: 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 @@ -3158,12 +3336,12 @@ for ac_func in \ unlink do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3162: checking for $ac_func" >&5 +echo "configure:3340: 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 <<EOF -#line 3167 "configure" +#line 3345 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3186,7 +3364,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3368: \"$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 @@ -3217,12 +3395,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:3221: checking for $ac_func" >&5 +echo "configure:3399: 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 <<EOF -#line 3226 "configure" +#line 3404 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3245,7 +3423,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3427: \"$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 @@ -3271,7 +3449,7 @@ done else echo $ac_n "checking if link/symlink functions work""... $ac_c" 1>&6 -echo "configure:3275: checking if link/symlink functions work" >&5 +echo "configure:3453: 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 @@ -3283,7 +3461,7 @@ else eval 'ac_cv_func_'$cf_func'=error' else cat > conftest.$ac_ext <<EOF -#line 3287 "configure" +#line 3465 "configure" #include "confdefs.h" #include <sys/types.h> @@ -3312,7 +3490,7 @@ int main() } EOF -if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3494: \"$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" @@ -3349,7 +3527,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:3353: checking if tic should use symbolic links" >&5 +echo "configure:3531: checking if tic should use symbolic links" >&5 if test "$ac_cv_func_symlink" = yes ; then with_symlinks=yes else @@ -3358,7 +3536,7 @@ echo "configure:3353: 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:3362: checking if tic should use hard links" >&5 +echo "configure:3540: checking if tic should use hard links" >&5 if test "$ac_cv_func_link" = yes ; then with_links=yes else @@ -3367,7 +3545,7 @@ echo "configure:3362: 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:3371: checking if tic should use symbolic links" >&5 +echo "configure:3549: checking if tic should use symbolic links" >&5 # Check whether --enable-symlinks or --disable-symlinks was given. if test "${enable_symlinks+set}" = set; then @@ -3391,7 +3569,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:3395: checking if you want broken-linker support code" >&5 +echo "configure:3573: 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 @@ -3402,19 +3580,52 @@ else fi echo "$ac_t""$with_broken_linker" 1>&6 -test "$with_broken_linker" = yes && cat >> confdefs.h <<\EOF + +BROKEN_LINKER=0 +if test "$with_broken_linker" = yes ; then + cat >> confdefs.h <<\EOF +#define BROKEN_LINKER 1 +EOF + + BROKEN_LINKER=1 +elif test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + cat >> confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF + BROKEN_LINKER=1 + test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 + + ;; + esac +fi + + +### use option --with-bool to override bool's type +echo $ac_n "checking for type of bool""... $ac_c" 1>&6 +echo "configure:3609: checking for type of bool" >&5 + +# Check whether --with-bool or --without-bool was given. +if test "${with_bool+set}" = set; then + withval="$with_bool" + NCURSES_BOOL="$withval" +else + NCURSES_BOOL=auto +fi + +echo "$ac_t""$NCURSES_BOOL" 1>&6 + ### use option --with-ospeed to override ospeed's type echo $ac_n "checking for type of ospeed""... $ac_c" 1>&6 -echo "configure:3413: checking for type of ospeed" >&5 +echo "configure:3624: checking for type of ospeed" >&5 # Check whether --with-ospeed or --without-ospeed was given. if test "${with_ospeed+set}" = set; then withval="$with_ospeed" - NCURSES_OSPEED=$withval + NCURSES_OSPEED="$withval" else NCURSES_OSPEED=short fi @@ -3424,7 +3635,7 @@ echo "$ac_t""$NCURSES_OSPEED" 1>&6 ### 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:3428: checking if tputs should process BSD-style prefix padding" >&5 +echo "configure:3639: 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 @@ -3442,7 +3653,7 @@ EOF ### Enable compiling-in rcs id's echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6 -echo "configure:3446: checking if RCS identifiers should be compiled-in" >&5 +echo "configure:3657: 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 @@ -3464,19 +3675,19 @@ EOF echo $ac_n "checking format of man-pages""... $ac_c" 1>&6 -echo "configure:3468: checking format of man-pages" >&5 +echo "configure:3679: 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 + MANPAGE_FORMAT=$withval else - cf_manpage_form=unknown + MANPAGE_FORMAT=unknown fi -case ".$cf_manpage_form" in +case ".$MANPAGE_FORMAT" in .gzip|.compress|.BSDI|.normal|.formatted) # (vi ;; .unknown|.) # (vi @@ -3485,7 +3696,7 @@ case ".$cf_manpage_form" in fi # look for the 'date' man-page (it's most likely to be installed!) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" - cf_manpage_form=unknown + MANPAGE_FORMAT=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 @@ -3493,15 +3704,15 @@ case ".$cf_manpage_form" in 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;; + *.gz) MANPAGE_FORMAT=gzip;; + *.Z) MANPAGE_FORMAT=compress;; + *.0) MANPAGE_FORMAT=BSDI,formatted;; + *) MANPAGE_FORMAT=normal;; esac break fi done - if test "$cf_manpage_form" != "unknown" ; then + if test "$MANPAGE_FORMAT" != "unknown" ; then break fi done @@ -3512,82 +3723,85 @@ case ".$cf_manpage_form" in ;; esac -echo "$ac_t""$cf_manpage_form" 1>&6 +echo "$ac_t""$MANPAGE_FORMAT" 1>&6 echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6 -echo "configure:3520: checking for manpage renaming" >&5 +echo "configure:3731: 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 + MANPAGE_RENAMES=$withval else - cf_manpage_renames=yes + MANPAGE_RENAMES=yes fi -case ".$cf_manpage_renames" in #(vi +case ".$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 + MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames else - cf_manpage_renames=no + 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; } +if test "$MANPAGE_RENAMES" != no ; then + if test -f $srcdir/man/$MANPAGE_RENAMES ; then + MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES + elif test ! -f $MANPAGE_RENAMES ; then + { echo "configure: error: not a filename: $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 + if test -n "$MANPAGE_RENAMES" ; then test ! -d man && mkdir man - $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed + sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed fi fi -echo "$ac_t""$cf_manpage_renames" 1>&6 +echo "$ac_t""$MANPAGE_RENAMES" 1>&6 + echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6 -echo "configure:3563: checking for manpage symlinks" >&5 +echo "configure:3777: 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 + MANPAGE_SYMLINKS=$withval else - cf_manpage_symlinks=yes + MANPAGE_SYMLINKS=yes fi -echo "$ac_t""$cf_manpage_symlinks" 1>&6 +echo "$ac_t""$MANPAGE_SYMLINKS" 1>&6 echo $ac_n "checking for manpage tbl""... $ac_c" 1>&6 -echo "configure:3579: checking for manpage tbl" >&5 +echo "configure:3793: 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 + MANPAGE_TBL=$withval else - cf_manpage_tbl=no + MANPAGE_TBL=no fi -echo "$ac_t""$cf_manpage_tbl" 1>&6 +echo "$ac_t""$MANPAGE_TBL" 1>&6 if test "$prefix" = "NONE" ; then @@ -3596,7 +3810,7 @@ echo "$ac_t""$cf_manpage_tbl" 1>&6 cf_prefix="$prefix" fi - case "$cf_manpage_form" in # (vi + case "$MANPAGE_FORMAT" in # (vi *formatted*) # (vi cf_subdir='$mandir/cat' cf_format=yes @@ -3613,8 +3827,9 @@ cat >man/edit_man.sh <<CF_EOF # this script is generated by the configure-script prefix="$cf_prefix" datadir="$datadir" +NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="`cd $srcdir && pwd`/mkinstalldirs" +MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs" INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" @@ -3650,13 +3865,13 @@ case \$i in #(vi continue fi CF_EOF -if test "$cf_manpage_symlinks" = yes ; then +if test "$MANPAGE_SYMLINKS" = yes ; then cat >>man/edit_man.sh <<CF_EOF aliases=\`sed -f \$srcdir/manlinks.sed \$inalias | sort -u\` CF_EOF fi -if test "$cf_manpage_renames" = no ; then +if test "$MANPAGE_RENAMES" = no ; then cat >>man/edit_man.sh <<CF_EOF # perform program transformations for section 1 man pages if test \$section = 1 ; then @@ -3667,7 +3882,7 @@ cat >>man/edit_man.sh <<CF_EOF CF_EOF else cat >>man/edit_man.sh <<CF_EOF - target=\`grep "^\$source" $cf_manpage_renames | $AWK '{print \$2}'\` + target=\`grep "^\$source" $MANPAGE_RENAMES | $AWK '{print \$2}'\` if test -z "\$target" ; then echo '? missing rename for '\$source target="\$source" @@ -3688,6 +3903,7 @@ CF_EOF cat >>man/edit_man.sh <<CF_EOF sed -e "s,@DATADIR@,\$datadir," \\ -e "s,@TERMINFO@,\$TERMINFO," \\ + -e "s,@NCURSES_OSPEED@,\$NCURSES_OSPEED," \\ CF_EOF for cf_name in captoinfo clear infocmp infotocap tic toe tput @@ -3698,10 +3914,16 @@ cat >>man/edit_man.sh <<CF_EOF CF_EOF done +if test -f $MANPAGE_RENAMES ; then +cat >>man/edit_man.sh <<CF_EOF + < \$i | sed -f edit_man.sed >\$TMP +CF_EOF +else cat >>man/edit_man.sh <<CF_EOF < \$i >\$TMP CF_EOF -if test $cf_manpage_tbl = yes ; then +fi +if test $MANPAGE_TBL = yes ; then cat >>man/edit_man.sh <<CF_EOF tbl \$TMP >\$TMP.out mv \$TMP.out \$TMP @@ -3719,7 +3941,7 @@ cat >>man/edit_man.sh <<CF_EOF mv \$TMP.out \$TMP CF_EOF fi -case "$cf_manpage_form" in #(vi +case "$MANPAGE_FORMAT" in #(vi *compress*) #(vi cat >>man/edit_man.sh <<CF_EOF if test \$verb = installing ; then @@ -3814,7 +4036,7 @@ chmod 755 man/edit_man.sh ### 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:3818: checking if you want to build with function extensions" >&5 +echo "configure:4040: 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 @@ -3826,6 +4048,7 @@ fi echo "$ac_t""$with_ext_funcs" 1>&6 if test "$with_ext_funcs" = yes ; then + NCURSES_EXT_FUNCS=1 cat >> confdefs.h <<\EOF #define HAVE_CURSES_VERSION 1 EOF @@ -3850,11 +4073,14 @@ EOF #define NCURSES_EXT_FUNCS 1 EOF +else + NCURSES_EXT_FUNCS=0 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:3858: checking for extended use of const keyword" >&5 +echo "configure:4084: checking for extended use of const keyword" >&5 # Check whether --enable-const or --disable-const was given. if test "${enable_const+set}" = set; then @@ -3872,7 +4098,7 @@ fi echo $ac_n "checking if you want \$NCURSES_NO_PADDING code""... $ac_c" 1>&6 -echo "configure:3876: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "configure:4102: 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 @@ -3890,7 +4116,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:3894: checking if you want SIGWINCH handler" >&5 +echo "configure:4120: checking if you want SIGWINCH handler" >&5 # Check whether --enable-sigwinch or --disable-sigwinch was given. if test "${enable_sigwinch+set}" = set; then @@ -3908,7 +4134,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:3912: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "configure:4138: 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 @@ -3927,7 +4153,7 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 # These options are relatively safe to experiment with. echo $ac_n "checking if you want all development code""... $ac_c" 1>&6 -echo "configure:3931: checking if you want all development code" >&5 +echo "configure:4157: checking if you want all development code" >&5 # Check whether --with-develop or --without-develop was given. if test "${with_develop+set}" = set; then @@ -3941,11 +4167,11 @@ 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 colorfgbg code""... $ac_c" 1>&6 -echo "configure:3945: checking if you want colorfgbg code" >&5 +echo "configure:4171: 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 - enableval="$enable_hard_tabs" +# Check whether --enable-enable-colorfgbg or --disable-enable-colorfgbg was given. +if test "${enable_enable_colorfgbg+set}" = set; then + enableval="$enable_enable_colorfgbg" with_colorfgbg=$enableval else with_colorfgbg=$with_develop @@ -3959,7 +4185,7 @@ EOF ### use option --enable-hard-tabs to turn on use of hard-tabs optimize echo $ac_n "checking if you want hard-tabs code""... $ac_c" 1>&6 -echo "configure:3963: checking if you want hard-tabs code" >&5 +echo "configure:4189: 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 @@ -3976,7 +4202,7 @@ EOF echo $ac_n "checking if you want to use restrict environment when running as root""... $ac_c" 1>&6 -echo "configure:3980: checking if you want to use restrict environment when running as root" >&5 +echo "configure:4206: 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 @@ -3994,7 +4220,7 @@ 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:3998: checking if you want limited support for xmc" >&5 +echo "configure:4224: 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 @@ -4015,7 +4241,7 @@ EOF echo $ac_n "checking if you do not want to assume colors are white-on-black""... $ac_c" 1>&6 -echo "configure:4019: checking if you do not want to assume colors are white-on-black" >&5 +echo "configure:4245: 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 @@ -4033,7 +4259,7 @@ 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:4037: checking if you want hashmap scrolling-optimization code" >&5 +echo "configure:4263: 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 @@ -4050,7 +4276,7 @@ EOF echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6 -echo "configure:4054: checking if you want experimental safe-sprintf code" >&5 +echo "configure:4280: 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 @@ -4070,7 +4296,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:4074: checking if you want to experiment without scrolling-hints code" >&5 +echo "configure:4300: 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 @@ -4088,8 +4314,11 @@ EOF fi ### use option --enable-widec to turn on use of wide-character support +NCURSES_CH_T=chtype +NCURSES_LIBUTF8=0 +NCURSES_MBSTATE_T=0 echo $ac_n "checking if you want experimental wide-character code""... $ac_c" 1>&6 -echo "configure:4093: checking if you want experimental wide-character code" >&5 +echo "configure:4322: 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 @@ -4106,14 +4335,203 @@ if test "$with_widec" = yes ; then #define USE_WIDEC_SUPPORT 1 EOF + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + with_overwrite=no + NCURSES_CH_T=cchar_t + echo $ac_n "checking for putwc""... $ac_c" 1>&6 +echo "configure:4343: checking for putwc" >&5 +if eval "test \"`echo '$''{'ac_cv_func_putwc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4348 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char putwc(); below. */ +#include <assert.h> +/* 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 putwc(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_putwc) || defined (__stub___putwc) +choke me +#else +putwc(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_putwc=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_putwc=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'putwc`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_putwc" != yes ; then + +echo $ac_n "checking for putwc in libutf8""... $ac_c" 1>&6 +echo "configure:4393: checking for putwc in libutf8" >&5 +if eval "test \"`echo '$''{'cf_cv_libutf8'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4401 "configure" +#include "confdefs.h" + +#include <libutf8.h> +int main() { +putwc(0,0); +; return 0; } +EOF +if { (eval echo configure:4409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_libutf8=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_libutf8=no +fi +rm -f conftest* + LIBS="$cf_save_LIBS" + fi +echo "$ac_t""$cf_cv_libutf8" 1>&6 + +if test "$cf_cv_libutf8" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_LIBUTF8_H 1 +EOF + + LIBS="-lutf8 $LIBS" +fi + + if test "$cf_cv_libutf8" = yes ; then + NCURSES_LIBUTF8=1 + fi +fi + +# This is needed on Tru64 5.0 to declare mbstate_t +echo $ac_n "checking if we must include wchar.h to declare mbstate_t""... $ac_c" 1>&6 +echo "configure:4440: checking if we must include wchar.h to declare mbstate_t" >&5 +if eval "test \"`echo '$''{'cf_cv_mbstate_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <<EOF +#line 4446 "configure" +#include "confdefs.h" + +#include <stdlib.h> +#ifdef HAVE_LIBUTF8_H +#include <libutf8.h> +#endif +int main() { +mbstate_t state +; return 0; } +EOF +if { (eval echo configure:4457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_mbstate_t=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext <<EOF +#line 4465 "configure" +#include "confdefs.h" + +#include <stdlib.h> +#include <wchar.h> +#ifdef HAVE_LIBUTF8_H +#include <libutf8.h> +#endif +int main() { +mbstate_t value +; return 0; } +EOF +if { (eval echo configure:4477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_mbstate_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_mbstate_t=unknown +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$cf_cv_mbstate_t" 1>&6 + +if test "$cf_cv_mbstate_t" = yes ; then + cat >> confdefs.h <<\EOF +#define NEED_WCHAR_H 1 +EOF + +fi + +if test "$cf_cv_mbstate_t" != unknown ; then + cat >> confdefs.h <<\EOF +#define HAVE_MBSTATE_T 1 +EOF + +fi + + if test $cf_cv_mbstate_t = yes ; then + NCURSES_MBSTATE_T=1 + fi +fi + + + + +echo $ac_n "checking for terminal capabilities file""... $ac_c" 1>&6 +echo "configure:4516: checking for terminal capabilities file" >&5 + +# Check whether --with-caps or --without-caps was given. +if test "${with_caps+set}" = set; then + withval="$with_caps" + TERMINFO_CAPS=Caps.$withval +else + TERMINFO_CAPS=Caps +fi + +test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps +echo "$ac_t""$TERMINFO_CAPS" 1>&6 + + ############################################################################### ### 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:4117: checking if you want to display full commands during build" >&5 +echo "configure:4535: 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 @@ -4134,7 +4552,7 @@ 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:4138: checking if you want to see compiler warnings" >&5 +echo "configure:4556: 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 @@ -4150,11 +4568,11 @@ if test -n "$with_warnings"; then if test "$GCC" = yes then cat > conftest.$ac_ext <<EOF -#line 4154 "configure" +#line 4572 "configure" int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; } EOF echo "checking for $CC warning options" 1>&6 -echo "configure:4158: checking for $CC warning options" >&5 +echo "configure:4576: checking for $CC warning options" >&5 cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-W -Wall" cf_warn_CONST="" @@ -4172,7 +4590,7 @@ echo "configure:4158: checking for $CC warning options" >&5 Wstrict-prototypes $cf_warn_CONST do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo configure:4176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4594: \"$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" @@ -4204,9 +4622,9 @@ EOF if test "$GCC" = yes then echo "checking for $CC __attribute__ directives" 1>&6 -echo "configure:4208: checking for $CC __attribute__ directives" >&5 +echo "configure:4626: checking for $CC __attribute__ directives" >&5 cat > conftest.$ac_ext <<EOF -#line 4210 "configure" +#line 4628 "configure" #include "confdefs.h" #include "conftest.h" #include "conftest.i" @@ -4244,7 +4662,7 @@ EOF EOF ;; esac - if { (eval echo configure:4248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4666: \"$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 @@ -4260,7 +4678,7 @@ 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:4264: checking if you want to enable runtime assertions" >&5 +echo "configure:4682: 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 @@ -4327,12 +4745,12 @@ fi ### Checks for libraries. echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:4331: checking for gettimeofday" >&5 +echo "configure:4749: 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 <<EOF -#line 4336 "configure" +#line 4754 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday(); below. */ @@ -4355,7 +4773,7 @@ gettimeofday(); ; return 0; } EOF -if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4777: \"$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 @@ -4378,7 +4796,7 @@ else echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:4382: checking for gettimeofday in -lbsd" >&5 +echo "configure:4800: 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 @@ -4386,7 +4804,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 4390 "configure" +#line 4808 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4397,7 +4815,7 @@ int main() { gettimeofday() ; return 0; } EOF -if { (eval echo configure:4401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4819: \"$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 @@ -4425,13 +4843,13 @@ fi echo $ac_n "checking if -lm needed for math functions""... $ac_c" 1>&6 -echo "configure:4429: checking if -lm needed for math functions" >&5 +echo "configure:4847: 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 <<EOF -#line 4435 "configure" +#line 4853 "configure" #include "confdefs.h" #include <stdio.h> @@ -4441,7 +4859,7 @@ int main() { double x = rand(); printf("result = %g\n", sin(x)) ; return 0; } EOF -if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_need_libm=no else @@ -4462,13 +4880,71 @@ fi ### Checks for header files. + +echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6 +echo "configure:4886: checking if we must define _GNU_SOURCE" >&5 +if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <<EOF +#line 4892 "configure" +#include "confdefs.h" +#include <sys/types.h> +int main() { + +#ifndef _XOPEN_SOURCE +make an error +#endif +; return 0; } +EOF +if { (eval echo configure:4902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_gnu_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + cat > conftest.$ac_ext <<EOF +#line 4912 "configure" +#include "confdefs.h" +#include <sys/types.h> +int main() { + +#ifdef _XOPEN_SOURCE +make an error +#endif +; return 0; } +EOF +if { (eval echo configure:4922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_gnu_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_gnu_source=yes +fi +rm -f conftest* + CPPFLAGS="$cf_save" + +fi +rm -f conftest* + +fi + +echo "$ac_t""$cf_cv_gnu_source" 1>&6 +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4467: checking for ANSI C header files" >&5 +echo "configure:4943: 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 <<EOF -#line 4472 "configure" +#line 4948 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -4476,7 +4952,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4956: \"$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* @@ -4493,7 +4969,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 -#line 4497 "configure" +#line 4973 "configure" #include "confdefs.h" #include <string.h> EOF @@ -4511,7 +4987,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 -#line 4515 "configure" +#line 4991 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4532,7 +5008,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 4536 "configure" +#line 5012 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4543,7 +5019,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4571,12 +5047,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:4575: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5051: 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 <<EOF -#line 4580 "configure" +#line 5056 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -4584,7 +5060,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4609,7 +5085,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:4613: checking for opendir in -ldir" >&5 +echo "configure:5089: 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 @@ -4617,7 +5093,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4621 "configure" +#line 5097 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4628,7 +5104,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5108: \"$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 @@ -4650,7 +5126,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4654: checking for opendir in -lx" >&5 +echo "configure:5130: 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 @@ -4658,7 +5134,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4662 "configure" +#line 5138 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4669,7 +5145,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5149: \"$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 @@ -4691,15 +5167,50 @@ fi fi +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:5172: 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 <<EOF +#line 5177 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:5186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + echo $ac_n "checking for regular-expression headers""... $ac_c" 1>&6 -echo "configure:4697: checking for regular-expression headers" >&5 +echo "configure:5208: 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 <<EOF -#line 4703 "configure" +#line 5214 "configure" #include "confdefs.h" #include <sys/types.h> #include <regex.h> @@ -4712,7 +5223,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_regex="regex.h" else @@ -4721,7 +5232,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 4725 "configure" +#line 5236 "configure" #include "confdefs.h" #include <regexp.h> int main() { @@ -4731,7 +5242,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_regex="regexp.h" else @@ -4742,7 +5253,7 @@ else cf_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <<EOF -#line 4746 "configure" +#line 5257 "configure" #include "confdefs.h" #include <regexpr.h> int main() { @@ -4752,7 +5263,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_regex="regexpr.h" else @@ -4806,17 +5317,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:4810: checking for $ac_hdr" >&5 +echo "configure:5321: 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 -#line 4815 "configure" +#line 5326 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5331: \"$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* @@ -4847,7 +5358,7 @@ done # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set if test "$ISC" = yes ; then echo $ac_n "checking for main in -lcposix""... $ac_c" 1>&6 -echo "configure:4851: checking for main in -lcposix" >&5 +echo "configure:5362: 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 @@ -4855,14 +5366,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <<EOF -#line 4859 "configure" +#line 5370 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5377: \"$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 @@ -4890,7 +5401,7 @@ else fi echo $ac_n "checking for bzero in -linet""... $ac_c" 1>&6 -echo "configure:4894: checking for bzero in -linet" >&5 +echo "configure:5405: 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 @@ -4898,7 +5409,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <<EOF -#line 4902 "configure" +#line 5413 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4909,7 +5420,7 @@ int main() { bzero() ; return 0; } EOF -if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5424: \"$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 @@ -4932,13 +5443,13 @@ fi echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6 -echo "configure:4936: checking if sys/time.h works with sys/select.h" >&5 +echo "configure:5447: 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 <<EOF -#line 4942 "configure" +#line 5453 "configure" #include "confdefs.h" #include <sys/types.h> @@ -4953,7 +5464,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sys_time_select=yes else @@ -4982,12 +5493,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:4986: checking for working const" >&5 +echo "configure:5497: 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 <<EOF -#line 4991 "configure" +#line 5502 "configure" #include "confdefs.h" int main() { @@ -5036,7 +5547,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:5040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5057,21 +5568,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5061: checking for inline" >&5 +echo "configure:5572: 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 <<EOF -#line 5068 "configure" +#line 5579 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:5075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5103,20 +5614,20 @@ EOF echo $ac_n "checking if unsigned literals are legal""... $ac_c" 1>&6 -echo "configure:5107: checking if unsigned literals are legal" >&5 +echo "configure:5618: 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 <<EOF -#line 5113 "configure" +#line 5624 "configure" #include "confdefs.h" int main() { long x = 1L + 1UL + 1U + 1 ; return 0; } EOF -if { (eval echo configure:5120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_unsigned_literals=yes else @@ -5134,7 +5645,7 @@ echo "$ac_t""$cf_cv_unsigned_literals" 1>&6 echo $ac_n "checking for type of chtype""... $ac_c" 1>&6 -echo "configure:5138: checking for type of chtype" >&5 +echo "configure:5649: 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 @@ -5143,7 +5654,7 @@ else cf_cv_typeof_chtype=long else cat > conftest.$ac_ext <<EOF -#line 5147 "configure" +#line 5658 "configure" #include "confdefs.h" #ifdef USE_WIDEC_SUPPORT @@ -5189,7 +5700,7 @@ int main() } EOF -if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5704: \"$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 @@ -5220,94 +5731,17 @@ 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:5226: 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 - - if test "$cross_compiling" = yes; then - cf_cv_shift_limit=32 -else - cat > conftest.$ac_ext <<EOF -#line 5235 "configure" -#include "confdefs.h" - -#include <stdio.h> -int main() -{ - FILE *fp = fopen("cf_test.out", "w"); - if (fp != 0) { - int n; - unsigned TYPEOF_CHTYPE x = 1L; - for (n = 0; ; n++) { - unsigned long y = (x >> n); - if (y != 1 || x == 0) - break; - x <<= 1; - } - fprintf(fp, "%d", n); - fclose(fp); - } - exit(0); -} - -EOF -if { (eval echo configure:5258: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_shift_limit=32 -fi -rm -fr conftest* -fi - - rm -f cf_test.out - -fi - -echo "$ac_t""$cf_cv_shift_limit" 1>&6 - - -echo $ac_n "checking for width of character-index""... $ac_c" 1>&6 -echo "configure:5278: 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 - -if test ".$with_widec" = ".yes" ; then - cf_attrs_width=39 - if ( expr $cf_cv_shift_limit \> $cf_attrs_width >/dev/null ) - then - cf_cv_widec_shift=`expr 16 + $cf_cv_shift_limit - $cf_attrs_width` - else - cf_cv_widec_shift=16 - fi -else - cf_cv_widec_shift=8 -fi - -fi - -echo "$ac_t""$cf_cv_widec_shift" 1>&6 - - - ### Checks for external-data echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6 -echo "configure:5305: checking if external errno is declared" >&5 +echo "configure:5739: 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 <<EOF -#line 5311 "configure" +#line 5745 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -5320,27 +5754,24 @@ int main() { long x = (long) errno ; return 0; } EOF -if { (eval echo configure:5324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval 'cf_cv_dcl_'errno'=yes' + cf_cv_dcl_errno=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval 'cf_cv_dcl_'errno'=no' + cf_cv_dcl_errno=no fi rm -f conftest* fi +echo "$ac_t""$cf_cv_dcl_errno" 1>&6 -eval 'cf_result=$cf_cv_dcl_'errno -echo "$ac_t""$cf_result" 1>&6 - -if test "$cf_result" = no ; then - eval 'cf_result=DECL_'errno +if test "$cf_cv_dcl_errno" = no ; then -cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <<EOF #define $cf_result 1 @@ -5351,13 +5782,13 @@ fi # It's possible (for near-UNIX clones) that the data doesn't exist echo $ac_n "checking if external errno exists""... $ac_c" 1>&6 -echo "configure:5355: checking if external errno exists" >&5 +echo "configure:5786: 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 <<EOF -#line 5361 "configure" +#line 5792 "configure" #include "confdefs.h" #undef errno @@ -5367,26 +5798,24 @@ int main() { errno = 2 ; return 0; } EOF -if { (eval echo configure:5371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval 'cf_cv_have_'errno'=yes' + cf_cv_have_errno=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval 'cf_cv_have_'errno'=no' + cf_cv_have_errno=no fi rm -f conftest* -fi +fi -eval 'cf_result=$cf_cv_have_'errno -echo "$ac_t""$cf_result" 1>&6 +echo "$ac_t""$cf_cv_have_errno" 1>&6 -if test "$cf_result" = yes ; then - eval 'cf_result=HAVE_'errno +if test "$cf_cv_have_errno" = yes ; then -cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <<EOF #define $cf_result 1 @@ -5399,23 +5828,23 @@ fi echo $ac_n "checking if data-only library module links""... $ac_c" 1>&6 -echo "configure:5403: checking if data-only library module links" >&5 +echo "configure:5832: 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 <<EOF -#line 5410 "configure" +#line 5839 "configure" int testdata[3] = { 123, 456, 789 }; EOF - if { (eval echo configure:5413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then + if { (eval echo configure:5842: \"$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 <<EOF -#line 5419 "configure" +#line 5848 "configure" int testfunc() { #if defined(NeXT) @@ -5428,7 +5857,7 @@ int testfunc() #endif } EOF - if { (eval echo configure:5432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:5861: \"$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 @@ -5440,7 +5869,7 @@ EOF cf_cv_link_dataonly=unknown else cat > conftest.$ac_ext <<EOF -#line 5444 "configure" +#line 5873 "configure" #include "confdefs.h" int main() @@ -5450,7 +5879,7 @@ else } EOF -if { (eval echo configure:5454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5883: \"$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 @@ -5467,10 +5896,15 @@ fi fi echo "$ac_t""$cf_cv_link_dataonly" 1>&6 -test "$cf_cv_link_dataonly" = no && cat >> confdefs.h <<\EOF + +if test "$cf_cv_link_dataonly" = no ; then + cat >> confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF + BROKEN_LINKER=1 +fi + ### Checks for library functions. @@ -5481,7 +5915,6 @@ geteuid \ getttynam \ issetugid \ memccpy \ -mkstemp \ nanosleep \ poll \ remove \ @@ -5495,18 +5928,16 @@ strdup \ strstr \ tcgetpgrp \ times \ -vfscanf \ vsnprintf \ -vsscanf \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5505: checking for $ac_func" >&5 +echo "configure:5936: 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 <<EOF -#line 5510 "configure" +#line 5941 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5529,7 +5960,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5964: \"$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 @@ -5556,13 +5987,13 @@ done if test "$with_getcap" = "yes" ; then echo $ac_n "checking for terminal-capability database functions""... $ac_c" 1>&6 -echo "configure:5560: checking for terminal-capability database functions" >&5 +echo "configure:5991: 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 <<EOF -#line 5566 "configure" +#line 5997 "configure" #include "confdefs.h" #include <stdlib.h> @@ -5577,7 +6008,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_cgetent=yes else @@ -5600,20 +6031,20 @@ fi echo $ac_n "checking for isascii""... $ac_c" 1>&6 -echo "configure:5604: checking for isascii" >&5 +echo "configure:6035: 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 <<EOF -#line 5610 "configure" +#line 6041 "configure" #include "confdefs.h" #include <ctype.h> int main() { int x = isascii(' ') ; return 0; } EOF -if { (eval echo configure:5617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_have_isascii=yes else @@ -5634,9 +6065,9 @@ EOF if test "$ac_cv_func_sigaction" = yes; then echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:5638: checking whether sigaction needs _POSIX_SOURCE" >&5 +echo "configure:6069: checking whether sigaction needs _POSIX_SOURCE" >&5 cat > conftest.$ac_ext <<EOF -#line 5640 "configure" +#line 6071 "configure" #include "confdefs.h" #include <sys/types.h> @@ -5645,7 +6076,7 @@ int main() { struct sigaction act ; return 0; } EOF -if { (eval echo configure:5649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* sigact_bad=no else @@ -5654,7 +6085,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5658 "configure" +#line 6089 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -5664,7 +6095,7 @@ int main() { struct sigaction act ; return 0; } EOF -if { (eval echo configure:5668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* sigact_bad=yes cat >> confdefs.h <<\EOF @@ -5692,17 +6123,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:5696: checking for $ac_hdr" >&5 +echo "configure:6127: 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 -#line 5701 "configure" +#line 6132 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6137: \"$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* @@ -5733,17 +6164,17 @@ if test "$ISC" = yes ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5737: checking for $ac_hdr" >&5 +echo "configure:6168: 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 -#line 5742 "configure" +#line 6173 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6178: \"$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* @@ -5778,16 +6209,16 @@ if test "$ac_cv_header_termios_h" = yes ; then esac if test "$termios_bad" = maybe ; then echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:5782: checking whether termios.h needs _POSIX_SOURCE" >&5 +echo "configure:6213: checking whether termios.h needs _POSIX_SOURCE" >&5 cat > conftest.$ac_ext <<EOF -#line 5784 "configure" +#line 6215 "configure" #include "confdefs.h" #include <termios.h> int main() { struct termios foo; int x = foo.c_iflag ; return 0; } EOF -if { (eval echo configure:5791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* termios_bad=no else @@ -5796,7 +6227,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5800 "configure" +#line 6231 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -5805,7 +6236,7 @@ int main() { struct termios foo; int x = foo.c_iflag ; return 0; } EOF -if { (eval echo configure:5809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* termios_bad=unknown else @@ -5828,13 +6259,13 @@ fi echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6 -echo "configure:5832: checking for tcgetattr" >&5 +echo "configure:6263: 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 <<EOF -#line 5838 "configure" +#line 6269 "configure" #include "confdefs.h" #include <sys/types.h> @@ -5857,7 +6288,7 @@ TTY foo; tcgetattr(1, &foo); ; return 0; } EOF -if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_have_tcgetattr=yes else @@ -5876,11 +6307,247 @@ EOF +echo $ac_n "checking for vsscanf function or workaround""... $ac_c" 1>&6 +echo "configure:6312: checking for vsscanf function or workaround" >&5 +if eval "test \"`echo '$''{'cf_cv_func_vsscanf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <<EOF +#line 6318 "configure" +#include "confdefs.h" + +#include <stdarg.h> +#include <stdio.h> +int main() { + + va_list ap; + vsscanf("from", "%d", ap) +; return 0; } +EOF +if { (eval echo configure:6329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_func_vsscanf=vsscanf +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +cat > conftest.$ac_ext <<EOF +#line 6338 "configure" +#include "confdefs.h" + +#include <stdarg.h> +#include <stdio.h> +int main() { + + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (vfscanf(&strbuf, "%d", ap)) +; return 0; } +EOF +if { (eval echo configure:6355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_func_vsscanf=vfscanf +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +cat > conftest.$ac_ext <<EOF +#line 6364 "configure" +#include "confdefs.h" + +#include <stdarg.h> +#include <stdio.h> +int main() { + + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (_doscan(&strbuf, "%d", ap)) +; return 0; } +EOF +if { (eval echo configure:6381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_func_vsscanf=_doscan +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +cf_cv_func_vsscanf=no +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$cf_cv_func_vsscanf" 1>&6 + +case $cf_cv_func_vsscanf in #(vi +vsscanf) cat >> confdefs.h <<\EOF +#define HAVE_VSSCANF 1 +EOF +;; #(vi +vfscanf) cat >> confdefs.h <<\EOF +#define HAVE_VFSCANF 1 +EOF +;; #(vi +_doscan) cat >> confdefs.h <<\EOF +#define HAVE__DOSCAN 1 +EOF +;; +esac + + + +echo $ac_n "checking for working mkstemp""... $ac_c" 1>&6 +echo "configure:6418: checking for working mkstemp" >&5 +if eval "test \"`echo '$''{'cf_cv_func_mkstemp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +rm -f conftest* +if test "$cross_compiling" = yes; then + echo $ac_n "checking for mkstemp""... $ac_c" 1>&6 +echo "configure:6426: checking for mkstemp" >&5 +if eval "test \"`echo '$''{'ac_cv_func_mkstemp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 6431 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp(); below. */ +#include <assert.h> +/* 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 mkstemp(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkstemp) || defined (__stub___mkstemp) +choke me +#else +mkstemp(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_mkstemp=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_mkstemp=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'mkstemp`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + +else + cat > conftest.$ac_ext <<EOF +#line 6476 "configure" +#include "confdefs.h" + +#include <sys/types.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +int main() +{ + char *tmpl = "conftestXXXXXX"; + char name[2][80]; + int n; + int result = 0; + int fd; + struct stat sb; + + umask(077); + for (n = 0; n < 2; ++n) { + strcpy(name[n], tmpl); + if ((fd = mkstemp(name[n])) >= 0) { + if (!strcmp(name[n], tmpl) + || stat(name[n], &sb) != 0 + || (sb.st_mode & S_IFMT) != S_IFREG + || (sb.st_mode & 077) != 0) { + result = 1; + } + close(fd); + } + } + if (result == 0 + && !strcmp(name[0], name[1])) + result = 1; + exit(result); +} + +EOF +if { (eval echo configure:6513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + cf_cv_func_mkstemp=yes + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + cf_cv_func_mkstemp=no + +fi +rm -fr conftest* +fi + + +fi + +echo "$ac_t""$cf_cv_func_mkstemp" 1>&6 +if test "$cf_cv_func_mkstemp" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_MKSTEMP 1 +EOF + +fi + + +# setup for prototype of fallback for vsscanf() +if test "$cf_cv_func_vsscanf" = vsscanf ; then + HAVE_VSSCANF=1 +else + HAVE_VSSCANF=0 +fi + + 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:5884: checking whether setvbuf arguments are reversed" >&5 +echo "configure:6551: 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 @@ -5888,7 +6555,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 5892 "configure" +#line 6559 "configure" #include "confdefs.h" #include <stdio.h> /* If setvbuf has the reversed format, exit 0. */ @@ -5902,7 +6569,7 @@ main () { exit(0); /* Non-reversed systems segv here. */ } EOF -if { (eval echo configure:5906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6573: \"$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 @@ -5927,12 +6594,12 @@ fi fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5931: checking return type of signal handlers" >&5 +echo "configure:6598: 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 <<EOF -#line 5936 "configure" +#line 6603 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -5949,7 +6616,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5969,13 +6636,13 @@ EOF echo $ac_n "checking for type sigaction_t""... $ac_c" 1>&6 -echo "configure:5973: checking for type sigaction_t" >&5 +echo "configure:6640: 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 <<EOF -#line 5979 "configure" +#line 6646 "configure" #include "confdefs.h" #include <signal.h> @@ -5983,7 +6650,7 @@ int main() { sigaction_t x ; return 0; } EOF -if { (eval echo configure:5987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_type_sigaction=yes else @@ -6004,7 +6671,7 @@ EOF echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6 -echo "configure:6008: checking declaration of size-change" >&5 +echo "configure:6675: 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 @@ -6018,7 +6685,7 @@ do CPPFLAGS="$cf_save_CPPFLAGS" test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" cat > conftest.$ac_ext <<EOF -#line 6022 "configure" +#line 6689 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_TERMIOS_H @@ -6057,7 +6724,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sizechange=yes else @@ -6096,12 +6763,12 @@ fi echo $ac_n "checking for memmove""... $ac_c" 1>&6 -echo "configure:6100: checking for memmove" >&5 +echo "configure:6767: 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 <<EOF -#line 6105 "configure" +#line 6772 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memmove(); below. */ @@ -6124,7 +6791,7 @@ memmove(); ; return 0; } EOF -if { (eval echo configure:6128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6795: \"$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 @@ -6143,12 +6810,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for bcopy""... $ac_c" 1>&6 -echo "configure:6147: checking for bcopy" >&5 +echo "configure:6814: 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 <<EOF -#line 6152 "configure" +#line 6819 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bcopy(); below. */ @@ -6171,7 +6838,7 @@ bcopy(); ; return 0; } EOF -if { (eval echo configure:6175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6842: \"$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 @@ -6187,7 +6854,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:6191: checking if bcopy does overlapping moves" >&5 +echo "configure:6858: 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 @@ -6196,7 +6863,7 @@ else cf_cv_good_bcopy=unknown else cat > conftest.$ac_ext <<EOF -#line 6200 "configure" +#line 6867 "configure" #include "confdefs.h" int main() { @@ -6209,7 +6876,7 @@ int main() { } EOF -if { (eval echo configure:6213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6880: \"$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 @@ -6247,7 +6914,7 @@ fi echo $ac_n "checking if poll really works""... $ac_c" 1>&6 -echo "configure:6251: checking if poll really works" >&5 +echo "configure:6918: 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 @@ -6256,7 +6923,7 @@ if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat > conftest.$ac_ext <<EOF -#line 6260 "configure" +#line 6927 "configure" #include "confdefs.h" #include <stdio.h> @@ -6276,7 +6943,7 @@ int main() { exit(ret != 0); } EOF -if { (eval echo configure:6280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6947: \"$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 @@ -6303,14 +6970,48 @@ if test -z "$cf_user_CFLAGS" ; then fi +ac_safe=`echo "stdbool.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for stdbool.h""... $ac_c" 1>&6 +echo "configure:6976: checking for stdbool.h" >&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 +#line 6981 "configure" +#include "confdefs.h" +#include <stdbool.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:6986: \"$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 + cf_cv_header_stdbool_h=1 +else + echo "$ac_t""no" 1>&6 +cf_cv_header_stdbool_h=0 +fi + echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6 -echo "configure:6308: checking for builtin bool type" >&5 +echo "configure:7009: 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 <<EOF -#line 6314 "configure" +#line 7015 "configure" #include "confdefs.h" #include <stdio.h> @@ -6320,7 +7021,7 @@ int main() { bool x = false ; return 0; } EOF -if { (eval echo configure:6324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_cc_bool_type=1 else @@ -6357,7 +7058,7 @@ os2*) #(vi ;; esac echo $ac_n "checking for library $cf_stdcpp_libname""... $ac_c" 1>&6 -echo "configure:6361: checking for library $cf_stdcpp_libname" >&5 +echo "configure:7062: 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 @@ -6365,7 +7066,7 @@ else cf_save="$LIBS" LIBS="$LIBS -l$cf_stdcpp_libname" cat > conftest.$ac_ext <<EOF -#line 6369 "configure" +#line 7070 "configure" #include "confdefs.h" #include <strstream.h> @@ -6376,7 +7077,7 @@ strstreambuf foo(buf, sizeof(buf)) ; return 0; } EOF -if { (eval echo configure:6380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_libstdcpp=yes else @@ -6395,16 +7096,12 @@ test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" fi - if test "$GXX" = yes; then - echo $ac_n "checking version of ${CXX-g++}""... $ac_c" 1>&6 -echo "configure:6401: checking version of ${CXX-g++}" >&5 - eval "${CXX-g++} --version" - case "`${CXX-g++} --version`" in - 1*|2.0-6*) - cf_cxx_library=yes - ;; - *-2.7*|2.7*) - + case $GXX_VERSION in + 1*|2.0-6*) + cf_cxx_library=yes + ;; + *-2.7*|2.7*) + cf_cxx_library=unknown case $cf_cv_system_name in #(vi os2*) #(vi @@ -6416,11 +7113,11 @@ os2*) #(vi esac if test "$ac_cv_prog_gxx" = yes; then echo $ac_n "checking for lib$cf_gpp_libname""... $ac_c" 1>&6 -echo "configure:6420: checking for lib$cf_gpp_libname" >&5 +echo "configure:7117: checking for lib$cf_gpp_libname" >&5 cf_save="$LIBS" LIBS="$LIBS -l$cf_gpp_libname" cat > conftest.$ac_ext <<EOF -#line 6424 "configure" +#line 7121 "configure" #include "confdefs.h" #include <$cf_gpp_libname/builtin.h> @@ -6429,7 +7126,7 @@ int main() { two_arg_error_handler_t foo2 = lib_error_handler ; return 0; } EOF -if { (eval echo configure:6433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7130: \"$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" @@ -6449,7 +7146,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6453 "configure" +#line 7150 "configure" #include "confdefs.h" #include <builtin.h> @@ -6458,7 +7155,7 @@ int main() { two_arg_error_handler_t foo2 = lib_error_handler ; return 0; } EOF -if { (eval echo configure:6462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7159: \"$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" @@ -6479,17 +7176,14 @@ rm -f conftest* echo "$ac_t""$cf_cxx_library" 1>&6 fi - ;; - *) - cf_cxx_library=no - ;; - esac - else + ;; + *) cf_cxx_library=no - fi + ;; + esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:6493: checking how to run the C++ preprocessor" >&5 +echo "configure:7187: 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 @@ -6502,12 +7196,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 -#line 6506 "configure" +#line 7200 "configure" #include "confdefs.h" #include <stdlib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7205: \"$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 : @@ -6535,17 +7229,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:6539: checking for $ac_hdr" >&5 +echo "configure:7233: 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 -#line 6544 "configure" +#line 7238 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7243: \"$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* @@ -6573,14 +7267,48 @@ done +ac_safe=`echo "stdbool.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for stdbool.h""... $ac_c" 1>&6 +echo "configure:7273: checking for stdbool.h" >&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 +#line 7278 "configure" +#include "confdefs.h" +#include <stdbool.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:7283: \"$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 + cf_cv_header_stdbool_h=1 +else + echo "$ac_t""no" 1>&6 +cf_cv_header_stdbool_h=0 +fi + echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6 -echo "configure:6578: checking for builtin bool type" >&5 +echo "configure:7306: 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 <<EOF -#line 6584 "configure" +#line 7312 "configure" #include "confdefs.h" #include <stdio.h> @@ -6590,7 +7318,7 @@ int main() { bool x = false ; return 0; } EOF -if { (eval echo configure:6594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_builtin_bool=1 else @@ -6610,7 +7338,7 @@ fi echo $ac_n "checking for size of bool""... $ac_c" 1>&6 -echo "configure:6614: checking for size of bool" >&5 +echo "configure:7342: 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 @@ -6620,7 +7348,7 @@ else cf_cv_type_of_bool=unknown else cat > conftest.$ac_ext <<EOF -#line 6624 "configure" +#line 7352 "configure" #include "confdefs.h" #ifdef __cplusplus extern "C" void exit(int); @@ -6628,6 +7356,9 @@ extern "C" void exit(int); #include <stdlib.h> #include <stdio.h> + +#if defined(__cplusplus) + #ifdef HAVE_GXX_BUILTIN_H #include <g++/builtin.h> #elif HAVE_GPP_BUILTIN_H @@ -6635,6 +7366,15 @@ extern "C" void exit(int); #elif HAVE_BUILTIN_H #include <builtin.h> #endif + +#else + +#if $cf_cv_header_stdbool_h +#include <stdbool.h> +#endif + +#endif + main() { FILE *fp = fopen("cf_test.out", "w"); @@ -6652,9 +7392,12 @@ main() } EOF -if { (eval echo configure:6656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7396: \"$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` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 @@ -6670,13 +7413,16 @@ fi rm -f cf_test.out echo "$ac_t""$cf_cv_type_of_bool" 1>&6 if test "$cf_cv_type_of_bool" = unknown ; then - echo "configure: warning: Assuming unsigned for type of bool" 1>&2 - cf_cv_type_of_bool=unsigned + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + echo "configure: warning: Assuming $NCURSES_BOOL for type of bool" 1>&2 + cf_cv_type_of_bool=$NCURSES_BOOL fi echo $ac_n "checking for special defines needed for etip.h""... $ac_c" 1>&6 -echo "configure:6680: checking for special defines needed for etip.h" >&5 +echo "configure:7426: checking for special defines needed for etip.h" >&5 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" for cf_math in "" MATH_H @@ -6687,7 +7433,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 <<EOF -#line 6691 "configure" +#line 7437 "configure" #include "confdefs.h" #include <etip.h.in> @@ -6696,7 +7442,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* test -n "$cf_math" && cat >> confdefs.h <<EOF @@ -6723,7 +7469,7 @@ CXXFLAGS="$cf_save_CXXFLAGS" if test -n "$CXX"; then echo $ac_n "checking if $CXX accepts parameter initialization""... $ac_c" 1>&6 -echo "configure:6727: checking if $CXX accepts parameter initialization" >&5 +echo "configure:7473: 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 @@ -6740,7 +7486,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cf_cv_cpp_param_init=unknown else cat > conftest.$ac_ext <<EOF -#line 6744 "configure" +#line 7490 "configure" #include "confdefs.h" #ifdef __cplusplus extern "C" void exit(int); @@ -6761,7 +7507,7 @@ TEST::TEST(int x = 1) // some compilers do not like second initializer void main() { } EOF -if { (eval echo configure:6765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7511: \"$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 @@ -6805,17 +7551,17 @@ for ac_hdr in strstream.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6809: checking for $ac_hdr" >&5 +echo "configure:7555: 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 -#line 6814 "configure" +#line 7560 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7565: \"$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* @@ -6843,19 +7589,20 @@ done echo $ac_n "checking if $CXX supports vscan function""... $ac_c" 1>&6 -echo "configure:6847: checking if $CXX supports vscan function" >&5 +echo "configure:7593: checking if $CXX supports vscan function" >&5 if eval "test \"`echo '$''{'cf_cv_cpp_vscan_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - for cf_vscan_func in strstream stdio + for cf_vscan_func in strstream strstream_cast stdio do case $cf_vscan_func in #(vi stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; + strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; esac cat > conftest.$ac_ext <<EOF -#line 6859 "configure" +#line 7606 "configure" #include "confdefs.h" #include <stdio.h> @@ -6869,25 +7616,25 @@ else int scanw(const char* fmt, ...) { int result = -1; -#if defined(__GNUG__) char buf[BUFSIZ]; va_list args; va_start(args, fmt); #if defined(USE_STDIO_VSCAN) - if (::vscanf(fmt, args) != -1) + if (::vsscanf(buf, fmt, args) != -1) result = 0; #elif defined(USE_STRSTREAM_VSCAN) strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = 0; +#elif defined(USE_STRSTREAM_VSCAN_CAST) + strstreambuf ss(buf, sizeof(buf)); if (ss.vscan(fmt, (_IO_va_list)args) != -1) result = 0; #else #error case $cf_vscan_func failed #endif va_end(args); -#else -#error sorry, we only know about the GNU compiler case -#endif return result; } @@ -6895,7 +7642,7 @@ int main() { int tmp, foo = scanw("%d", &tmp) ; return 0; } EOF -if { (eval echo configure:6899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_cpp_vscan_func=$cf_vscan_func; break else @@ -6942,15 +7689,41 @@ EOF EOF ;; +strstream_cast) + cat >> confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >> confdefs.h <<\EOF +#define USE_STRSTREAM_VSCAN_CAST 1 +EOF + + ;; esac + CXX_AR='$(AR)' + CXX_AR_OPTS='$(AR_OPTS)' case $cf_cv_system_name in #(vi - sco3.2v5*) + irix*) #(vi + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-ar -o' + fi + ;; + sco3.2v5*) #(vi CXXLDFLAGS="-u main" ;; + solaris2*) + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-xar -o' + fi + ;; esac + + else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -6964,13 +7737,104 @@ else # Caveat: since the storage of the bool type is not standardized, it # may change. - echo $ac_n "checking for fallback type of bool""... $ac_c" 1>&6 -echo "configure:6969: 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 ;; + if test "$NCURSES_BOOL" != auto ; then + cf_cv_type_of_bool=$NCURSES_AUTO + else + if test "$cf_cv_header_stdbool_h" = 1 ; then + +echo $ac_n "checking for size of bool""... $ac_c" 1>&6 +echo "configure:7747: 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 + + rm -f cf_test.out + if test "$cross_compiling" = yes; then + cf_cv_type_of_bool=unknown +else + cat > conftest.$ac_ext <<EOF +#line 7757 "configure" +#include "confdefs.h" +#ifdef __cplusplus +extern "C" void exit(int); +#endif + +#include <stdlib.h> +#include <stdio.h> + +#if defined(__cplusplus) + +#ifdef HAVE_GXX_BUILTIN_H +#include <g++/builtin.h> +#elif HAVE_GPP_BUILTIN_H +#include <gpp/builtin.h> +#elif HAVE_BUILTIN_H +#include <builtin.h> +#endif + +#else + +#if $cf_cv_header_stdbool_h +#include <stdbool.h> +#endif + +#endif + +main() +{ + FILE *fp = fopen("cf_test.out", "w"); + if (fp != 0) { + bool x = true; + if ((bool)(-x) >= 0) + fputs("unsigned ", fp); + if (sizeof(x) == sizeof(int)) fputs("int", fp); + else if (sizeof(x) == sizeof(char)) fputs("char", fp); + else if (sizeof(x) == sizeof(short))fputs("short",fp); + else if (sizeof(x) == sizeof(long)) fputs("long", fp); + fclose(fp); + } + exit(0); +} + +EOF +if { (eval echo configure:7801: \"$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` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + cf_cv_type_of_bool=unknown +fi +rm -fr conftest* +fi + + +fi + + rm -f cf_test.out +echo "$ac_t""$cf_cv_type_of_bool" 1>&6 +if test "$cf_cv_type_of_bool" = unknown ; then + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; esac - echo "$ac_t""$cf_cv_type_of_bool" 1>&6 + echo "configure: warning: Assuming $NCURSES_BOOL for type of bool" 1>&2 + cf_cv_type_of_bool=$NCURSES_BOOL +fi + + else + echo $ac_n "checking for fallback type of bool""... $ac_c" 1>&6 +echo "configure:7831: 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 ;; + esac + echo "$ac_t""$cf_cv_type_of_bool" 1>&6 + fi + fi fi @@ -6981,7 +7845,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:6985: checking for $ac_word" >&5 +echo "configure:7849: 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 @@ -7035,7 +7899,7 @@ 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:7039: checking for $ac_word" >&5 +echo "configure:7903: 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 @@ -7068,7 +7932,7 @@ fi fi if test "$cf_cv_prog_gnat_correct" = yes; then echo $ac_n "checking if GNAT works""... $ac_c" 1>&6 -echo "configure:7072: checking if GNAT works" >&5 +echo "configure:7936: checking if GNAT works" >&5 rm -f conftest* cat >>conftest.ads <<CF_EOF @@ -7130,7 +7994,9 @@ else fi case ".$withval" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; @@ -7146,7 +8012,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; } ;; esac @@ -7164,7 +8030,9 @@ else fi case ".$withval" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; @@ -7180,7 +8048,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; } ;; esac @@ -7195,30 +8063,29 @@ 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 "$GCC" = yes; then - case "`$CC --version`" in - 2.6.3) - if test "$cf_cv_type_of_bool" != "char"; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - fi - ;; - 2.5*) + case $GCC_VERSION in + 2.6.3) + if test "$cf_cv_type_of_bool" != "char"; then EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - ;; - esac - fi + fi + ;; + 2.5*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + ;; + esac fi ### Construct the library-subsets, if any, from this set of keywords: ### none, base, ext_funcs, termlib. echo $ac_n "checking for library subsets""... $ac_c" 1>&6 -echo "configure:7216: checking for library subsets" >&5 +echo "configure:8082: checking for library subsets" >&5 if test "$with_termlib" = yes ; then LIB_SUBSETS="termlib " else LIB_SUBSETS="termlib+" fi LIB_SUBSETS="${LIB_SUBSETS}base" +test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" echo "$ac_t""$LIB_SUBSETS" 1>&6 @@ -7272,7 +8139,7 @@ fi ### Build up pieces for makefile rules echo $ac_n "checking default library suffix""... $ac_c" 1>&6 -echo "configure:7276: checking default library suffix" >&5 +echo "configure:8143: checking default library suffix" >&5 case $DFT_LWR_MODEL in libtool) DFT_ARG_SUFFIX='' ;; @@ -7285,7 +8152,7 @@ echo "configure:7276: 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:7289: checking default library-dependency suffix" >&5 +echo "configure:8156: checking default library-dependency suffix" >&5 case $DFT_LWR_MODEL in @@ -7295,28 +8162,43 @@ echo "configure:7289: checking default library-dependency suffix" >&5 profile) DFT_DEP_SUFFIX='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) DFT_DEP_SUFFIX='.dll' ;; + darwin*) DFT_DEP_SUFFIX='.dylib' ;; hpux*) DFT_DEP_SUFFIX='.sl' ;; *) DFT_DEP_SUFFIX='.so' ;; esac esac test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" +if test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + DFT_DEP_SUFFIX=".dll.a" + ;; + esac +fi echo "$ac_t""$DFT_DEP_SUFFIX" 1>&6 echo $ac_n "checking default object directory""... $ac_c" 1>&6 -echo "configure:7307: checking default object directory" >&5 +echo "configure:8183: 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' ;; - shared) DFT_OBJ_SUBDIR='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + DFT_OBJ_SUBDIR='objects' ;; + *) + DFT_OBJ_SUBDIR='obj_s' ;; + esac 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 suffix""... $ac_c" 1>&6 -echo "configure:7320: checking c++ library-dependency suffix" >&5 +echo "configure:8202: checking c++ library-dependency suffix" >&5 if test "$with_libtool" = "yes"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else @@ -7329,6 +8211,8 @@ else profile) CXX_LIB_SUFFIX='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) CXX_LIB_SUFFIX='.dll' ;; + darwin*) CXX_LIB_SUFFIX='.dylib' ;; hpux*) CXX_LIB_SUFFIX='.sl' ;; *) CXX_LIB_SUFFIX='.so' ;; esac @@ -7342,7 +8226,7 @@ TINFO_LIST="$SHLIB_LIST" 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:7346: checking where we will install curses.h" >&5 +echo "configure:8230: checking where we will install curses.h" >&5 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='$(prefix)/include/ncurses'${LIB_SUFFIX} @@ -7370,7 +8254,7 @@ PROG_ARGS="$TEST_ARGS" echo $ac_n "checking for src modules""... $ac_c" 1>&6 -echo "configure:7374: checking for src modules" >&5 +echo "configure:8258: 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" @@ -7430,11 +8314,11 @@ EOF fi done echo "$ac_t""$cf_cv_src_modules" 1>&6 -TEST_ARGS="-L${LIB_DIR} -L\$(libdir) $TEST_ARGS" +TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" -PROG_ARGS="-L${LIB_DIR} -L\$(libdir) $PROG_ARGS" +PROG_ARGS="-L${LIB_DIR} $PROG_ARGS" SRC_SUBDIRS="man include" @@ -7442,7 +8326,8 @@ for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS misc test" +SRC_SUBDIRS="$SRC_SUBDIRS test" +test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= @@ -7475,10 +8360,20 @@ do normal) cf_subdir='objects' ;; debug) cf_subdir='obj_g' ;; profile) cf_subdir='obj_p' ;; - shared) cf_subdir='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + cf_subdir='objects' ;; + *) + cf_subdir='obj_s' ;; + esac esac - DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" done for cf_dir in $DIRS_TO_MAKE do @@ -7586,7 +8481,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.20000819" + echo "$CONFIG_STATUS generated by autoconf version 2.13.20020210" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -7599,7 +8494,7 @@ ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "\ include/MKterm.h.awk \ - include/curses.h \ + include/curses.head:include/curses.h.in \ include/termcap.h \ include/unctrl.h \ misc/run_tic.sh:misc/run_tic.in \ @@ -7643,6 +8538,7 @@ s%@cf_cv_rel_version@%$cf_cv_rel_version%g s%@cf_cv_abi_version@%$cf_cv_abi_version%g s%@cf_cv_cc_bool_type@%$cf_cv_cc_bool_type%g s%@cf_cv_builtin_bool@%$cf_cv_builtin_bool%g +s%@cf_cv_header_stdbool_h@%$cf_cv_header_stdbool_h%g s%@cf_cv_type_of_bool@%$cf_cv_type_of_bool%g s%@host@%$host%g s%@host_alias@%$host_alias%g @@ -7661,6 +8557,9 @@ s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@CC@%$CC%g s%@BUILD_CC@%$BUILD_CC%g +s%@BUILD_CFLAGS@%$BUILD_CFLAGS%g +s%@BUILD_LDFLAGS@%$BUILD_LDFLAGS%g +s%@BUILD_LIBS@%$BUILD_LIBS%g s%@CPP@%$CPP%g s%@PROG_EXT@%$PROG_EXT%g s%@LDCONFIG@%$LDCONFIG%g @@ -7703,22 +8602,33 @@ s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g s%@LOCAL_LDFLAGS2@%$LOCAL_LDFLAGS2%g s%@INSTALL_LIB@%$INSTALL_LIB%g s%@TERMINFO_SRC@%$TERMINFO_SRC%g -s%@FALLBACK_LIST@%$FALLBACK_LIST%g s%@PATHSEP@%$PATHSEP%g +s%@FALLBACK_LIST@%$FALLBACK_LIST%g s%@TERMINFO_DIRS@%$TERMINFO_DIRS%g s%@TERMINFO@%$TERMINFO%g +s%@MAKE_TERMINFO@%$MAKE_TERMINFO%g +s%@TERMPATH@%$TERMPATH%g +s%@BROKEN_LINKER@%$BROKEN_LINKER%g +s%@NCURSES_BOOL@%$NCURSES_BOOL%g s%@NCURSES_OSPEED@%$NCURSES_OSPEED%g +s%@MANPAGE_RENAMES@%$MANPAGE_RENAMES%g +s%@NCURSES_EXT_FUNCS@%$NCURSES_EXT_FUNCS%g s%@NCURSES_CONST@%$NCURSES_CONST%g s%@NCURSES_XNAMES@%$NCURSES_XNAMES%g +s%@NCURSES_CH_T@%$NCURSES_CH_T%g +s%@NCURSES_LIBUTF8@%$NCURSES_LIBUTF8%g +s%@NCURSES_MBSTATE_T@%$NCURSES_MBSTATE_T%g +s%@TERMINFO_CAPS@%$TERMINFO_CAPS%g s%@ECHO_LINK@%$ECHO_LINK%g s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g s%@MATH_LIB@%$MATH_LIB%g s%@cf_cv_typeof_chtype@%$cf_cv_typeof_chtype%g s%@cf_cv_1UL@%$cf_cv_1UL%g -s%@cf_cv_shift_limit@%$cf_cv_shift_limit%g -s%@cf_cv_widec_shift@%$cf_cv_widec_shift%g +s%@HAVE_VSSCANF@%$HAVE_VSSCANF%g s%@CXXCPP@%$CXXCPP%g s%@CXXLDFLAGS@%$CXXLDFLAGS%g +s%@CXX_AR@%$CXX_AR%g +s%@CXX_AR_OPTS@%$CXX_AR_OPTS%g s%@CXXLIBS@%$CXXLIBS%g s%@gnat_exists@%$gnat_exists%g s%@M4_exists@%$M4_exists%g @@ -7787,7 +8697,7 @@ cat >> $CONFIG_STATUS <<EOF CONFIG_FILES=\${CONFIG_FILES-"\ include/MKterm.h.awk \ - include/curses.h \ + include/curses.head:include/curses.h.in \ include/termcap.h \ include/unctrl.h \ misc/run_tic.sh:misc/run_tic.in \ @@ -7964,22 +8874,25 @@ CF_LIST_MODELS="$cf_list_models" DFT_LWR_MODEL="$DFT_LWR_MODEL" LDCONFIG="$LDCONFIG" LIB_NAME="$LIB_NAME" -LIB_SUFFIX="$LIB_SUFFIX" LIB_SUBSETS="$LIB_SUBSETS" +LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +MAKE_TERMINFO="$MAKE_TERMINFO" +NCURSES_OSPEED="$NCURSES_OSPEED" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" TINFO_NAME="$TINFO_NAME" +WITH_CURSES_H="$with_curses_h" 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" cf_cv_rm_so_locs="$cf_cv_rm_so_locs" +cf_cv_shlib_version="$cf_cv_shlib_version" +cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" cf_with_cxx_binding="$cf_with_cxx_binding" -cf_cv_shlib_version="$cf_cv_shlib_version" target="$target" @@ -8002,7 +8915,9 @@ for cf_dir in $SRC_SUBDIRS do if test -f $srcdir/$cf_dir/modules; then - cf_libs_to_make= + IMPORT_LIB= + SHARED_LIB= + LIBS_TO_MAKE= for cf_item in $CF_LIST_MODELS do @@ -8014,6 +8929,8 @@ do profile) cf_suffix='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) cf_suffix='.dll' ;; + darwin*) cf_suffix='.dylib' ;; hpux*) cf_suffix='.sl' ;; *) cf_suffix='.so' ;; esac @@ -8023,36 +8940,61 @@ do if test $cf_item = shared ; then if test "$cf_cv_do_symlinks" = yes ; then case "$cf_cv_shlib_version" in #(vi - rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi - abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + rel) #(vi + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; + esac + ;; + abi) + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + esac + ;; esac fi + # cygwin needs import library, and has unique naming convention + if test $cf_cv_shlib_version = cygdll ; then + SHARED_LIB="../lib/${cf_prefix}${cf_dir}\$(ABI_VERSION).dll" + IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a" + LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)" + continue + fi fi - cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}" + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" done if test $cf_dir = ncurses ; then + cf_subsets="$LIB_SUBSETS" case "$LIB_SUBSETS" in #(vi termlib+*) #(vi ;; *) #(vi - cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g` - cf_libs_to_make="$cf_item $cf_libs_to_make" + cf_item=`echo $LIBS_TO_MAKE |sed -e s/$LIB_NAME/$TINFO_NAME/g` + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" ;; esac + else + cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib //'` fi - sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \ + sed -e "s@\@LIBS_TO_MAKE\@@$LIBS_TO_MAKE@" \ + -e "s@\@IMPORT_LIB\@@$IMPORT_LIB@" \ + -e "s@\@SHARED_LIB\@@$SHARED_LIB@" \ $cf_dir/Makefile >$cf_dir/Makefile.out mv $cf_dir/Makefile.out $cf_dir/Makefile $AWK -f $srcdir/mk-0th.awk \ - name=$cf_dir \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - for cf_item in $CF_LIST_MODELS + for cf_subset in $cf_subsets do - echo 'Appending rules for '$cf_item' model ('$cf_dir')' + cf_subdirs= + for cf_item in $CF_LIST_MODELS + do + echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` @@ -8065,6 +9007,8 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ profile) cf_suffix='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) cf_suffix='.dll' ;; + darwin*) cf_suffix='.dylib' ;; hpux*) cf_suffix='.sl' ;; *) cf_suffix='.so' ;; esac @@ -8077,7 +9021,13 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ normal) cf_subdir='objects' ;; debug) cf_subdir='obj_g' ;; profile) cf_subdir='obj_p' ;; - shared) cf_subdir='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + cf_subdir='objects' ;; + *) + cf_subdir='obj_s' ;; + esac esac @@ -8096,8 +9046,6 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ cf_depend="$cf_depend $cf_reldir/curses.priv.h" fi - for cf_subset in $LIB_SUBSETS - do $AWK -f $srcdir/mk-1st.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -8107,6 +9055,7 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ suffix=$cf_suffix \ subset=$cf_subset \ ShlibVer=$cf_cv_shlib_version \ + ShlibVerInfix=$cf_cv_shlib_version_infix \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ @@ -8114,7 +9063,11 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ depend="$cf_depend" \ target="$target" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - test $cf_dir = ncurses && WITH_OVERWRITE=no + for cf_subdir2 in $cf_subdirs lib + do + test $cf_subdir = $cf_subdir2 && break + done + test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \ $AWK -f $srcdir/mk-2nd.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -8124,6 +9077,7 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ srcdir=$srcdir \ echo=$WITH_ECHO \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile + cf_subdirs="$cf_subdirs $cf_subdir" done done fi @@ -8179,11 +9133,11 @@ done cat >> Makefile <<CF_EOF -install.data \ +install.data \\ uninstall.data :: - cd misc && \$(MAKE) \$(CF_MFLAGS) \$@ +$MAKE_TERMINFO cd misc && \$(MAKE) \$(CF_MFLAGS) \$@ -install.man \ +install.man \\ uninstall.man :: cd man && \$(MAKE) \$(CF_MFLAGS) \$@ @@ -8198,7 +9152,7 @@ if test -d tack ; then if test -f $srcdir/$tack.h; then cat >> Makefile <<CF_EOF -install.man \ +install.man \\ uninstall.man :: cd tack && \$(MAKE) \$(CF_MFLAGS) \$@ CF_EOF @@ -8276,6 +9230,9 @@ test "\$NAME" = "curses.h" && NAME=ncurses.h CF_EOF fi cat >>headers.sh <<CF_EOF +# Just in case someone gzip'd manpages, remove the conflicting copy. +test -f \$DST/\$NAME.gz && rm -f \$DST/\$NAME.gz + eval \$PRG \$TMPSRC \$DST/\$NAME rm -f \$TMPSRC \$TMPSED CF_EOF @@ -8287,7 +9244,7 @@ do if test -f $srcdir/$cf_dir/headers; then cat >>$cf_dir/Makefile <<CF_EOF \$(DESTDIR)\$(includedir) : - \$(srcdir)/../mkinstalldirs \$@ + sh \$(srcdir)/../mkinstalldirs \$@ install \\ install.libs \\ @@ -8319,6 +9276,17 @@ CF_EOF test $i = curses.h && echo " -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile done fi + + if test -f $srcdir/$cf_dir/modules; then + if test "$cf_dir" != "c++" ; then + cat >>$cf_dir/Makefile <<"CF_EOF" +depend : $(AUTO_SRC) + makedepend -- $(CPPFLAGS) -- $(C_SRC) + +# DO NOT DELETE THIS LINE -- make depend depends on it. +CF_EOF + fi + fi done diff --git a/contrib/ncurses/configure.in b/contrib/ncurses/configure.in index 62e9e82..b7beda6 100644 --- a/contrib/ncurses/configure.in +++ b/contrib/ncurses/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * +dnl Copyright (c) 1998,1999,2000,2001,2002 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,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 dnl -dnl $Id: configure.in,v 1.233 2001/04/07 22:09:57 tom Exp $ +dnl $Id: configure.in,v 1.267 2002/05/18 21:14:13 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://dickey.his.com/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20000819) -AC_REVISION($Revision: 1.233 $) +AC_REVISION($Revision: 1.267 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -80,16 +80,40 @@ CF_CFG_DEFAULTS ### Checks for programs. AC_PROG_CC +GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of gcc) - eval "$CC --version" + GCC_VERSION="`${CC} --version|head -1`" + AC_MSG_RESULT($GCC_VERSION) fi -if test "$host" != $build; then - AC_CHECK_PROGS(BUILD_CC, $CC gcc cc) -else - BUILD_CC="$CC" + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the target +# compiler, etc., but we need a host compiler to generate parts of the source. +BUILD_CC='$(CC)' +BUILD_CFLAGS='$(CFLAGS)' +BUILD_LDFLAGS='$(LDFLAGS)' +BUILD_LIBS='$(LIBS)' +if test "$host_alias" != "$target_alias" ; then + AC_ARG_WITH(build-cc, + [ --with-build-cc=XXX if cross-compiling, the host C compiler (\$BUILD_CC)], + [BUILD_CC="$withval"], + [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)]) + AC_ARG_WITH(build-cflags, + [ --with-build-cflags=XXX if cross-compiling, the host C compiler-flags], + [BUILD_CFLAGS="$withval"]) + AC_ARG_WITH(build-ldflags, + [ --with-build-ldflags=XXX if cross-compiling, the host linker-flags], + [BUILD_LDFLAGS="$withval"]) + AC_ARG_WITH(build-libs, + [ --with-build-libs=XXX if cross-compiling, the host libraries], + [BUILD_LIBS="$withval"]) fi AC_SUBST(BUILD_CC) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(BUILD_LDFLAGS) +AC_SUBST(BUILD_LIBS) + AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX @@ -126,12 +150,16 @@ else popdef([AC_MSG_ERROR])dnl fi +GXX_VERSION=none if test "$GXX" = yes; then - case "`${CXX-g++} --version`" in + AC_MSG_CHECKING(version of g++) + GXX_VERSION="`${CXX-g++} --version|head -1`" + AC_MSG_RESULT($GXX_VERSION) + case $GXX_VERSION in 1*|2.[[0-6]]*) GXX=""; CXX=""; ac_cv_prog_gxx=no cf_cxx_library=no - echo No: templates do not work + AC_MSG_WARN(templates do not work) ;; esac fi @@ -195,7 +223,7 @@ dnl adjust the location into which the actual install is done, so that an dnl archive can be built without modifying the host system's configuration. AC_MSG_CHECKING(if you have specified an install-prefix) AC_ARG_WITH(install-prefix, - [ --with-install-prefix prefixes actual install-location], + [ --with-install-prefix prefixes actual install-location (\$DESTDIR)], [case "$withval" in #(vi yes|no) #(vi ;; @@ -394,7 +422,7 @@ 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], + [ --disable-database do not use terminfo, only fallbacks/termcap], [use_database=$enableval], [use_database=yes]) AC_MSG_RESULT($use_database) @@ -409,6 +437,7 @@ os2*) #(vi esac AC_SUBST(TERMINFO_SRC) +CF_PATHSEP if test "$use_database" != no ; then AC_DEFINE(USE_DATABASE) AC_MSG_CHECKING(which terminfo source-file will be installed) @@ -427,11 +456,10 @@ AC_MSG_RESULT($with_fallback) FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` AC_SUBST(FALLBACK_LIST) +MAKE_TERMINFO= 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" + MAKE_TERMINFO="#" else AC_MSG_CHECKING(for list of terminfo directories) @@ -455,6 +483,7 @@ AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO") fi AC_SUBST(TERMINFO) +AC_SUBST(MAKE_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. @@ -487,9 +516,23 @@ AC_ARG_ENABLE(termcap, AC_MSG_RESULT($with_termcap) if test "$with_termcap" != "yes" ; then + if test "$use_database" = no ; then + if test -z $with_fallback ; then + AC_ERROR(You have disabled the database w/o specifying fallbacks) + fi + fi AC_DEFINE(PURE_TERMINFO) else +AC_DEFINE(USE_TERMCAP) +AC_MSG_CHECKING(for list of termcap files) +CF_WITH_PATHLIST(termpath, + [ --with-termpath=XXX specify list of termcap files], + TERMPATH, + /etc/termcap:/usr/share/misc/termcap) +AC_MSG_RESULT($TERMPATH) +test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH") + ### use option --enable-getcap to use a hacked getcap for reading termcaps AC_MSG_CHECKING(if fast termcap-loader is needed) AC_ARG_ENABLE(getcap, @@ -551,13 +594,36 @@ AC_ARG_ENABLE(broken_linker, [with_broken_linker=$enableval], [with_broken_linker=$BROKEN_LINKER]) AC_MSG_RESULT($with_broken_linker) -test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER) + +BROKEN_LINKER=0 +if test "$with_broken_linker" = yes ; then + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 +elif test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 + CF_VERBOSE(cygwin linker is broken anyway) + ;; + esac +fi +AC_SUBST(BROKEN_LINKER) + +### use option --with-bool to override bool's type +AC_MSG_CHECKING(for type of bool) +AC_ARG_WITH(bool, + [ --with-bool=TYPE override fallback type of bool variable], + [NCURSES_BOOL="$withval"], + [NCURSES_BOOL=auto]) +AC_MSG_RESULT($NCURSES_BOOL) +AC_SUBST(NCURSES_BOOL) ### use option --with-ospeed to override ospeed's type AC_MSG_CHECKING(for type of ospeed) AC_ARG_WITH(ospeed, [ --with-ospeed=TYPE override type of ospeed variable], - [NCURSES_OSPEED=$withval], + [NCURSES_OSPEED="$withval"], [NCURSES_OSPEED=short]) AC_MSG_RESULT($NCURSES_OSPEED) AC_SUBST(NCURSES_OSPEED) @@ -594,13 +660,17 @@ AC_ARG_ENABLE(ext-funcs, [with_ext_funcs=yes]) AC_MSG_RESULT($with_ext_funcs) if test "$with_ext_funcs" = yes ; then + NCURSES_EXT_FUNCS=1 AC_DEFINE(HAVE_CURSES_VERSION) AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) AC_DEFINE(HAVE_WRESIZE) AC_DEFINE(NCURSES_EXT_FUNCS) +else + NCURSES_EXT_FUNCS=0 fi +AC_SUBST(NCURSES_EXT_FUNCS) ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) @@ -655,7 +725,7 @@ AC_MSG_RESULT($with_develop) ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment AC_MSG_CHECKING(if you want colorfgbg code) -AC_ARG_ENABLE(hard-tabs, +AC_ARG_ENABLE(enable-colorfgbg, [ --enable-colorfgbg compile with \$COLORFGBG code], [with_colorfgbg=$enableval], [with_colorfgbg=$with_develop]) @@ -730,6 +800,9 @@ test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS) fi ### use option --enable-widec to turn on use of wide-character support +NCURSES_CH_T=chtype +NCURSES_LIBUTF8=0 +NCURSES_MBSTATE_T=0 AC_MSG_CHECKING(if you want experimental wide-character code) AC_ARG_ENABLE(widec, [ --enable-widec compile with experimental wide-char/UTF-8 code], @@ -739,7 +812,33 @@ AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" AC_DEFINE(USE_WIDEC_SUPPORT) + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + with_overwrite=no + NCURSES_CH_T=cchar_t + AC_CHECK_FUNC(putwc) +if test "$ac_cv_func_putwc" != yes ; then + CF_LIBUTF8 + if test "$cf_cv_libutf8" = yes ; then + NCURSES_LIBUTF8=1 + fi +fi + CF_MBSTATE_T + if test $cf_cv_mbstate_t = yes ; then + NCURSES_MBSTATE_T=1 + fi fi +AC_SUBST(NCURSES_CH_T) +AC_SUBST(NCURSES_LIBUTF8) +AC_SUBST(NCURSES_MBSTATE_T) + +AC_MSG_CHECKING(for terminal capabilities file) +AC_ARG_WITH(caps, + [ --with-caps=alt compile with experimental alternate Caps file], + [TERMINFO_CAPS=Caps.$withval], + [TERMINFO_CAPS=Caps]) +test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps +AC_MSG_RESULT($TERMINFO_CAPS) +AC_SUBST(TERMINFO_CAPS) ############################################################################### CF_HELP_MESSAGE(Testing/development Options:) @@ -818,8 +917,10 @@ CF_MATH_LIB(MATH_LIB,sin(x)) AC_SUBST(MATH_LIB) ### Checks for header files. +CF_GNU_SOURCE AC_STDC_HEADERS AC_HEADER_DIRENT +AC_HEADER_TIME CF_REGEX dnl These are some other potentially nonportable headers. @@ -857,7 +958,6 @@ AC_C_INLINE test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) CF_TYPEOF_CHTYPE -CF_WIDEC_SHIFT ### Checks for external-data CF_ERRNO @@ -871,7 +971,6 @@ geteuid \ getttynam \ issetugid \ memccpy \ -mkstemp \ nanosleep \ poll \ remove \ @@ -885,9 +984,7 @@ strdup \ strstr \ tcgetpgrp \ times \ -vfscanf \ vsnprintf \ -vsscanf \ ) if test "$with_getcap" = "yes" ; then CF_CGETENT @@ -896,6 +993,16 @@ fi CF_ISASCII CF_STRUCT_SIGACTION CF_FUNC_TERMIOS +CF_FUNC_VSSCANF +CF_MKSTEMP + +# setup for prototype of fallback for vsscanf() +if test "$cf_cv_func_vsscanf" = vsscanf ; then + HAVE_VSSCANF=1 +else + HAVE_VSSCANF=0 +fi +AC_SUBST(HAVE_VSSCANF) dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS if test "$cross_compiling" = yes ; then @@ -921,23 +1028,17 @@ if test -n "$CXX" ; then AC_LANG_CPLUSPLUS CF_STDCPP_LIBRARY - if test "$GXX" = yes; then - AC_MSG_CHECKING(version of ${CXX-g++}) - eval "${CXX-g++} --version" - case "`${CXX-g++} --version`" in - 1*|2.[0-6]*) - cf_cxx_library=yes - ;; - *-2.7*|2.7*) - CF_GPP_LIBRARY - ;; - *) - cf_cxx_library=no - ;; - esac - else + case $GXX_VERSION in + 1*|2.[0-6]*) + cf_cxx_library=yes + ;; + *-2.7*|2.7*) + CF_GPP_LIBRARY + ;; + *) cf_cxx_library=no - fi + ;; + esac AC_CHECK_HEADERS(typeinfo) @@ -947,12 +1048,28 @@ if test -n "$CXX" ; then CF_CPP_PARAM_INIT CF_CPP_VSCAN_FUNC + CXX_AR='$(AR)' + CXX_AR_OPTS='$(AR_OPTS)' case $cf_cv_system_name in #(vi - sco3.2v5*) + irix*) #(vi + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-ar -o' + fi + ;; + sco3.2v5*) #(vi CXXLDFLAGS="-u main" ;; + solaris2*) + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-xar -o' + fi + ;; esac AC_SUBST(CXXLDFLAGS) + AC_SUBST(CXX_AR) + AC_SUBST(CXX_AR_OPTS) else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -966,12 +1083,20 @@ else # Caveat: since the storage of the bool type is not standardized, it # may change. - AC_MSG_CHECKING(for fallback type of bool) - case "$host_cpu" in #(vi - i?86) cf_cv_type_of_bool=char ;; #(vi - *) cf_cv_type_of_bool=int ;; - esac - AC_MSG_RESULT($cf_cv_type_of_bool) + if test "$NCURSES_BOOL" != auto ; then + cf_cv_type_of_bool=$NCURSES_AUTO + else + if test "$cf_cv_header_stdbool_h" = 1 ; then + CF_BOOL_SIZE + else + AC_MSG_CHECKING(for fallback type of bool) + case "$host_cpu" in #(vi + i?86) cf_cv_type_of_bool=char ;; #(vi + *) cf_cv_type_of_bool=int ;; + esac + AC_MSG_RESULT($cf_cv_type_of_bool) + fi + fi fi AC_SUBST(CXXLIBS) @@ -1043,18 +1168,16 @@ 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 "$GCC" = yes; then - case "`$CC --version`" in - 2.6.3) - if test "$cf_cv_type_of_bool" != "char"; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - fi - ;; - 2.5*) + case $GCC_VERSION in + 2.6.3) + if test "$cf_cv_type_of_bool" != "char"; then EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - ;; - esac - fi + fi + ;; + 2.5*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + ;; + esac fi ### Construct the library-subsets, if any, from this set of keywords: @@ -1066,6 +1189,7 @@ else LIB_SUBSETS="termlib+" fi LIB_SUBSETS="${LIB_SUBSETS}base" +test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" AC_MSG_RESULT($LIB_SUBSETS) @@ -1091,6 +1215,13 @@ AC_MSG_RESULT($DFT_ARG_SUFFIX) AC_MSG_CHECKING(default library-dependency suffix) CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl +if test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + DFT_DEP_SUFFIX=".dll.a" + ;; + esac +fi AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a") AC_MSG_RESULT($DFT_DEP_SUFFIX) @@ -1149,7 +1280,7 @@ CFLAGS="$CFLAGS $EXTRA_CFLAGS" ################################################################################ AC_OUTPUT( \ include/MKterm.h.awk \ - include/curses.h \ + include/curses.head:include/curses.h.in \ include/termcap.h \ include/unctrl.h \ misc/run_tic.sh:misc/run_tic.in \ @@ -1165,22 +1296,25 @@ CF_LIST_MODELS="$cf_list_models" DFT_LWR_MODEL="$DFT_LWR_MODEL" LDCONFIG="$LDCONFIG" LIB_NAME="$LIB_NAME" -LIB_SUFFIX="$LIB_SUFFIX" LIB_SUBSETS="$LIB_SUBSETS" +LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +MAKE_TERMINFO="$MAKE_TERMINFO" +NCURSES_OSPEED="$NCURSES_OSPEED" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" TINFO_NAME="$TINFO_NAME" +WITH_CURSES_H="$with_curses_h" 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" cf_cv_rm_so_locs="$cf_cv_rm_so_locs" +cf_cv_shlib_version="$cf_cv_shlib_version" +cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" cf_with_cxx_binding="$cf_with_cxx_binding" -cf_cv_shlib_version="$cf_cv_shlib_version" target="$target" ],sort)dnl diff --git a/contrib/ncurses/dist.mk b/contrib/ncurses/dist.mk index 08cb199..b432b41 100644 --- a/contrib/ncurses/dist.mk +++ b/contrib/ncurses/dist.mk @@ -1,4 +1,4 @@ -# $Id: dist.mk,v 1.247 2001/05/12 18:18:37 tom Exp $ +# $Id: dist.mk,v 1.303 2002/05/18 19:18:04 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -10,7 +10,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 2 -NCURSES_PATCH = 20010512 +NCURSES_PATCH = 20020518 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) @@ -63,17 +63,33 @@ manhtml: MANIFEST echo "s/$${xu}/$${x}/g" >> subst.tmp ;\ fi ;\ done + # change some things to make weblint happy: + @echo 's/<B>/<STRONG>/g' >> subst.tmp + @echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp + @echo 's/<I>/<EM>/g' >> subst.tmp + @echo 's/<\/I>/<\/EM>/g' >> subst.tmp + @echo 's/<\/TITLE>/<\/TITLE><link rev=made href="mailto:bug-ncurses@gnu.org">/' >> subst.tmp @sort < subst.tmp | uniq > subst.sed @rm -f subst.tmp @for f in man/*.[0-9]* ; do \ m=`basename $$f` ;\ + T=`egrep '^.TH' $$f|sed -e 's/^.TH //' -e s'/"//g' -e 's/[ ]\+$$//'` ; \ g=$${m}.html ;\ if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\ echo "Converting $$m to HTML" ;\ - man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) | \ + echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' > doc/html/man/$$g ;\ + echo '<!-- ' >> doc/html/man/$$g ;\ + egrep '^.\\"[^#]' $$f | \ + sed -e 's/\$$/@/g' \ + -e 's/^.../ */' \ + -e 's/</\</g' \ + -e 's/>/\>/g' \ + >> doc/html/man/$$g ;\ + echo '-->' >> doc/html/man/$$g ;\ + man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \ sed -f subst.sed |\ sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \ - > doc/html/man/$$g ;\ + >> doc/html/man/$$g ;\ done @rm -f subst.sed @sed -e "\%./doc/html/man/%d" < MANIFEST > MANIFEST.tmp diff --git a/contrib/ncurses/doc/html/ncurses-intro.html b/contrib/ncurses/doc/html/ncurses-intro.html index 05c756e..bdc5fa0 100644 --- a/contrib/ncurses/doc/html/ncurses-intro.html +++ b/contrib/ncurses/doc/html/ncurses-intro.html @@ -1,6 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN"> <!-- - $Id: ncurses-intro.html,v 1.34 2000/06/11 00:03:55 tom Exp $ + $Id: ncurses-intro.html,v 1.35 2001/09/02 00:23:11 tom Exp $ --> <HTML> <HEAD> @@ -704,7 +704,11 @@ restore the ncurses screen from before the escape. <CODE>newterm()</CODE> instead of <CODE>initscr()</CODE>. <CODE>newterm()</CODE> should be called once for each terminal. It returns a variable of type <CODE>SCREEN *</CODE> which should be saved as a reference to that -terminal. The arguments are the type of the terminal (a string) and +terminal. +(NOTE: a SCREEN variable is not a <em>screen</em> in the sense we +are describing in this introduction, but a collection of +parameters used to assist in optimizing the display.) +The arguments are the type of the terminal (a string) and <CODE>FILE</CODE> pointers for the output and input of the terminal. If type is NULL then the environment variable <CODE>$TERM</CODE> is used. <CODE>endwin()</CODE> should called once at wrapup time for each terminal diff --git a/contrib/ncurses/form/Makefile.in b/contrib/ncurses/form/Makefile.in index 8f3f297..e55afcb 100644 --- a/contrib/ncurses/form/Makefile.in +++ b/contrib/ncurses/form/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.32 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.36 2002/01/20 01:49:17 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 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"), # @@ -50,6 +50,7 @@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ @@ -57,6 +58,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -85,7 +87,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ @@ -97,6 +99,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -113,8 +117,9 @@ install :: $(AUTO_SRC) $(LIBRARIES) sources : $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # make copies to simplify include-paths while still keeping form's include # file in this directory. @@ -136,7 +141,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/contrib/ncurses/form/form.h b/contrib/ncurses/form/form.h index 70b7a3b..140b25f 100644 --- a/contrib/ncurses/form/form.h +++ b/contrib/ncurses/form/form.h @@ -332,7 +332,7 @@ extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); extern NCURSES_EXPORT(FORM *) new_form (FIELD **); -extern NCURSES_EXPORT(FIELD **)form_fields (const FORM *); +extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); diff --git a/contrib/ncurses/include/Caps b/contrib/ncurses/include/Caps index 0e48508..795f9da 100644 --- a/contrib/ncurses/include/Caps +++ b/contrib/ncurses/include/Caps @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2001 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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 # and: Eric S. Raymond <esr@snark.thyrsus.com> # -# $Id: Caps,v 1.31 2001/05/05 21:01:27 tom Exp $ +# $Id: Caps,v 1.35 2002/04/20 15:43:34 tom Exp $ # # This is the master termcap/terminfo capability table. # @@ -49,11 +49,13 @@ # Column 2: terminfo capability name # Column 3: capability type (boolean, numeric, or string) # Column 4: termcap capability name -# Column 5: Lead with `Y' if capability should be emitted in termcap +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap # translations, `-' otherwise -# Column 6: capability description +# Column 8: capability description # -# The codes following [Y-] in column 5 describe the versions of termcap which +# The codes following [Y-] in column 7 describe the versions of termcap which # use the given capability. This information is not used by the curses library # proper; rather, it's there to help the terminfo maintainer avoid emitting # termcap entry translations that are more than 1023 bytes long (and tank a @@ -67,7 +69,7 @@ # translation if possible. The problem is that preserving all such caps may # lead to some termcap translations being too long. The termcap maintainer # has a bit of a juggling act to do...potential problem cases are marked with -# a * or **. +# an asterisk (*). # # The aliases section has the following format: # @@ -207,43 +209,43 @@ #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBBooleans name Code\fR -auto_left_margin bw bool bw YB-G- cub1 wraps from column 0 to last column -auto_right_margin am bool am YBCGE terminal has automatic margins -no_esc_ctlc xsb bool xb YBCG- beehive (f1=escape, f2=ctrl C) -ceol_standout_glitch xhp bool xs YBCGE standout not erased by overwriting (hp) -eat_newline_glitch xenl bool xn YBCGE newline ignored after 80 cols (concept) -erase_overstrike eo bool eo YBCG- can erase overstrikes with a blank -generic_type gn bool gn YB-G- generic line type -hard_copy hc bool hc YBCG- hardcopy terminal -has_meta_key km bool km YB-GE Has a meta key (i.e., sets 8th-bit) -has_status_line hs bool hs YB-G- has extra status line -insert_null_glitch in bool in YBCGE insert mode distinguishes nulls -memory_above da bool da YBCG- display may be retained above the screen -memory_below db bool db YB-GE display may be retained below the screen -move_insert_mode mir bool mi YBCGE safe to move while in insert mode -move_standout_mode msgr bool ms YBCGE safe to move while in standout mode -over_strike os bool os YBCG- terminal can overstrike -status_line_esc_ok eslok bool es YB-G- escape can be used on the status line -dest_tabs_magic_smso xt bool xt YBCGE tabs destructive, magic so char (t1061) -tilde_glitch hz bool hz YB-GE can't print ~'s (hazeltine) -transparent_underline ul bool ul YBCGE underline character overstrikes -xon_xoff xon bool xo YB--- terminal uses xon/xoff handshaking -needs_xon_xoff nxon bool nx ----- padding won't work, xon/xoff required -prtr_silent mc5i bool 5i ----- printer won't echo on screen -hard_cursor chts bool HC ----- cursor is hard to see -non_rev_rmcup nrrmc bool NR ----- smcup does not reverse rmcup -no_pad_char npc bool NP ----- pad character does not exist -non_dest_scroll_region ndscr bool ND ----- scrolling region is non-destructive -can_change ccc bool cc ----- terminal can re-define existing colors -back_color_erase bce bool ut ----- screen erased with background color -hue_lightness_saturation hls bool hl ----- terminal uses only HLS color notation (Tektronix) -col_addr_glitch xhpa bool YA ----- only positive motion for hpa/mhpa caps -cr_cancels_micro_mode crxm bool YB ----- using cr turns off micro mode -has_print_wheel daisy bool YC ----- printer needs operator to change character set -row_addr_glitch xvpa bool YD ----- only positive motion for vpa/mvpa caps -semi_auto_right_margin sam bool YE ----- printing in last column causes cr -cpi_changes_res cpix bool YF ----- changing character pitch changes resolution -lpi_changes_res lpix bool YG ----- changing line pitch changes resolution +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE cannot print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution #%.TE #%.ad #% @@ -257,23 +259,23 @@ lpi_changes_res lpix bool YG ----- changing line pitch changes resolution #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBNumeric name Code\fR -columns cols num co YBCGE number of columns in a line -init_tabs it num it YB-G- tabs initially every # spaces -lines lines num li YBCGE number of lines on screen or page -lines_of_memory lm num lm YB-G- lines of memory if > line. 0 means varies -magic_cookie_glitch xmc num sg YBCGE number of blank characters left by smso or rmso -padding_baud_rate pb num pb YB-GE lowest baud rate where padding needed -virtual_terminal vt num vt YB--- virtual terminal number (CB/unix) -width_status_line wsl num ws YB-G- number of columns in status line -num_labels nlab num Nl ----- number of labels on screen -label_height lh num lh ----- rows in each label -label_width lw num lw ----- columns in each label -max_attributes ma num ma YBC-- maximum combined attributes terminal can handle -maximum_windows wnum num MW ----- maximum number of defineable windows +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows # These came in with SVr4's color support -max_colors colors num Co ----- maximum number of colors on screen -max_pairs pairs num pa ----- maximum number of color-pairs on the screen -no_color_video ncv num NC ----- video attributes that can't be used with colors +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that cannot be used with colors #%.TE #%.ad #% @@ -289,23 +291,23 @@ no_color_video ncv num NC ----- video attributes that can't be used with color #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBNumeric name Code\fR -buffer_capacity bufsz num Ya ----- numbers of bytes buffered before printing -dot_vert_spacing spinv num Yb ----- spacing of pins vertically in pins per inch -dot_horz_spacing spinh num Yc ----- spacing of dots horizontally in dots per inch -max_micro_address maddr num Yd ----- maximum value in micro_..._address -max_micro_jump mjump num Ye ----- maximum value in parm_..._micro -micro_col_size mcs num Yf ----- character step size when in micro mode -micro_line_size mls num Yg ----- line step size when in micro mode -number_of_pins npins num Yh ----- numbers of pins in print-head -output_res_char orc num Yi ----- horizontal resolution in units per line -output_res_line orl num Yj ----- vertical resolution in units per line -output_res_horz_inch orhi num Yk ----- horizontal resolution in units per inch -output_res_vert_inch orvi num Yl ----- vertical resolution in units per inch -print_rate cps num Ym ----- print rate in characters per second -wide_char_size widcs num Yn ----- character step size when in double wide mode -buttons btns num BT ----- number of buttons on mouse -bit_image_entwining bitwin num Yo ----- number of passes for each bit-image row -bit_image_type bitype num Yp ----- type of bit-image device +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device #%.TE #%.ad #% @@ -319,370 +321,370 @@ bit_image_type bitype num Yp ----- type of bit-image device #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBString name Code\fR -back_tab cbt str bt YBCGE back tab (P) -bell bel str bl YB-GE audible signal (bell) (P) -carriage_return cr str cr YBCGE carriage return (P*) (P*) -change_scroll_region csr str cs YBCGE change region to line #1 to line #2 (P) -clear_all_tabs tbc str ct YB-G- clear all tab stops (P) -clear_screen clear str cl YBCGE clear screen and home cursor (P*) -clr_eol el str ce YBCGE clear to end of line (P) -clr_eos ed str cd YBCGE clear to end of screen (P*) -column_address hpa str ch -B-GE** horizontal position #1, absolute (P) -command_character cmdch str CC YB-G- terminal settable cmd character in prototype !? -cursor_address cup str cm YBCGE move to row #1 columns #2 -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, 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) -cursor_up cuu1 str up YBCGE up one line -cursor_visible cvvis str vs YBCGE make cursor very visible -delete_character dch1 str dc YBCGE delete character (P*) -delete_line dl1 str dl YBCGE delete line (P*) -dis_status_line dsl str ds YB-G- disable status line -down_half_line hd str hd YB-G- half a line down -enter_alt_charset_mode smacs str as YB-G- start alternate character set (P) -enter_blink_mode blink str mb YB-G- turn on blinking -enter_bold_mode bold str md YB-G- turn on bold (extra bright) mode -enter_ca_mode smcup str ti YBCGE string to start programs using cup -enter_delete_mode smdc str dm YBCGE enter delete mode -enter_dim_mode dim str mh YB-G- turn on half-bright mode -enter_insert_mode smir str im YBCGE enter insert mode -enter_secure_mode invis str mk -B-G-* turn on blank mode (characters invisible) -enter_protected_mode prot str mp -B-G-* turn on protected mode -enter_reverse_mode rev str mr YB-G- turn on reverse video mode -enter_standout_mode smso str so YBCGE begin standout mode -enter_underline_mode smul str us YBCGE begin underline mode -erase_chars ech str ec YB-G- erase #1 characters (P) -exit_alt_charset_mode rmacs str ae YB-G- end alternate character set (P) -exit_attribute_mode sgr0 str me YB-GE turn off all attributes -exit_ca_mode rmcup str te YBCGE strings to end programs using cup -exit_delete_mode rmdc str ed YBCGE end delete mode -exit_insert_mode rmir str ei YBCGE exit insert mode -exit_standout_mode rmso str se YBCGE exit standout mode -exit_underline_mode rmul str ue YBCGE exit underline mode -flash_screen flash str vb YBCGE visible bell (may not move cursor) -form_feed ff str ff YB-G- hardcopy terminal page eject (P*) -from_status_line fsl str fs YB-G- return from status line -init_1string is1 str i1 YB-G- initialization string -init_2string is2 str is YB-G- initialization string -init_3string is3 str i3 YB-G- initialization string -init_file if str if YB-G- name of initialization file -insert_character ich1 str ic YBCGE insert character (P) -insert_line il1 str al YBCGE insert line (P*) -insert_padding ip str ip YBCGE insert padding after inserted character -key_backspace kbs str kb YB-G- backspace key -key_catab ktbc str ka -B-G-* clear-all-tabs key -key_clear kclr str kC -B-G-* clear-screen or erase key -key_ctab kctab str kt -B-G-* clear-tab key -key_dc kdch1 str kD YB-G- delete-character key -key_dl kdl1 str kL -B-G-* delete-line key -key_down kcud1 str kd YBCGE down-arrow key -key_eic krmir str kM -B-G-* sent by rmir or smir in insert mode -key_eol kel str kE -B-G-* clear-to-end-of-line key -key_eos ked str kS -B-G-* clear-to-end-of-screen key -key_f0 kf0 str k0 YBCGE F0 function key -key_f1 kf1 str k1 YBCGE F1 function key -key_f10 kf10 str k; ----E F10 function key -key_f2 kf2 str k2 YBCGE F2 function key -key_f3 kf3 str k3 YBCGE F3 function key -key_f4 kf4 str k4 YBCGE F4 function key -key_f5 kf5 str k5 YBCGE F5 function key -key_f6 kf6 str k6 YBCGE F6 function key -key_f7 kf7 str k7 YBCGE F7 function key -key_f8 kf8 str k8 YBCGE F8 function key -key_f9 kf9 str k9 YBCGE F9 function key -key_home khome str kh YBCGE home key -key_ic kich1 str kI YB-GE insert-character key -key_il kil1 str kA -B-G-* insert-line key -key_left kcub1 str kl YBCGE left-arrow key -key_ll kll str kH YB-G- lower-left key (home down) -key_npage knp str kN YB-GE next-page key -key_ppage kpp str kP YB-GE previous-page key -key_right kcuf1 str kr YBCGE right-arrow key -key_sf kind str kF -B-G-* scroll-forward key -key_sr kri str kR -B-G-* scroll-backward key -key_stab khts str kT -B-G-* set-tab key -key_up kcuu1 str ku YBCGE up-arrow key -keypad_local rmkx str ke YBCGE leave 'keyboard_transmit' mode -keypad_xmit smkx str ks YBCGE enter 'keyboard_transmit' mode -lab_f0 lf0 str l0 -B-G-* label on function key f0 if not f0 -lab_f1 lf1 str l1 -B-G-* label on function key f1 if not f1 -lab_f10 lf10 str la ----- label on function key f10 if not f10 -lab_f2 lf2 str l2 -B-G-* label on function key f2 if not f2 -lab_f3 lf3 str l3 -B-G-* label on function key f3 if not f3 -lab_f4 lf4 str l4 -B-G-* label on function key f4 if not f4 -lab_f5 lf5 str l5 -B-G-* label on function key f5 if not f5 -lab_f6 lf6 str l6 -B-G-* label on function key f6 if not f6 -lab_f7 lf7 str l7 -B-G-* label on function key f7 if not f7 -lab_f8 lf8 str l8 -B-G-* label on function key f8 if not f8 -lab_f9 lf9 str l9 -B-G-* label on function key f9 if not f9 -meta_off rmm str mo YB-G-* turn off meta mode -meta_on smm str mm YB-G-* turn on meta mode (8th-bit on) -newline nel str nw YB-G-* newline (behave like cr followed by lf) -pad_char pad str pc YBCGE padding char (instead of null) -parm_dch dch str DC YB-GE delete #1 characters (P*) -parm_delete_line dl str DL YBCGE delete #1 lines (P*) -parm_down_cursor cud str DO YBCGE down #1 lines (P*) -parm_ich ich str IC YB-GE insert #1 characters (P*) -parm_index indn str SF YBCG- scroll forward #1 lines (P) -parm_insert_line il str AL YBCGE insert #1 lines (P*) -parm_left_cursor cub str LE YBCGE move #1 characters to the left (P) -parm_right_cursor cuf str RI YBCGE move #1 characters to the right (P*) -parm_rindex rin str SR YBCG- scroll back #1 lines (P) -parm_up_cursor cuu str UP YBCGE up #1 lines (P*) -pkey_key pfkey str pk -B--- program function key #1 to type string #2 -pkey_local pfloc str pl -B--- program function key #1 to execute string #2 -pkey_xmit pfx str px -B--- program function key #1 to transmit string #2 -print_screen mc0 str ps -B-G-* print contents of screen -prtr_off mc4 str pf -B-G-* turn off printer -prtr_on mc5 str po -B-G-* turn on printer -repeat_char rep str rp YB-GE repeat char #1 #2 times (P*) -reset_1string rs1 str r1 -B--- reset string -reset_2string rs2 str r2 -B--- reset string -reset_3string rs3 str r3 -B--- reset string -reset_file rf str rf -B--- name of reset file -restore_cursor rc str rc YBCG- restore cursor to position of last save_cursor -row_address vpa str cv -B-GE** vertical position #1 absolute (P) -save_cursor sc str sc YBCG- save current cursor position (P) -scroll_forward ind str sf YBCGE scroll text up (P) -scroll_reverse ri str sr YBCGE scroll text down (P) -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, 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 -key_a1 ka1 str K1 YB-GE upper left of keypad -key_a3 ka3 str K3 YB-GE upper right of keypad -key_b2 kb2 str K2 YB-GE center of keypad -key_c1 kc1 str K4 YB-GE lower left of keypad -key_c3 kc3 str K5 YB-GE lower right of keypad -prtr_non mc5p str pO -B-G-* turn on printer for #1 bytes +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +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, 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) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +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, 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 +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes # # SVr1 capabilities stop here. IBM's version of terminfo is the same as # SVr4 up to this point, but has a different set afterwards. # -char_padding rmp str rP ----- like ip but when in insert mode -acs_chars acsc str ac ----- graphics charset pairs, based on vt100 -plab_norm pln str pn ----- program label #1 to show string #2 -key_btab kcbt str kB ----- back-tab key -enter_xon_mode smxon str SX ----- turn on xon/xoff handshaking -exit_xon_mode rmxon str RX ----- turn off xon/xoff handshaking -enter_am_mode smam str SA ----- turn on automatic margins -exit_am_mode rmam str RA ----- turn off automatic margins -xon_character xonc str XN ----- XON character -xoff_character xoffc str XF ----- XOFF character -ena_acs enacs str eA ----- enable alternate char set -label_on smln str LO ----- turn on soft labels -label_off rmln str LF ----- turn off soft labels -key_beg kbeg str @1 ----- begin key -key_cancel kcan str @2 ----- cancel key -key_close kclo str @3 ----- close key -key_command kcmd str @4 ----- command key -key_copy kcpy str @5 ----- copy key -key_create kcrt str @6 ----- create key -key_end kend str @7 ----- end key -key_enter kent str @8 ----- enter/send key -key_exit kext str @9 ----- exit key -key_find kfnd str @0 ----- find key -key_help khlp str %1 ----- help key -key_mark kmrk str %2 ----- mark key -key_message kmsg str %3 ----- message key -key_move kmov str %4 ----- move key -key_next knxt str %5 ----- next key -key_open kopn str %6 ----- open key -key_options kopt str %7 ----- options key -key_previous kprv str %8 ----- previous key -key_print kprt str %9 ----- print key -key_redo krdo str %0 ----- redo key -key_reference kref str &1 ----- reference key -key_refresh krfr str &2 ----- refresh key -key_replace krpl str &3 ----- replace key -key_restart krst str &4 ----- restart key -key_resume kres str &5 ----- resume key -key_save ksav str &6 ----- save key -key_suspend kspd str &7 ----- suspend key -key_undo kund str &8 ----- undo key -key_sbeg kBEG str &9 ----- shifted begin key -key_scancel kCAN str &0 ----- shifted cancel key -key_scommand kCMD str *1 ----- shifted command key -key_scopy kCPY str *2 ----- shifted copy key -key_screate kCRT str *3 ----- shifted create key -key_sdc kDC str *4 ----- shifted delete-character key -key_sdl kDL str *5 ----- shifted delete-line key -key_select kslt str *6 ----- select key -key_send kEND str *7 ----- shifted end key -key_seol kEOL str *8 ----- shifted clear-to-end-of-line key -key_sexit kEXT str *9 ----- shifted exit key -key_sfind kFND str *0 ----- shifted find key -key_shelp kHLP str #1 ----- shifted help key -key_shome kHOM str #2 ----- shifted home key -key_sic kIC str #3 ----- shifted insert-character key -key_sleft kLFT str #4 ----- shifted left-arrow key -key_smessage kMSG str %a ----- shifted message key -key_smove kMOV str %b ----- shifted move key -key_snext kNXT str %c ----- shifted next key -key_soptions kOPT str %d ----- shifted options key -key_sprevious kPRV str %e ----- shifted previous key -key_sprint kPRT str %f ----- shifted print key -key_sredo kRDO str %g ----- shifted redo key -key_sreplace kRPL str %h ----- shifted replace key -key_sright kRIT str %i ----- shifted right-arrow key -key_srsume kRES str %j ----- shifted resume key -key_ssave kSAV str !1 ----- shifted save key -key_ssuspend kSPD str !2 ----- shifted suspend key -key_sundo kUND str !3 ----- shifted undo key -req_for_input rfi str RF ----- send next input char (for ptys) -key_f11 kf11 str F1 ----E F11 function key -key_f12 kf12 str F2 ----E F12 function key -key_f13 kf13 str F3 ----E F13 function key -key_f14 kf14 str F4 ----E F14 function key -key_f15 kf15 str F5 ----E F15 function key -key_f16 kf16 str F6 ----E F16 function key -key_f17 kf17 str F7 ----E F17 function key -key_f18 kf18 str F8 ----E F18 function key -key_f19 kf19 str F9 ----E F19 function key -key_f20 kf20 str FA ----E F20 function key -key_f21 kf21 str FB ----E F21 function key -key_f22 kf22 str FC ----E F22 function key -key_f23 kf23 str FD ----E F23 function key -key_f24 kf24 str FE ----E F24 function key -key_f25 kf25 str FF ----E F25 function key -key_f26 kf26 str FG ----E F26 function key -key_f27 kf27 str FH ----E F27 function key -key_f28 kf28 str FI ----E F28 function key -key_f29 kf29 str FJ ----E F29 function key -key_f30 kf30 str FK ----E F30 function key -key_f31 kf31 str FL ----E F31 function key -key_f32 kf32 str FM ----E F32 function key -key_f33 kf33 str FN ----E F33 function key -key_f34 kf34 str FO ----E F34 function key -key_f35 kf35 str FP ----E F35 function key -key_f36 kf36 str FQ ----E F36 function key -key_f37 kf37 str FR ----E F37 function key -key_f38 kf38 str FS ----E F38 function key -key_f39 kf39 str FT ----E F39 function key -key_f40 kf40 str FU ----E F40 function key -key_f41 kf41 str FV ----E F41 function key -key_f42 kf42 str FW ----E F42 function key -key_f43 kf43 str FX ----E F43 function key -key_f44 kf44 str FY ----E F44 function key -key_f45 kf45 str FZ ----E F45 function key -key_f46 kf46 str Fa ----E F46 function key -key_f47 kf47 str Fb ----E F47 function key -key_f48 kf48 str Fc ----E F48 function key -key_f49 kf49 str Fd ----E F49 function key -key_f50 kf50 str Fe ----E F50 function key -key_f51 kf51 str Ff ----E F51 function key -key_f52 kf52 str Fg ----E F52 function key -key_f53 kf53 str Fh ----E F53 function key -key_f54 kf54 str Fi ----E F54 function key -key_f55 kf55 str Fj ----E F55 function key -key_f56 kf56 str Fk ----E F56 function key -key_f57 kf57 str Fl ----E F57 function key -key_f58 kf58 str Fm ----E F58 function key -key_f59 kf59 str Fn ----E F59 function key -key_f60 kf60 str Fo ----E F60 function key -key_f61 kf61 str Fp ----E F61 function key -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. 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 -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 -hangup hup str HU ----- hang-up phone -dial_phone dial str DI ----- dial number #1 -quick_dial qdial str QD ----- dial number #1 without checking -tone tone str TO ----- select touch tone dialing -pulse pulse str PU ----- select pulse dialing -flash_hook hook str fh ----- flash switch hook -fixed_pause pause str PA ----- pause for 2-3 seconds -wait_tone wait str WA ----- wait for dial-tone -user0 u0 str u0 ----- User string #0 -user1 u1 str u1 ----- User string #1 -user2 u2 str u2 ----- User string #2 -user3 u3 str u3 ----- User string #3 -user4 u4 str u4 ----- User string #4 -user5 u5 str u5 ----- User string #5 -user6 u6 str u6 ----- User string #6 -user7 u7 str u7 ----- User string #7 -user8 u8 str u8 ----- User string #8 -user9 u9 str u9 ----- User string #9 +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----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. 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 +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 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 # # SVr4 added these capabilities to support color # -orig_pair op str op ----- Set default pair to its original value -orig_colors oc str oc ----- Set all color pairs to the original ones -initialize_color initc str Ic ----- initialize color #1 to (#2,#3,#4) -initialize_pair initp str Ip ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) -set_color_pair scp str sp ----- Set current color pair to #1 -set_foreground setf str Sf ----- Set foreground color #1 -set_background setb str Sb ----- Set background color #1 +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +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 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 -enter_leftward_mode slm str ZI ----- Start leftward carriage motion -enter_micro_mode smicm str ZJ ----- Start micro-motion mode -enter_near_letter_quality snlq str ZK ----- Enter NLQ mode -enter_normal_quality snrmq str ZL ----- Enter normal-quality mode -enter_shadow_mode sshm str ZM ----- Enter shadow-print mode -enter_subscript_mode ssubm str ZN ----- Enter subscript mode -enter_superscript_mode ssupm str ZO ----- Enter superscript mode -enter_upward_mode sum str ZP ----- Start upward carriage motion -exit_doublewide_mode rwidm str ZQ ----- End double-wide mode -exit_italics_mode ritm str ZR ----- End italic mode -exit_leftward_mode rlm str ZS ----- End left-motion mode -exit_micro_mode rmicm str ZT ----- End micro-motion mode -exit_shadow_mode rshm str ZU ----- End shadow-print mode -exit_subscript_mode rsubm str ZV ----- End subscript mode -exit_superscript_mode rsupm str ZW ----- End superscript mode -exit_upward_mode rum str ZX ----- End reverse character motion -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 #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, #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 (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 -start_bit_image sbim str Zq ----- Start printing bit image graphics -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 #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 -zero_motion zerom str Zx ----- No motion for subsequent 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 +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +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 #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, #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 (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 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +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 #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 +zero_motion zerom str Zx - - ----- No motion for subsequent character #%.TE #%.ad #% @@ -697,41 +699,41 @@ 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 ----- 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, 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 -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. (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 -bit_image_carriage_return bicr str Yv ----- Move to beginning of same row -color_names colornm str Yw ----- Give name for color #1 -define_bit_image_region defbi str Yx ----- Define rectangualar bit image region -end_bit_image_region endbi str Yy ----- End a bit-image region -set_color_band setcolor str Yz ----- Change to ribbon color #1 -set_page_length slines str YZ ----- Set page length to #1 lines +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- 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, 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 +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +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 +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +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 #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 -exit_scancode_mode rmsc str S5 ----- Exit PC scancode mode -pc_term_options pctrm str S6 ----- PC terminal options -scancode_escape scesc str S7 ----- Escape for scancode emulation -alt_scancode_esc scesa str S8 ----- Alternate escape for scancode emulation +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 +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation #%.TE #%.ad #% @@ -751,14 +753,14 @@ alt_scancode_esc scesa str S8 ----- Alternate escape for scancode emulation #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBString name Code\fR -enter_horizontal_hl_mode ehhlm str Xh ----- Enter horizontal highlight mode -enter_left_hl_mode elhlm str Xl ----- Enter left highlight mode -enter_low_hl_mode elohlm str Xo ----- Enter low highlight mode -enter_right_hl_mode erhlm str Xr ----- Enter right highlight mode -enter_top_hl_mode ethlm str Xt ----- Enter top highlight mode -enter_vertical_hl_mode evhlm str Xv ----- Enter vertical highlight mode -set_a_attributes sgr1 str sA ----- Define second set of video attributes #1-#6 -set_pglen_inch slength str sL ----- YI Set page length to #1 hundredth of an inch +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch #%.TE #%.ad # @@ -795,34 +797,34 @@ set_pglen_inch slength str sL ----- YI Set page length to #1 hundredth of an i # The ug capability is thrown away, but assumed to be whatever sg is if the # latter is nonzero and we're dumping in termcap format. # -termcap_init2 OTi2 str i2 YB--- secondary initialization string -termcap_reset OTrs str rs YB-G- terminal reset string -magic_cookie_glitch_ul OTug num ug YBCGE number of blanks left by ul +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul # # Obsolete termcap capabilities. Some are used for termcap translation. The # code uses the 'OT' prefix we put on obsolete capabilities to suppress # printing them in terminfo source dumps of compiled entries. # -backspaces_with_bs OTbs bool bs YBCGE uses ^H to move left -crt_no_scrolling OTns bool ns YBCG- crt cannot scroll -no_correctly_working_cr OTnc bool nc YBCG- no way to go to start of line -carriage_return_delay OTdC num dC YB-G- pad needed for CR -new_line_delay OTdN num dN YB-G- pad needed for LF -linefeed_if_not_lf OTnl str nl YBCGE use to move down -backspace_if_not_bs OTbc str bc YBCGE move left, if not ^H +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H # # GNU termcap library extensions. The GNU termcap file distributed with # Emacs no longer uses these, but MT showed up in pre-9.0 versions of the # BSD termcap file. The name clash with terminfo MT is resolved by type # info; MT is converted to km. # -gnu_has_meta_key OTMT bool MT ----E has meta key -# gnu_tab_width OTtw num tw ----E tab width in spaces +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces # # GNU termcap *does* include the following extended capability, Only the # now-obsolete Ann Arbor terminals used it. # -# gnu_change_scroll_region OTcS str cS ---GE alternate set scrolling region +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region # # The following comments describe capnames so ancient that I believe no # software uses them any longer. Some of these have to go because they @@ -855,50 +857,50 @@ gnu_has_meta_key OTMT bool MT ----E has meta key # Applications that use terminfo are supposed to behave as though xr is # always true. # -linefeed_is_newline OTNL bool NL YB--- move down with \n -# even_parity OTEP bool EP -B--- terminal requires even parity -# odd_parity OTOP bool OP -B--- terminal requires odd parity -# half_duplex OTHD bool HD -B--- terminal is half-duplex -# lower_case_only OTLC bool LC -B--- terminal has only lower case -# upper_case_only OTUC bool UC -B--- terminal has only upper case -backspace_delay OTdB num dB YB-G- padding required for ^H -# form_feed_delay OTdF num dF -B-G- padding required for ^L -horizontal_tab_delay OTdT num dT YB-G- padding required for ^I -# vertical_tab_delay OTdV num dV -B--- padding required for ^V -number_of_function_keys OTkn num kn -B-G- count of function keys -other_non_function_keys OTko str ko -B-G- list of self-mapped keycaps -arrow_key_map OTma str ma YBC-- map arrow keys rogue(1) motion keys -# memory_lock_above OTml str ml -B--- lock visible screen memory above the current line -# memory_unlock OTmu str mu -B--- unlock visible screen memory above the current line -has_hardware_tabs OTpt bool pt YB--- has 8-char tabs invoked with ^I -return_does_clr_eol OTxr bool xr YB--- return clears the line -# tek_4025_insert_line OTxx bool xx -BC-- Tektronix 4025 insert-line glitch +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch # # mytinfo described this as a termcap capability, but it's not listed in the # 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses # package, like System V, behaves as though it is always true. # -# rind_only_at_top OTxq bool xq ----- reverse index only works from top line +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line # # University of Waterloo termcap extensions (as described in mytinfo). # The `xl' termcap file clashes with a terminfo name; this ambiguity cannot # be resolved by a type check. The descriptions are guesses from what was # in the mytinfo tables. # -# key_interrupt_char OTki str ki ----- string set by interrupt key (?) -# key_kill_char OTkk str kk ----- string set by kill key (?) -# key_suspend_char OTkz str kz ----- string set by suspend key (?) -# initialization_messy OTxc bool xc ----- initialization leaves garbage on the screen (?) -# ind_at_bottom_does_cr OTxl bool xl ----- index does a carriage return +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return # # Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. # SR clashes with a terminfo name; this ambiguity cannot be resolved by a type # check. # -# scroll_left OTsl1 str Sl ----- scroll screen leftward -# scroll_right OTsr1 str Sr ----- scroll screen rightward -# parm_scroll_left OTsl str SL ----- scroll screen leftward #1 characters -# parm_scroll_right OTsr str SR ----- scroll screen rightward #1 characters +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters # # The mytinfo capabilities end here. # @@ -938,17 +940,17 @@ return_does_clr_eol OTxr bool xr YB--- return clears the line # that detects the acs_ prefix and uses it to suppress pad translation. # These terminfo names are invented. # -acs_ulcorner OTG2 str G2 ----- single upper left -acs_llcorner OTG3 str G3 ----- single lower left -acs_urcorner OTG1 str G1 ----- single upper right -acs_lrcorner OTG4 str G4 ----- single lower right -acs_ltee OTGR str GR ----- tee pointing right -acs_rtee OTGL str GL ----- tee pointing left -acs_btee OTGU str GU ----- tee pointing up -acs_ttee OTGD str GD ----- tee pointing down -acs_hline OTGH str GH ----- single horizontal line -acs_vline OTGV str GV ----- single vertical line -acs_plus OTGC str GC ----- single intersection +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection # ############################################################################# # @@ -965,64 +967,64 @@ acs_plus OTGC str GC ----- single intersection # functionally identical to SVr4 extensions, but they make the binary format # different. Grrr.... # -memory_lock meml str ml ----K memory lock above -memory_unlock memu str mu ----K memory unlock -#plab_norm pln str pn ----- program label #1 to show string #2 -#label_on smln str LO ----- turn on soft labels -#label_off rmln str LF ----- turn off soft labels -#key_f11 kf11 str F1 ----- F11 function key -#key_f12 kf12 str F2 ----- F12 function key -#key_f13 kf13 str F3 ----- F13 function key -#key_f14 kf14 str F4 ----- F14 function key -#key_f15 kf15 str F5 ----- F15 function key -#key_f16 kf16 str F6 ----- F16 function key -#key_f17 kf17 str F7 ----- F17 function key -#key_f18 kf18 str F8 ----- F18 function key -#key_f19 kf19 str F9 ----- F19 function key -#key_f20 kf20 str FA ----- F20 function key -#key_f21 kf21 str FB ----- F21 function key -#key_f22 kf22 str FC ----- F22 function key -#key_f23 kf23 str FD ----- F23 function key -#key_f24 kf24 str FE ----- F24 function key -#key_f25 kf25 str FF ----- F25 function key -#key_f26 kf26 str FG ----- F26 function key -#key_f27 kf27 str FH ----- F27 function key -#key_f28 kf28 str FI ----- F28 function key -#key_f29 kf29 str FJ ----- F29 function key -#key_f30 kf30 str FK ----- F30 function key -#key_f31 kf31 str FL ----- F31 function key -#key_f32 kf32 str FM ----- F32 function key -#key_f33 kf33 str FN ----- F33 function key -#key_f34 kf34 str FO ----- F34 function key -#key_f35 kf35 str FP ----- F35 function key -#key_f36 kf36 str FQ ----- F36 function key -#key_f37 kf37 str FR ----- F37 function key -#key_f38 kf38 str FS ----- F38 function key -#key_f39 kf39 str FT ----- F39 function key -#key_f40 kf40 str FU ----- F40 function key -#key_f41 kf41 str FV ----- F41 function key -#key_f42 kf42 str FW ----- F42 function key -#key_f43 kf43 str FX ----- F43 function key -#key_f44 kf44 str FY ----- F44 function key -#key_f45 kf45 str FZ ----- F45 function key -#key_f46 kf46 str Fa ----- F46 function key -#key_f47 kf47 str Fb ----- F47 function key -#key_f48 kf48 str Fc ----- F48 function key -#key_f49 kf49 str Fd ----- F49 function key -#key_f50 kf50 str Fe ----- F50 function key -#key_f51 kf51 str Ff ----- F51 function key -#key_f52 kf52 str Fg ----- F52 function key -#key_f53 kf53 str Fh ----- F53 function key -#key_f54 kf54 str Fi ----- F54 function key -#key_f55 kf55 str Fj ----- F55 function key -#key_f56 kf56 str Fk ----- F56 function key -#key_f57 kf57 str Fl ----- F57 function key -#key_f58 kf58 str Fm ----- F58 function key -#key_f59 kf59 str Fn ----- F59 function key -#key_f60 kf60 str Fo ----- F60 function key -#key_f61 kf61 str Fp ----- F61 function key -#key_f62 kf62 str Fq ----- F62 function key -#key_f63 kf63 str Fr ----- F63 function key +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key # # IBM extensions # @@ -1046,94 +1048,94 @@ memory_unlock memu str mu ----K memory unlock # # The box2 characters are the double-line versions of these forms graphics. # -box_chars_1 box1 str bx ----K box characters primary set -#box_chars_2 box2 str by ----K box characters secondary set -#box_attr_1 batt1 str Bx ----K attributes for box1 -#box_attr_2 batt2 str By ----K attributes for box2 -#color_bg_0 colb0 str d0 ----K background color 0 -#color_bg_1 colb1 str d1 ----K background color 1 -#color_bg_2 colb2 str d2 ----K background color 2 -#color_bg_3 colb3 str d3 ----K background color 3 -#color_bg_4 colb4 str d4 ----K background color 4 -#color_bg_5 colb5 str d5 ----K background color 5 -#color_bg_6 colb6 str d6 ----K background color 6 -#color_bg_7 colb7 str d7 ----K background color 7 -#color_fg_0 colf0 str c0 ----K foreground color 0 -#color_fg_1 colf1 str c1 ----K foreground color 1 -#color_fg_2 colf2 str c2 ----K foreground color 2 -#color_fg_3 colf3 str c3 ----K foreground color 3 -#color_fg_4 colf4 str c4 ----K foreground color 4 -#color_fg_5 colf5 str c5 ----K foreground color 5 -#color_fg_6 colf6 str c6 ----K foreground color 6 -#color_fg_7 colf7 str c7 ----K foreground color 7 -#font_0 font0 str f0 ----- select font 0 -#font_1 font1 str f1 ----- select font 1 -#font_2 font2 str f2 ----- select font 2 -#font_3 font3 str f3 ----- select font 3 -#font_4 font4 str f4 ----K select font 4 -#font_5 font5 str f5 ----K select font 5 -#font_6 font6 str f6 ----K select font 6 -#font_7 font7 str f7 ----K select font 7 -#key_back_tab kbtab str k0 ----- backtab key -#key_do kdo str ki ----K do request key -#key_command kcmd str kd ----K command-request key -#key_command_pane kcpn str kW ----K command-pane key -#key_end kend str kw ----- end key -#key_help khlp str kq ----- help key -#key_newline knl str nl ----K newline key -#key_next_pane knpn str kv ----K next-pane key -#key_prev_cmd kppn str kp ----K previous-command key -#key_prev_pane kppn str kV ----K previous-pane key -#key_quit kquit str kQ ----K quit key -#key_select ksel str kU ----- select key -#key_scroll_left kscl str kz ----K scroll left -#key_scroll_right kscr str kZ ----K scroll right -#key_tab ktab str ko ----K tab key -#key_smap_in1 kmpf1 str Kv ----K special mapped key 1 input -#key_smap_out1 kmpt1 str KV ----K special mapped key 1 output -#key_smap_in2 kmpf2 str Kw ----K special mapped key 2 input -#key_smap_out2 kmpt2 str KW ----K special mapped key 2 output -#key_smap_in3 kmpf3 str Kx ----K special mapped key 3 input -#key_smap_out3 kmpt3 str KX ----K special mapped key 3 output -#key_smap_in4 kmpf4 str Ky ----K special mapped key 4 input -#key_smap_out4 kmpt4 str KY ----K special mapped key 4 output -#key_smap_in5 kmpf5 str Kz ----K special mapped key 5 input -#key_smap_out5 kmpt5 str KZ ----K special mapped key 5 output -#appl_defined_str apstr str za ----K application-defined string +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string # The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in # the IBM manual pages, so the cap name strings are guesses. The terminfo # names are almost certainly right, the termcap ones almost certainly wrong. -#key_smap_in6 kmpf6 str k! ----K special mapped key 6 input -#key_smap_out6 kmpt6 str K@ ----K special mapped key 6 output -#key_smap_in7 kmpf7 str k# ----K special mapped key 7 input -#key_smap_out7 kmpt7 str K$ ----K special mapped key 7 output -#key_smap_in8 kmpf8 str k% ----K special mapped key 8 input -#key_smap_out8 kmpt8 str K^ ----K special mapped key 8 output -#key_smap_in9 kmpf9 str k& ----K special mapped key 9 input -#key_smap_out9 kmpt9 str K* ----K special mapped key 9 output +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output # Undocumented capabilities end here -#key_sf1 ksf1 str S1 ----K special function key 1 -#key_sf2 ksf2 str S2 ----K special function key 2 -#key_sf3 ksf3 str S3 ----K special function key 3 -#key_sf4 ksf4 str S4 ----K special function key 4 -#key_sf5 ksf5 str S5 ----K special function key 5 -#key_sf6 ksf6 str S6 ----K special function key 6 -#key_sf7 ksf7 str S7 ----K special function key 7 -#key_sf8 ksf8 str S8 ----K special function key 8 -#key_sf9 ksf9 str S9 ----K special function key 9 -#key_sf10 ksf10 str SA ----K special function key 10 +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 # AIX version 3 documents different codes for F11, F12 and does not mention # F13-F64. AIX version 4 uses the same naming for F0-F63 as above. -#key_f11 kf11 str k< ----- function key 11 -#key_f12 kf12 str k> ----- function key 12 +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 # Undocumented capabilities end here. -#key_action kact str kJ ----K sent by action key +#key_action kact str kJ - - ----K sent by action key # The IBM docs say these capabilities are for table-drawing, and are # valid only for aixterm descriptions. -#enter_topline_mode topl str tp ----K start top-line mode -#enter_bottom_mode btml str bm ----K start bottom-line mode -#enter_rvert_mode rvert str rv ----K start right-vertical mode -#enter_lvert_mode lvert str lv ----K start left-vertical mode +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode # ############################################################################# # diff --git a/contrib/ncurses/include/Caps.aix4 b/contrib/ncurses/include/Caps.aix4 new file mode 100644 index 0000000..c010bbd --- /dev/null +++ b/contrib/ncurses/include/Caps.aix4 @@ -0,0 +1,1255 @@ +############################################################################## +# Copyright (c) 2001 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 Dickey +# +# $Id: Caps.aix4,v 1.5 2002/04/20 15:43:42 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with AIX 4.x's terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE can't print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding won't work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer won't echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that can't be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +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, 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) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +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, 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 +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +box_chars_2 box2 str by - - ----K box characters secondary set +box_attr_1 batt1 str Bx - - ----K attributes for box1 +box_attr_2 batt2 str By - - ----K attributes for box2 +color_bg_0 colb0 str d0 - - ----K background color 0 +color_bg_1 colb1 str d1 - - ----K background color 1 +color_bg_2 colb2 str d2 - - ----K background color 2 +color_bg_3 colb3 str d3 - - ----K background color 3 +color_bg_4 colb4 str d4 - - ----K background color 4 +color_bg_5 colb5 str d5 - - ----K background color 5 +color_bg_6 colb6 str d6 - - ----K background color 6 +color_bg_7 colb7 str d7 - - ----K background color 7 +color_fg_0 colf0 str c0 - - ----K foreground color 0 +color_fg_1 colf1 str c1 - - ----K foreground color 1 +color_fg_2 colf2 str c2 - - ----K foreground color 2 +color_fg_3 colf3 str c3 - - ----K foreground color 3 +color_fg_4 colf4 str c4 - - ----K foreground color 4 +color_fg_5 colf5 str c5 - - ----K foreground color 5 +color_fg_6 colf6 str c6 - - ----K foreground color 6 +color_fg_7 colf7 str c7 - - ----K foreground color 7 +font_0 font0 str f0 - - ----K select font 0 +font_1 font1 str f1 - - ----K select font 1 +font_2 font2 str f2 - - ----K select font 2 +font_3 font3 str f3 - - ----K select font 3 +font_4 font4 str f4 - - ----K select font 4 +font_5 font5 str f5 - - ----K select font 5 +font_6 font6 str f6 - - ----K select font 6 +font_7 font7 str f7 - - ----K select font 7 +key_back_tab kbtab str k0 - - ----K backtab key +key_do kdo str ki - - ----K do request key +key_command kcmd str kd - - ----K command-request key +key_command_pane kcpn str kW - - ----K command-pane key +key_end kend str kw KEY_END 0550 ----- end key +key_help khlp str kq - - ----- help key +key_newline knl str nl - - ----K newline key +key_next_pane knpn str kv - - ----K next-pane key +key_prev_cmd kppn str kp - - ----K previous-command key +key_prev_pane kppn str kV - - ----K previous-pane key +key_quit kquit str kQ - - ----K quit key +key_select_aix ksel str kU - - ----- select key +key_scroll_left kscl str kz - - ----K scroll left +key_scroll_right kscr str kZ - - ----K scroll right +key_tab ktab str ko - - ----K tab key +key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +appl_defined_str apstr str za - - ----K application-defined string +key_smap_in6 kmpf6 str kr - - ----K special mapped key 6 input +key_smap_out6 kmpt6 str KR - - ----K special mapped key 6 output +key_smap_in7 kmpf7 str ks - - ----K special mapped key 7 input +key_smap_out7 kmpt7 str KS - - ----K special mapped key 7 output +key_smap_in8 kmpf8 str kt - - ----K special mapped key 8 input +key_smap_out8 kmpt8 str KT - - ----K special mapped key 8 output +key_smap_in9 kmpf9 str ku - - ----K special mapped key 9 input +key_smap_out9 kmpt9 str KU - - ----K special mapped key 9 output +key_sf1 ksf1 str S1 - - ----K special function key 1 +key_sf2 ksf2 str S2 - - ----K special function key 2 +key_sf3 ksf3 str S3 - - ----K special function key 3 +key_sf4 ksf4 str S4 - - ----K special function key 4 +key_sf5 ksf5 str S5 - - ----K special function key 5 +key_sf6 ksf6 str S6 - - ----K special function key 6 +key_sf7 ksf7 str S7 - - ----K special function key 7 +key_sf8 ksf8 str S8 - - ----K special function key 8 +key_sf9 ksf9 str S9 - - ----K special function key 9 +key_sf10 ksf10 str S0 - - ----K special function key 10 +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +key_action kact str kJ - - ----K sent by action key + +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +enter_topline_mode topl str tp - - ----K start top-line mode +enter_bottom_mode btml str bm - - ----K start bottom-line mode +enter_rvert_mode rvert str rv - - ----K start right-vertical mode +enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +# SVr4 capabilities resume here. Note that key_end is in the IBM-extensions. +# +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +#key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +#key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +#key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +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. 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 +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 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +# +# SVr4 added these capabilities to support color +# +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +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 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 +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +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 #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, #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 (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 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +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 #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 +zero_motion zerom str Zx - - ----- No motion for subsequent character +#%.TE +#%.ad +#% +#%The following string capabilities are present in the SVr4.0 term structure, +#%but were originally not documented in the man page. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw18. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- 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, 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 +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +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 +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +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 #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 +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +#%.TE +#%.ad +#% +#%.in .8i +#%The XSI Curses standard added these. They are some post-4.1 +#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. +#%The \fBncurses\fR termcap names for them are invented; according to the +#%XSI Curses standard, they have no termcap names. If your compiled terminfo +#%entries use these, they may not be binary-compatible with System V terminfo +#%entries after SVr4.1; beware! +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +#%.TE +#%.ad +# +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/contrib/ncurses/include/Caps.keys b/contrib/ncurses/include/Caps.keys new file mode 100644 index 0000000..7ef7545 --- /dev/null +++ b/contrib/ncurses/include/Caps.keys @@ -0,0 +1,1354 @@ +############################################################################## +# Copyright (c) 2001 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 Dickey +# and: Ilya Zakharevich +# +# $Id: Caps.keys,v 1.2 2002/04/20 15:43:49 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is illustrates an experimental extension to describe alt-, shift- and +# control-modifiers applied to function and normal keys, as done on IBM pc's. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE can't print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding won't work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer won't echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that can't be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +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, 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) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +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, 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 +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----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. 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 +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 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +# +# NCurses extensions for keys accessible on most PC consoles +# +key_sup kUP str !5 KEY_SUP + ----- shifted up-arrow key +key_sdown kDOWN str !6 KEY_SDOWN + ----- shifted down-arrow key +key_sbackspace kBS str !7 KEY_SBACKSPACE + ----- shifted backspace key +key_c_delete kcdelete str !8 KEY_C_DELETE + ----- control- delete-character key +key_c_end kcend str !9 KEY_C_END + ----- control- end key +key_c_home kchom str !0 KEY_C_HOME + ----- control- home key +key_c_insert kcinsert str !_ KEY_C_INSERT + ----- control- insert-character key +key_c_left kclft str %k KEY_C_LEFT + ----- control- left-arrow key +key_c_next kcnxt str %l KEY_C_NEXT + ----- control- next key +key_c_previous kcprv str %m KEY_C_PREVIOUS + ----- control- previous key +key_c_print kcprt str %n KEY_C_PRINT + ----- control- print key +key_c_right kcrit str %o KEY_C_RIGHT + ----- control- right-arrow key +key_c_backspace kcbs str %p KEY_C_BACKSPACE + ----- control- backspace key +key_c_up kcup str %q KEY_C_UP + ----- control- up-arrow key +key_c_down kcdown str %r KEY_C_DOWN + ----- control- down-arrow key +key_a_delete kadelete str %s KEY_A_DELETE + ----- alt- delete-character key +key_a_end kaend str %t KEY_A_END + ----- alt- end key +key_a_home kahom str %u KEY_A_HOME + ----- alt- home key +key_a_insert kainsert str %v KEY_A_INSERT + ----- alt- insert-character key +key_a_left kalft str %w KEY_A_LEFT + ----- alt- left-arrow key +key_a_next kanxt str %x KEY_A_NEXT + ----- alt- next key +key_a_previous kaprv str %y KEY_A_PREVIOUS + ----- alt- previous key +key_a_print kaprt str %z KEY_A_PRINT + ----- alt- print key +key_a_right karit str %! KEY_A_RIGHT + ----- alt- right-arrow key +key_a_backspace kabs str %@ KEY_A_BACKSPACE + ----- alt- backspace key +key_a_up kaup str %# KEY_A_UP + ----- alt- up-arrow key +key_a_down kadown str %$ KEY_A_DOWN + ----- alt- down-arrow key +key_a_a kaa str $a KEY_A_A + ----- alt- a key +key_a_b kab str $b KEY_A_B + ----- alt- b key +key_a_c kac str $c KEY_A_C + ----- alt- c key +key_a_d kad str $d KEY_A_D + ----- alt- d key +key_a_e kae str $e KEY_A_E + ----- alt- e key +key_a_f kaf str $f KEY_A_F + ----- alt- f key +key_a_g kag str $g KEY_A_G + ----- alt- g key +key_a_h kah str $h KEY_A_H + ----- alt- h key +key_a_i kai str $i KEY_A_I + ----- alt- i key +key_a_j kaj str $j KEY_A_J + ----- alt- j key +key_a_k kak str $k KEY_A_K + ----- alt- k key +key_a_l kal str $l KEY_A_L + ----- alt- l key +key_a_m kam str $m KEY_A_M + ----- alt- m key +key_a_n kan str $n KEY_A_N + ----- alt- n key +key_a_o kao str $o KEY_A_O + ----- alt- o key +key_a_p kap str $p KEY_A_P + ----- alt- p key +key_a_q kaq str $q KEY_A_Q + ----- alt- q key +key_a_r kar str $r KEY_A_R + ----- alt- r key +key_a_s kas str $s KEY_A_S + ----- alt- s key +key_a_t kat str $t KEY_A_T + ----- alt- t key +key_a_u kau str $u KEY_A_U + ----- alt- u key +key_a_v kav str $v KEY_A_V + ----- alt- v key +key_a_w kaw str $w KEY_A_W + ----- alt- w key +key_a_x kax str $x KEY_A_X + ----- alt- x key +key_a_y kay str $y KEY_A_Y + ----- alt- y key +key_a_z kaz str $z KEY_A_Z + ----- alt- z key +key_a_0 ka_0 str $0 KEY_A_0 + ----- alt- 0 key +key_a_1 ka_1 str $1 KEY_A_1 + ----- alt- 1 key +key_a_2 ka_2 str $2 KEY_A_2 + ----- alt- 2 key +key_a_3 ka_3 str $3 KEY_A_3 + ----- alt- 3 key +key_a_4 ka_4 str $4 KEY_A_4 + ----- alt- 4 key +key_a_5 ka_5 str $5 KEY_A_5 + ----- alt- 5 key +key_a_6 ka_6 str $6 KEY_A_6 + ----- alt- 6 key +key_a_7 ka_7 str $7 KEY_A_7 + ----- alt- 7 key +key_a_8 ka_8 str $8 KEY_A_8 + ----- alt- 8 key +key_a_9 ka_9 str $9 KEY_A_9 + ----- alt- 9 key +key_a_backtick ka_bt str $` KEY_A_BACKTICK + ----- alt- ` key +key_a_under ka_und str $_ KEY_A_UNDER + ----- alt- _ key +key_a_equals ka_eq str $= KEY_A_EQUALS + ----- alt- = key +key_a_bar ka_bsl str $| KEY_A_BAR + ----- alt- | key +key_a_lbracker ka_lbr str $[ KEY_A_LBRACKER + ----- alt- [ key +key_a_rbracker ka_rbr str $] KEY_A_RBRACKER + ----- alt- ] key +key_a_semi ka_semi str $; KEY_A_SEMI + ----- alt- ; key +key_a_tick ka_tick str $' KEY_A_TICK + ----- alt- ' key +key_a_comma ka_com str $, KEY_A_COMMA + ----- alt- , key +key_a_dot ka_dot str $. KEY_A_DOT + ----- alt- . key +key_a_question ka_sla str $? KEY_A_QUESTION + ----- alt- ? key +key_a_divide ka_div str $/ KEY_A_DIVIDE + ----- alt- keypad / key +key_a_multiply ka_mul str $* KEY_A_MULTIPLY + ----- alt- keypad * key +key_a_add ka_add str $+ KEY_A_ADD + ----- alt- keypad + key +key_a_subtract ka_sub str $- KEY_A_SUBTRACT + ----- alt- keypad - key +key_a_kenter ka_kent str $< KEY_A_KENTER + ----- alt- keypad enter key +key_a_enter ka_ent str $> KEY_A_ENTER + ----- alt- enter key +key_c_at kcat str %% KEY_C_AT + ----- control- @ key +key_c_divide kcdiv str %/ KEY_C_DIVIDE + ----- control- keypad / key +key_c_multiply kcmul str %* KEY_C_MULTIPLY + ----- control- keypad * key +key_c_add kcadd str %+ KEY_C_ADD + ----- control- keypad + key +key_c_subtract kcsub str %- KEY_C_SUBTRACT + ----- control- keypad - key +# +# SVr4 added these capabilities to support color +# +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +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 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 +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +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 #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, #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 (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 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +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 #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 +zero_motion zerom str Zx - - ----- No motion for subsequent character +#%.TE +#%.ad +#% +#%The following string capabilities are present in the SVr4.0 term structure, +#%but were originally not documented in the man page. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw18. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- 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, 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 +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +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 +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +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 #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 +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +#%.TE +#%.ad +#% +#%.in .8i +#%The XSI Curses standard added these. They are some post-4.1 +#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. +#%The \fBncurses\fR termcap names for them are invented; according to the +#%XSI Curses standard, they have no termcap names. If your compiled terminfo +#%entries use these, they may not be binary-compatible with System V terminfo +#%entries after SVr4.1; beware! +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +#%.TE +#%.ad +# +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/contrib/ncurses/include/Caps.osf1r5 b/contrib/ncurses/include/Caps.osf1r5 new file mode 100644 index 0000000..28f4681 --- /dev/null +++ b/contrib/ncurses/include/Caps.osf1r5 @@ -0,0 +1,1274 @@ +############################################################################## +# Copyright (c) 2002 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 Dickey +# +# $Id: Caps.osf1r5,v 1.2 2002/04/20 15:43:58 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with OSF/1 version 5 (Tru64) terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE can't print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +back_color_erase bce bool ut - - ----- screen erased with background color +can_change ccc bool cc - - ----- terminal can re-define existing colors +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +hard_cursor chts bool HC - - ----- cursor is hard to see +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +buttons btns num BT - - ----- number of buttons on mouse +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +max_colors colors num Co - - ----- maximum number of colors on screen +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +maximum_windows wnum num MW - - ----- maximum number of defineable windows +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +no_color_video ncv num NC - - ----- video attributes that can not be used with colors +number_of_pins npins num Yh - - ----- numbers of pins in print-head +num_labels nlab num Nl - - ----- number of labels on screen +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +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, 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) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +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, 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 +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +# OSF1 differences start here, based on IBM version: +# +box_chars_1 box1 str bx - - ----K box characters primary set +box_chars_2 box2 str by - - ----K box characters secondary set +box_attr_1 batt1 str Bx - - ----K attributes for box1 +box_attr_2 batt2 str By - - ----K attributes for box2 +color_bg_0 colb0 str d0 - - ----K background color 0 +color_bg_1 colb1 str d1 - - ----K background color 1 +color_bg_2 colb2 str d2 - - ----K background color 2 +color_bg_3 colb3 str d3 - - ----K background color 3 +color_bg_4 colb4 str d4 - - ----K background color 4 +color_bg_5 colb5 str d5 - - ----K background color 5 +color_bg_6 colb6 str d6 - - ----K background color 6 +color_bg_7 colb7 str d7 - - ----K background color 7 +color_fg_0 colf0 str c0 - - ----K foreground color 0 +color_fg_1 colf1 str c1 - - ----K foreground color 1 +color_fg_2 colf2 str c2 - - ----K foreground color 2 +color_fg_3 colf3 str c3 - - ----K foreground color 3 +color_fg_4 colf4 str c4 - - ----K foreground color 4 +color_fg_5 colf5 str c5 - - ----K foreground color 5 +color_fg_6 colf6 str c6 - - ----K foreground color 6 +color_fg_7 colf7 str c7 - - ----K foreground color 7 +font_0 font0 str f0 - - ----- select font 0 +font_1 font1 str f1 - - ----- select font 1 +font_2 font2 str f2 - - ----- select font 2 +font_3 font3 str f3 - - ----- select font 3 +font_4 font4 str f4 - - ----K select font 4 +font_5 font5 str f5 - - ----K select font 5 +font_6 font6 str f6 - - ----K select font 6 +font_7 font7 str f7 - - ----K select font 7 +key_back_tab kbtab str k0 - - ----- backtab key +key_do kdo str ki - - ----K do request key +key_command kcmd str kc KEY_COMMAND 0545 ----- command key +key_command_pane kcpn str kW - - ----K command-pane key +key_end kend str @7 KEY_END 0550 ----- end key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_newline knl str nl - - ----K newline key +key_next_pane knpn str kv - - ----K next-pane key +key_prev_cmd kppn str kp - - ----K previous-command key +key_prev_pane kppn str kV - - ----K previous-pane key +key_quit kquit str kQ - - ----K quit key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_scroll_left kscl str kz - - ----K scroll left +key_scroll_right kscr str kZ - - ----K scroll right +key_tab ktab str ko - - ----K tab key +key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities are described in +# the Tru64 manual pages. +key_smap_in6 kmpf6 str Kr - - ----K special mapped key 6 input +key_smap_out6 kmpt6 str KR - - ----K special mapped key 6 output +key_smap_in7 kmpf7 str Ks - - ----K special mapped key 7 input +key_smap_out7 kmpt7 str KS - - ----K special mapped key 7 output +key_smap_in8 kmpf8 str Kt - - ----K special mapped key 8 input +key_smap_out8 kmpt8 str KT - - ----K special mapped key 8 output +key_smap_in9 kmpf9 str Ku - - ----K special mapped key 9 input +key_smap_out9 kmpt9 str KU - - ----K special mapped key 9 output +key_sf1 ksf1 str S1 - - ----K special function key 1 +key_sf2 ksf2 str S2 - - ----K special function key 2 +key_sf3 ksf3 str S3 - - ----K special function key 3 +key_sf4 ksf4 str S4 - - ----K special function key 4 +key_sf5 ksf5 str S5 - - ----K special function key 5 +key_sf6 ksf6 str S6 - - ----K special function key 6 +key_sf7 ksf7 str S7 - - ----K special function key 7 +key_sf8 ksf8 str S8 - - ----K special function key 8 +key_sf9 ksf9 str S9 - - ----K special function key 9 +key_sf10 ksf10 str SA - - ----K special function key 10 +# +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_action kact str kJ KEY_ACTION 0541 ----K sent by action key +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +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 +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +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 +char_padding rmp str rP - - ----- like ip but when in insert mode +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +clear_margins mgc str MC - - ----- clear right and left soft margins +clr_bol el1 str cb - - ----- Clear to beginning of line +code_set_init csin str ci - - ----- Init sequence for multiple codesets +color_names colornm str Yw - - ----- Give name for color #1 +create_window cwin str CW - - ----- define a window #1 from #2,#3 to #4,#5 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +define_char defc str ZE - - ----- Define a character #1, #2 dots wide, descender #3 +device_type devt str dv - - ----- Indicate language/codeset support +dial_phone dial str DI - - ----- dial number #1 +display_clock dclk str DK - - ----- display clock +display_pc_char dispc str S1 - - ----- Display PC character #1 +ena_acs enacs str eA - - ----- enable alternate char set +end_bit_image_region endbi str Yy - - ----- End a bit-image region +enter_am_mode smam str SA - - ----- turn on automatic margins +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 +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_pc_charset_mode smpch str S2 - - ----- Enter PC character display mode +enter_scancode_mode smsc str S4 - - ----- Enter PC scancode mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_am_mode rmam str RA - - ----- turn off automatic margins +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_pc_charset_mode rmpch str S3 - - ----- Exit PC character display mode +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +fixed_pause pause str PA - - ----- pause for 2-3 seconds +flash_hook hook str fh - - ----- flash switch hook +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +goto_window wingo str WG - - ----- go to window #1 +hangup hup str HU - - ----- hang-up phone +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_btab kcbt str kB KEY_BTAB 0632 ----- back-tab key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +label_format fln str Lf - - ----- label format +label_off rmln str LF - - ----- turn off soft labels +label_on smln str LO - - ----- turn on soft labels +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 #1 in micro mode +micro_up mcuu1 str Zd - - ----- Like cursor_up in micro mode +mouse_info minfo str Mi - - ----- Mouse status information +order_of_pins porder str Ze - - ----- Match software bits to print-head pins +orig_colors oc str oc - - ----- Set all color pairs to the original ones +orig_pair op str op - - ----- Set default pair to its original value +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 +pc_term_options pctrm str S6 - - ----- PC terminal options +pkey_plab pfxl str xl - - ----- Program function key #1 to type string #2 and show string #3 +plab_norm pln str pn - - ----- program label #1 to show string #2 +pulse pulse str PU - - ----- select pulse dialing +quick_dial qdial str QD - - ----- dial number #1 without checking +req_for_input rfi str RF - - ----- send next input char (for ptys) +req_mouse_pos reqmp str RQ - - ----- Request mouse position +remove_clock rmclk str RC - - ----- remove clock +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +select_char_set scs str Zj - - ----- Select character set, #1 +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_background setb str Sb - - ----- Set background color #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 (if smgtp is not given) #2 lines from bottom +set_clock sclk str SC - - ----- set clock, #1 hrs #2 mins #3 secs +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_left_margin_parm smglp str Zm - - ----- Set left (right) margin at column #1 +set_lr_margin smglr str ML - - ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). +set_page_length slines str YZ - - ----- Set page length to #1 lines +set_right_margin smgr str MR - - ----- set right soft margin at current column +set_right_margin_parm smgrp str Zn - - ----- Set right margin at column #1 +set_tb_margin smgtb str MT - - ----- Sets both top and bottom margins to #1, #2 +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 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +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 #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 +tone tone str TO - - ----- select touch tone dialing +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +wait_tone wait str WA - - ----- wait for dial-tone +xoff_character xoffc str XF - - ----- XOFF character +xon_character xonc str XN - - ----- XON character +zero_motion zerom str Zx - - ----- No motion for subsequent character +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +# +# +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +#box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/contrib/ncurses/include/Caps.uwin b/contrib/ncurses/include/Caps.uwin new file mode 100644 index 0000000..ea755c1 --- /dev/null +++ b/contrib/ncurses/include/Caps.uwin @@ -0,0 +1,1090 @@ +############################################################################## +# Copyright (c) 2001 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 Dickey +# +# $Id: Caps.uwin,v 1.2 2002/04/20 15:44:04 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with U/Win's terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE can't print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding won't work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer won't echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +back_color_erase bce bool ut - - ----- screen erased with background color +can_change ccc bool cc - - ----- terminal can re-define existing colors +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +buttons btns num BT - - ----- number of buttons on mouse +#max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +#maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that can't be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +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, 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) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +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, 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 +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----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. See smgl. (ML is not in BSD termcap). +set_right_margin smgr str MR - - ----- set right soft margin at current column +device_type devt str dv - - ----- Indicate language/codeset support +code_set_init csin str ci - - ----- Init sequence for multiple codesets +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +key_mouse kmous str Km KEY_MOUSE 0631 ----- 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, parameter #1 not documented. +release_mouse relm str Rm - - ----- Curses should release the mouse */ +color_names colornm str Yw - - ----- Give name for color #1 +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +orig_colors oc str oc - - ----- Set all color pairs to the original ones +orig_pair op str op - - ----- Set default pair to its original value +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_background setb str Sb - - ----- Set background color #1 +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +#%.TE +#%.ad +#% +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/contrib/ncurses/include/MKkey_defs.sh b/contrib/ncurses/include/MKkey_defs.sh new file mode 100755 index 0000000..68f3346 --- /dev/null +++ b/contrib/ncurses/include/MKkey_defs.sh @@ -0,0 +1,162 @@ +#! /bin/sh +# $Id: MKkey_defs.sh,v 1.7 2002/01/13 01:36:32 tom Exp $ +############################################################################## +# Copyright (c) 2001,2002 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. # +############################################################################## +# +# MKkey_defs.sh -- generate function-key definitions for curses.h +# +# Author: Thomas E. Dickey <dickey@herndon4.his.com> 2001 +# +# Extract function-key definitions from the Caps file +# +: ${AWK-awk} +DATA=${1-Caps} + +data=data$$ +pass1=pass1_$$ +pass2=pass2_$$ +pass3=pass3_$$ +pass4=pass4_$$ +trap 'rm -f $data pass[1234]_$$' 0 1 2 5 15 +sed -e 's/[ ]\+/ /g' < $DATA |sort -n +5 >$data + +cat <<EOF +/* + * These definitions were generated by $0 $DATA + */ +EOF + +# KEY_RESIZE +maxkey=410 + +for pass in 1 2 3 4 +do + +output=pass${pass}_$$ + +${AWK-awk} >$output <$data ' +function print_cols(text,cols) { + printf "%s", text + len = length(text); + while (len < cols) { + printf " " + len += 8; + } +} +function decode(keycode) { + result = 0; + if (substr(keycode, 1, 2) == "0x") { + digits="0123456789abcdef"; + } else if (substr(keycode, 1, 1) == "0") { + digits="01234567"; + } else { + digits="0123456789"; + } + while (length(keycode) != 0) { + digit=substr(keycode, 1, 1); + keycode=substr(keycode, 2); + result = result * length(digits) + index(digits, digit) - 1; + } + return result; +} + +BEGIN { + maxkey='$maxkey'; + pass='$pass'; + key_max=1; + bits=1; + while (key_max < maxkey) { + bits = bits + 1; + key_max = (key_max * 2) + 1; + } + octal_fmt = sprintf ("%%0%do", (bits + 2) / 3 + 1); +} + +/^$/ {next;} +/^#/ {next;} +/^capalias/ {next;} +/^infoalias/ {next;} + +$5 != "-" && $6 != "-" { + if ($6 == "+") { + if (pass == 1 || pass == 2) + next; + thiskey=maxkey + 1; + } else { + if (pass == 3) + next; + thiskey=decode($6); + } + if (thiskey > maxkey) + maxkey = thiskey; + if (pass == 2 || pass == 3) { + showkey=sprintf(octal_fmt, thiskey); + if ($5 == "KEY_F(0)" ) { + printf "#define " + print_cols("KEY_F0", 16); + print_cols(showkey, 16); + print "/* Function keys. Space for 64 */"; + printf "#define " + print_cols("KEY_F(n)", 16); + print_cols("(KEY_F0+(n))", 16); + print "/* Value of function key n */" + } else { + printf "#define " + print_cols($5, 16); + print_cols(showkey, 16); + printf "/*" + for (i = 8; i <= NF; i++) + printf " %s", $i + print " */" + } + } + } +END { + if (pass == 1) { + print maxkey; + } else if (pass == 4) { + print ""; + printf "#define "; + print_cols("KEY_MAX", 16); + result = sprintf (octal_fmt, key_max); + print_cols(result, 16); + printf "/* Maximum key value is "; + printf octal_fmt, maxkey; + print " */"; + } + } +' +if test $pass = 1 ; then + maxkey=`cat $pass1` +fi + +done + +cat $pass2 +cat $pass3 +cat $pass4 diff --git a/contrib/ncurses/include/MKterm.h.awk.in b/contrib/ncurses/include/MKterm.h.awk.in index efca636..8243aea 100644 --- a/contrib/ncurses/include/MKterm.h.awk.in +++ b/contrib/ncurses/include/MKterm.h.awk.in @@ -1,7 +1,6 @@ - BEGIN { print "/****************************************************************************" - print " * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *" + print " * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *" print " * *" print " * Permission is hereby granted, free of charge, to any person obtaining a *" print " * copy of this software and associated documentation files (the *" @@ -33,7 +32,7 @@ BEGIN { print "/* and: Eric S. Raymond <esr@snark.thyrsus.com> */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.39 2001/03/24 21:53:32 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.41 2001/12/23 01:04:38 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -52,22 +51,15 @@ BEGIN { print "#endif" print "" print "/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H" - print " * and BROKEN_LINKER definition (based on the system for which this was" - print " * configured)." + print " * definition (based on the system for which this was configured)." print " */" print "" print "#undef HAVE_TERMIOS_H" print "#define HAVE_TERMIOS_H 1/*default*/" print "" - print "#undef HAVE_TERMIO_H" - print "#define HAVE_TERMIO_H 0/*default*/" - print "" print "#undef HAVE_TCGETATTR" print "#define HAVE_TCGETATTR 1/*default*/" print "" - print "#undef BROKEN_LINKER" - print "#define BROKEN_LINKER 0/*default*/" - print "" print "#undef NCURSES_CONST" print "#define NCURSES_CONST @NCURSES_CONST@" print "" @@ -81,7 +73,7 @@ BEGIN { print "#undef SET_TTY" print "#undef GET_TTY" print "" - print "/* Assume Posix termio if we have the header and function */" + print "/* Assume POSIX termio if we have the header and function */" print "#if HAVE_TERMIOS_H && HAVE_TCGETATTR" print "" print "#undef TERMIOS" @@ -228,7 +220,7 @@ END { print "" print "typedef struct term { /* describe an actual terminal */" print " TERMTYPE type; /* terminal type description */" - print " short Filedes; /* file description being written to */" + print " short Filedes; /* file description being written to */" print " TTY Ottyb, /* original state of the terminal */" print " Nttyb; /* current state of the terminal */" print " int _baudrate; /* used to compute padding */" diff --git a/contrib/ncurses/include/Makefile.in b/contrib/ncurses/include/Makefile.in index 32f1421..1a48a17 100644 --- a/contrib/ncurses/include/Makefile.in +++ b/contrib/ncurses/include/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.27 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.35 2001/12/08 18:50:06 tom Exp $ ############################################################################## # Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 +# Author: Thomas E. Dickey 1996-2001 # # Makefile for ncurses source code. # @@ -56,15 +56,20 @@ LN_S = @LN_S@ VERSION = @cf_cv_rel_version@ +# The "Caps" file specifies the terminfo database format, as well as the list +# of function keys. +TERMINFO_CAPS = $(srcdir)/@TERMINFO_CAPS@ + # These files are generated by the configure script CONFIG_SRC = \ MKterm.h.awk \ - curses.h \ + curses.head \ termcap.h \ unctrl.h # These files are generated by this makefile AUTO_SRC = \ + curses.h \ hashsize.h \ ncurses_def.h \ parametrized.h \ @@ -73,21 +78,31 @@ AUTO_SRC = \ ################################################################################ all \ libs \ +depend \ sources \ install :: $(AUTO_SRC) -term.h: $(srcdir)/Caps MKterm.h.awk - $(AWK) -f MKterm.h.awk $(srcdir)/Caps > $@ +curses.h : $(TERMINFO_CAPS) \ + curses.head \ + $(srcdir)/curses.tail \ + $(srcdir)/MKkey_defs.sh + cat curses.head >$@ + AWK=$(AWK) sh $(srcdir)/MKkey_defs.sh $(TERMINFO_CAPS) >>$@ + sh -c 'if test "@NCURSES_CH_T@" = "cchar_t" ; then cat $(srcdir)/curses.wide >>$@ ; fi' + cat $(srcdir)/curses.tail >>$@ + +term.h: $(TERMINFO_CAPS) MKterm.h.awk + $(AWK) -f MKterm.h.awk $(TERMINFO_CAPS) > $@ sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ -hashsize.h: $(srcdir)/Caps $(srcdir)/MKhashsize.sh - sh $(srcdir)/MKhashsize.sh $(srcdir)/Caps >$@ +hashsize.h: $(TERMINFO_CAPS) $(srcdir)/MKhashsize.sh + sh $(srcdir)/MKhashsize.sh $(TERMINFO_CAPS) >$@ 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 >$@ +parametrized.h: $(TERMINFO_CAPS) $(srcdir)/MKparametrized.sh + AWK=$(AWK) sh $(srcdir)/MKparametrized.sh $(TERMINFO_CAPS) >$@ tags: ctags *.[ch] @@ -96,7 +111,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/contrib/ncurses/include/curses.h.in b/contrib/ncurses/include/curses.h.in index b73d44f..88028cc 100644 --- a/contrib/ncurses/include/curses.h.in +++ b/contrib/ncurses/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $Id: curses.h.in,v 1.97 2000/12/10 02:00:24 tom Exp $ */ +/* $Id: curses.h.in,v 1.128 2002/05/11 21:38:02 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -73,6 +73,9 @@ #undef NCURSES_SIZE_T #define NCURSES_SIZE_T short +#undef NCURSES_CH_T +#define NCURSES_CH_T @NCURSES_CH_T@ + typedef unsigned @cf_cv_typeof_chtype@ chtype; #include <stdio.h> @@ -85,6 +88,13 @@ typedef unsigned @cf_cv_typeof_chtype@ chtype; /* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also * implement it. If so, we must use the C++ compiler's type to avoid conflict * with other interfaces. + * + * A further complication is that <stdbool.h> may declare 'bool' to be a + * different type, such as an enum which is not necessarily compatible with + * C++. If we have <stdbool.h>, make 'bool' a macro, so users may #undef it. + * Otherwise, let it remain a typedef to avoid conflicts with other #define's. + * In either case, make a typedef for NCURSES_BOOL which can be used if needed + * from either C or C++. */ #undef TRUE @@ -93,11 +103,24 @@ typedef unsigned @cf_cv_typeof_chtype@ chtype; #undef FALSE #define FALSE 0 +typedef @cf_cv_type_of_bool@ NCURSES_BOOL; + #if (!defined(__cplusplus) || !@cf_cv_builtin_bool@) && (!@cf_cv_cc_bool_type@) + +#if @cf_cv_header_stdbool_h@ +#include <stdbool.h> +#endif + #undef bool + +#if @cf_cv_header_stdbool_h@ +#define bool NCURSES_BOOL +#else typedef @cf_cv_type_of_bool@ bool; #endif +#endif /* !__cplusplus, etc. */ + #ifdef __cplusplus extern "C" { #endif @@ -139,7 +162,12 @@ extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; /* line graphics */ +#if @BROKEN_LINKER@ +extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void); +#define acs_map (_nc_acs_map()) +#else extern NCURSES_EXPORT_VAR(chtype) acs_map[]; +#endif /* VT100 symbols begin here */ #define ACS_ULCORNER (acs_map['l']) /* upper left corner */ @@ -199,11 +227,19 @@ extern NCURSES_EXPORT_VAR(chtype) acs_map[]; #define ACS_SBSB ACS_VLINE #define ACS_SSSS ACS_PLUS -#if !defined(ERR) || ((ERR) != -1) +#if defined(ERR) && ((ERR) != -1) +#undef ERR +#endif + +#if !defined(ERR) #define ERR (-1) #endif -#if !defined(OK) || ((OK) != 0) +#if defined(OK) && ((OK) != 0) +#undef OK +#endif + +#if !defined(OK) #define OK (0) #endif @@ -234,6 +270,20 @@ typedef struct _win_st WINDOW; typedef chtype attr_t; /* ...must be at least as wide as chtype */ #ifdef _XOPEN_SOURCE_EXTENDED + +#if @NCURSES_LIBUTF8@ +#ifdef mblen /* libutf8.h defines it w/o undefining first */ +#undef mblen +#endif +#include <libutf8.h> +#define _WCHAR_T +#define _WINT_T +#endif + +#if @NCURSES_MBSTATE_T@ +#include <wchar.h> /* ...to get mbstate_t, etc. */ +#endif + #ifndef _WCHAR_T typedef unsigned long wchar_t; #endif /* _WCHAR_T */ @@ -248,15 +298,10 @@ typedef struct wchar_t chars[CCHARW_MAX]; } cchar_t; + #endif /* _XOPEN_SOURCE_EXTENDED */ -struct ldat -{ - chtype *text; /* text of the line */ - NCURSES_SIZE_T firstchar; /* first changed character in the line */ - NCURSES_SIZE_T lastchar; /* last changed character in the line */ - NCURSES_SIZE_T oldindex; /* index of the line at last update */ -}; +struct ldat; struct _win_st { @@ -274,14 +319,14 @@ struct _win_st /* option values set by user */ bool _notimeout; /* no time out on function-key entry? */ - bool _clear; /* consider all data in the window invalid? */ - bool _leaveok; /* OK to not reset cursor on exit? */ - bool _scroll; /* OK to scroll this window? */ - bool _idlok; /* OK to use insert/delete line? */ - bool _idcok; /* OK to use insert/delete char? */ + bool _clear; /* consider all data in the window invalid? */ + bool _leaveok; /* OK to not reset cursor on exit? */ + bool _scroll; /* OK to scroll this window? */ + bool _idlok; /* OK to use insert/delete line? */ + bool _idcok; /* OK to use insert/delete char? */ bool _immed; /* window in immed mode? (not yet used) */ bool _sync; /* window in sync mode? */ - bool _use_keypad; /* process function keys into KEY_ symbols? */ + bool _use_keypad; /* process function keys into KEY_ symbols? */ int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ struct ldat *_line; /* the actual line data */ @@ -304,6 +349,10 @@ struct _win_st } _pad; NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ + +#ifdef _XOPEN_SOURCE_EXTENDED + cchar_t _bkgrnd; /* current background char/attribute pair */ +#endif }; extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; @@ -324,15 +373,21 @@ extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility /* * These functions are extensions - not in XSI Curses. */ +#if @NCURSES_EXT_FUNCS@ +extern NCURSES_EXPORT(bool) is_term_resized (int, int); extern NCURSES_EXPORT(char *) keybound (int, int); extern NCURSES_EXPORT(const char *) curses_version (void); extern NCURSES_EXPORT(int) assume_default_colors (int, int); extern NCURSES_EXPORT(int) define_key (char *, int); extern NCURSES_EXPORT(int) keyok (int, bool); +extern NCURSES_EXPORT(int) resize_term (int, int); extern NCURSES_EXPORT(int) resizeterm (int, int); extern NCURSES_EXPORT(int) use_default_colors (void); extern NCURSES_EXPORT(int) use_extended_names (bool); extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); +#else +#define curses_version() NCURSES_VERSION +#endif /* * GCC (and some other compilers) define '__attribute__'; we're using this @@ -359,17 +414,21 @@ extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); * We cannot define these in ncurses_cfg.h, since they require parameters to be * passed (that's non-portable). */ -#ifdef GCC_PRINTF +#ifndef GCC_PRINTFLIKE +#if defined(GCC_PRINTF) && !defined(printf) #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) #else #define GCC_PRINTFLIKE(fmt,var) /*nothing*/ #endif +#endif -#ifdef GCC_SCANF +#ifndef GCC_SCANFLIKE +#if defined(GCC_SCANF) && !defined(scanf) #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) #else #define GCC_SCANFLIKE(fmt,var) /*nothing*/ #endif +#endif #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ @@ -391,13 +450,6 @@ extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */ extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */ extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */ extern NCURSES_EXPORT(int) addstr (const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) add_wch (const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */ extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */ extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */ @@ -409,18 +461,8 @@ extern NCURSES_EXPORT(int) baudrate (void); /* implemented */ extern NCURSES_EXPORT(int) beep (void); /* implemented */ extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */ extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */ extern NCURSES_EXPORT(int) cbreak (void); /* implemented */ extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */ @@ -446,41 +488,21 @@ extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) echo (void); /* implemented */ extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */ extern NCURSES_EXPORT(int) erase (void); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) erasewchar (wchar_t*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) endwin (void); /* implemented */ extern NCURSES_EXPORT(char) erasechar (void); /* implemented */ extern NCURSES_EXPORT(void) filter (void); /* implemented */ extern NCURSES_EXPORT(int) flash (void); /* implemented */ extern NCURSES_EXPORT(int) flushinp (void); /* implemented */ extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) getch (void); /* generated */ extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) getstr (char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) get_wch (wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) get_wstr (wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */ extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */ extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */ extern NCURSES_EXPORT(bool) has_il (void); /* implemented */ extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */ extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */ extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */ @@ -491,39 +513,19 @@ extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */ extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */ extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */ extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) innwstr (wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) insch (chtype); /* generated */ extern NCURSES_EXPORT(int) insdelln (int); /* generated */ extern NCURSES_EXPORT(int) insertln (void); /* generated */ extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */ extern NCURSES_EXPORT(int) insstr (const char *); /* generated */ extern NCURSES_EXPORT(int) instr (char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) ins_wch (const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) inwstr (wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) in_wch (NCURSES_CONST cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) in_wchstr (NCURSES_CONST cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) in_wchnstr (NCURSES_CONST cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */ extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */ extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */ extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(char *) key_name (wchar_t); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */ extern NCURSES_EXPORT(char) killchar (void); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) killwchar (wchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */ extern NCURSES_EXPORT(char *) longname (void); /* implemented */ extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */ @@ -533,120 +535,52 @@ extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* gener extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */ extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */ extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* missing */ -extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */ extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */ extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */ extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */ extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */ extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */ extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */ extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */ extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */ extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */ extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */ extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvin_wch (int, int, NCURSES_CONST cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvin_wchstr (int, int, NCURSES_CONST cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, NCURSES_CONST cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvprintw (int,int, NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(3,4); extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(3,4); extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */ extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */ extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */ extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */ extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* missing */ -extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */ extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */ extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */ extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */ extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */ extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */ extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */ extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */ extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */ extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* missing */ -extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, NCURSES_CONST cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, NCURSES_CONST cchar_t *,int); /* missing */ -extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, NCURSES_CONST cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(4,5); extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(4,5); extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) napms (int); /* implemented */ extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */ @@ -664,9 +598,6 @@ extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented * extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */ extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */ extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */ extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */ extern NCURSES_EXPORT(int) printw (NCURSES_CONST char *,...) /* implemented */ @@ -680,7 +611,7 @@ extern NCURSES_EXPORT(int) refresh (void); /* generated */ extern NCURSES_EXPORT(int) resetty (void); /* implemented */ extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */ extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) ripoffline (int, int (*init)(WINDOW *, int)); /* implemented */ +extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */ extern NCURSES_EXPORT(int) savetty (void); /* implemented */ extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(1,2); @@ -691,9 +622,6 @@ extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */ extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */ extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */ extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */ extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */ extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */ @@ -712,9 +640,6 @@ extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */ extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */ extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */ extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) standout (void); /* generated */ extern NCURSES_EXPORT(int) standend (void); /* generated */ extern NCURSES_EXPORT(int) start_color (void); /* implemented */ @@ -722,7 +647,6 @@ extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implem extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *,int,int,int,int); /* implemented */ extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */ extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */ -extern NCURSES_EXPORT(attr_t) term_attrs (void); /* missing */ extern NCURSES_EXPORT(char *) termname (void); /* implemented */ extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */ @@ -733,21 +657,11 @@ extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */ extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* implemented */ extern NCURSES_EXPORT(int) typeahead (int); /* implemented */ extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ -extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* generated:WIDEC */ extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) vwprintw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ extern NCURSES_EXPORT(int) vw_printw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */ extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ @@ -757,13 +671,6 @@ extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *const,int); /* imp extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */ extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *const,int); /* implemented */ extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int); /* missing */ -extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int); /* missing */ -extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */ extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */ extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */ @@ -773,14 +680,7 @@ extern NCURSES_EXPORT(int) wattr_off (WINDOW *, NCURSES_CONST attr_t, void *); / extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */ extern NCURSES_EXPORT(int) wbkgd (WINDOW *,const chtype); /* implemented */ extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */ extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */ @@ -790,49 +690,21 @@ extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */ extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *); /* missing */ -extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */ extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */ extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */ extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */ extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */ extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */ extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */ extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* missing */ -extern NCURSES_EXPORT(int) win_wch (WINDOW *, NCURSES_CONST cchar_t *); /* missing */ -extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, NCURSES_CONST cchar_t *, int); /* missing */ -extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, NCURSES_CONST cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */ extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */ extern NCURSES_EXPORT(int) wprintw (WINDOW *, NCURSES_CONST char *,...) /* implemented */ @@ -849,19 +721,19 @@ extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */ extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */ extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */ extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(wchar_t *) wunctrl (cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ +/* + * vid_attr() was implemented originally based on the draft of XSI curses. + */ +#ifndef _XOPEN_SOURCE_EXTENDED +#define vid_attr(a,pair,opts) vidattr(a) +#endif /* attributes */ -#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + @cf_cv_widec_shift@)) +#define NCURSES_ATTR_SHIFT 8 +#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) #define A_NORMAL 0L #define A_ATTRIBUTES NCURSES_BITS(~(@cf_cv_1UL@ - @cf_cv_1UL@),0) @@ -875,11 +747,6 @@ extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* gene #define A_BOLD NCURSES_BITS(@cf_cv_1UL@,13) #define A_ALTCHARSET NCURSES_BITS(@cf_cv_1UL@,14) #define A_INVIS NCURSES_BITS(@cf_cv_1UL@,15) - -/* Tradeoff on 32-bit machines ('protect' vs widec). The others (e.g., left - * highlight are not implemented in any terminal descriptions, anyway. - */ -#if ((16 + @cf_cv_widec_shift@) < @cf_cv_shift_limit@) #define A_PROTECT NCURSES_BITS(@cf_cv_1UL@,16) #define A_HORIZONTAL NCURSES_BITS(@cf_cv_1UL@,17) #define A_LEFT NCURSES_BITS(@cf_cv_1UL@,18) @@ -887,18 +754,9 @@ extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* gene #define A_RIGHT NCURSES_BITS(@cf_cv_1UL@,20) #define A_TOP NCURSES_BITS(@cf_cv_1UL@,21) #define A_VERTICAL NCURSES_BITS(@cf_cv_1UL@,22) -#else -#define A_PROTECT 0L -#define A_HORIZONTAL 0L -#define A_LEFT 0L -#define A_LOW 0L -#define A_RIGHT 0L -#define A_TOP 0L -#define A_VERTICAL 0L -#endif #define COLOR_PAIR(n) NCURSES_BITS(n, 0) -#define PAIR_NUMBER(a) (((a) & A_COLOR) >> @cf_cv_widec_shift@) +#define PAIR_NUMBER(a) (((a) & A_COLOR) >> NCURSES_ATTR_SHIFT) /* * pseudo functions @@ -943,7 +801,7 @@ extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* gene #define wattron(win,at) wattr_on(win, at, (void *)0) #define wattroff(win,at) wattr_off(win, at, (void *)0) -#define wattrset(win,at) ((win)->_attrs = (at)) +#define wattrset(win,at) ((win)->_attrs = (at)) #define scroll(win) wscrl(win,1) @@ -968,172 +826,108 @@ extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* gene * pseudo functions for standard screen */ -#define addch(ch) waddch(stdscr,ch) +#define addch(ch) waddch(stdscr,ch) #define addchnstr(str,n) waddchnstr(stdscr,str,n) #define addchstr(str) waddchstr(stdscr,str) #define addnstr(str,n) waddnstr(stdscr,str,n) -#define addstr(str) waddnstr(stdscr,str,-1) -#define attroff(at) wattroff(stdscr,at) -#define attron(at) wattron(stdscr,at) -#define attrset(at) wattrset(stdscr,at) +#define addstr(str) waddnstr(stdscr,str,-1) +#define attroff(at) wattroff(stdscr,at) +#define attron(at) wattron(stdscr,at) +#define attrset(at) wattrset(stdscr,at) +#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o) +#define attr_off(a,o) wattr_off(stdscr,a,o) +#define attr_on(a,o) wattr_on(stdscr,a,o) +#define attr_set(a,c,o) wattr_set(stdscr,a,c,o) #define bkgd(ch) wbkgd(stdscr,ch) #define bkgdset(ch) wbkgdset(stdscr,ch) -#define clear() wclear(stdscr) -#define clrtobot() wclrtobot(stdscr) -#define clrtoeol() wclrtoeol(stdscr) +#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) +#define clear() wclear(stdscr) +#define clrtobot() wclrtobot(stdscr) +#define clrtoeol() wclrtoeol(stdscr) #define color_set(c,o) wcolor_set(stdscr,c,o) -#define delch() wdelch(stdscr) -#define deleteln() winsdelln(stdscr,-1) +#define delch() wdelch(stdscr) +#define deleteln() winsdelln(stdscr,-1) #define echochar(c) wechochar(stdscr,c) -#define erase() werase(stdscr) -#define getch() wgetch(stdscr) -#define getstr(str) wgetstr(stdscr,str) -#define inch() winch(stdscr) +#define erase() werase(stdscr) +#define getch() wgetch(stdscr) +#define getstr(str) wgetstr(stdscr,str) +#define inch() winch(stdscr) #define inchnstr(s,n) winchnstr(stdscr,s,n) #define inchstr(s) winchstr(stdscr,s) #define innstr(s,n) winnstr(stdscr,s,n) -#define insch(c) winsch(stdscr,c) +#define insch(c) winsch(stdscr,c) #define insdelln(n) winsdelln(stdscr,n) -#define insertln() winsdelln(stdscr,1) +#define insertln() winsdelln(stdscr,1) #define insnstr(s,n) winsnstr(stdscr,s,n) #define insstr(s) winsstr(stdscr,s) #define instr(s) winstr(stdscr,s) -#define move(y,x) wmove(stdscr,y,x) -#define refresh() wrefresh(stdscr) +#define move(y,x) wmove(stdscr,y,x) +#define refresh() wrefresh(stdscr) #define scrl(n) wscrl(stdscr,n) -#define setscrreg(t,b) wsetscrreg(stdscr,t,b) -#define standend() wstandend(stdscr) -#define standout() wstandout(stdscr) +#define setscrreg(t,b) wsetscrreg(stdscr,t,b) +#define standend() wstandend(stdscr) +#define standout() wstandout(stdscr) #define timeout(delay) wtimeout(stdscr,delay) -#define wdeleteln(win) winsdelln(win,-1) -#define winsertln(win) winsdelln(win,1) +#define wdeleteln(win) winsdelln(win,-1) +#define winsertln(win) winsdelln(win,1) /* * mv functions */ -#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) +#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) #define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)) -#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) +#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) #define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)) -#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) -#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) -#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) -#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) -#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) -#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) -#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? (chtype)ERR : winch(win)) +#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) +#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) +#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) +#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) +#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) +#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) +#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) +#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? (chtype)ERR : winch(win)) #define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n)) #define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s)) #define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) -#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) +#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) #define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n)) #define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s)) #define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s)) -#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) +#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) -#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) +#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) #define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n) #define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str) #define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n) -#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) -#define mvdelch(y,x) mvwdelch(stdscr,y,x) -#define mvgetch(y,x) mvwgetch(stdscr,y,x) +#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) +#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) +#define mvdelch(y,x) mvwdelch(stdscr,y,x) +#define mvgetch(y,x) mvwgetch(stdscr,y,x) #define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n) -#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) +#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) #define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n) -#define mvinch(y,x) mvwinch(stdscr,y,x) +#define mvinch(y,x) mvwinch(stdscr,y,x) #define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n) #define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s) #define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) -#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) +#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) #define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n) #define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s) #define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s) #define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n) /* - * XSI curses macros for XPG4 conformance. - * The underlying functions needed to make these work are: - * waddnwstr(), waddchnwstr(), wadd_wch(), wborder_set(), wchgat(), - * wecho_wchar(), wgetn_wstr(), wget_wch(), whline_set(), vhline_set(), - * winnwstr(), wins_nwstr(), wins_wch(), win_wch(), win_wchnstr(). - * Except for wchgat(), these are not yet implemented. They will be someday. + * Some wide-character functions do not depend on the extensions. */ -#define add_wch(c) wadd_wch(stdscr,c) -#define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) -#define addwstr(wstr,n) waddnwstr(stdscr,wstr,-1) -#define attr_get(a,pair,opts) wattr_get(stdscr,a,pair,opts) -#define attr_off(a,opts) wattr_off(stdscr,a,opts) -#define attr_on(a,opts) wattr_on(stdscr,a,opts) -#define attr_set(a,pair,opts) wattr_set(stdscr,a,pair,opts) -#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) -#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) -#define echo_wchar(c) wecho_wchar(stdscr,c) -#define getbkgd(win) ((win)->_bkgd) -#define get_wch(c) wget_wch(stdscr,c) -#define get_wstr(t) wgetn_wstr(stdscr,t,-1) -#define getn_wstr(t,n) wgetn_wstr(stdscr,t,n) -#define hline_set(c,n) whline_set(stdscr,c,n) -#define in_wch(c) win_wch(stdscr,c) -#define in_wchnstr(c,n) win_wchnstr(stdscr,c,n) -#define in_wchstr(c) win_wchnstr(stdscr,c,-1) -#define innwstr(c,n) winnwstr(stdscr,c,n) -#define ins_nwstr(t,n) wins_nwstr(stdscr,t,n) -#define ins_wch(c) wins_wch(stdscr,c) -#define ins_wstr(t) wins_nwstr(stdscr,t,-1) -#define inwstr(c) winnwstr(stdscr,c,-1) - -#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c) -#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n) -#define mvaddwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,-1) -#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) -#define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c) -#define mvget_wstr(y,x,t) mvwgetn_wstr(stdscr,y,x,t,-1) -#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n) -#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n) -#define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c) -#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n) -#define mvin_wchstr(y,x,c) mvwin_wchnstr(stdscr,y,x,c,-1) -#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n) -#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n) -#define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c) -#define mvins_wstr(y,x,t) mvwins_nwstr(stdscr,y,x,t,-1) -#define mvinwstr(y,x,c) mvwinnwstr(stdscr,y,x,c,-1) -#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) - -#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(stdscr,c)) -#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,n)) -#define mvwaddwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,-1)) -#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) -#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) -#define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,-1)) -#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) -#define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) -#define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c)) -#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,n)) -#define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,-1)) -#define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,n)) -#define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,n)) -#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(stdscr,c)) -#define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,-1)) -#define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,-1)) -#define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) +#define getbkgd(win) ((win)->_bkgd) #define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a)) #define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) -#define vid_attr(a,pair,opts) vidattr(a) -#define vline_set(c,n) wvline_set(stdscr,c,n) -#define waddwstr(win,wstr,n) waddnwstr(win,wstr,-1) #define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \ (void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \ OK) -#define wget_wstr(w,t) wgetn_wstr(w,t,-1) -#define win_wchstr(w,c) win_wchnstr(w,c,-1) -#define wins_wstr(w,t) wins_nwstr(w,t,-1) -#define winwstr(w,c) winnwstr(w,c,-1) - /* * XSI curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use @@ -1145,228 +939,28 @@ extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* gene #define vw_scanw vwscanw /* + * Export fallback function for use in C++ binding. + */ +#if !@HAVE_VSSCANF@ +#define vsscanf(a,b,c) _nc_vsscanf(a,b,c) +NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); +#endif + +/* * Pseudo-character tokens outside ASCII range. The curses wgetch() function * will return any given one of these only if the corresponding k- capability * is defined in your terminal's terminfo entry. + * + * Some keys (KEY_A1, etc) are arranged like this: + * a1 up a3 + * left b2 right + * c1 down c3 + * + * A few key codes do not depend upon the terminfo entry. */ #define KEY_CODE_YES 0400 /* A wchar_t contains a key code */ #define KEY_MIN 0401 /* Minimum curses key */ -#define KEY_BREAK 0401 /* Break key (unreliable) */ -#define KEY_DOWN 0402 /* Down-arrow */ -#define KEY_UP 0403 /* Up-arrow */ -#define KEY_LEFT 0404 /* Left-arrow */ -#define KEY_RIGHT 0405 /* Right-arrow */ -#define KEY_HOME 0406 /* Home key (upward+left arrow) */ -#define KEY_BACKSPACE 0407 /* Backspace (unreliable) */ -#define KEY_F0 0410 /* Function keys. Space for 64 */ -#define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */ -#define KEY_DL 0510 /* Delete line */ -#define KEY_IL 0511 /* Insert line */ -#define KEY_DC 0512 /* Delete character */ -#define KEY_IC 0513 /* Insert char or enter insert mode */ -#define KEY_EIC 0514 /* Exit insert char mode */ -#define KEY_CLEAR 0515 /* Clear screen */ -#define KEY_EOS 0516 /* Clear to end of screen */ -#define KEY_EOL 0517 /* Clear to end of line */ -#define KEY_SF 0520 /* Scroll 1 line forward */ -#define KEY_SR 0521 /* Scroll 1 line backward (reverse) */ -#define KEY_NPAGE 0522 /* Next page */ -#define KEY_PPAGE 0523 /* Previous page */ -#define KEY_STAB 0524 /* Set tab */ -#define KEY_CTAB 0525 /* Clear tab */ -#define KEY_CATAB 0526 /* Clear all tabs */ -#define KEY_ENTER 0527 /* Enter or send (unreliable) */ -#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ -#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ -#define KEY_PRINT 0532 /* Print */ -#define KEY_LL 0533 /* Home down or bottom (lower left) */ - -/* The keypad is arranged like this: */ -/* a1 up a3 */ -/* left b2 right */ -/* c1 down c3 */ - -#define KEY_A1 0534 /* Upper left of keypad */ -#define KEY_A3 0535 /* Upper right of keypad */ -#define KEY_B2 0536 /* Center of keypad */ -#define KEY_C1 0537 /* Lower left of keypad */ -#define KEY_C3 0540 /* Lower right of keypad */ -#define KEY_BTAB 0541 /* Back tab */ -#define KEY_BEG 0542 /* Beg (beginning) */ -#define KEY_CANCEL 0543 /* Cancel */ -#define KEY_CLOSE 0544 /* Close */ -#define KEY_COMMAND 0545 /* Cmd (command) */ -#define KEY_COPY 0546 /* Copy */ -#define KEY_CREATE 0547 /* Create */ -#define KEY_END 0550 /* End */ -#define KEY_EXIT 0551 /* Exit */ -#define KEY_FIND 0552 /* Find */ -#define KEY_HELP 0553 /* Help */ -#define KEY_MARK 0554 /* Mark */ -#define KEY_MESSAGE 0555 /* Message */ -#define KEY_MOVE 0556 /* Move */ -#define KEY_NEXT 0557 /* Next */ -#define KEY_OPEN 0560 /* Open */ -#define KEY_OPTIONS 0561 /* Options */ -#define KEY_PREVIOUS 0562 /* Prev (previous) */ -#define KEY_REDO 0563 /* Redo */ -#define KEY_REFERENCE 0564 /* Ref (reference) */ -#define KEY_REFRESH 0565 /* Refresh */ -#define KEY_REPLACE 0566 /* Replace */ -#define KEY_RESTART 0567 /* Restart */ -#define KEY_RESUME 0570 /* Resume */ -#define KEY_SAVE 0571 /* Save */ -#define KEY_SBEG 0572 /* Shifted Beg (beginning) */ -#define KEY_SCANCEL 0573 /* Shifted Cancel */ -#define KEY_SCOMMAND 0574 /* Shifted Command */ -#define KEY_SCOPY 0575 /* Shifted Copy */ -#define KEY_SCREATE 0576 /* Shifted Create */ -#define KEY_SDC 0577 /* Shifted Delete char */ -#define KEY_SDL 0600 /* Shifted Delete line */ -#define KEY_SELECT 0601 /* Select */ -#define KEY_SEND 0602 /* Shifted End */ -#define KEY_SEOL 0603 /* Shifted Clear line */ -#define KEY_SEXIT 0604 /* Shifted Dxit */ -#define KEY_SFIND 0605 /* Shifted Find */ -#define KEY_SHELP 0606 /* Shifted Help */ -#define KEY_SHOME 0607 /* Shifted Home */ -#define KEY_SIC 0610 /* Shifted Input */ -#define KEY_SLEFT 0611 /* Shifted Left arrow */ -#define KEY_SMESSAGE 0612 /* Shifted Message */ -#define KEY_SMOVE 0613 /* Shifted Move */ -#define KEY_SNEXT 0614 /* Shifted Next */ -#define KEY_SOPTIONS 0615 /* Shifted Options */ -#define KEY_SPREVIOUS 0616 /* Shifted Prev */ -#define KEY_SPRINT 0617 /* Shifted Print */ -#define KEY_SREDO 0620 /* Shifted Redo */ -#define KEY_SREPLACE 0621 /* Shifted Replace */ -#define KEY_SRIGHT 0622 /* Shifted Right arrow */ -#define KEY_SRSUME 0623 /* Shifted Resume */ -#define KEY_SSAVE 0624 /* Shifted Save */ -#define KEY_SSUSPEND 0625 /* Shifted Suspend */ -#define KEY_SUNDO 0626 /* Shifted Undo */ -#define KEY_SUSPEND 0627 /* Suspend */ -#define KEY_UNDO 0630 /* Undo */ -#define KEY_MOUSE 0631 /* Mouse event has occurred */ +#define KEY_BREAK 0401 /* Break key (unreliable) */ +#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ +#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ #define KEY_RESIZE 0632 /* Terminal resize event */ -#define KEY_MAX 0777 /* Maximum key value */ - -/* mouse interface */ -#define NCURSES_MOUSE_VERSION 1 - -/* event masks */ -#define BUTTON1_RELEASED 000000000001L -#define BUTTON1_PRESSED 000000000002L -#define BUTTON1_CLICKED 000000000004L -#define BUTTON1_DOUBLE_CLICKED 000000000010L -#define BUTTON1_TRIPLE_CLICKED 000000000020L -#define BUTTON1_RESERVED_EVENT 000000000040L -#define BUTTON2_RELEASED 000000000100L -#define BUTTON2_PRESSED 000000000200L -#define BUTTON2_CLICKED 000000000400L -#define BUTTON2_DOUBLE_CLICKED 000000001000L -#define BUTTON2_TRIPLE_CLICKED 000000002000L -#define BUTTON2_RESERVED_EVENT 000000004000L -#define BUTTON3_RELEASED 000000010000L -#define BUTTON3_PRESSED 000000020000L -#define BUTTON3_CLICKED 000000040000L -#define BUTTON3_DOUBLE_CLICKED 000000100000L -#define BUTTON3_TRIPLE_CLICKED 000000200000L -#define BUTTON3_RESERVED_EVENT 000000400000L -#define BUTTON4_RELEASED 000001000000L -#define BUTTON4_PRESSED 000002000000L -#define BUTTON4_CLICKED 000004000000L -#define BUTTON4_DOUBLE_CLICKED 000010000000L -#define BUTTON4_TRIPLE_CLICKED 000020000000L -#define BUTTON4_RESERVED_EVENT 000040000000L -#define BUTTON_CTRL 000100000000L -#define BUTTON_SHIFT 000200000000L -#define BUTTON_ALT 000400000000L -#define ALL_MOUSE_EVENTS 000777777777L -#define REPORT_MOUSE_POSITION 001000000000L - -/* macros to extract single event-bits from masks */ -#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1)))) -#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1)))) -#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1)))) -#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1)))) -#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1)))) -#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1)))) - -typedef unsigned long mmask_t; - -typedef struct -{ - short id; /* ID to distinguish multiple devices */ - int x, y, z; /* event coordinates (character-cell) */ - mmask_t bstate; /* button state bits */ -} -MEVENT; - -extern NCURSES_EXPORT(int) getmouse (MEVENT *); -extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); -extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); -extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); -extern NCURSES_EXPORT(int) mouseinterval (int); -extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW* win,int* y, int* x, bool to_screen); - -#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) - -/* other non-XSI functions */ - -extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ -extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ - -/* Debugging : use with libncurses_g.a */ - -extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); -extern NCURSES_EXPORT(char *) _traceattr (attr_t); -extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); -extern NCURSES_EXPORT(char *) _nc_tracebits (void); -extern NCURSES_EXPORT(char *) _tracechar (const unsigned char); -extern NCURSES_EXPORT(char *) _tracechtype (chtype); -extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); -extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); -extern NCURSES_EXPORT(void) trace (const unsigned int); - -/* trace masks */ -#define TRACE_DISABLE 0x0000 /* turn off tracing */ -#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ -#define TRACE_TPUTS 0x0002 /* trace tputs calls */ -#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ -#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ -#define TRACE_CHARPUT 0x0010 /* trace all character outputs */ -#define TRACE_ORDINARY 0x001F /* trace all update actions */ -#define TRACE_CALLS 0x0020 /* trace all curses calls */ -#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ -#define TRACE_IEVENT 0x0080 /* trace low-level input processing */ -#define TRACE_BITS 0x0100 /* trace state of TTY control bits */ -#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ -#define TRACE_CCALLS 0x0400 /* trace per-character calls */ -#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ -#define TRACE_ATTRS 0x1000 /* trace attribute updates */ -#define TRACE_MAXIMUM 0xffff /* maximum trace level */ - -#if defined(TRACE) || defined(NCURSES_TEST) -extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ -extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); -#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ -#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ -#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ -#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ -#endif - -#ifdef __cplusplus - -/* these names conflict with STL */ -#undef box -#undef clear -#undef erase -#undef move -#undef refresh - -} -#endif - -#endif /* __NCURSES_H */ diff --git a/contrib/ncurses/include/curses.tail b/contrib/ncurses/include/curses.tail new file mode 100644 index 0000000..589a2ad --- /dev/null +++ b/contrib/ncurses/include/curses.tail @@ -0,0 +1,134 @@ +/* $Id: curses.tail,v 1.5 2001/12/30 00:01:16 tom Exp $ */ + +/* mouse interface */ +#define NCURSES_MOUSE_VERSION 1 + +/* event masks */ +#define BUTTON1_RELEASED 000000000001L +#define BUTTON1_PRESSED 000000000002L +#define BUTTON1_CLICKED 000000000004L +#define BUTTON1_DOUBLE_CLICKED 000000000010L +#define BUTTON1_TRIPLE_CLICKED 000000000020L +#define BUTTON1_RESERVED_EVENT 000000000040L +#define BUTTON2_RELEASED 000000000100L +#define BUTTON2_PRESSED 000000000200L +#define BUTTON2_CLICKED 000000000400L +#define BUTTON2_DOUBLE_CLICKED 000000001000L +#define BUTTON2_TRIPLE_CLICKED 000000002000L +#define BUTTON2_RESERVED_EVENT 000000004000L +#define BUTTON3_RELEASED 000000010000L +#define BUTTON3_PRESSED 000000020000L +#define BUTTON3_CLICKED 000000040000L +#define BUTTON3_DOUBLE_CLICKED 000000100000L +#define BUTTON3_TRIPLE_CLICKED 000000200000L +#define BUTTON3_RESERVED_EVENT 000000400000L +#define BUTTON4_RELEASED 000001000000L +#define BUTTON4_PRESSED 000002000000L +#define BUTTON4_CLICKED 000004000000L +#define BUTTON4_DOUBLE_CLICKED 000010000000L +#define BUTTON4_TRIPLE_CLICKED 000020000000L +#define BUTTON4_RESERVED_EVENT 000040000000L +#define BUTTON_CTRL 000100000000L +#define BUTTON_SHIFT 000200000000L +#define BUTTON_ALT 000400000000L +#define ALL_MOUSE_EVENTS 000777777777L +#define REPORT_MOUSE_POSITION 001000000000L + +/* macros to extract single event-bits from masks */ +#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1)))) +#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1)))) +#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1)))) +#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1)))) +#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1)))) +#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1)))) + +typedef unsigned long mmask_t; + +typedef struct +{ + short id; /* ID to distinguish multiple devices */ + int x, y, z; /* event coordinates (character-cell) */ + mmask_t bstate; /* button state bits */ +} +MEVENT; + +extern NCURSES_EXPORT(int) getmouse (MEVENT *); +extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); +extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); +extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); +extern NCURSES_EXPORT(int) mouseinterval (int); +extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW* win,int* y, int* x, bool to_screen); +extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ + +#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) + +/* other non-XSI functions */ + +extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ +extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ + +/* Debugging : use with libncurses_g.a */ + +extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); +extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); +extern NCURSES_EXPORT(char *) _traceattr (attr_t); +extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); +extern NCURSES_EXPORT(char *) _nc_tracebits (void); +extern NCURSES_EXPORT(char *) _tracechar (int); +extern NCURSES_EXPORT(char *) _tracechtype (chtype); +extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); +#ifdef _XOPEN_SOURCE_EXTENDED +#define _tracech_t _tracecchar_t +extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); +#define _tracech_t2 _tracecchar_t2 +extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *); +#else +#define _tracech_t _tracechtype +#define _tracech_t2 _tracechtype2 +#endif +extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); +extern NCURSES_EXPORT(void) trace (const unsigned int); + +/* trace masks */ +#define TRACE_DISABLE 0x0000 /* turn off tracing */ +#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ +#define TRACE_TPUTS 0x0002 /* trace tputs calls */ +#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ +#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ +#define TRACE_CHARPUT 0x0010 /* trace all character outputs */ +#define TRACE_ORDINARY 0x001F /* trace all update actions */ +#define TRACE_CALLS 0x0020 /* trace all curses calls */ +#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ +#define TRACE_IEVENT 0x0080 /* trace low-level input processing */ +#define TRACE_BITS 0x0100 /* trace state of TTY control bits */ +#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ +#define TRACE_CCALLS 0x0400 /* trace per-character calls */ +#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ +#define TRACE_ATTRS 0x1000 /* trace attribute updates */ +#define TRACE_MAXIMUM 0xffff /* maximum trace level */ + +#if defined(TRACE) || defined(NCURSES_TEST) +extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ +#ifdef _XOPEN_SOURCE_EXTENDED +extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); +#endif +extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); +#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ +#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ +#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ +#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ +#endif + +#ifdef __cplusplus + +/* these names conflict with STL */ +#undef box +#undef clear +#undef erase +#undef move +#undef refresh + +} +#endif + +#endif /* __NCURSES_H */ diff --git a/contrib/ncurses/include/curses.wide b/contrib/ncurses/include/curses.wide new file mode 100644 index 0000000..c557754 --- /dev/null +++ b/contrib/ncurses/include/curses.wide @@ -0,0 +1,237 @@ + +#ifdef _XOPEN_SOURCE_EXTENDED + +/* $Id: curses.wide,v 1.23 2002/05/11 22:25:33 tom Exp $ */ + +extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; + +#define WACS_BSSB (&_nc_wacs['l']) +#define WACS_SSBB (&_nc_wacs['m']) +#define WACS_BBSS (&_nc_wacs['k']) +#define WACS_SBBS (&_nc_wacs['j']) +#define WACS_SBSS (&_nc_wacs['u']) +#define WACS_SSSB (&_nc_wacs['t']) +#define WACS_SSBS (&_nc_wacs['v']) +#define WACS_BSSS (&_nc_wacs['w']) +#define WACS_BSBS (&_nc_wacs['q']) +#define WACS_SBSB (&_nc_wacs['x']) +#define WACS_SSSS (&_nc_wacs['n']) + +#define WACS_ULCORNER WACS_BSSB +#define WACS_LLCORNER WACS_SSBB +#define WACS_URCORNER WACS_BBSS +#define WACS_LRCORNER WACS_SBBS +#define WACS_RTEE WACS_SBSS +#define WACS_LTEE WACS_SSSB +#define WACS_BTEE WACS_SSBS +#define WACS_TTEE WACS_BSSS +#define WACS_HLINE WACS_BSBS +#define WACS_VLINE WACS_SBSB +#define WACS_PLUS WACS_SSSS + +#define WACS_S1 (&_nc_wacs['o']) /* scan line 1 */ +#define WACS_S9 (&_nc_wacs['s']) /* scan line 9 */ +#define WACS_DIAMOND (&_nc_wacs['`']) /* diamond */ +#define WACS_CKBOARD (&_nc_wacs['a']) /* checker board */ +#define WACS_DEGREE (&_nc_wacs['f']) /* degree symbol */ +#define WACS_PLMINUS (&_nc_wacs['g']) /* plus/minus */ +#define WACS_BULLET (&_nc_wacs['~']) /* bullet */ + + /* Teletype 5410v1 symbols */ +#define WACS_LARROW (&_nc_wacs[',']) /* arrow left */ +#define WACS_RARROW (&_nc_wacs['+']) /* arrow right */ +#define WACS_DARROW (&_nc_wacs['.']) /* arrow down */ +#define WACS_UARROW (&_nc_wacs['-']) /* arrow up */ +#define WACS_BOARD (&_nc_wacs['h']) /* board of squares */ +#define WACS_LANTERN (&_nc_wacs['i']) /* lantern symbol */ +#define WACS_BLOCK (&_nc_wacs['0']) /* solid square block */ + + /* ncurses extensions */ +#define WACS_S3 (&_nc_wacs['p']) /* scan line 3 */ +#define WACS_S7 (&_nc_wacs['r']) /* scan line 7 */ +#define WACS_LEQUAL (&_nc_wacs['y']) /* less/equal */ +#define WACS_GEQUAL (&_nc_wacs['z']) /* greater/equal */ +#define WACS_PI (&_nc_wacs['{']) /* Pi */ +#define WACS_NEQUAL (&_nc_wacs['|']) /* not equal */ +#define WACS_STERLING (&_nc_wacs['}']) /* UK pound sign */ + +/* + * Function prototypes for wide-character operations. + * + * "generated" comments should include ":WIDEC" to make the corresponding + * functions ifdef'd in lib_gen.c + * + * "implemented" comments do not need this marker. + */ + +extern NCURSES_EXPORT(int) add_wch (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) erasewchar (wchar_t*); /* implemented:WIDEC */ +extern NCURSES_EXPORT(int) get_wch (wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) get_wstr (wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*); /* implemented */ +extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wch (NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wchnstr (NCURSES_CONST cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wchstr (NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) innwstr (wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_wch (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) inwstr (wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(char*) key_name (wchar_t); /* implemented */ +extern NCURSES_EXPORT(int) killwchar (wchar_t *); /* implemented:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wch (int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, NCURSES_CONST cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wchstr (int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, NCURSES_CONST cchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *); /* missing */ +extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* implemented */ +extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* missing */ +extern NCURSES_EXPORT(attr_t) term_attrs (void); /* implemented:WIDEC */ +extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* implemented:WIDEC */ +extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* implemented:WIDEC */ +extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented:WIDEC */ +extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int); /* implemented */ +extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int); /* implemented */ +extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* implemented */ +extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *); /* implemented */ +extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) win_wch (WINDOW *, NCURSES_CONST cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, NCURSES_CONST cchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, NCURSES_CONST cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* implemented */ +extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* implemented */ + +/* + * XSI curses macros for XPG4 conformance. + */ +#define add_wch(c) wadd_wch(stdscr,c) +#define add_wchnstr(str,n) wadd_wchnstr(stdscr,str,n) +#define add_wchstr(str) wadd_wchstr(stdscr,str) +#define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) +#define addwstr(wstr) waddwstr(stdscr,wstr) +#define bkgrnd(c) wbkgrnd(stdscr,c) +#define bkgrndset(c) wbkgrndset(stdscr,c) +#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,l,r,t,b,tl,tr,bl,br) +#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) +#define echo_wchar(c) wecho_wchar(stdscr,c) +#define get_wch(c) wget_wch(stdscr,c) +#define get_wstr(t) wget_wstr(stdscr,t) +#define getbkgrnd(wch) wgetbkgrnd(stdscr,wch) +#define getn_wstr(t,n) wgetn_wstr(stdscr,t,n) +#define hline_set(c,n) whline_set(stdscr,c,n) +#define in_wch(c) win_wch(stdscr,c) +#define in_wchnstr(c,n) win_wchnstr(stdscr,c,n) +#define in_wchstr(c) win_wchstr(stdscr,c) +#define innwstr(c,n) winnwstr(stdscr,c,n) +#define ins_nwstr(t,n) wins_nwstr(stdscr,t,n) +#define ins_wch(c) wins_wch(stdscr,c) +#define ins_wstr(t) wins_wstr(stdscr,t) +#define inwstr(c) winwstr(stdscr,c) +#define vid_attr(a,pair,opts) vidattr(a) +#define vline_set(c,n) wvline_set(stdscr,c,n) +#define wadd_wchstr(win,str) wadd_wchnstr(win,str,-1) +#define waddwstr(win,wstr) waddnwstr(win,wstr,-1) +#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK) +#define wget_wstr(w,t) wgetn_wstr(w,t,-1) +#define wgetbkgrnd(win,wch) (*wch = win->_bkgrnd, OK) +#define win_wchstr(w,c) win_wchnstr(w,c,-1) +#define wins_wstr(w,t) wins_nwstr(w,t,-1) + +#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c) +#define mvadd_wchnstr(y,x,s,n) mvwadd_wchnstr(stdscr,y,x,s,n) +#define mvadd_wchstr(y,x,s) mvwadd_wchstr(stdscr,y,x,s) +#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n) +#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr) +#define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c) +#define mvget_wstr(y,x,t) mvwget_wstr(stdscr,y,x,t) +#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n) +#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n) +#define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c) +#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n) +#define mvin_wchstr(y,x,c) mvwin_wchstr(stdscr,y,x,c) +#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n) +#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n) +#define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c) +#define mvins_wstr(y,x,t) mvwins_wstr(stdscr,y,x,t) +#define mvinwstr(y,x,c) mvwinwstr(stdscr,y,x,c) +#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) + +#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(win,c)) +#define mvwadd_wchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : wadd_wchnstr(win,s,n)) +#define mvwadd_wchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : wadd_wchstr(win,s)) +#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(win,wstr,n)) +#define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr)) +#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) +#define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wget_wstr(win,t)) +#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) +#define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) +#define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c)) +#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(win,c,n)) +#define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchstr(win,c)) +#define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(win,c,n)) +#define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(win,t,n)) +#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(win,c)) +#define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_wstr(win,t)) +#define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winwstr(win,c)) +#define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) + +#endif /* _XOPEN_SOURCE_EXTENDED */ diff --git a/contrib/ncurses/include/edit_cfg.sh b/contrib/ncurses/include/edit_cfg.sh index ef9694c..8d64fee 100755 --- a/contrib/ncurses/include/edit_cfg.sh +++ b/contrib/ncurses/include/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.10 2000/09/09 20:29:58 tom Exp $ +# $Id: edit_cfg.sh,v 1.12 2001/12/23 00:52:40 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 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,18 +48,20 @@ do mv $2 $BAK if ( grep "[ ]$name[ ]" $1 2>&1 >$TMP ) then - sed -e 's@#define '$name'.*$@'"`cat $TMP`@" $BAK >$2 - elif test "$name" = "NCURSES_CONST" ; then - sed -e 's/define '$name'.*$/define '$name' \/\*nothing\*\//' $BAK >$2 + value=1 else - sed -e 's/define '$name'.*$/define '$name' 0/' $BAK >$2 + value=0 fi + echo '** edit: '$name $value + sed \ + -e "s@#define ${name}.*\$@#define $name $value@" \ + -e "s@#if $name\$@#if $value /* $name */@" \ + -e "s@#if !$name\$@#if $value /* !$name */@" \ + $BAK >$2 if (cmp -s $2 $BAK) then - echo '** same: '$name mv $BAK $2 else - echo '** edit: '$name rm -f $BAK fi done diff --git a/contrib/ncurses/include/nc_alloc.h b/contrib/ncurses/include/nc_alloc.h index 5ac5a78..c7317a0 100644 --- a/contrib/ncurses/include/nc_alloc.h +++ b/contrib/ncurses/include/nc_alloc.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 * ****************************************************************************/ -/* $Id: nc_alloc.h,v 1.8 2000/04/08 23:42:57 tom Exp $ */ +/* $Id: nc_alloc.h,v 1.10 2001/12/08 23:49:44 tom Exp $ */ #ifndef NC_ALLOC_included #define NC_ALLOC_included 1 @@ -66,14 +66,14 @@ extern void _nc_leaks_dump_entry(void); #endif #ifndef ExitProgram -#define ExitProgram(code) return code +#define ExitProgram(code) exit(code) #endif /* doalloc.c */ -extern void *_nc_doalloc(void *, size_t); +extern NCURSES_EXPORT(void *) _nc_doalloc(void *, size_t); #if !HAVE_STRDUP #define strdup _nc_strdup -extern char *_nc_strdup(const char *); +extern NCURSES_EXPORT(char *) _nc_strdup(const char *); #endif #define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type)) diff --git a/contrib/ncurses/include/ncurses_defs b/contrib/ncurses/include/ncurses_defs index 76bfcae..f4c46cb 100644 --- a/contrib/ncurses/include/ncurses_defs +++ b/contrib/ncurses/include/ncurses_defs @@ -1,6 +1,6 @@ -# $Id: ncurses_defs,v 1.7 2001/04/07 22:53:10 tom Exp $ +# $Id: ncurses_defs,v 1.14 2002/05/11 19:18:32 tom Exp $ ############################################################################## -# Copyright (c) 2000 Free Software Foundation, Inc. # +# Copyright (c) 2000-2001,2002 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"), # @@ -37,6 +37,8 @@ CC_HAS_INLINE_FUNCS CC_HAS_PROTOS CPP_HAS_PARAM_INIT CPP_HAS_VSCAN_FUNC +CURSES_ACS_ARRAY acs_map +CURSES_WACS_ARRAY _nc_wacs DECL_ERRNO ETIP_NEEDS_MATH_H GCC_NORETURN /* nothing */ @@ -51,6 +53,7 @@ HAVE_FORM_H HAVE_GETCWD HAVE_GETEGID HAVE_GETEUID +HAVE_GETNSTR HAVE_GETOPT_H HAVE_GETTIMEOFDAY HAVE_GETTTYNAM @@ -109,6 +112,7 @@ HAVE_TERMIO_H HAVE_TIMES HAVE_TTYENT_H HAVE_TYPEINFO +HAVE_TYPE_ATTR_T HAVE_TYPE_SIGACTION HAVE_UNISTD_H HAVE_UNLINK @@ -118,11 +122,13 @@ HAVE_VSNPRINTF HAVE_VSSCANF HAVE_WORKING_POLL HAVE_WRESIZE +HAVE__DOSCAN MIXEDCASE_FILENAMES NCURSES_EXPANDED NCURSES_EXT_FUNCS NCURSES_NOMACROS NCURSES_NO_PADDING +NCURSES_PATHSEP ':' NDEBUG NEED_PTEM_H NO_LEAKS @@ -133,6 +139,8 @@ SVR4_ACTION SVR4_TERMIO SYSTEM_NAME "unknown" TERMINFO "none" +TERMPATH "none" +TIME_WITH_SYS_TIME TYPEOF_CHTYPE USE_COLORFGBG USE_DATABASE @@ -149,6 +157,8 @@ USE_SCROLL_HINTS USE_SIGWINCH USE_STDIO_VSCAN USE_STRSTREAM_VSCAN +USE_STRSTREAM_VSCAN_CAST USE_SYMLINKS +USE_TERMCAP USE_WIDEC_SUPPORT USE_XMC_SUPPORT diff --git a/contrib/ncurses/include/ncurses_dll.h b/contrib/ncurses/include/ncurses_dll.h index 723d21e..c961c3e 100644 --- a/contrib/ncurses/include/ncurses_dll.h +++ b/contrib/ncurses/include/ncurses_dll.h @@ -1,5 +1,10 @@ -/* $Id: ncurses_dll.h,v 1.1 2000/12/10 00:05:35 tom Exp $ */ +/* $Id: ncurses_dll.h,v 1.2 2001/12/09 01:36:34 tom Exp $ */ +#ifndef NCURSES_DLL_H_incl +#define NCURSES_DLL_H_incl 1 + +#undef NCURSES_DLL /* cygwin dll not implemented */ +#define NCURSES_STATIC /* cygwin dll not implemented */ #if defined(__CYGWIN__) # if defined(NCURSES_DLL) @@ -39,3 +44,5 @@ #if !defined(NCURSES_EXPORT_VAR) # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type #endif + +#endif /* NCURSES_DLL_H_incl */ diff --git a/contrib/ncurses/include/tic.h b/contrib/ncurses/include/tic.h index ff35c04..c4e7dfd 100644 --- a/contrib/ncurses/include/tic.h +++ b/contrib/ncurses/include/tic.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2001 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 * @@ -32,7 +32,7 @@ ****************************************************************************/ /* - * $Id: tic.h,v 1.38 2001/03/11 15:12:08 tom Exp $ + * $Id: tic.h,v 1.40 2001/08/12 00:45:57 tom Exp $ * tic.h - Global variables and structures for the terminfo * compiler. */ @@ -216,16 +216,16 @@ extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_tabl #define NOTFOUND ((struct name_table_entry *) 0) /* out-of-band values for representing absent capabilities */ -#define ABSENT_BOOLEAN -1 -#define ABSENT_NUMERIC -1 +#define ABSENT_BOOLEAN (-1) /* 255 */ +#define ABSENT_NUMERIC (-1) #define ABSENT_STRING (char *)0 /* out-of-band values for representing cancels */ -#define CANCELLED_BOOLEAN (char)(-2) -#define CANCELLED_NUMERIC -2 -#define CANCELLED_STRING (char *)-1 +#define CANCELLED_BOOLEAN (char)(-2) /* 254 */ +#define CANCELLED_NUMERIC (-2) +#define CANCELLED_STRING (char *)(-1) -#define VALID_BOOLEAN(s) ((s) >= 0) +#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */ #define VALID_NUMERIC(s) ((s) >= 0) #define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) @@ -241,6 +241,7 @@ extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_tabl /* access.c */ extern NCURSES_EXPORT(char *) _nc_basename (char *); +extern NCURSES_EXPORT(char *) _nc_rootname (char *); /* comp_hash.c: name lookup */ extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry diff --git a/contrib/ncurses/man/MKterminfo.sh b/contrib/ncurses/man/MKterminfo.sh index d4e25c5..d9d8c82 100755 --- a/contrib/ncurses/man/MKterminfo.sh +++ b/contrib/ncurses/man/MKterminfo.sh @@ -1,6 +1,6 @@ #!/bin/sh #*************************************************************************** -# Copyright (c) 1998-2000 Free Software Foundation, Inc. * +# Copyright (c) 1998,2000,2001 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: MKterminfo.sh,v 1.6 2000/01/25 11:31:57 tom Exp $ +# $Id: MKterminfo.sh,v 1.9 2001/09/01 23:06:18 tom Exp $ # # MKterminfo.sh -- generate terminfo.5 from Caps tabular data # @@ -68,8 +68,9 @@ sed -n <$caps "\ /%%-STOP-HERE-%%/q /^#%/s///p /^#/d +s/[ ]\+/ /g s/$/T}/ -s/ [Y\-][B\-][C\-][G\-][E\-]\** / T{/ +s/ [A-Z0-9_()\-]\+ [0-9\-]\+ [Y\-][B\-][C\-][G\-][EK\-]\** / T{/ s/ bool / /p s/ num / /p s/ str / /p @@ -80,6 +81,7 @@ rm -f $temp saved=no while true do + data= read data test -z "$data" && break case "$data" in #(vi diff --git a/contrib/ncurses/man/Makefile.in b/contrib/ncurses/man/Makefile.in index 0d7648a..56dbe09 100644 --- a/contrib/ncurses/man/Makefile.in +++ b/contrib/ncurses/man/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.28 2000/08/19 19:15:44 tom Exp $ +# $Id: Makefile.in,v 1.33 2002/01/19 22:49:44 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001,2002 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"), # @@ -47,10 +47,11 @@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ all \ -sources: terminfo.5 +sources : terminfo.5 +depend : $(DESTDIR)$(mandir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]* @@ -61,15 +62,18 @@ uninstall uninstall.man : -sh ./edit_man.sh removing $(EDITARGS) # We compose terminfo.5 from the real sources... -CAPLIST=$(srcdir)/../include/Caps +CAPLIST=$(srcdir)/../include/@TERMINFO_CAPS@ terminfo.5: $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail Makefile $(srcdir)/MKterminfo.sh sh $(srcdir)/MKterminfo.sh $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail >terminfo.5 mostlyclean : - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.ln *.atac trace clean: mostlyclean rm -f terminfo.5 +edit_man.sed : make_sed.sh @MANPAGE_RENAMES@ + sh $srcdir/make_sed.sh @MANPAGE_RENAMES@ >edit_man.sed + distclean realclean: clean rm -f Makefile edit_man.* diff --git a/contrib/ncurses/man/curs_add_wch.3x b/contrib/ncurses/man/curs_add_wch.3x new file mode 100644 index 0000000..fae59ae --- /dev/null +++ b/contrib/ncurses/man/curs_add_wch.3x @@ -0,0 +1,134 @@ +.\"*************************************************************************** +.\" Copyright (c) 2001,2002 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: curs_add_wch.3x,v 1.4 2002/02/16 22:28:43 tom Exp $ +.TH curs_add_wch 3X "" +.SH NAME +\fBadd_wch\fP, +\fBwadd_wch\fP, +\fBmvadd_wch\fP, +\fBmvwadd_wch\fP, +\fBecho_wchar\fP, +\fBwecho_wchar\fP - add a complex character and rendition to a \fBcurses\fR window, then advance the cursor +.SH SYNOPSIS +.PP +\fB#include <curses.h>\fP +.sp +.B "int add_wch( const cchar_t *\fIwch\fB );" +.br +.B "int wadd_wch( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );" +.br +.B "int mvadd_wch( int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );" +.br +.B "int mvwadd_wch( WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );" +.br +.B "int echo_wchar( const cchar_t *\fIwch\fB );" +.br +.B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );" +.br +.SH DESCRIPTION +.PP +The +\fBadd_wch\fP, +\fBwadd_wch\fP, +\fBmvadd_wch\fP, and +\fBmvwadd_wch\fP +functions put the complex character \fIwch\fP into the given +window at its current position, +which is then advanced. +These functions perform +wrapping and special-character processing as follows: +.TP 5 +- +If \fIwch\fP refers to a spacing character, +then any previous character at that location is removed. +A new character specified by \fIwch\fP is +placed at that location with rendition specified by \fIwch\fP. +The cursor then advances to +the next spacing character on the screen. +.TP 5 +- +If \fIwch\fP refers to a non-spacing character, +all previous characters at that location are preserved. +The non-spacing characters of \fIwch\fP +are added to the spacing complex character, +and the rendition specified by \fIwch\fP is ignored. +.TP 5 +- +If the character part of \fIwch\fP is +a tab, newline, backspace or other control character, +the window is updated and the cursor moves as if \fBaddch\fR(3X) were called. +.PP +The \fBecho_wchar\fP +function is functionally equivalent to a call to +\fBadd_wch\fP +followed by a call to +\fBrefresh\fP. +Similarly, the +\fBwecho_wchar\fP +is functionally equivalent to a call to +\fBwadd_wch\fP +followed by a call to +\fBwrefresh\fP. +The knowledge +that only a single character is being output is taken into consideration and, +for non-control characters, a considerable performance gain might be seen +by using the *\fBecho\fP* functions instead of their equivalents. +.SH RETURN VALUES +.PP +All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. +.SH NOTES +.PP +Note that +\fBadd_wch\fP, +\fBmvadd_wch\fP, +\fBmvwadd_wch\fP, and +\fBecho_wchar\fP +may be macros. +.SH PORTABILITY +.PP +All these functions are described in the XSI Curses standard, Issue 4. +The defaults specified for forms-drawing characters apply in the POSIX locale. +.PP +XSI documents constants beginning with \fBWACS_\fP which are used for +line-drawing. +Those are not currently implemented in \fBncurses\fP. +.SH SEE ALSO +.PP +\fBcurses\fR(3X), +\fBcurs_attr_get\fR(3X), +\fBcurs_clear\fR(3X), +\fBcurs_outopts\fR(3X), +\fBcurs_refresh\fR(3X), +\fBputwc\fR(3) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_add_wchstr.3x b/contrib/ncurses/man/curs_add_wchstr.3x new file mode 100644 index 0000000..17d3446 --- /dev/null +++ b/contrib/ncurses/man/curs_add_wchstr.3x @@ -0,0 +1,98 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_add_wchstr.3x,v 1.1 2002/02/23 22:15:55 tom Exp $ +.TH curs_add_wchstr 3X "" +.SH NAME +.PP +\fBadd_wchstr\fR, +\fBadd_wchnstr\fR, +\fBwadd_wchstr\fR, +\fBwadd_wchnstr\fR, +\fBmvadd_wchstr\fR, +\fBmvadd_wchnstr\fR, +\fBmvwadd_wchstr\fR, +\fBmvwadd_wchnstr\fR \- add an array of complex characters (and attributes) to a curses window +.SH SYNOPSIS +.B #include <curses.h> + +.nf +\fBint add_wchstr(const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint add_wchnstr(const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint wadd_wchstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint wadd_wchnstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvadd_wchstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvadd_wchnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwadd_wchstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvwadd_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines copy the array of complex characters \fIwchstr\fR +into the window image structure at and after the current cursor position. +The four routines with \fIn\fR as the last +argument copy at most \fIn\fR elements, but no more than will fit on the line. +If \fBn\fR=\fB-1\fR then the whole array is copied, +to the maximum number of characters that will fit on the line. +.PP +The window cursor is \fInot\fR advanced. +These routines work faster than \fBwaddnstr\fR. +On the other hand, they do not perform checking +(such as for the newline, backspace, or carriage return characters), +they do not advance the current cursor position, +they do not expand other control characters to ^-escapes, +and they truncate the string if it crosses the right margin, +rather then wrapping it around to the new line. +.PP +These routines end successfully +on encountering a null \fIcchar_t\fR, or +when they have filled the current line. +If a complex character cannot completely fit at the end of the current line, +the remaining columns are filled with the background character and rendition. +.SH NOTES +All functions except \fBwadd_wchnstr\fR may be macros. +.SH RETURN VALUES +All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. +.SH PORTABILITY +All these entry points are described in the XSI Curses standard, Issue 4. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_addchstr\fR(3X) +\fBcurs_addwstr\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_addstr.3x b/contrib/ncurses/man/curs_addstr.3x index 6b74452..a845acb 100644 --- a/contrib/ncurses/man/curs_addstr.3x +++ b/contrib/ncurses/man/curs_addstr.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_addstr.3x,v 1.9 2000/07/01 19:54:05 tom Exp $ +.\" $Id: curs_addstr.3x,v 1.10 2002/03/09 23:09:29 tom Exp $ .TH curs_addstr 3X "" .SH NAME \fBaddstr\fR, @@ -38,29 +38,34 @@ \fBmvwaddstr\fR, \fBmvwaddnstr\fR - add a string of characters to a \fBcurses\fR window and advance cursor .SH SYNOPSIS +.nf \fB#include <curses.h>\fR -\fBint addstr(const char *str);\fR +\fBint addstr(const char *\fR\fIstr\fR\fB);\fR .br -\fBint addnstr(const char *str, int n);\fR +\fBint addnstr(const char *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR .br -\fBint waddstr(WINDOW *win, const char *str);\fR +\fBint waddstr(WINDOW *\fR\fIwin\fR\fB, const char *\fR\fIstr\fR\fB);\fR .br -\fBint waddnstr(WINDOW *win, const char *str, int n);\fR +\fBint waddnstr(WINDOW *\fR\fIwin\fR\fB, const char *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR .br -\fBint mvaddstr(int y, int x, const char *str);\fR +\fBint mvaddstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr\fR\fB);\fR .br -\fBint mvaddnstr(int y, int x, const char *str, int n);\fR +\fBint mvaddnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR .br -\fBint mvwaddstr(WINDOW *win, int y, int x, const char *str);\fR +\fBint mvwaddstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr\fR\fB);\fR .br -\fBint mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);\fR +\fBint mvwaddnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr, int \fR\fIn\fR\fB);\fR +.fi .SH DESCRIPTION These routines write the characters of the (null-terminated) character string -\fIstr\fR on the given window. It is similar to calling \fBwaddch\fR once for -each character in the string. The four routines with \fIn\fR as the last -argument write at most \fIn\fR characters. If \fIn\fR is -1, then the -entire string will be added. +\fIstr\fR on the given window. +It is similar to calling \fBwaddch\fR once for each character in the string. +The four routines with \fIn\fR as the last argument +write at most \fIn\fR characters. +If \fIn\fR is -1, then the entire string will be added, +up to the maximum number of characters that will fit on the line, +or until a terminating null is reached. .SH RETURN VALUE All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success (the SVr4 manuals specify only "an integer value other than \fBERR\fR") upon diff --git a/contrib/ncurses/man/curs_addwstr.3x b/contrib/ncurses/man/curs_addwstr.3x new file mode 100644 index 0000000..4ce7c23 --- /dev/null +++ b/contrib/ncurses/man/curs_addwstr.3x @@ -0,0 +1,91 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_addwstr.3x,v 1.2 2002/03/09 23:16:59 tom Exp $ +.TH curs_addwstr 3X "" +.SH NAME +\fBaddwstr\fR, +\fBaddnwstr\fR, +\fBwaddwstr\fR, +\fBwaddnwstr\fR, +\fBmvaddwstr\fR, +\fBmvaddnwstr\fR, +\fBmvwaddwstr\fR, +\fBmvwaddnwstr\fR \- add a string of wide characters to a \fBcurses\fR window and advance cursor +.SH SYNOPSIS +.nf +\fB#include <curses.h>\fR + +\fBint addwstr(const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint addnwstr(const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint waddwstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint waddnwstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvaddwstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvaddnwstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwaddwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvwaddnwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines write the characters of the (null-terminated) \fBwchar_t\fRcharacter string +\fIwstr\fR on the given window. +It is similar to constructing a \fBcchar_t\fR for each wchar_t in the string, +then calling \fBwadd_wch\fR for the resulting \fBcchar_t\fR. +.PP +The \fImv\fR routines perform cursor movement once, before writing any +characters. +Thereafter, the cursor is advanced as a side-effect of writing to the window. +.PP +The four routines with \fIn\fR as the last argument +write at most \fIn\fR \fBwchar_t\fR characters. +If \fIn\fR is -1, then the entire string will be added, +up to the maximum number of characters that will fit on the line, +or until a terminating null is reached. +.SH RETURN VALUES +All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. +.SH NOTES +Note that all of these routines except \fBwaddnwstr\fR may be macros. +.SH PORTABILITY +All these entry points are described in the XSI Curses standard, Issue 4. +.SH SEE ALSO +.PP +Functions: +\fBcurses\fR(3X), +\fBcurs_add_wch\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_attr.3x b/contrib/ncurses/man/curs_attr.3x index e884fa8..022613d 100644 --- a/contrib/ncurses/man/curs_attr.3x +++ b/contrib/ncurses/man/curs_attr.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 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: curs_attr.3x,v 1.22 2000/07/08 11:59:58 tom Exp $ +.\" $Id: curs_attr.3x,v 1.24 2002/02/16 22:38:32 tom Exp $ .TH curs_attr 3X "" .SH NAME \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, @@ -159,10 +159,10 @@ l l . The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR: -.DS C +.br \fBPAIR_NUMBER(\fR\fIattrs\fR) Returns the pair number associated with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute. -.DE +.br The return values of many of these routines are not meaningful (they are implemented as macro-expanded assignments and simply return their argument). diff --git a/contrib/ncurses/man/curs_bkgd.3x b/contrib/ncurses/man/curs_bkgd.3x index efd4f82..035e975 100644 --- a/contrib/ncurses/man/curs_bkgd.3x +++ b/contrib/ncurses/man/curs_bkgd.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 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,13 +26,13 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_bkgd.3x,v 1.14 2000/07/01 17:39:31 tom Exp $ +.\" $Id: curs_bkgd.3x,v 1.16 2002/02/16 22:38:32 tom Exp $ .TH curs_bkgd 3X "" .SH NAME \fBbkgdset\fR, \fBwbkgdset\fR, \fBbkgd\fR, \fBwbkgd\fR, \fBgetbkgd\fR - \fBcurses\fR window background manipulation routines -.. + .SH SYNOPSIS \fB#include <curses.h>\fR @@ -46,7 +46,6 @@ .br \fBchtype getbkgd(WINDOW *win);\fR .br -.. .SH DESCRIPTION The \fBbkgdset\fR and \fBwbkgdset\fR routines manipulate the background of the named window. @@ -77,21 +76,17 @@ appears, it is changed to the new background character. The \fBgetbkgd\fR function returns the given window's current background character/attribute pair. -.. .SH RETURN VALUE The routines \fBbkgd\fR and \fBwbkgd\fR return the integer \fBOK\fR. The SVr4.0 manual says "or a non-negative integer if \fBimmedok\fR is set", but this appears to be an error. -.. .SH NOTES Note that \fBbkgdset\fR and \fBbkgd\fR may be macros. -.. .SH PORTABILITY These functions are described in the XSI Curses standard, Issue 4. The draft does not include \fBconst\fR qualifiers on the arguments. The standard specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR, on failure. but gives no failure conditions. -.. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_outopts\fR(3X) .\"# diff --git a/contrib/ncurses/man/curs_bkgrnd.3x b/contrib/ncurses/man/curs_bkgrnd.3x new file mode 100644 index 0000000..3be0dce --- /dev/null +++ b/contrib/ncurses/man/curs_bkgrnd.3x @@ -0,0 +1,107 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_bkgrnd.3x,v 1.1 2002/02/23 23:23:42 tom Exp $ +.TH curs_bkgrnd 3X "" +.SH NAME +.PP +\fBbkgrnd\fR, +\fBwbkgrnd\fR, +\fBbkgrndset\fR, +\fBwbkgrndset\fR, +\fBgetbkgrnd\fR, +\fBwgetbkgrnd\fR \- \fBcurses\fR window complex background manipulation routines +.SH SYNOPSIS +.PP +.B #include <curses.h> + +\fBint bkgrnd(\fR\fB const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wbkgrnd(\fR\fB WINDOW *\fR\fIwin\fR\fB, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBvoid bkgrndset(const cchar_t *\fR\fIwch\fR \fB);\fR +.br +\fBvoid wbkgrndset(WINDOW *\fR\fIwin\fR\fB, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint getbkgrnd(cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wgetbkgrnd(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwch\fR\fB);\fR +.br +.SH DESCRIPTION +The \fBbkgrndset\fR and \fBwbkgrndset\fR routines manipulate the +background of the named window. +The window background is a \fBcchar_t\fR consisting of +any combination of attributes (i.e., rendition) and a complex character. +The attribute part of the background is combined (OR'ed) with all non-blank +characters that are written into the window with \fBwaddch\fR. Both +the character and attribute parts of the background are combined with +the blank characters. +The background becomes a property of the +character and moves with the character through any scrolling and +insert/delete line/character operations. + +To the extent possible on a +particular terminal, the attribute part of the background is displayed +as the graphic rendition of the character put on the screen. + +The \fBbkgrnd\fR and \fBwbkgrnd\fR functions +set the background property of the current or specified window +and then apply this setting to every character position in that window: + +.RS +The rendition of every character on the screen is changed to +the new background rendition. + +Wherever the former background character +appears, it is changed to the new background character. +.RE + +The \fBgetbkgrnd\fR function returns the given window's current background +character/attribute pair via the \fBwch\fR pointer. + +.SH NOTES +Note that +\fBbkgrnd\fR, +\fBbkgrndset\fR, and +\fBgetbkgrnd\fR +may be macros. +.SH RETURN VALUES +The \fBbkgrndset\fR and \fBwbkgrndset\fR routines do not return a value. +.PP +Upon successful completion, the other functions return \fBOK\fR. +Otherwise, they return \fBERR\fR. +A null window pointer is treated as an error. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_bkgd\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_border.3x b/contrib/ncurses/man/curs_border.3x index 2bd9626..c087fad 100644 --- a/contrib/ncurses/man/curs_border.3x +++ b/contrib/ncurses/man/curs_border.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_border.3x,v 1.14 2000/07/01 19:54:58 tom Exp $ +.\" $Id: curs_border.3x,v 1.15 2002/02/16 22:21:47 tom Exp $ .TH curs_border 3X "" .SH NAME \fBborder\fR, \fBwborder\fR, \fBbox\fR, @@ -63,15 +63,45 @@ \fBint mvwvline(WINDOW *, int y, int x, chtype ch, int n);\fR .br .SH DESCRIPTION -The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines draw a box around the -edges of a window. The argument \fIls\fR is a character and attributes used -for the left side of the border, \fIrs\fR - right side, \fIts\fR - top side, -\fIbs\fR - bottom side, \fItl\fR - top left-hand corner, \fItr\fR - top -right-hand corner, \fIbl\fR - bottom left-hand corner, and \fIbr\fR - bottom -right-hand corner. If any of these arguments is zero, then the following -default values (defined in \fBcurses.h\fR) are used instead: \fBACS_VLINE\fR, -\fBACS_VLINE\fR, \fBACS_HLINE\fR, \fBACS_HLINE\fR, \fB\fBACS_ULCORNER\fR, -\fBACS_URCORNER\fR, \fBACS_LLCORNER\fR, \fBACS_LRCORNER\fR. +The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines +draw a box around the edges of a window. +Other than the window, each argument is a character with attributes: +.RS +\fIls\fR - left side, +.br +\fIrs\fR - right side, +.br +\fIts\fR - top side, +.br +\fIbs\fR - bottom side, +.br +\fItl\fR - top left-hand corner, +.br +\fItr\fR - top right-hand corner, +.br +\fIbl\fR - bottom left-hand corner, and +.br +\fIbr\fR - bottom right-hand corner. +.RE +If any of these arguments is zero, then the corresponding +default values (defined in \fBcurses.h\fR) are used instead: +.RS +\fBACS_VLINE\fR, +.br +\fBACS_VLINE\fR, +.br +\fBACS_HLINE\fR, +.br +\fBACS_HLINE\fR, +.br +\fBACS_ULCORNER\fR, +.br +\fBACS_URCORNER\fR, +.br +\fBACS_LLCORNER\fR, +.br +\fBACS_LRCORNER\fR. +.RE \fBbox(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIhorch\fR\fB)\fR is a shorthand for the following call: \fBwborder(\fR\fIwin\fR\fB,\fR \fIverch\fR\fB,\fR @@ -95,11 +125,9 @@ is also true of SVr4 curses, though the fact is not documented). Note that \fBborder\fR and \fBbox\fR may be macros. .SH PORTABILITY -These functions are described in the XSI Curses standard, Issue 4. Additional -functions \fBmvhline\fR, \fBmvvline\fR, \fBmvwhline\fR, and \fBmvwvline\fR are -described there which this implementation does not yet support. The standard -specifies that they return \fBERR\fR on failure, but specifies no error -conditions. +These functions are described in the XSI Curses standard, Issue 4. +The standard specifies that they return \fBERR\fR on failure, +but specifies no error conditions. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_outopts\fR(3X). .\"# diff --git a/contrib/ncurses/man/curs_border_set.3x b/contrib/ncurses/man/curs_border_set.3x new file mode 100644 index 0000000..ba7a197 --- /dev/null +++ b/contrib/ncurses/man/curs_border_set.3x @@ -0,0 +1,202 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_border_set.3x,v 1.3 2002/04/20 16:49:13 tom Exp $ +.TH curs_border_set 3X "" +.SH NAME +.PP +\fBborder_set\fR, +\fBwborder_set\fR, +\fBbox_set\fR, +\fBhline_set\fR, +\fBwhline_set\fR, +\fBmvhline_set\fR, +\fBmvwhline_set\fR, +\fBvline_set\fR, +\fBwvline_set\fR, +\fBmvvline_set\fR, +\fBmvwvline_set\fR \- create \fBcurses\fR borders or lines using complex characters and renditions +.SH SYNOPSIS +.PP +\fB#include <curses.h>\fR +.sp +\fBint border_set(\fR + \fBconst cchar_t *\fR\fIls\fR, \fBconst cchar_t *\fR\fIrs\fR, + \fBconst cchar_t *\fR\fIts\fR, \fBconst cchar_t *\fR\fIbs\fR, + \fBconst cchar_t *\fR\fItl\fR, \fBconst cchar_t *\fR\fItr\fR, + \fBconst cchar_t *\fR\fIbl\fR, \fBconst cchar_t *\fR\fIbr\fR +\fB);\fR +.br +\fBint wborder_set(\fR + \fBWINDOW *win\fR, + \fBconst cchar_t *\fR\fIls\fR, \fBconst cchar_t *\fR\fIrs\fR, + \fBconst cchar_t *\fR\fIts\fR, \fBconst cchar_t *\fR\fIbs\fR, + \fBconst cchar_t *\fR\fItl\fR, \fBconst cchar_t *\fR\fItr\fR, + \fBconst cchar_t *\fR\fIbl\fR, \fBconst cchar_t *\fR\fIbr\fR\fB);\fR +.br +\fBint box_set(\fR + \fBWINDOW *win\fR, + \fBconst cchar_t *\fR\fIverch\fR, + \fBconst cchar_t *\fR\fIhorch\fR\fB);\fR +.br +\fBint hline_set(\fR + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint whline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvhline_set(\fR + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvwhline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint vline_set(\fR + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint wvline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvvline_set(\fR + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvwvline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +.SH DESCRIPTION +.PP +The +\fBborder_set\fR +and +\fBwborder_set\fR +functions draw a border around the edges of the current or specified window. +These functions do not change the cursor position, and do not wrap. +.PP +Other than the window, each argument is a complex character with attributes: +.RS +\fIls\fR - left side, +.br +\fIrs\fR - right side, +.br +\fIts\fR - top side, +.br +\fIbs\fR - bottom side, +.br +\fItl\fR - top left-hand corner, +.br +\fItr\fR - top right-hand corner, +.br +\fIbl\fR - bottom left-hand corner, and +.br +\fIbr\fR - bottom right-hand corner. +.RE +.PP +If any of these arguments is zero, then the corresponding +default values (defined in \fBcurses.h\fR) are used instead: +.RS +\fBWACS_VLINE\fR, +.br +\fBWACS_VLINE\fR, +.br +\fBWACS_HLINE\fR, +.br +\fBWACS_HLINE\fR, +.br +\fBWACS_ULCORNER\fR, +.br +\fBWACS_URCORNER\fR, +.br +\fBWACS_LLCORNER\fR, and +.br +\fBWACS_LRCORNER\fR. +.RE +.PP +\fBbox_set(\fR\fIwin\fR, \fIverch\fR\fB, \fR\fIhorch\fR\fB);\fR +is a shorthand for the following call: +.PP +\fBwborder_set(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIverch\fR\fB,\fR + \fIhorch\fR\fB, \fR\fIhorch\fR\fB, NULL, NULL, NULL, NULL);\fR +.PP +The +\fB*line_set\fR +functions use +\fIwch\fR +to draw a line starting at the current cursor position in the window. +The line is at most \fIn\fR characters long or as many as fit into the window. +The current cursor position is not changed. +.PP +The +\fBhline_set\fR, +\fBmvhline_set\fR, +\fBmvwhline_set\fR, and +\fBwhline_set\fR +functions draw a line proceeding toward the last column of the same line. +.PP +The +\fBvline_set\fR, +\fBmvvline_set\fR, +\fBmvwvline_set\fR, and +\fBwvline_set\fR +functions draw a line proceeding toward the last line of the window. +.br +.SH NOTES +.PP +Note that +\fBborder_set\fR, +\fBhline_set\fR, +\fBmvhline_set\fR, +\fBmvvline_set\fR, +\fBmvwhline_set\fR, +\fBmvwvline_set\fR, and +\fBvline_set\fR +may be macros. +.br +.SH RETURN VALUES +.PP +Upon successful completion, these functions return +\fBOK\fR. +Otherwise, they return +\fBERR\fR. +.SH SEE ALSO +\fBncurses\fR(3X), +\fBcurs_border\fR(3X), +\fBcurs_outopts\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_color.3x b/contrib/ncurses/man/curs_color.3x index ccf8cf8..18926d9 100644 --- a/contrib/ncurses/man/curs_color.3x +++ b/contrib/ncurses/man/curs_color.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 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: curs_color.3x,v 1.16 2000/07/15 22:57:03 tom Exp $ +.\" $Id: curs_color.3x,v 1.19 2002/02/16 22:38:32 tom Exp $ .TH curs_color 3X "" .SH NAME \fBstart_color\fR, @@ -100,8 +100,8 @@ third arguments must be between 0 and \fBCOLORS\fR (the 0 color pair is wired to white on black and cannot be changed). .PP If the color-pair was previously -initialized, the screen is refreshed and all occurrences of that color-pair is -changed to the new definition. +initialized, the screen is refreshed and all occurrences of that color-pair +are changed to the new definition. As an extension, ncurses allows you to set color pair 0 via the \fBassume_default_colors\fR routine, or to specify the use of @@ -202,7 +202,7 @@ but only if that routine has been first invoked. The assumption that \fBCOLOR_BLACK\fR is the default background color for all terminals can be modified using the \fBassume_default_colors\fP extension, -.. + .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), diff --git a/contrib/ncurses/man/curs_extend.3x b/contrib/ncurses/man/curs_extend.3x index 632fc38..dc05b39 100644 --- a/contrib/ncurses/man/curs_extend.3x +++ b/contrib/ncurses/man/curs_extend.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1999-2000,2002 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 * @@ -28,20 +28,18 @@ .\" .\" Author: Thomas E. Dickey <dickey@clark.net> 1999 .\" -.\" $Id: curs_extend.3x,v 1.6 2000/07/15 22:57:20 tom Exp $ +.\" $Id: curs_extend.3x,v 1.9 2002/02/16 22:39:04 tom Exp $ .TH curs_extend 3X "" .SH NAME -\fBcurs_extend\fR: \fBcurses_version\fP, \fBuse_extended_names\fP \- miscellaneous curses extensions -.. + .SH SYNOPSIS \fB#include <curses.h>\fP \fBconst char * curses_version(void);\fP .br \fBint use_extended_names(bool enable);\fP -.. .SH DESCRIPTION These functions are extensions to the curses library which do not fit easily into other categories. @@ -62,12 +60,10 @@ is made by using the \fB-x\fP option of \fItic\fP to compile extended terminal definitions. However you can disable this feature to ensure compatiblity with other implementations of curses -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBcurs_getch\fR(3X), \fBcurs_mouse\fR(3X), @@ -78,7 +74,6 @@ any code depending on them be conditioned using NCURSES_VERSION. \fBkeyok\fR(3X), \fBresizeterm\fR(3X), \fBwresize\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/contrib/ncurses/man/curs_get_wch.3x b/contrib/ncurses/man/curs_get_wch.3x new file mode 100644 index 0000000..26ff2d4 --- /dev/null +++ b/contrib/ncurses/man/curs_get_wch.3x @@ -0,0 +1,161 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_get_wch.3x,v 1.3 2002/05/18 21:48:53 tom Exp $ +.TH curs_get_wch 3X "" +.SH NAME +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, +\fBmvwget_wch\fR, +\fBunget_wch\fR \- get (or push back) a wide character from curses terminal keyboard +.SH SYNOPSIS +\fB#include <curses.h>\fR +.sp +\fBint get_wch(win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wget_wch(WINDOW *\fR\fIwin\fR\fB, win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvget_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvwget_wch(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint unget_wch(const wchar_t \fR\fIwch\fR\fB);\fR +.SH DESCRIPTION +The +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, and +\fBmvwget_wch\fR +functions read a character +from the terminal associated with the current or specified window. +In no-delay mode, +if no input is waiting, the value \fBERR\fR is returned. +In delay mode, +the program waits until the system passes text through to the program. +Depending on the setting of \fBcbreak\fR, +this is after one character (cbreak mode), +or after the first newline (nocbreak mode). +In half-delay mode, +the program waits until the user types a character or the specified +timeout interval has elapsed. + +Unless \fBnoecho\fR has been set, +these routines echo the character into the designated window. + +If the window is not a pad and has been moved or modified since the +last call to \fBwrefresh\fR, +\fBwrefresh\fR will be called before another character is read. + +If \fBkeypad\fR is enabled, +these functions respond to +the pressing of a function key by setting the object pointed to by +\fIwch\fR +to the corresponding +\fBKEY_\fR +value defined +in +\fB<curses.h>\fR +and returning +\fBKEY_CODE_YES\fR. +If a character (such as escape) that could be the +beginning of a function key is received, curses sets a timer. +If the remainder +of the sequence does arrive within the designated time, curses passes through +the character; otherwise, curses returns the function key value. +For this +reason, many terminals experience a delay between the time a user presses +the escape key and the time the escape is returned to the program. +.PP +The +\fBunget_wch\fR +function pushes the wide character +\fIwch\fR +back onto the head of the input queue, so the wide character +is returned by the next call to +\fBget_wch\fR. +The pushback of +one character is guaranteed. +If the program calls +\fBunget_wch\fR +too many times without an intervening call to +\fBget_wch\fR, +the operation may fail. +.SH NOTES +The header file +\fB<curses.h>\fR +automatically +includes the header file +\fB<stdio.h>\fR. +.PP +Applications should not define the escape key by itself as a single-character +function. +.PP +When using +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, or +\fBmvwget_wch\fR, applications should +not use +\fBnocbreak\fR +mode and +\fBecho\fR +mode +at the same time. +Depending on the state of the tty driver when each character +is typed, the program may produce undesirable results. +.PP +All functions except \fBwget_wch\fR and \fBunget_wch\fR +may be macros. +.SH RETURN VALUES +When +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, and +\fBmvwget_wch\fR +functions successfully +report the pressing of a function key, they return +\fBKEY_CODE_YES\fR. +When they successfully report a wide character, they return +\fBOK\fR. +Otherwise, they return +\fBERR\fR. +.PP +Upon successful completion, +\fBunget_wch\fR +returns +\fBOK\fR. +Otherwise, the function returns +\fBERR\fR. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_getch\fR(3X), +\fBcurs_ins_wch\fR(3X), +\fBcurs_inopts\fR(3X), +\fBcurs_move\fR(3X), +\fBcurs_refresh\fR(3X) diff --git a/contrib/ncurses/man/curs_get_wstr.3x b/contrib/ncurses/man/curs_get_wstr.3x new file mode 100644 index 0000000..f8fa51d --- /dev/null +++ b/contrib/ncurses/man/curs_get_wstr.3x @@ -0,0 +1,164 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_get_wstr.3x,v 1.2 2002/05/18 21:48:15 tom Exp $ +.TH curs_get_wstr 3X "" +.SH NAME +\fBget_wstr\fR, +\fBgetn_wstr\fR, +\fBwget_wstr\fR, +\fBwgetn_wstr\fR, +\fBmvget_wstr\fR, +\fBmvgetn_wstr\fR, +\fBmvwget_wstr\fR, +\fBmvwgetn_wstr\fR \- get an array of wide characters from a curses terminal keyboard +.SH SYNOPSIS +.nf +\fB#include <curses.h>\fR + +\fBint get_wstr(wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint getn_wstr(wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint wget_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint wgetn_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvget_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvgetn_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwget_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvwgetn_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +The effect of +\fBget_wstr\fR +is as though a series of calls +to +\fBget_wch\fR +were made, until a newline, other end-of-line, or end-of-file condition is processed. +An end-of-file condition is represented by \fBWEOF\fR, as defined in \fB<wchar.h>\fR. +The newline and end-of-line conditions are represented by the \fB\\n\fR \fBwchar_t\fR value. +In all instances, the end of the string is terminated by a null \fBwchar_t\fR. +The routine places resulting values in the area pointed to by \fIwstr\fR. + +The user's erase and kill characters are interpreted. If keypad +mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR +are both considered equivalent to the user's kill character. + +Characters input are echoed only if \fBecho\fR is currently on. In that case, +backspace is echoed as deletion of the previous character (typically a left +motion). + +The effect of +\fBwget_wstr\fR +is as though a series of +calls to +\fBwget_wch\fR +were made. + +The effect of +\fBmvget_wstr\fR +is as though a call to +\fBmove\fR +and then a series of calls to +\fBget_wch\fR +were +made. + +The effect of +\fBmvwget_wstr\fR +is as though a call to +\fBwmove\fR +and then a series of calls to +\fBwget_wch\fR +were made. + +The +\fBgetn_wstr\fR, +\fBmvgetn_wstr\fR, +\fBmvwgetn_wstr\fR, and +\fBwgetn_wstr\fR +functions are identical +to the +\fBget_wstr\fR, +\fBmvget_wstr\fR, +\fBmvwget_wstr\fR, and +\fBwget_wstr\fR +functions, respectively, +except that the +\fB*n_*\fR +versions read at most +\fIn\fR +characters, letting the application prevent overflow of the +input buffer. +.SH NOTES +Using +\fBget_wstr\fR, +\fBmvget_wstr\fR, +\fBmvwget_wstr\fR, or +\fBwget_wstr\fR +to read a line that +overflows the array pointed to by +\fBwstr\fR +causes undefined +results. +The use of +\fBgetn_wstr\fR, +\fBmvgetn_wstr\fR, +\fBmvwgetn_wstr\fR, or +\fBwgetn_wstr\fR, respectively, is recommended. + +These functions cannot return \fBKEY_\fR values because there +is no way to distinguish a \fBKEY_\fR value from a valid \fBwchar_t\fR value. + +All of these routines except \fBwgetn_wstr\fR may be macros. +.SH RETURN VALUES +All of these functions return \fBOK\fR upon successful completion. +Otherwise, they return \fBERR\fR. +.SH PORTABILITY +These functions are described in The Single Unix Specification, Version 2. +No error conditions are defined. +This implementation returns ERR if the window pointer is null, +or if the lower-level \fBwget_wch\fR call returns an ERR. +In the latter case, +an ERR return without other data is treated as an end-of-file condition, +and the returned array contains a \fBWEOF\fR followed by a null \fBwchar_t\fR. +.SH SEE ALSO +Functions: +\fBcurses\fR(3X), +\fBcurs_get_wch\fR(3X), +\fBcurs_getstr\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_getcchar.3x b/contrib/ncurses/man/curs_getcchar.3x new file mode 100644 index 0000000..2dfa10b --- /dev/null +++ b/contrib/ncurses/man/curs_getcchar.3x @@ -0,0 +1,144 @@ +.\"*************************************************************************** +.\" Copyright (c) 2001,2002 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: curs_getcchar.3x,v 1.6 2002/03/24 01:08:55 tom Exp $ +.TH curs_getcchar 3X "" +.SH NAME +\fBgetcchar\fP, +\fBsetcchar\fP \- Get a wide character string and rendition from a \fBcchar_t\fP or set a \fBcchar_t\fP from a wide-character string +.SH SYNOPSIS +\fB#include <curses.h>\fP +.sp +\fBint getcchar(\fP +.br +.B " const cchar_t *\fIwcval\fP," +.br +.B " wchar_t *\fIwch\fP," +.br +.B " attr_t *\fIattrs\fP," +.br +.B " short *\fIcolor_pair\fP," +.br +.B " void *\fIopts\fP );" +.sp +.B "int setcchar(" +.br +.B " cchar_t *\fIwcval\fP," +.br +.B " const wchar_t *\fIwch\fP," +.br +.B " const attr_t \fIattrs\fP," +.br +.B " short \fIcolor_pair\fP," +.br +.B " void *\fIopts\fP );" +.SH DESCRIPTION +.PP +The \fBgetcchar\fP function gets a wide-character string +and rendition from a \fBcchar_t\fP argument. +When \fIwch\fP is not a null pointer, +the \fBgetcchar\fP function does the following: +.TP 5 +- +Extracts information from a \fBcchar_t\fP value \fIwcval\fP +.TP 5 +- +Stores the character attributes in the location pointed to by \fIattrs\fP +.TP 5 +- +Stores the color-pair in the location pointed to by \fIcolor_pair\fP +.TP 5 +- +Stores the wide-character string, +characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP. +.PP +When +\fIwch\fP +is a null pointer, the +\fBgetcchar\fP +function does the following: +.TP 5 +- +Obtains the number of wide characters pointed to by \fIwcval\fP +.TP 5 +- +Does not change the data referenced by +\fIattrs\fP +or +\fIcolor_pair\fP +.PP +The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP +by using: +.TP 5 +- +The character attributes in +\fIattrs\fP +.TP 5 +- +The color pair in +\fIcolor_pair\fP +.TP 5 +- +The wide-character string pointed to by \fIwch\fP. +The string must be L'\\0' terminated, +contain at most one character with strictly positive width, +which must be the first, +and contain no characters of negative width. +.SH NOTES +.PP +The \fIopts\fP argument is reserved for future use. +Currently, an application must provide a null pointer as \fIopts\fP. +.PP +The \fIwcval\fP argument may be a value generated by a call to +\fBsetcchar\fP or by a function that has a \fBcchar_t\fP output argument. +If \fIwcval\fP is constructed by any other means, the effect is unspecified. +.SH RETURN VALUES +.PP +When \fIwch\fP is a null pointer, +\fBgetcchar\fP returns the number of wide characters referenced by +\fIwcval\fP, including the null terminator. +.PP +When \fIwch\fP is not a null pointer, +\fBgetcchar\fP returns \fBOK\fP upon successful completion, +and \fBERR\fP otherwise. +.PP +Upon successful completion, \fBsetcchar\fP returns \fBOK\fP. +Otherwise, it returns \fBERR\fP. +.SH SEE ALSO +.PP +Functions: +\fBcurses\fR(3X), +\fBwcwidth\fR(3X), +\fBcurs_attr_get\fR(3X), +\fBcan_change_color\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_getch.3x b/contrib/ncurses/man/curs_getch.3x index 56028f8..73e1a29 100644 --- a/contrib/ncurses/man/curs_getch.3x +++ b/contrib/ncurses/man/curs_getch.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 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: curs_getch.3x,v 1.18 2001/02/25 00:20:30 tom Exp $ +.\" $Id: curs_getch.3x,v 1.21 2002/03/17 14:36:21 tom Exp $ .TH curs_getch 3X "" .SH NAME \fBgetch\fR, @@ -53,14 +53,19 @@ .br .SH DESCRIPTION The \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR and \fBmvwgetch\fR, routines read -a character from the window. In no-delay mode, if no input is waiting, the -value \fBERR\fR is returned. In delay mode, the program waits until the system -passes text through to the program. Depending on the setting of \fBcbreak\fR, -this is after one character (cbreak mode), or after the first newline (nocbreak -mode). In half-delay mode, the program waits until a character is typed or the +a character from the window. +In no-delay mode, if no input is waiting, the value \fBERR\fR is returned. +In delay mode, the program waits until the system +passes text through to the program. +Depending on the setting of \fBcbreak\fR, +this is after one character (cbreak mode), +or after the first newline (nocbreak mode). +In half-delay mode, +the program waits until a character is typed or the specified timeout has been reached. -Unless \fBnoecho\fR has been set, then the character will also be echoed into the +Unless \fBnoecho\fR has been set, +then the character will also be echoed into the designated window according to the following rules: If the character is the current erase character, left arrow, or backspace, the cursor is moved one space to the left and that screen position is erased @@ -74,26 +79,30 @@ call to \fBwrefresh\fR, \fBwrefresh\fR will be called before another character is read. If \fBkeypad\fR is \fBTRUE\fR, and a function key is pressed, the token for -that function key is returned instead of the raw characters. Possible function +that function key is returned instead of the raw characters. +Possible function keys are defined in \fB<curses.h>\fR as macros with values outside the range of 8-bit characters whose names begin with \fBKEY_.\fR Thus, a variable intended to hold the return value of a function key must be of short size or larger. When a character that could be the beginning of a function key is received -(which, on modern terminals, means an escape character), \fBcurses\fR sets a -timer. If the remainder of the sequence does not come in within the designated -time, the character is passed through; otherwise, the function key value is -returned. For this reason, many terminals experience a delay between the time +(which, on modern terminals, means an escape character), +\fBcurses\fR sets a timer. +If the remainder of the sequence does not come in within the designated +time, the character is passed through; +otherwise, the function key value is returned. +For this reason, many terminals experience a delay between the time a user presses the escape key and the escape is returned to the program. The \fBungetch\fR routine places \fIch\fR back onto the input queue to be -returned by the next call to \fBwgetch\fR. Note that there is, in effect, -just one input queue for all windows. +returned by the next call to \fBwgetch\fR. +There is just one input queue for all windows. .SS Function Keys The following function keys, defined in \fB<curses.h>\fR, might be returned by -\fBgetch\fR if \fBkeypad\fR has been enabled. Note that not all of these are +\fBgetch\fR if \fBkeypad\fR has been enabled. +Note that not all of these are necessarily supported on any particular terminal. .sp .TS @@ -211,8 +220,8 @@ c c c . .TE .sp The \fBhas_key\fR routine takes a key value from the above list, and -returns TRUE or FALSE according as the current terminal type recognizes -a key with that value. +returns TRUE or FALSE according to whether +the current terminal type recognizes a key with that value. .SH RETURN VALUE All routines return the integer \fBERR\fR upon failure and an integer value @@ -234,30 +243,38 @@ when you press control/M. When using \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, or \fBmvwgetch\fR, nocbreak mode (\fBnocbreak\fR) and echo mode -(\fBecho\fR) should not be used at the same time. Depending on the +(\fBecho\fR) should not be used at the same time. +Depending on the state of the tty driver when each character is typed, the program may produce undesirable results. Note that \fBgetch\fR, \fBmvgetch\fR, and \fBmvwgetch\fR may be macros. Historically, the set of keypad macros was largely defined by the extremely -function-key-rich keyboard of the AT&T 7300, aka 3B1, aka Safari 4. Modern -personal computers usually have only a small subset of these. IBM PC-style +function-key-rich keyboard of the AT&T 7300, aka 3B1, aka Safari 4. +Modern +personal computers usually have only a small subset of these. +IBM PC-style consoles typically support little more than \fBKEY_UP\fR, \fBKEY_DOWN\fR, \fBKEY_LEFT\fR, \fBKEY_RIGHT\fR, \fBKEY_HOME\fR, \fBKEY_END\fR, -\fBKEY_NPAGE\fR, \fBKEY_PPAGE\fR, and function keys 1 through 12. The Ins key +\fBKEY_NPAGE\fR, \fBKEY_PPAGE\fR, and function keys 1 through 12. +The Ins key is usually mapped to \fBKEY_IC\fR. .SH PORTABILITY -The *get* functions are described in the XSI Curses standard, Issue 4. They -read single-byte characters only. The standard specifies that they return +The *get* functions are described in the XSI Curses standard, Issue 4. +They +read single-byte characters only. +The standard specifies that they return \fBERR\fR on failure, but specifies no error conditions. The echo behavior of these functions on input of \fBKEY_\fR or backspace -characters was not specified in the SVr4 documentation. This description is +characters was not specified in the SVr4 documentation. +This description is adopted from the XSI Curses standard. The behavior of \fBgetch\fR and friends in the presence of handled signals is -unspecified in the SVr4 and XSI Curses documentation. Under historical curses +unspecified in the SVr4 and XSI Curses documentation. +Under historical curses implementations, it varied depending on whether the operating system's implementation of handled signal receipt interrupts a \fBread\fR(2) call in progress or not, and also (in some implementations) depending on whether an @@ -266,10 +283,12 @@ input timeout or non-blocking mode hsd been set. Programmers concerned about portability should be prepared for either of two cases: (a) signal receipt does not interrupt \fBgetch\fR; (b) signal receipt interrupts \fBgetch\fR and causes it to return ERR with \fBerrno\fR set to -\fBEINTR\fR. Under the \fBncurses\fR implementation, handled signals never +\fBEINTR\fR. +Under the \fBncurses\fR implementation, handled signals never interrupt \fBgetch\fR. -The \fBhas_key\fR function is unique to \fBncurses\fR. We recommend that +The \fBhas_key\fR function is unique to \fBncurses\fR. +We recommend that any code using it be conditionalized on the \fBNCURSES_VERSION\fR feature macro. .SH SEE ALSO \fBcurses\fR(3X), diff --git a/contrib/ncurses/man/curs_getstr.3x b/contrib/ncurses/man/curs_getstr.3x index 42c2293..1a32a0b 100644 --- a/contrib/ncurses/man/curs_getstr.3x +++ b/contrib/ncurses/man/curs_getstr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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: curs_getstr.3x,v 1.9 2000/07/01 17:39:31 tom Exp $ +.\" $Id: curs_getstr.3x,v 1.11 2002/04/13 22:14:30 tom Exp $ .TH curs_getstr 3X "" .SH NAME \fBgetstr\fR, @@ -82,11 +82,11 @@ completion. .SH NOTES Note that \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros. .SH PORTABILITY -These functions are described in the XSI Curses standard, Issue 4. They read -single-byte characters only. The standard specifies that they return \fBERR\fR -on failure, but the single error condition \fBEOVERFLOW\fR associated with -extended-level conformance is not yet returned (the XSI curses support for -multi-byte characters is not yet present). +These functions are described in the XSI Curses standard, Issue 4. +They read single-byte characters only. +The standard does not define any error conditions. +This implementation returns ERR if the window pointer is null, +or if the lower-level \fBwgetch\fR call returns an ERR. SVr3 and early SVr4 curses implementations did not reject function keys; the SVr4.0 documentation claimed that "special keys" (such as function diff --git a/contrib/ncurses/man/curs_in_wch.3x b/contrib/ncurses/man/curs_in_wch.3x new file mode 100644 index 0000000..668595c --- /dev/null +++ b/contrib/ncurses/man/curs_in_wch.3x @@ -0,0 +1,68 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_in_wch.3x,v 1.1 2002/03/10 15:08:57 tom Exp $ +.TH curs_in_wch 3X "" +.SH NAME +\fBin_wch\fR, +\fBmvin_wch\fR, +\fBmvwin_wch\fR, +\fBwin_wch\fR - extract a complex character and rendition from a window +.SH SYNOPSIS +\fB#include <curses.h>\fR + +\fBint in_wch(cchar_t *\fR\fIwcval\fR\fB);\fR +.br +\fBint mvin_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwcval\fR\fB);\fR +.br +\fBint mvwin_wch(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwcval\fR\fB);\fR +.br +\fBint win_wch(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwcval\fR\fB);\fR +.SH DESCRIPTION +These functions extract the complex character and rendition from +the current position in the named window into the \fBcchar_t\fR object +referenced by wcval. +.SH RETURN VALUE +No errors are defined in the XSI Curses standard. +This implementation checks for null pointers, returns ERR in that case. +Also, the \fImv\fR routines check for error moving the cursor, returning ERR +in that case. +Otherwise they return OK +.SH NOTES +Note that all of these routines may be macros. +.SH PORTABILITY +These functions are described in the XSI Curses standard, Issue 4. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_inch\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_in_wchstr.3x b/contrib/ncurses/man/curs_in_wchstr.3x new file mode 100644 index 0000000..0012789 --- /dev/null +++ b/contrib/ncurses/man/curs_in_wchstr.3x @@ -0,0 +1,117 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_in_wchstr.3x,v 1.2 2002/05/18 21:48:30 tom Exp $ +.TH curs_in_wchstr 3X "" +.SH NAME +\fBin_wchstr\fR, +\fBin_wchnstr\fR, +\fBwin_wchstr\fR, +\fBwin_wchnstr\fR, +\fBmvin_wchstr\fR, +\fBmvin_wchnstr\fR, +\fBmvwin_wchstr\fR, +\fBmvwin_wchnstr\fR \- get an array of complex characters and renditions from a curses window +.SH SYNOPSIS +.nf +\fB#include <curses.h>\fR + +\fBint in_wchstr(cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint in_wchnstr(cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint win_wchstr(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint win_wchnstr(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvin_wchstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvin_wchnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwin_wchstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvwin_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR, int \fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These functions return an array of complex characters in \fIwchstr\fR, +starting at the current cursor position in the named window. +Attributes (rendition) are stored with the characters. +.PP +The +\fBin_wchnstr\fR, +\fBmvin_wchnstr\fR, +\fBmvwin_wchnstr\fR +and +\fBwin_wchnstr\fR +fill the array +with at most +\fIn\fR +\fBcchar_t\fR +elements. +.br +.SH NOTES +Note that all routines except +\fBwin_wchnstr\fR +may be +macros. +.PP +Reading a line that overflows the array pointed to by +\fIwchstr\fR +with +\fBin_wchstr\fR, +\fBmvin_wchstr\fR, +\fBmvwin_wchstr\fR +or +\fBwin_wchstr\fR +causes undefined results. Therefore, the use of +\fBin_wchnstr\fR, +\fBmvin_wchnstr\fR, +\fBmvwin_wchnstr\fR, or +\fBwin_wchnstr\fR +is recommended. +.SH RETURN VALUES +Upon successful completion, these functions return +\fBOK\fR. +Otherwise, they return +\fBERR\fR. +.SH PORTABILITY +The XSI Curses defines no error conditions. +This implementation checks for null pointers, +returning ERR in that case. +.SH SEE ALSO +Functions: +\fBcurses\fR(3X), +\fBcurs_in_wch\fR(3X) +\fBcurs_instr\fR(3X), +\fBcurs_inwstr\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_ins_wch.3x b/contrib/ncurses/man/curs_ins_wch.3x new file mode 100644 index 0000000..23cf099 --- /dev/null +++ b/contrib/ncurses/man/curs_ins_wch.3x @@ -0,0 +1,65 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_ins_wch.3x,v 1.2 2002/03/10 23:43:27 tom Exp $ +.TH curs_ins_wch 3X "" +.SH NAME +\fBins_wch\fR, +\fBmvins_wch\fR, +\fBmvwins_wch\fR, +\fBwins_wch\fR \- insert a complex character and rendition into a window +.SH SYNOPSIS +#include <curses.h> + +\fBint ins_wch(const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wins_wch(WINDOW *\fR\fIwin, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvins_wch(int \fR\fIy, int \fR\fIx, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvwins_wch(WINDOW *\fR\fIwin, int \fR\fIy, int \fR\fIx, const cchar_t *\fR\fIwch\fR\fB);\fR +.SH DESCRIPTION +These routines, insert the complex character \fIwch\fR with rendition +before the character under the cursor. +All characters to the right of the cursor are moved one space to the right, +with the possibility of the rightmost character on the line being lost. +The insertion operation does not change the cursor position. +.SH RETURN VALUE +If successful, these functions return OK. +If not, they return ERR. +.SH ERRORS +No errors are defined. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_insch\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_ins_wstr.3x b/contrib/ncurses/man/curs_ins_wstr.3x new file mode 100644 index 0000000..197f30f --- /dev/null +++ b/contrib/ncurses/man/curs_ins_wstr.3x @@ -0,0 +1,104 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_ins_wstr.3x,v 1.2 2002/03/10 23:43:27 tom Exp $ +.TH curs_ins_wstr 3X "" +.SH NAME +\fBins_wstr\fR, +\fBins_nwstr\fR, +\fBwins_wstr\fR, +\fBwins_nwstr\fR, +\fBmvins_wstr\fR, +\fBmvins_nwstr\fR, +\fBmvwins_wstr\fR, +\fBmvwins_nwstr\fR \- insert a wide-character string into a curses window +.SH SYNOPSIS +.nf +\fB#include <curses.h>\fR + +\fBint ins_wstr(const wchar_t *\fR\fIwstr);\fR +.br +\fBint ins_nwstr(const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint wins_wstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint wins_nwstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvins_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvins_nwstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwins_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvwins_nwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines insert a \fBwchar_t\fR character string +(as many characters as will fit on the line) +before the character under the cursor. +All characters to the right of the cursor are shifted right, +with the possibility of the rightmost characters on the line being lost. +No wrapping is performed. +The cursor position does not change +(after moving to \fIy\fR, \fIx\fR, if specified). +The four routines with \fIn\fR as the last argument +insert a leading substring of at most \fIn\fR \fBwchar_t\fR characters. +If \fIn\fR is less than 1, the entire string is inserted. + +If a character in \fIwstr\fR is a tab, newline, carriage return or +backspace, the cursor is moved appropriately within the window. +A newline also does a \fBclrtoeol\fR before moving. +Tabs are considered to be at every eighth column. +If a character in \fIwstr\fR is another control character, +it is drawn in the \fB^\fR\fIX\fR notation. +Calling \fBwin_wch\fR after adding a control character +(and moving to it, if necessary) +does not return the control character, +but instead returns a character in the ^-representation +of the control character. +.SH NOTES +Note that all but wins_nwstr may be macros. + +If the first character in the string is a nonspacing character, these +functions will fail. +XSI does not define what will happen if a nonspacing character follows +a control character. +.SH RETURN VALUES +Upon successful completion, these functions return OK. +Otherwise, they return ERR. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_insstr\fR(3X), +\fBcurs_in_wch\fR(3X), +\fBcurs_ins_wch\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_insstr.3x b/contrib/ncurses/man/curs_insstr.3x index af84cb9..ed1e13e 100644 --- a/contrib/ncurses/man/curs_insstr.3x +++ b/contrib/ncurses/man/curs_insstr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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: curs_insstr.3x,v 1.11 2000/07/01 19:57:49 tom Exp $ +.\" $Id: curs_insstr.3x,v 1.12 2001/11/03 19:59:03 tom Exp $ .TH curs_insstr 3X "" .SH NAME \fBinsstr\fR, @@ -83,7 +83,7 @@ Note that all but \fBwinsnstr\fR may be macros. These functions are described in the XSI Curses standard, Issue 4, which adds const qualifiers to the arguments. The XSI Curses error conditions \fBEILSEQ\fR and \fBEILOVERFLOW\fR associated with extended-level conformance -are not yet detected (this implementation does not yet support XPG4 multi-byte +are not yet detected (this implementation does not yet support XPG4 multibyte characters). .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_clear\fR(3X), \fBcurs_inch\fR(3X). diff --git a/contrib/ncurses/man/curs_instr.3x b/contrib/ncurses/man/curs_instr.3x index 283ae19..9a09ab2 100644 --- a/contrib/ncurses/man/curs_instr.3x +++ b/contrib/ncurses/man/curs_instr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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: curs_instr.3x,v 1.9 2000/07/01 20:05:03 tom Exp $ +.\" $Id: curs_instr.3x,v 1.10 2001/11/03 19:58:56 tom Exp $ .TH curs_instr 3X "" .SH NAME \fBinstr\fR, @@ -71,7 +71,7 @@ Note that all routines except \fBwinnstr\fR may be macros. The XSI Curses error conditions \fBEILSEQ\fR and \fBEILOVERFLOW\fR associated with extended-level conformance are not yet detected (this implementation does not -yet support XPG4 multi-byte characters). +yet support XPG4 multibyte characters). SVr4 does not document whether a length limit includes or excludes the trailing NUL. .PP diff --git a/contrib/ncurses/man/curs_inwstr.3x b/contrib/ncurses/man/curs_inwstr.3x new file mode 100644 index 0000000..b345ce6 --- /dev/null +++ b/contrib/ncurses/man/curs_inwstr.3x @@ -0,0 +1,95 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 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: curs_inwstr.3x,v 1.2 2002/04/13 20:25:35 tom Exp $ +.TH curs_inwstr 3 "" +.SH NAME +.PP +\fBinwstr\fR, +\fBinnwstr\fR, +\fBwinwstr\fR, +\fBwinnwstr\fR, +\fBmvinwstr\fR, +\fBmvinnwstr\fR, +\fBmvwinwstr\fR, +\fBmvwinnwstr\fR \- get a string of \fBwchar_t\fR characters from a curses window +.SH SYNOPSIS +.nf +\fB#include <curses.h> \fR + +\fBint inwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint innwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint winwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint winnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvinwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint mvinnwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwinwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint mvwinnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines return a string of \fBwchar_t\fR characters in \fIwstr\fR, +extracted starting at the current cursor position in the named window. +Attributes are stripped from the characters. +The four functions with \fIn\fR as the last argument return a leading substring at most +\fIn\fR bytes long (exclusive of the trailing NUL). +Transfer stops at the end of the current line, or when \fIn\fR bytes have +been stored at the location referenced by \fIwstr\fR. +.PP +If the size \fIn\fR is not large enough to store a complete character, +an error is generated. +.SH NOTES +Note that all routines except +\fBwinnwstr\fR +may be macros. +.SH RETURN VALUES +All routines return +\fBERR\fR +upon failure. Upon +successful completion, the *\fBinwstr\fR +routines return +\fBOK\fR, and the *\fBinnwstr\fR +routines return the +number of characters read into the string. +.SH SEE ALSO +Functions: +\fBcurses\fR(3X), +\fBcurs_instr\fR(3X), +\fBcurs_in_wchstr\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/contrib/ncurses/man/curs_kernel.3x b/contrib/ncurses/man/curs_kernel.3x index ada1a1d1..caeb5bb 100644 --- a/contrib/ncurses/man/curs_kernel.3x +++ b/contrib/ncurses/man/curs_kernel.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_kernel.3x,v 1.12 2000/02/27 01:37:46 tom Exp $ +.\" $Id: curs_kernel.3x,v 1.13 2001/12/08 18:01:25 tom Exp $ .TH curs_kernel 3X "" .SH NAME \fBdef_prog_mode\fR, \fBdef_shell_mode\fR, @@ -138,7 +138,7 @@ on the correctness of the return value anywhere else. Both ncurses and SVr4 will call \fBcurs_set\fR in \fBendwin\fR if \fBcurs_set\fR has been called to make the cursor other than normal, i.e., either -visible or very visible. +invisible or very visible. There is no way for ncurses to determine the initial cursor state to restore that. .SH PORTABILITY diff --git a/contrib/ncurses/man/curs_mouse.3x b/contrib/ncurses/man/curs_mouse.3x index 316598a..8211ef8 100644 --- a/contrib/ncurses/man/curs_mouse.3x +++ b/contrib/ncurses/man/curs_mouse.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 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: curs_mouse.3x,v 1.15 2000/07/08 12:50:08 tom Exp $ +.\" $Id: curs_mouse.3x,v 1.19 2002/02/16 22:39:04 tom Exp $ .TH curs_mouse 3X "" .SH NAME \fBgetmouse\fR, \fBungetmouse\fR, @@ -67,19 +67,23 @@ MEVENT;\fR .br .SH DESCRIPTION These functions provide an interface to mouse events from -\fBncurses\fR(3X). Mouse events are represented by \fBKEY_MOUSE\fR +\fBncurses\fR(3X). +Mouse events are represented by \fBKEY_MOUSE\fR pseudo-key values in the \fBwgetch\fR input stream. -To make mouse events visible, use the \fBmousemask\fR function. This will set -the mouse events to be reported. By default, no mouse events are reported. +To make mouse events visible, use the \fBmousemask\fR function. +This will set +the mouse events to be reported. +By default, no mouse events are reported. The function will return a mask to indicate which of the specified mouse events -can be reported; on complete failure it returns 0. If oldmask is non-NULL, +can be reported; on complete failure it returns 0. +If oldmask is non-NULL, this function fills the indicated location with the previous value of the given window's mouse event mask. As a side effect, setting a zero mousemask may turn off the mouse pointer; -setting a nonzero mask may turn it on. Whether this happens is -device-dependent. +setting a nonzero mask may turn it on. +Whether this happens is device-dependent. Here are the mouse event type masks: @@ -119,20 +123,24 @@ Once a class of mouse events have been made visible in a window, calling the \fBwgetch\fR function on that window may return \fBKEY_MOUSE\fR as an indicator that a mouse event has been queued. To read the event data and pop the event off the queue, call -\fBgetmouse\fR. This function will return \fBOK\fR if a mouse event +\fBgetmouse\fR. +This function will return \fBOK\fR if a mouse event is actually visible in the given window, \fBERR\fR otherwise. When \fBgetmouse\fR returns \fBOK\fR, the data deposited as y and x in the event structure coordinates will be screen-relative character-cell -coordinates. The returned state mask will have exactly one bit set to +coordinates. +The returned state mask will have exactly one bit set to indicate the event type. -The \fBungetmouse\fR function behaves analogously to \fBungetch\fR. It pushes +The \fBungetmouse\fR function behaves analogously to \fBungetch\fR. +It pushes a \fBKEY_MOUSE\fR event onto the input queue, and associates with that event the given state data and screen-relative character-cell coordinates. The \fBwenclose\fR function tests whether a given pair of screen-relative character-cell coordinates is enclosed by a given window, returning TRUE -if it is and FALSE otherwise. It is useful for determining what subset of +if it is and FALSE otherwise. +It is useful for determining what subset of the screen windows enclose the location of a mouse event. The \fBwmouse_trafo\fR function transforms a given pair of coordinates from @@ -140,24 +148,33 @@ stdscr-relative coordinates to screen-relative coordinates or vice versa. Please remember, that stdscr-relative coordinates are not always identical to screen-relative coordinates due to the mechanism to reserve lines on top or bottom of the screen for other purposes (ripoff() call, see also slk_... -functions). If the parameter \fBto_screen\fR is \fBTRUE\fR, the pointers +functions). +If the parameter \fBto_screen\fR is \fBTRUE\fR, the pointers \fBpY, pX\fR must reference the coordinates of a location inside the window -\fBwin\fR. They are converted to screen-relative coordinates and returned -through the pointers. If the conversion was successful, the function -returns \fBTRUE\fR. If one of the parameters was NULL or the location is -not inside the window, \fBFALSE\fR is returned. If \fBto_screen\fR is +\fBwin\fR. +They are converted to screen-relative coordinates and returned +through the pointers. +If the conversion was successful, the function returns \fBTRUE\fR. +If one of the parameters was NULL or the location is +not inside the window, \fBFALSE\fR is returned. +If \fBto_screen\fR is \fBFALSE\fR, the pointers \fBpY, pX\fR must reference screen-relative -coordinates. They are converted to stdscr-relative coordinates if the -window \fBwin\fR encloses this point. In this case the function returns -\fBTRUE\fR. If one of the parameters is NULL or the point is not inside the -window, \fBFALSE\fR is returned. Please notice, that the referenced coordinates +coordinates. +They are converted to stdscr-relative coordinates if the +window \fBwin\fR encloses this point. +In this case the function returns \fBTRUE\fR. +If one of the parameters is NULL or the point is not inside the +window, \fBFALSE\fR is returned. +Please notice, that the referenced coordinates are only replaced by the converted coordinates if the transformation was successful. The \fBmouseinterval\fR function sets the maximum time (in thousands of a -second) that can elapse between press and release events in order for them to -be recognized as a click. This function returns the previous interval value. -The default is one fifth of a second. +second) that can elapse between press and release events for them to +be recognized as a click. +Use \fBmouseinterval(-1)\fR to disable click resolution. +This function returns the previous interval value. +The default is one sixth of a second. Note that mouse events will be ignored when input is in cooked mode, and will cause an error beep when cooked mode is being simulated in a window by a @@ -167,8 +184,10 @@ termination. .SH RETURN VALUE \fBgetmouse\fR, \fBungetmouse\fR and \fBmouseinterval\fR return the integer \fBERR\fR upon failure or \fBOK\fR -upon successful completion. \fBmousemask\fR returns the -mask of reportable events. \fBwenclose\fR and \fBwmouse_trafo\fR +upon successful completion. +\fBmousemask\fR returns the +mask of reportable events. +\fBwenclose\fR and \fBwmouse_trafo\fR are boolean functions returning \fBTRUE\fR or \fBFALSE\fR depending on their test result. .SH PORTABILITY @@ -190,12 +209,14 @@ running on your machine, mouse events will not be visible to \fBncurses\fR(3X) (and the \fBwmousemask\fR function will always return \fB0\fR). -The z member in the event structure is not presently used. It is intended +The z member in the event structure is not presently used. +It is intended for use with touch screens (which may be pressure-sensitive) or with 3D-mice/trackballs/power gloves. .SH BUGS Mouse events under xterm will not in fact be ignored during cooked mode, -if they have been enabled by \fBwmousemask\fR. Instead, the xterm mouse +if they have been enabled by \fBwmousemask\fR. +Instead, the xterm mouse report sequence will appear in the string read. Mouse events under xterm will not be detected correctly in a window with @@ -205,7 +226,8 @@ of the response from xterm for mouse clicks). Because there are no standard terminal responses that would serve to identify terminals which support the xterm mouse protocol, \fBncurses\fR assumes that -if your $DISPLAY environment variable is set, and \fBkmous\fR is defined in +if your $TERM environment variable contains "xterm", +or \fBkmous\fR is defined in the terminal description, then the terminal may send mouse events. .SH SEE ALSO \fBcurses\fR(3X). diff --git a/contrib/ncurses/man/curs_move.3x b/contrib/ncurses/man/curs_move.3x index 25c47fe..2fff160 100644 --- a/contrib/ncurses/man/curs_move.3x +++ b/contrib/ncurses/man/curs_move.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 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: curs_move.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_move.3x,v 1.7 2001/11/03 19:58:47 tom Exp $ .TH curs_move 3X "" .SH NAME \fBmove\fR, \fBwmove\fR - move \fBcurses\fR window cursor @@ -52,7 +52,7 @@ Note that \fBmove\fR may be a macro. These functions are described in the XSI Curses standard, Issue 4. The standard specifies that if (y,x) is within a multi-column character, the cursor is moved to the first column of that character; however, this implementation -does not yet support the extended-level XSI multi-byte characters. +does not yet support the extended-level XSI multibyte characters. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_refresh\fR(3X) .\"# diff --git a/contrib/ncurses/man/curs_outopts.3x b/contrib/ncurses/man/curs_outopts.3x index 3ba7cf5..f9db6f2 100644 --- a/contrib/ncurses/man/curs_outopts.3x +++ b/contrib/ncurses/man/curs_outopts.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 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: curs_outopts.3x,v 1.16 2001/03/31 23:47:31 tom Exp $ +.\" $Id: curs_outopts.3x,v 1.17 2001/10/14 00:50:30 tom Exp $ .TH curs_outopts 3X "" .SH NAME \fBclearok\fR, \fBidlok\fR, \fBidcok\fR, \fBimmedok\fR, @@ -57,74 +57,96 @@ .br .SH DESCRIPTION These routines set options that change the style of output within -\fBcurses\fR. All options are initially \fBFALSE\fR, unless otherwise stated. +\fBcurses\fR. +All options are initially \fBFALSE\fR, unless otherwise stated. It is not necessary to turn these options off before calling \fBendwin\fR. If \fBclearok\fR is called with \fBTRUE\fR as argument, the next call to \fBwrefresh\fR with this window will clear the screen completely and -redraw the entire screen from scratch. This is useful when the contents of the -screen are uncertain, or in some cases for a more pleasing visual effect. If +redraw the entire screen from scratch. +This is useful when the contents of the +screen are uncertain, or in some cases for a more pleasing visual effect. +If the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR, the next call to \fBwrefresh\fR with any window causes the screen to be cleared and repainted from scratch. If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR considers using the hardware insert/delete line feature of terminals so -equipped. Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use -of line insertion and deletion. This option should be enabled only if the -application needs insert/delete line, for example, for a screen editor. It is +equipped. +Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use +of line insertion and deletion. +This option should be enabled only if the +application needs insert/delete line, for example, for a screen editor. +It is disabled by default because insert/delete line tends to be visually annoying -when used in applications where it isn't really needed. If insert/delete line +when used in applications where it isn't really needed. +If insert/delete line cannot be used, \fBcurses\fR redraws the changed portions of all lines. If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR no longer considers using the hardware insert/delete character feature of -terminals so equipped. Use of character insert/delete is enabled by default. +terminals so equipped. +Use of character insert/delete is enabled by default. Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use of character insertion and deletion. If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR, -\fIetc\fR., automatically cause a call to \fBwrefresh\fR. However, it may +\fIetc\fR., automatically cause a call to \fBwrefresh\fR. +However, it may degrade performance considerably, due to repeated calls to \fBwrefresh\fR. It is disabled by default. Normally, the hardware cursor is left at the location of the window cursor -being refreshed. The \fBleaveok\fR option allows the cursor to be left -wherever the update happens to leave it. It is useful for applications where +being refreshed. +The \fBleaveok\fR option allows the cursor to be left +wherever the update happens to leave it. +It is useful for applications where the cursor is not used, since it reduces the need for cursor motions. The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application -programmer to set a software scrolling region in a window. \fItop\fR and +programmer to set a software scrolling region in a window. +\fItop\fR and \fIbot\fR are the line numbers of the top and bottom margin of the scrolling -region. (Line 0 is the top line of the window.) If this option and +region. +(Line 0 is the top line of the window.) If this option and \fBscrollok\fR are enabled, an attempt to move off the bottom margin line causes all lines in the scrolling region to scroll one line in the direction -of the first line. Only the text of the window is scrolled. (Note that this +of the first line. +Only the text of the window is scrolled. +(Note that this has nothing to do with the use of a physical scrolling region capability in the -terminal, like that in the VT100. If \fBidlok\fR is enabled and the terminal +terminal, like that in the VT100. +If \fBidlok\fR is enabled and the terminal has either a scrolling region or insert/delete line capability, they will probably be used by the output routines.) The \fBscrollok\fR option controls what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last -line. If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom -line. If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line -(Note that in order to get the physical scrolling effect on the terminal, it is +line. +If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom +line. +If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line +(Note that to get the physical scrolling effect on the terminal, it is also necessary to call \fBidlok\fR). The \fBnl\fR and \fBnonl\fR routines control whether the underlying display device translates the return key into newline on input, and whether it translates newline into return and line-feed on output (in either case, the call \fBaddch('\\n')\fR does the equivalent of return and line feed on the -virtual screen). Initially, these translations do occur. If you disable them +virtual screen). +Initially, these translations do occur. +If you disable them using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed -capability, resulting in faster cursor motion. Also, \fBcurses\fR will then be +capability, resulting in faster cursor motion. +Also, \fBcurses\fR will then be able to detect the return key. .SH RETURN VALUE The functions \fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success -and \fBERR\fR upon failure. All other routines that return an integer always +and \fBERR\fR upon failure. +All other routines that return an integer always return \fBOK\fR. .SH PORTABILITY These functions are described in the XSI Curses standard, Issue 4. @@ -132,19 +154,22 @@ These functions are described in the XSI Curses standard, Issue 4. The XSI Curses standard is ambiguous on the question of whether \fBraw\fR() should disable the CRLF translations controlled by \fBnl\fR() and \fBnonl\fR(). BSD curses did turn off these translations; AT&T curses (at least as late as -SVr1) did not. We choose to do so, on the theory that a programmer requesting +SVr1) did not. +We choose to do so, on the theory that a programmer requesting raw input wants a clean (ideally 8-bit clean) connection that the operating system does not mess with. Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of \fBclearok(..., 1)\fR by saying -\fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. This will not work under +\fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. +This will not work under ncurses. Earlier System V curses implementations specified that with \fBscrollok\fR enabled, any window modification triggering a scroll also forced a physical -refresh. XSI Curses does not require this, and \fBncurses\fR avoids doing -it in order to perform better vertical-motion optimization at \fBwrefresh\fR +refresh. +XSI Curses does not require this, and \fBncurses\fR avoids doing +it to perform better vertical-motion optimization at \fBwrefresh\fR time. The XSI Curses standard does not mention that the cursor should be diff --git a/contrib/ncurses/man/curs_overlay.3x b/contrib/ncurses/man/curs_overlay.3x index 9c0b82c..f17b375 100644 --- a/contrib/ncurses/man/curs_overlay.3x +++ b/contrib/ncurses/man/curs_overlay.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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: curs_overlay.3x,v 1.9 2000/07/01 20:05:31 tom Exp $ +.\" $Id: curs_overlay.3x,v 1.10 2001/11/03 19:58:30 tom Exp $ .TH curs_overlay 3X "" .SH NAME \fBoverlay\fR, @@ -65,7 +65,7 @@ Note that \fBoverlay\fR and \fBoverwrite\fR may be macros. .SH PORTABILITY The XSI Curses standard, Issue 4 describes these functions (adding the const qualifiers). It further specifies their behavior in the presence of characters -with multi-byte renditions (not yet supported in this implementation). +with multibyte renditions (not yet supported in this implementation). .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_pad\fR(3X), \fBcurs_refresh\fR(3X) .\"# diff --git a/contrib/ncurses/man/curs_print.3x b/contrib/ncurses/man/curs_print.3x index 7b78198..dd4b6e3 100644 --- a/contrib/ncurses/man/curs_print.3x +++ b/contrib/ncurses/man/curs_print.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: curs_print.3x,v 1.3 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_print.3x,v 1.5 2002/02/16 22:39:04 tom Exp $ .TH curs_print 3X "" .SH NAME \fBmcprint\fR - ship binary data to printer diff --git a/contrib/ncurses/man/curs_refresh.3x b/contrib/ncurses/man/curs_refresh.3x index 9b4cb1d..210b326 100644 --- a/contrib/ncurses/man/curs_refresh.3x +++ b/contrib/ncurses/man/curs_refresh.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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,15 +26,15 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_refresh.3x,v 1.8 2000/07/01 20:06:14 tom Exp $ +.\" $Id: curs_refresh.3x,v 1.10 2001/11/03 18:57:12 tom Exp $ .TH curs_refresh 3X "" .SH NAME -\fBrefresh\fR, -\fBwrefresh\fR, -\fBwnoutrefresh\fR, \fBdoupdate\fR, \fBredrawwin\fR, -\fBwredrawln\fR - refresh \fBcurses\fR windows and lines +\fBrefresh\fR, +\fBwnoutrefresh\fR, +\fBwredrawln\fR, +\fBwrefresh\fR - refresh \fBcurses\fR windows and lines .SH SYNOPSIS \fB#include <curses.h>\fR @@ -53,15 +53,19 @@ .SH DESCRIPTION The \fBrefresh\fR and \fBwrefresh\fR routines (or \fBwnoutrefresh\fR and \fBdoupdate\fR) must be called to get actual output to the terminal, as other -routines merely manipulate data structures. The routine \fBwrefresh\fR copies +routines merely manipulate data structures. +The routine \fBwrefresh\fR copies the named window to the physical terminal screen, taking into account what is -already there in order to do optimizations. The \fBrefresh\fR routine is the -same, using \fBstdscr\fR as the default window. Unless \fBleaveok\fR has been +already there to do optimizations. +The \fBrefresh\fR routine is the +same, using \fBstdscr\fR as the default window. +Unless \fBleaveok\fR has been enabled, the physical cursor of the terminal is left at the location of the cursor for that window. The \fBwnoutrefresh\fR and \fBdoupdate\fR routines allow multiple updates with -more efficiency than \fBwrefresh\fR alone. In addition to all the window +more efficiency than \fBwrefresh\fR alone. +In addition to all the window structures, \fBcurses\fR keeps two data structures representing the terminal screen: a physical screen, describing what is actually on the screen, and a virtual screen, describing what the programmer wants to have on the screen. @@ -69,21 +73,26 @@ virtual screen, describing what the programmer wants to have on the screen. The routine \fBwrefresh\fR works by first calling \fBwnoutrefresh\fR, which copies the named window to the virtual screen, and then calling \fBdoupdate\fR, which compares the virtual screen to the physical screen and does the actual -update. If the programmer wishes to output several windows at once, a series +update. +If the programmer wishes to output several windows at once, a series of calls to \fBwrefresh\fR results in alternating calls to \fBwnoutrefresh\fR -and \fBdoupdate\fR, causing several bursts of output to the screen. By first +and \fBdoupdate\fR, causing several bursts of output to the screen. +By first calling \fBwnoutrefresh\fR for each window, it is then possible to call \fBdoupdate\fR once, resulting in only one burst of output, with fewer total -characters transmitted and less CPU time used. If the \fIwin\fR argument to +characters transmitted and less CPU time used. +If the \fIwin\fR argument to \fBwrefresh\fR is the global variable \fBcurscr\fR, the screen is immediately cleared and repainted from scratch. The phrase "copies the named window to the virtual screen" above is ambiguous. What actually happens is that all \fItouched\fR (changed) lines in the window -are copied to the virtual screen. This affects programs that use overlapping +are copied to the virtual screen. +This affects programs that use overlapping windows; it means that if two windows overlap, you can refresh them in either order and the overlap region will be modified only when it is explicitly -changed. (But see the section on \fBPORTABILITY\fR below for a warning about +changed. +(But see the section on \fBPORTABILITY\fR below for a warning about exploiting this behavior.) The \fBwredrawln\fR routine indicates to \fBcurses\fR that some screen lines @@ -101,9 +110,11 @@ The XSI Curses standard, Issue 4 describes these functions. Whether \fBwnoutrefresh()\fR copies to the virtual screen the entire contents of a window or just its changed portions has never been well-documented in -historic curses versions (including SVr4). It might be unwise to rely on +historic curses versions (including SVr4). +It might be unwise to rely on either behavior in programs that might have to be linked with other curses -implementations. Instead, you can do an explicit \fBtouchwin()\fR before the +implementations. +Instead, you can do an explicit \fBtouchwin()\fR before the \fBwnoutrefresh()\fR call to guarantee an entire-contents copy anywhere. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_outopts\fR(3X) diff --git a/contrib/ncurses/man/curs_scroll.3x b/contrib/ncurses/man/curs_scroll.3x index 863b587..f957ac9 100644 --- a/contrib/ncurses/man/curs_scroll.3x +++ b/contrib/ncurses/man/curs_scroll.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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: curs_scroll.3x,v 1.8 2000/07/01 17:54:23 tom Exp $ +.\" $Id: curs_scroll.3x,v 1.9 2001/10/14 00:51:56 tom Exp $ .TH curs_scroll 3X "" .SH NAME \fBscroll\fR, \fBscrl\fR, \fBwscrl\fR - scroll a \fBcurses\fR window @@ -40,15 +40,19 @@ \fBint wscrl(WINDOW *win, int n);\fR .br .SH DESCRIPTION -The \fBscroll\fR routine scrolls the window up one line. This involves moving -the lines in the window data structure. As an optimization, if the scrolling +The \fBscroll\fR routine scrolls the window up one line. +This involves moving +the lines in the window data structure. +As an optimization, if the scrolling region of the window is the entire screen, the physical screen may be scrolled at the same time. For positive \fIn\fR, the \fBscrl\fR and \fBwscrl\fR routines scroll the window up \fIn\fR lines (line \fIi\fR+\fIn\fR becomes \fIi\fR); otherwise -scroll the window down \fIn\fR lines. This involves moving the lines in the -window character image structure. The current cursor position is not changed. +scroll the window down \fIn\fR lines. +This involves moving the lines in the +window character image structure. +The current cursor position is not changed. For these functions to work, scrolling must be enabled via \fBscrollok\fR. .SH RETURN VALUE @@ -59,8 +63,9 @@ Note that \fBscrl\fR and \fBscroll\fR may be macros. The SVr4 documentation says that the optimization of physically scrolling immediately if the scroll region is the entire screen "is" performed, not -"may be" performed. This implementation deliberately does not guarantee -that this will occur, in order to leave open the possibility of smarter +"may be" performed. +This implementation deliberately does not guarantee +that this will occur, to leave open the possibility of smarter optimization of multiple scroll actions on the next update. Neither the SVr4 nor the XSI documentation specify whether the current diff --git a/contrib/ncurses/man/curs_termattrs.3x b/contrib/ncurses/man/curs_termattrs.3x index 3938bc0..d285b86 100644 --- a/contrib/ncurses/man/curs_termattrs.3x +++ b/contrib/ncurses/man/curs_termattrs.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 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,11 +26,19 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_termattrs.3x,v 1.6 2000/07/08 12:53:34 tom Exp $ +.\" $Id: curs_termattrs.3x,v 1.8 2002/05/11 21:32:26 tom Exp $ .TH curs_termattrs 3X "" .SH NAME -\fBbaudrate\fR, \fBerasechar\fR, \fBhas_ic\fR, -\fBhas_il\fR, \fBkillchar\fR, \fBlongname\fR, \fBtermattrs\fR, +\fBbaudrate\fR, +\fBerasechar\fR, +\fBerasewchar\fR, +\fBhas_ic\fR, +\fBhas_il\fR, +\fBkillchar\fR, +\fBkillwchar\fR, +\fBlongname\fR, +\fBterm_attrs\fR, +\fBtermattrs\fR, \fBtermname\fR - \fBcurses\fR environment query routines .SH SYNOPSIS \fB#include <curses.h>\fR @@ -39,15 +47,21 @@ .br \fBchar erasechar(void);\fR .br +\fBint erasewchar(wchar_t *\fR\fIch\fR\fB);\fR +.br \fBbool has_ic(void);\fR .br \fBbool has_il(void);\fR .br \fBchar killchar(void);\fR .br +\fBint killwchar(wchar_t *\fR\fIch\fR\fB);\fR +.br \fBchar *longname(void);\fR .br -\fBattr_t termattrs(void);\fR +\fBattr_t term_attrs(void);\fR +.br +\fBchtype termattrs(void);\fR .br \fBchar *termname(void);\fR .br @@ -58,6 +72,11 @@ integer. The \fBerasechar\fR routine returns the user's current erase character. +The \fBerasewchar\fR routine stores the current erase character +in the location referenced by \fIch\fR. +If no erase character has been defined, the routine fails +and the location referenced by \fIch\fR is not changed. + The \fBhas_ic\fR routine is true if the terminal has insert- and delete- character capabilities. @@ -68,6 +87,11 @@ scrolling using \fBscrollok\fR. The \fBkillchar\fR routine returns the user's current line kill character. +The \fBkillwchar\fR routine stores the current line-kill character +in the location referenced by \fIch\fR. +If no line-kill character has been defined, +the routine fails and the location referenced by \fIch\fR is not changed. + The \fBlongname\fR routine returns a pointer to a static area containing a verbose description of the current terminal. The maximum length of a verbose description is 128 characters. It is defined only @@ -79,9 +103,11 @@ terminals. If a given terminal doesn't support a video attribute that an application program is trying to use, \fBcurses\fR may substitute a -different video attribute for it. The \fBtermattrs\fR function -returns a logical \fBOR\fR of all video attributes supported by the -terminal. This information is useful when a \fBcurses\fR program +different video attribute for it. +The \fBtermattrs\fR and \fBterm_attrs\fR functions +return a logical \fBOR\fR of all video attributes supported by the +terminal using \fIA_\fR and \fIWA_\fR constants respectively. +This information is useful when a \fBcurses\fR program needs complete control over the appearance of the screen. The \fBtermname\fR routine returns the value of the environmental diff --git a/contrib/ncurses/man/curs_termcap.3x b/contrib/ncurses/man/curs_termcap.3x index c7bd81a..828bb9a 100644 --- a/contrib/ncurses/man/curs_termcap.3x +++ b/contrib/ncurses/man/curs_termcap.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 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: curs_termcap.3x,v 1.14 2000/12/02 22:47:14 tom Exp $ +.\" $Id: curs_termcap.3x,v 1.16 2002/02/16 19:26:41 tom Exp $ .TH curs_termcap 3X "" .ds n 5 .SH NAME @@ -41,6 +41,11 @@ .br \fB#include <term.h>\fR .br +\fBextern char PC;\fR +\fBextern char * UP;\fR +\fBextern char * BC;\fR +\fBextern @NCURSES_OSPEED@ ospeed;\fR +.br \fBint tgetent(char *bp, const char *name);\fR .br \fBint tgetflag(char *id);\fR @@ -89,6 +94,21 @@ The output from this routine is to be passed to \fBtputs\fR. The \fBtputs\fR routine is described on the \fBcurs_terminfo\fR(3X) manual page. It can retrieve capabilities by either termcap or terminfo name. +The variables +\fBPC\fR, +\fBUP\fR and +\fBBC\fR +are set by \fBtgetent\fR to the terminfo entry's data for +\fBpad_char\fR, +\fBcursor_up\fR and +\fBbackspace_if_not_bs\fR, +respectively. +\fBUP\fR is not used by ncurses. +\fBPC\fR is used in the \fBtdelay_output\fR function. +\fBBC\fR is used in the \fBtgoto\fR emulation. +The variable \fBospeed\fR is set by ncurses in a system-specific coding +to reflect the terminal speed. + .SH RETURN VALUE Except where explicitly noted, routines that return an integer return \fBERR\fR upon failure and \fBOK\fR @@ -117,6 +137,17 @@ are marked TO BE WITHDRAWN and may be removed in future versions. Neither the XSI Curses standard nor the SVr4 man pages documented the return values of \fBtgetent\fR correctly, though all three were in fact returned ever since SVr1. +In particular, an omission in the XSI Curses documentation has been +misinterpreted to mean that \fBtgetent\fR returns \fBOK\fR or \fBERR\fR. +Because the purpose of these functions is to provide compatibility with +the \fItermcap\fR library, that is a defect in XCurses, Issue 4, Version 2 +rather than in ncurses. + +External variables are provided for support of certain termcap applications. +However, termcap applications' use of those variables is poorly documented, +e.g., not distinguishing between input and output. +In particular, some applications are reported to declare and/or +modify \fBospeed\fR. .SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBputc\fR(3S). .\"# diff --git a/contrib/ncurses/man/curs_terminfo.3x b/contrib/ncurses/man/curs_terminfo.3x index d55fa24..c61b695 100644 --- a/contrib/ncurses/man/curs_terminfo.3x +++ b/contrib/ncurses/man/curs_terminfo.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1999-2000,2002 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,57 +26,65 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_terminfo.3x,v 1.14 2000/12/03 00:07:23 tom Exp $ +.\" $Id: curs_terminfo.3x,v 1.15 2002/05/11 21:19:29 tom Exp $ .TH curs_terminfo 3X "" .ds n 5 .SH NAME -\fBsetupterm\fR, -\fBsetterm\fR, -\fBset_curterm\fR, \fBdel_curterm\fR, +\fBmvcur\fR, +\fBputp\fR, \fBrestartterm\fR, +\fBset_curterm\fR, +\fBsetterm\fR, +\fBsetupterm\fR, +\fBtigetflag\fR, +\fBtigetnum\fR, +\fBtigetstr\fR, \fBtparm\fR, \fBtputs\fR, -\fBputp\fR, -\fBvidputs\fR, +\fBvid_attr\fR, +\fBvid_puts\fR, \fBvidattr\fR, -\fBmvcur\fR, -\fBtigetflag\fR, -\fBtigetnum\fR, -\fBtigetstr\fR - \fBcurses\fR interfaces to terminfo database +\fBvidputs\fR - \fBcurses\fR interfaces to terminfo database .SH SYNOPSIS +.nf \fB#include <curses.h>\fR .br \fB#include <term.h>\fR -\fBint setupterm(const char *term, int fildes, int *errret);\fR +\fBint setupterm(const char *\fR\fIterm\fR\fB, int \fR\fIfildes\fR\fB, int *\fR\fIerrret\fR\fB);\fR +.br +\fBint setterm(const char *\fR\fIterm\fR\fB);\fR .br -\fBint setterm(const char *term);\fR +\fBTERMINAL *set_curterm(TERMINAL *\fR\fInterm\fR\fB);\fR .br -\fBTERMINAL *set_curterm(TERMINAL *nterm);\fR +\fBint del_curterm(TERMINAL *\fR\fIoterm\fR\fB);\fR .br -\fBint del_curterm(TERMINAL *oterm);\fR +\fBint restartterm(const char *\fR\fIterm\fR\fB, int \fR\fIfildes\fR\fB, int *\fR\fIerrret\fR\fB);\fR .br -\fBint restartterm(const char *term, int fildes, int *errret);\fR +\fBchar *tparm(const char *\fR\fIstr\fR\fB, ...);\fR .br -\fBchar *tparm(const char *str, ...);\fR +\fBint tputs(const char *\fR\fIstr\fR\fB, int \fR\fIaffcnt\fR\fB, int (*\fR\fIputc\fR\fB)(int));\fR .br -\fBint tputs(const char *str, int affcnt, int (*putc)(int));\fR +\fBint putp(const char *\fR\fIstr\fR\fB);\fR .br -\fBint putp(const char *str);\fR +\fBint vidputs(chtype \fR\fIattrs\fR\fB, int (*\fR\fIputc\fR\fB)(char));\fR .br -\fBint vidputs(chtype attrs, int (*putc)(char));\fR +\fBint vidattr(chtype \fR\fIattrs\fR\fB);\fR .br -\fBint vidattr(chtype attrs);\fR +\fBint vid_puts(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB, int (*\fR\fIputc\fR\fB)(char));\fR .br -\fBint mvcur(int oldrow, int oldcol, int newrow, int newcol);\fR +\fBint vid_attr(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB);\fR .br -\fBint tigetflag(const char *capname);\fR +\fBint mvcur(int \fR\fIoldrow\fR\fB, int \fR\fIoldcol\fR\fB, int \fR\fInewrow\fR, int \fR\fInewcol\fR\fB);\fR .br -\fBint tigetnum(const char *capname);\fR +\fBint tigetflag(const char *\fR\fIcapname\fR\fB);\fR .br -\fBchar *tigetstr(const char *capname);\fR +\fBint tigetnum(const char *\fR\fIcapname\fR\fB);\fR .br +\fBchar *tigetstr(const char *\fR\fIcapname\fR\fB);\fR +.br +.fi .SH DESCRIPTION These low-level routines must be called by programs that have to deal directly with the \fBterminfo\fR database to handle certain terminal @@ -196,6 +204,17 @@ the \fBputchar\fR-like routine \fIputc\fR. The \fBvidattr\fR routine is like the \fBvidputs\fR routine, except that it outputs through \fBputchar\fR. +The \fBvid_attr\fR and \fBvid_puts\fR routines correspond to vidattr and vidputs, +respectively. +They use a set of arguments for representing the video attributes plus color, +i.e., +one of type attr_t for the attributes and one of short for +the color_pair number. +The \fBvid_attr\fR and \fBvid_puts\fR routines +are designed to use the attribute constants with the \fIWA_\fR prefix. +The opts argument is reserved for future use. +Currently, applications must provide a null pointer for that argument. + The \fBmvcur\fR routine provides low-level cursor motion. It takes effect immediately (rather than at the next refresh). diff --git a/contrib/ncurses/man/curs_trace.3x b/contrib/ncurses/man/curs_trace.3x index a9dc57c..4af258d 100644 --- a/contrib/ncurses/man/curs_trace.3x +++ b/contrib/ncurses/man/curs_trace.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2000 Free Software Foundation, Inc. * +.\" Copyright (c) 2000,2002 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: curs_trace.3x,v 1.3 2000/07/29 16:34:24 tom Exp $ +.\" $Id: curs_trace.3x,v 1.5 2002/02/16 22:39:52 tom Exp $ .TH curs_trace 3X "" .SH NAME \fB_tracef\fR, @@ -131,7 +131,6 @@ maximum trace level, enables all of the separate trace features. Some tracing features are enabled whenever the \fBtrace\fR parameter is nonzero. Some features overlap. The specific names are used as a guideline. -.. .SH RETURN VALUE Routines which return a value are designed to be used as parameters to the \fB_tracef\fR routine. diff --git a/contrib/ncurses/man/curs_util.3x b/contrib/ncurses/man/curs_util.3x index 8f85cf4..09d490d 100644 --- a/contrib/ncurses/man/curs_util.3x +++ b/contrib/ncurses/man/curs_util.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 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,22 +26,33 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_util.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_util.3x,v 1.8 2002/02/23 22:55:47 tom Exp $ .TH curs_util 3X "" .SH NAME -\fBunctrl\fR, \fBkeyname\fR, \fBfilter\fR, -\fBuse_env\fR, \fBputwin\fR, \fBgetwin\fR, \fBdelay_output\fR, -\fBflushinp\fR - miscellaneous \fBcurses\fR utility routines +\fBdelay_output\fR, +\fBfilter\fR, +\fBflushinp\fR, +\fBgetwin\fR, +\fBkey_name\fR, +\fBkeyname\fR, +\fBputwin\fR, +\fBunctrl\fR, +\fBuse_env\fR, +\fBwunctrl\fR - miscellaneous \fBcurses\fR utility routines .SH SYNOPSIS \fB#include <curses.h>\fR \fBchar *unctrl(chtype c);\fR .br +\fBchar *wunctrl(wchar_t w);\fR +.br \fBchar *keyname(int c);\fR .br +\fBchar *key_name(wchar_t w);\fR +.br \fBvoid filter(void);\fR .br -\fBvoid use_env(char bool);\fR +\fBvoid use_env(bool f);\fR .br \fBint putwin(WINDOW *win, FILE *filep);\fR .br @@ -52,12 +63,22 @@ \fBint flushinp(void);\fR .br .SH DESCRIPTION -The \fBunctrl\fR macro expands to a character string which is a printable -representation of the character \fIc\fR. Control characters are displayed in -the \fB^\fR\fIX\fR notation. Printing characters are displayed as is. +The \fBunctrl\fR routine returns a character string which is a printable +representation of the character \fIc\fR, ignoring attributes. +Control characters are displayed in the \fB^\fR\fIX\fR notation. +Printing characters are displayed as is. +The corresponding \fBwunctrl\fR returns a printable representation of +a wide-character. -The \fBkeyname\fR routine returns a character string corresponding to -the key \fIc\fR. +The \fBkeyname\fR routine returns a character string corresponding to the key \fIc\fR. +Control characters are displayed in the \fB^\fR\fIX\fR notation. +Values above 128 are either meta characters, shown in the \fBM-\fR\fIX\fR notation, +or the names of function keys, or +"UNKNOWN STRING". +The corresponding \fBkey_name\fR returns a character string corresponding +to the wide-character value \fIw\fR. +The two functions do not return the same set of strings; +the latter returns "UNKNOWN STRING" where the former would display a meta character. The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or \fBnewterm\fR are called. The effect is that, during those calls, \fBLINES\fR @@ -98,12 +119,12 @@ upon failure and \fBOK\fR (SVr4 specifies only "an integer value other than Routines that return pointers return \fBNULL\fR on error. .SH PORTABILITY The XSI Curses standard, Issue 4 describes these functions. +It states that \fBunctrl\fR and \fBwunctrl\fR will return a null pointer if +unsuccessful, but does not define any error conditions. The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest terms. The description here is adapted from the XSI Curses standard (which erroneously fails to describe the disabling of \fBcuu\fR). -.SH NOTES -Note that \fBunctrl\fR is a macro, which is defined in <\fBunctrl.h\fR>. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_scr_dump\fR(3X). .\"# diff --git a/contrib/ncurses/man/default_colors.3x b/contrib/ncurses/man/default_colors.3x index 9d6d97c..4ebb901 100644 --- a/contrib/ncurses/man/default_colors.3x +++ b/contrib/ncurses/man/default_colors.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 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 * @@ -28,20 +28,17 @@ .\" .\" Author: Thomas E. Dickey <dickey@clark.net> 1997,1999,2000 .\" -.\" $Id: default_colors.3x,v 1.13 2000/07/15 22:06:50 tom Exp $ +.\" $Id: default_colors.3x,v 1.16 2002/02/16 22:39:52 tom Exp $ .TH default_colors 3X "" .SH NAME -\fBdefault_colors\fR: \fBuse_default_colors\fR, \fBassume_default_colors\fR \- use terminal's default colors -.. .SH SYNOPSIS \fB#include <curses.h>\fP \fBint use_default_colors(void);\fP .br \fBint assume_default_colors(int fg, int bg);\fP -.. .SH DESCRIPTION The .I use_default_colors() @@ -100,28 +97,23 @@ or .I assume_default_colors() ncurses will paint a white foreground (text) with black background for color pair 0. -.. .SH RETURN VALUE These functions return the integer \fBERR\fP upon failure and \fBOK\fP on success. They will fail if either the terminal does not support the \fIorig_pair\fP or \fIorig_colors\fP capability. If the \fIinitialize_pair\fP capability is found, this causes an error as well. -.. .SH NOTES Associated with this extension, the \fBinit_pair\fR(3X) function accepts negative arguments to specify default foreground or background colors. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBcurs_color\fR(3X), \fBded\fP(1). -.. .SH AUTHOR Thomas Dickey (from an analysis of the requirements for color xterm for XFree86 3.1.2C, February 1996). diff --git a/contrib/ncurses/man/define_key.3x b/contrib/ncurses/man/define_key.3x index 047d78f..1019c42 100644 --- a/contrib/ncurses/man/define_key.3x +++ b/contrib/ncurses/man/define_key.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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 * @@ -28,16 +28,14 @@ .\" .\" Author: Thomas E. Dickey <dickey@clark.net> 1997 .\" -.\" $Id: define_key.3x,v 1.6 1999/02/19 11:43:17 tom Exp $ +.\" $Id: define_key.3x,v 1.8 2002/02/16 22:39:52 tom Exp $ .TH define_key 3X "" .SH NAME \fBdefine_key\fP \- define a keycode -.. .SH SYNOPSIS \fB#include <curses.h>\fP \fBint define_key(char *definition, int keycode);\fP -.. .SH DESCRIPTION This is an extension to the curses library. It permits an application to define keycodes with their corresponding control @@ -48,18 +46,14 @@ If the given string is null, any existing definition for the keycode is removed. Similarly, if the given keycode is negative or zero, any existing string for the given definition is removed. -.. .SH RETURN VALUE The keycode must be greater than zero, else ERR is returned. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBkeyok\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/contrib/ncurses/man/form.3x b/contrib/ncurses/man/form.3x index 51c1e8c..811b9ff 100644 --- a/contrib/ncurses/man/form.3x +++ b/contrib/ncurses/man/form.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form.3x,v 1.13 1999/07/10 21:53:03 tom Exp $ +.\" $Id: form.3x,v 1.15 2002/01/19 22:48:05 tom Exp $ .TH form 3X "" .SH NAME \fBform\fR - curses extension for programming forms @@ -177,7 +177,7 @@ No fields are connected to the form. \fBE_REQUEST_DENIED\fR The form driver could not process the request. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<form.h>\fR automatically includes the header files diff --git a/contrib/ncurses/man/form_driver.3x b/contrib/ncurses/man/form_driver.3x index 408aecd..2354089 100644 --- a/contrib/ncurses/man/form_driver.3x +++ b/contrib/ncurses/man/form_driver.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form_driver.3x,v 1.7 1999/07/10 23:13:18 tom Exp $ +.\" $Id: form_driver.3x,v 1.9 2002/02/16 22:39:52 tom Exp $ .TH form_driver 3X "" .SH NAME \fBform_driver\fR - command-processing loop of the form system diff --git a/contrib/ncurses/man/form_field_attributes.3x b/contrib/ncurses/man/form_field_attributes.3x index 7f6293d..ac7a3b5 100644 --- a/contrib/ncurses/man/form_field_attributes.3x +++ b/contrib/ncurses/man/form_field_attributes.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001,2002 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: form_field_attributes.3x,v 1.5 1998/11/29 01:06:02 Rick.Ohnemus Exp $ +.\" $Id: form_field_attributes.3x,v 1.7 2002/01/19 22:48:14 tom Exp $ .TH form_field_attributes 3X "" .SH NAME \fBform_field_attributes\fR - color and attribute control for form fields @@ -44,7 +44,7 @@ chtype field_back(const FIELD *field); .br int set_field_pad(FIELD *field, int pad); .br -chtype field_pad(const FIELD *field); +int field_pad(const FIELD *field); .br .SH DESCRIPTION The function \fBset_field_fore\fR sets the foreground attribute of @@ -72,7 +72,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<form.h>\fR automatically includes the header file diff --git a/contrib/ncurses/man/form_field_buffer.3x b/contrib/ncurses/man/form_field_buffer.3x index 202d4e7..814c5d9 100644 --- a/contrib/ncurses/man/form_field_buffer.3x +++ b/contrib/ncurses/man/form_field_buffer.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form_field_buffer.3x,v 1.8 1999/06/16 00:37:09 juergen Exp $ +.\" $Id: form_field_buffer.3x,v 1.9 2002/01/19 22:48:23 tom Exp $ .TH form_field_buffer 3X "" .SH NAME \fBform_field_buffer\fR - field buffer control @@ -80,7 +80,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<form.h>\fR automatically includes the header file diff --git a/contrib/ncurses/man/form_field_info.3x b/contrib/ncurses/man/form_field_info.3x index 6165dd7..56b81ac 100644 --- a/contrib/ncurses/man/form_field_info.3x +++ b/contrib/ncurses/man/form_field_info.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001,2002 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: form_field_info.3x,v 1.6 2000/04/15 22:21:31 tom Exp $ +.\" $Id: form_field_info.3x,v 1.8 2002/01/19 22:48:32 tom Exp $ .TH form_field_info 3X "" .SH NAME \fBform_field_info\fR - retrieve field characteristics @@ -37,7 +37,7 @@ int field_info(const FIELD *field, int *rows, int *cols, int *frow, int *fcol, int *nrow, int *nbuf); .br -int dynamic_field_info(const FIELD *field, int *rows, int *cols, *max); +int dynamic_field_info(const FIELD *field, int *rows, int *cols, int *max); .br .SH DESCRIPTION The function \fBfield_info\fR returns the sizes and other attributes passed in @@ -61,7 +61,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<form.h>\fR automatically includes the header file diff --git a/contrib/ncurses/man/form_field_just.3x b/contrib/ncurses/man/form_field_just.3x index dcb4676..9468d8b 100644 --- a/contrib/ncurses/man/form_field_just.3x +++ b/contrib/ncurses/man/form_field_just.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form_field_just.3x,v 1.5 1998/11/29 01:06:32 Rick.Ohnemus Exp $ +.\" $Id: form_field_just.3x,v 1.6 2002/01/19 22:48:41 tom Exp $ .TH form_field_just 3X "" .SH NAME \fBform_field_just\fR - retrieve field characteristics @@ -59,7 +59,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<form.h>\fR automatically includes the header file diff --git a/contrib/ncurses/man/form_field_new.3x b/contrib/ncurses/man/form_field_new.3x index b798b5b..9691520 100644 --- a/contrib/ncurses/man/form_field_new.3x +++ b/contrib/ncurses/man/form_field_new.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form_field_new.3x,v 1.9 1998/11/29 01:06:44 Rick.Ohnemus Exp $ +.\" $Id: form_field_new.3x,v 1.11 2002/02/16 22:39:52 tom Exp $ .TH form_field_new 3X "" .SH NAME \fBform_field_new\fR - create and destroy form fields diff --git a/contrib/ncurses/man/form_field_validation.3x b/contrib/ncurses/man/form_field_validation.3x index c3f90ba..cc3d508 100644 --- a/contrib/ncurses/man/form_field_validation.3x +++ b/contrib/ncurses/man/form_field_validation.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form_field_validation.3x,v 1.10 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: form_field_validation.3x,v 1.12 2002/02/16 22:39:52 tom Exp $ .TH form_field_validation 3X "" .SH NAME \fBform_field_validation\fR - data type validation for fields diff --git a/contrib/ncurses/man/form_fieldtype.3x b/contrib/ncurses/man/form_fieldtype.3x index d93ba28..69a8e20 100644 --- a/contrib/ncurses/man/form_fieldtype.3x +++ b/contrib/ncurses/man/form_fieldtype.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 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: form_fieldtype.3x,v 1.8 2000/07/15 22:02:03 tom Exp $ +.\" $Id: form_fieldtype.3x,v 1.9 2001/08/04 20:36:25 William.Setzer Exp $ .TH form_fieldtype 3X "" .SH NAME \fBform_fieldtype\fR - define validation-field types @@ -47,7 +47,7 @@ int set_fieldtype_arg( void (* const free_arg)(void *)); .br int set_fieldtype_choice( - FIELDTYPE *fieldtype + FIELDTYPE *fieldtype, bool (* const next_choice)(FIELD *, const void *), bool (* const prev_choice)(FIELD *, const void *)); .br diff --git a/contrib/ncurses/man/form_new_page.3x b/contrib/ncurses/man/form_new_page.3x index b93b48c..432f624 100644 --- a/contrib/ncurses/man/form_new_page.3x +++ b/contrib/ncurses/man/form_new_page.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: form_new_page.3x,v 1.5 1998/11/29 01:07:45 Rick.Ohnemus Exp $ +.\" $Id: form_new_page.3x,v 1.6 2002/01/19 22:48:51 tom Exp $ .TH form_new_page 3X "" .SH NAME \fBform_new_page\fR - form pagination functions @@ -58,7 +58,7 @@ System error occurred (see \fBerrno\fR). \fBE_CONNECTED\fR The given field is already connected to a form. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<form.h>\fR automatically includes the header file diff --git a/contrib/ncurses/man/infocmp.1m b/contrib/ncurses/man/infocmp.1m index 1276cca..8ee2840 100644 --- a/contrib/ncurses/man/infocmp.1m +++ b/contrib/ncurses/man/infocmp.1m @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 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: infocmp.1m,v 1.27 2000/08/19 18:51:05 tom Exp $ +.\" $Id: infocmp.1m,v 1.29 2002/02/16 22:40:59 tom Exp $ .TH infocmp 1M "" .ds n 5 .ds d @TERMINFO@ @@ -46,12 +46,10 @@ terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the binary file (\fBterm\fR) in a variety of formats. In all cases, the boolean fields will be printed first, followed by the numeric fields, followed by the string fields. -.. .SS Default Options If no options are specified and zero or one \fItermnames\fR are specified, the \fB-I\fR option will be assumed. If more than one \fItermname\fR is specified, the \fB-d\fR option will be assumed. -.. .SS Comparison Options [-d] [-c] [-n] \fBinfocmp\fR compares the \fBterminfo\fR description of the first terminal \fItermname\fR with each of the descriptions given by the entries for the other @@ -72,7 +70,6 @@ The \fB-n\fR option produces a list of each capability that is in neither entry. If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be used for both of the \fItermnames\fR. This can be used as a quick check to see if anything was left out of a description. -.. .SS Source Listing Options [-I] [-L] [-C] [-r] The \fB-I\fR, \fB-L\fR, and \fB-C\fR options will produce a source listing for each terminal named. @@ -166,7 +163,6 @@ Another error that does not cause incorrect compiled files, but will slow down the compilation time, is specifying extra \fBuse=\fR fields that are superfluous. \fBinfocmp\fR will flag any other \fItermname use=\fR fields that were not needed. -.. .SS Changing Databases [-A \fIdirectory\fR] [-B \fIdirectory\fR] The location of the compiled \fBterminfo\fR database is taken from the environment variable \fBTERMINFO\fR . If the variable is not defined, or the @@ -178,11 +174,9 @@ set \fBTERMINFO\fR for the other \fItermnames\fR. 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. -.. .SS Other Options [-s d|i|l|c] [-1FTVefip] [-Rsubset] [-v \fIn\fR] [-w \fIwidth\fR] The \fB-s\fR option sorts the fields within each type according to the argument below: -.. .TP 5 \fBd\fR leave fields in the order that they are stored in the \fIterminfo\fR database. @@ -334,12 +328,10 @@ Higher values of n induce greater verbosity. .TP 5 \fB-w\fR \fIwidth\fR changes the output to \fIwidth\fR characters. -.. .SH FILES .TP 20 \*d Compiled terminal description database. -.. .SH EXTENSIONS The \fB-E\fR, diff --git a/contrib/ncurses/man/keybound.3x b/contrib/ncurses/man/keybound.3x index e6bf5e4..79c480c 100644 --- a/contrib/ncurses/man/keybound.3x +++ b/contrib/ncurses/man/keybound.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1999 Free Software Foundation, Inc. * +.\" Copyright (c) 1999,2002 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 * @@ -28,35 +28,29 @@ .\" .\" Author: Thomas E. Dickey <dickey@clark.net> 1999 .\" -.\" $Id: keybound.3x,v 1.1 1999/02/19 11:59:24 tom Exp $ +.\" $Id: keybound.3x,v 1.3 2002/02/16 22:30:36 tom Exp $ .TH keyok 3X "" .SH NAME \fBkeybound\fP \- return definition of keycode -.. .SH SYNOPSIS \fB#include <curses.h>\fP -\fBint keybound(int keycode, int count);\fP -.. +\fBchar * keybound(int keycode, int count);\fP .SH DESCRIPTION This is an extension to the curses library. It permits an application to determine the string which is defined in the terminfo for specific keycodes. -.. .SH RETURN VALUE The keycode must be greater than zero, else NULL is returned. If it does not correspond to a defined key, then NULL is returned. Otherwise, the function returns a string, which must be freed by the caller. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBdefine_key\fR(3X), \fBkeyok\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/contrib/ncurses/man/keyok.3x b/contrib/ncurses/man/keyok.3x index 21befe8..e3f2287 100644 --- a/contrib/ncurses/man/keyok.3x +++ b/contrib/ncurses/man/keyok.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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 * @@ -28,37 +28,31 @@ .\" .\" Author: Thomas E. Dickey <dickey@clark.net> 1997 .\" -.\" $Id: keyok.3x,v 1.5 1998/03/14 23:43:07 tom Exp $ +.\" $Id: keyok.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ .TH keyok 3X "" .SH NAME \fBkeyok\fP \- enable or disable a keycode -.. .SH SYNOPSIS \fB#include <curses.h>\fP \fBint keyok(int keycode, bool enable);\fP -.. .SH DESCRIPTION This is an extension to the curses library. It permits an application to disable specific keycodes, rather than use the \fIkeypad\fP function to disable all keycodes. Keys that have been disabled can be reenabled. -.. .SH RETURN VALUE The keycode must be greater than zero, else ERR is returned. If it does not correspond to a defined key, then ERR is returned. If the \fIenable\fP parameter is true, then the key must have been disabled, and vice versa. Otherwise, the function returns OK. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBdefine_key\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/contrib/ncurses/man/man_db.renames b/contrib/ncurses/man/man_db.renames index b824861..7aaf1de 100644 --- a/contrib/ncurses/man/man_db.renames +++ b/contrib/ncurses/man/man_db.renames @@ -1,30 +1,44 @@ -# $Id: man_db.renames,v 0.20 2000/07/15 22:58:35 tom Exp $ +# $Id: man_db.renames,v 0.31 2002/04/13 21:49:08 tom Exp $ # Manual-page renamings for the man_db program # +# Files: captoinfo.1m captoinfo.1 clear.1 clear.1 +curs_add_wch.3x add_wch.3ncurses +curs_add_wchstr.3x add_wchstr.3ncurses curs_addch.3x addch.3ncurses curs_addchstr.3x addchstr.3ncurses curs_addstr.3x addstr.3ncurses +curs_addwstr.3x addwstr.3ncurses curs_attr.3x attr.3ncurses curs_beep.3x beep.3ncurses curs_bkgd.3x bkgd.3ncurses +curs_bkgrnd.3x bkgrnd.3ncurses curs_border.3x border.3ncurses +curs_border_set.3x border_set.3ncurses curs_clear.3x clear.3ncurses curs_color.3x color.3ncurses curs_delch.3x delch.3ncurses curs_deleteln.3x deleteln.3ncurses curs_extend.3x extensions.3ncurses +curs_get_wch.3x get_wch.3ncurses +curs_get_wstr.3x get_wstr.3ncurses +curs_getcchar.3x getcchar.3ncurses curs_getch.3x getch.3ncurses curs_getstr.3x getstr.3ncurses curs_getyx.3x getyx.3ncurses +curs_in_wch.3x in_wch.3ncurses +curs_in_wchstr.3x in_wchstr.3ncurses curs_inch.3x inch.3ncurses curs_inchstr.3x inchstr.3ncurses curs_initscr.3x initscr.3ncurses curs_inopts.3x inopts.3ncurses +curs_ins_wch.3x ins_wch.3ncurses +curs_ins_wstr.3x ins_wstr.3ncurses curs_insch.3x insch.3ncurses curs_insstr.3x insstr.3ncurses curs_instr.3x instr.3ncurses +curs_inwstr.3x inwstr.3ncurses curs_kernel.3x kernel.3ncurses curs_mouse.3x mouse.3ncurses curs_move.3x move.3ncurses @@ -115,3 +129,10 @@ tput.1 tput.1 tset.1 tset.1 vprintf.3s vprintf.3 wresize.3x wresize.3ncurses +# +# Other cross-references: +addch.3x addch.3ncurses +can_change_color.3x can_change_color.3ncurses +curs_attr_get.3x attr_get.3ncurses +dup_field.3x dup_field.3ncurses +init_pair.3x init_pair.3ncurses diff --git a/contrib/ncurses/man/menu.3x b/contrib/ncurses/man/menu.3x index 8279844..e81913c 100644 --- a/contrib/ncurses/man/menu.3x +++ b/contrib/ncurses/man/menu.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2002 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.14 2000/07/15 22:55:59 tom Exp $ +.\" $Id: menu.3x,v 1.15 2002/01/19 22:48:58 tom Exp $ .TH menu 3X "" .SH NAME \fBmenu\fR - curses extension for programming menus @@ -167,7 +167,7 @@ No items are connected to the menu. \fBE_REQUEST_DENIED\fR The menu driver could not process the request. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "menu_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "menu_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<menu.h>\fR automatically includes the header files diff --git a/contrib/ncurses/man/menu_attributes.3x b/contrib/ncurses/man/menu_attributes.3x index 8241260..99a2ac2 100644 --- a/contrib/ncurses/man/menu_attributes.3x +++ b/contrib/ncurses/man/menu_attributes.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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_attributes.3x,v 1.6 1998/11/29 01:09:20 Rick.Ohnemus Exp $ +.\" $Id: menu_attributes.3x,v 1.7 2002/01/19 22:49:06 tom Exp $ .TH menu_attributes 3X "" .SH NAME \fBmenu_attributes\fR - color and attribute control for menus @@ -81,7 +81,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "menu_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "menu_" for detailed descriptions of the entry points. .SH NOTES The header file \fB<menu.h>\fR automatically includes the header file diff --git a/contrib/ncurses/man/menu_driver.3x b/contrib/ncurses/man/menu_driver.3x index cffd08d..0e6f9e0 100644 --- a/contrib/ncurses/man/menu_driver.3x +++ b/contrib/ncurses/man/menu_driver.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: menu_driver.3x,v 1.8 1999/01/09 22:55:18 tom Exp $ +.\" $Id: menu_driver.3x,v 1.10 2002/02/16 22:40:59 tom Exp $ .TH menu_driver 3X "" .SH NAME \fBmenu_driver\fR - command-processing loop of the menu system diff --git a/contrib/ncurses/man/menu_format.3x b/contrib/ncurses/man/menu_format.3x index 57c77a3..7dde28f 100644 --- a/contrib/ncurses/man/menu_format.3x +++ b/contrib/ncurses/man/menu_format.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 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_format.3x,v 1.7 1998/11/29 01:09:39 Rick.Ohnemus Exp $ +.\" $Id: menu_format.3x,v 1.8 2001/08/04 20:36:19 William.Setzer Exp $ .TH menu_format 3X "" .SH NAME \fBmenu_format\fR - set and get menu sizes @@ -36,7 +36,7 @@ .br int set_menu_format(MENU *menu, int rows, int cols); .br -int menu_format(const MENU *menu, int *rows, int *cols); +void menu_format(const MENU *menu, int *rows, int *cols); .br .SH DESCRIPTION The function \fBset_menu_format\fR sets the maximum display size of the given diff --git a/contrib/ncurses/man/menu_pattern.3x b/contrib/ncurses/man/menu_pattern.3x index 693ebe3..990a9dc 100644 --- a/contrib/ncurses/man/menu_pattern.3x +++ b/contrib/ncurses/man/menu_pattern.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: menu_pattern.3x,v 1.5 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: menu_pattern.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ .TH menu_pattern 3X "" .SH NAME \fBmenu_pattern\fR - get and set a menu's pattern buffer diff --git a/contrib/ncurses/man/menu_spacing.3x b/contrib/ncurses/man/menu_spacing.3x index 0480b3c..1831621 100644 --- a/contrib/ncurses/man/menu_spacing.3x +++ b/contrib/ncurses/man/menu_spacing.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 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_spacing.3x,v 1.5 1998/11/29 01:10:51 Rick.Ohnemus Exp $ +.\" $Id: menu_spacing.3x,v 1.6 2001/08/04 20:36:16 William.Setzer Exp $ .TH menu_spacing 3X "" .SH NAME \fBmenu_spacing\fR - Control spacing between menu items. @@ -35,12 +35,12 @@ \fB#include <menu.h>\fR .br int set_menu_spacing(MENU *menu, - int spc_description + int spc_description, int spc_rows, int spc_columns); .br int menu_spacing(const MENU *menu, - int* spc_description + int* spc_description, int* spc_rows, int* spc_columns); .br diff --git a/contrib/ncurses/man/mitem_value.3x b/contrib/ncurses/man/mitem_value.3x index 680fda8..5817d8d 100644 --- a/contrib/ncurses/man/mitem_value.3x +++ b/contrib/ncurses/man/mitem_value.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: mitem_value.3x,v 1.4 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: mitem_value.3x,v 1.6 2002/02/16 22:40:59 tom Exp $ .TH mitem_value 3X "" .SH NAME \fBmitem_value\fR - set and get menu item values diff --git a/contrib/ncurses/man/ncurses.3x b/contrib/ncurses/man/ncurses.3x index 6ce50d8..84ead5c 100644 --- a/contrib/ncurses/man/ncurses.3x +++ b/contrib/ncurses/man/ncurses.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,1999,2001,2002 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: ncurses.3x,v 1.46 2000/11/25 21:58:45 tom Exp $ +.\" $Id: ncurses.3x,v 1.61 2002/05/11 21:15:32 tom Exp $ .hy 0 .TH ncurses 3X "" .ds n 5 @@ -209,11 +209,16 @@ _tracechtype2/\fBcurs_trace\fR(3X)* _tracedump/\fBcurs_trace\fR(3X)* _tracef/\fBcurs_trace\fR(3X)* _tracemouse/\fBcurs_trace\fR(3X)* +add_wch/\fBcurs_add_wch\fR(3X) +add_wchnstr/\fBcurs_add_wchstr\fR(3X) +add_wchstr/\fBcurs_add_wchstr\fR(3X) addch/\fBcurs_addch\fR(3X) addchnstr/\fBcurs_addchstr\fR(3X) addchstr/\fBcurs_addchstr\fR(3X) addnstr/\fBcurs_addstr\fR(3X) +addnwstr/\fBcurs_addwstr\fR(3X) addstr/\fBcurs_addstr\fR(3X) +addwstr/\fBcurs_addwstr\fR(3X) assume_default_colors/\fBdefault_colors\fR(3X)* attr_get/\fBcurs_attr\fR(3X) attr_off/\fBcurs_attr\fR(3X) @@ -226,8 +231,12 @@ baudrate/\fBcurs_termattrs\fR(3X) beep/\fBcurs_beep\fR(3X) bkgd/\fBcurs_bkgd\fR(3X) bkgdset/\fBcurs_bkgd\fR(3X) +bkgrnd/\fBcurs_bkgrnd\fR(3X) +bkgrndset/\fBcurs_bkgrnd\fR(3X) border/\fBcurs_border\fR(3X) +border_set/\fBcurs_border_set\fR(3X) box/\fBcurs_border\fR(3X) +box_set/\fBcurs_border_set\fR(3X) can_change_color/\fBcurs_color\fR(3X) cbreak/\fBcurs_inopts\fR(3X) chgat/\fBcurs_attr\fR(3X) @@ -253,18 +262,25 @@ derwin/\fBcurs_window\fR(3X) doupdate/\fBcurs_refresh\fR(3X) dupwin/\fBcurs_window\fR(3X) echo/\fBcurs_inopts\fR(3X) +echo_wchar/\fBcurs_add_wch\fR(3X) echochar/\fBcurs_addch\fR(3X) endwin/\fBcurs_initscr\fR(3X) erase/\fBcurs_clear\fR(3X) erasechar/\fBcurs_termattrs\fR(3X) +erasewchar/\fBcurs_termattrs\fR(3X) filter/\fBcurs_util\fR(3X) flash/\fBcurs_beep\fR(3X) flushinp/\fBcurs_util\fR(3X) +get_wch/\fBcurs_get_wch\fR(3X) +get_wstr/\fBcurs_get_wstr\fR(3X) getbegyx/\fBcurs_getyx\fR(3X) getbkgd/\fBcurs_bkgd\fR(3X) +getbkgrnd/\fBcurs_bkgrnd\fR(3X) +getcchar/\fBcurs_getcchar\fR(3X) getch/\fBcurs_getch\fR(3X) getmaxyx/\fBcurs_getyx\fR(3X) getmouse/\fBcurs_mouse\fR(3X)* +getn_wstr/\fBcurs_get_wstr\fR(3X) getnstr/\fBcurs_getstr\fR(3X) getparyx/\fBcurs_getyx\fR(3X) getstr/\fBcurs_getstr\fR(3X) @@ -277,9 +293,13 @@ has_ic/\fBcurs_termattrs\fR(3X) has_il/\fBcurs_termattrs\fR(3X) has_key/\fBcurs_getch\fR(3X)* hline/\fBcurs_border\fR(3X) +hline_set/\fBcurs_border_set\fR(3X) idcok/\fBcurs_outopts\fR(3X) idlok/\fBcurs_outopts\fR(3X) immedok/\fBcurs_outopts\fR(3X) +in_wch/\fBcurs_in_wch\fR(3X) +in_wchnstr/\fBcurs_in_wchstr\fR(3X) +in_wchstr/\fBcurs_in_wchstr\fR(3X) inch/\fBcurs_inch\fR(3X) inchnstr/\fBcurs_inchstr\fR(3X) inchstr/\fBcurs_inchstr\fR(3X) @@ -287,6 +307,10 @@ init_color/\fBcurs_color\fR(3X) init_pair/\fBcurs_color\fR(3X) initscr/\fBcurs_initscr\fR(3X) innstr/\fBcurs_instr\fR(3X) +innwstr/\fBcurs_inwstr\fR(3X) +ins_nwstr/\fBcurs_ins_wstr\fR(3X) +ins_wch/\fBcurs_ins_wch\fR(3X) +ins_wstr/\fBcurs_ins_wstr\fR(3X) insch/\fBcurs_insch\fR(3X) insdelln/\fBcurs_deleteln\fR(3X) insertln/\fBcurs_deleteln\fR(3X) @@ -294,14 +318,17 @@ insnstr/\fBcurs_insstr\fR(3X) insstr/\fBcurs_insstr\fR(3X) instr/\fBcurs_instr\fR(3X) intrflush/\fBcurs_inopts\fR(3X) +inwstr/\fBcurs_inwstr\fR(3X) is_linetouched/\fBcurs_touch\fR(3X) is_wintouched/\fBcurs_touch\fR(3X) isendwin/\fBcurs_initscr\fR(3X) +key_name/\fBcurs_util\fR(3X) keybound/\fBkeybound\fR(3X)* keyname/\fBcurs_util\fR(3X) keyok/\fBkeyok\fR(3X)* keypad/\fBcurs_inopts\fR(3X) killchar/\fBcurs_termattrs\fR(3X) +killwchar/\fBcurs_termattrs\fR(3X) leaveok/\fBcurs_outopts\fR(3X) longname/\fBcurs_termattrs\fR(3X) mcprint/\fBcurs_print\fR(3X)* @@ -310,53 +337,89 @@ mouse_trafo/\fBcurs_mouse\fR(3X)* mouseinterval/\fBcurs_mouse\fR(3X)* mousemask/\fBcurs_mouse\fR(3X)* move/\fBcurs_move\fR(3X) +mvadd_wch/\fBcurs_add_wch\fR(3X) +mvadd_wchnstr/\fBcurs_add_wchstr\fR(3X) +mvadd_wchstr/\fBcurs_add_wchstr\fR(3X) mvaddch/\fBcurs_addch\fR(3X) mvaddchnstr/\fBcurs_addchstr\fR(3X) mvaddchstr/\fBcurs_addchstr\fR(3X) mvaddnstr/\fBcurs_addstr\fR(3X) +mvaddnwstr/\fBcurs_addwstr\fR(3X) mvaddstr/\fBcurs_addstr\fR(3X) +mvaddwstr/\fBcurs_addwstr\fR(3X) mvchgat/\fBcurs_attr\fR(3X) mvcur/\fBcurs_terminfo\fR(3X) mvdelch/\fBcurs_delch\fR(3X) mvderwin/\fBcurs_window\fR(3X) +mvget_wch/\fBcurs_get_wch\fR(3X) +mvget_wstr/\fBcurs_get_wstr\fR(3X) mvgetch/\fBcurs_getch\fR(3X) +mvgetn_wstr/\fBcurs_get_wstr\fR(3X) mvgetnstr/\fBcurs_getstr\fR(3X) mvgetstr/\fBcurs_getstr\fR(3X) mvhline/\fBcurs_border\fR(3X) +mvhline_set/\fBcurs_border_set\fR(3X) +mvin_wch/\fBcurs_in_wch\fR(3X) +mvin_wchnstr/\fBcurs_in_wchstr\fR(3X) +mvin_wchstr/\fBcurs_in_wchstr\fR(3X) mvinch/\fBcurs_inch\fR(3X) mvinchnstr/\fBcurs_inchstr\fR(3X) mvinchstr/\fBcurs_inchstr\fR(3X) mvinnstr/\fBcurs_instr\fR(3X) +mvinnwstr/\fBcurs_inwstr\fR(3X) +mvins_nwstr/\fBcurs_ins_wstr\fR(3X) +mvins_wch/\fBcurs_ins_wch\fR(3X) +mvins_wstr/\fBcurs_ins_wstr\fR(3X) mvinsch/\fBcurs_insch\fR(3X) mvinsnstr/\fBcurs_insstr\fR(3X) mvinsstr/\fBcurs_insstr\fR(3X) mvinstr/\fBcurs_instr\fR(3X) +mvinwstr/\fBcurs_inwstr\fR(3X) mvprintw/\fBcurs_printw\fR(3X) mvscanw/\fBcurs_scanw\fR(3X) mvvline/\fBcurs_border\fR(3X) +mvvline_set/\fBcurs_border_set\fR(3X) +mvwadd_wch/\fBcurs_add_wch\fR(3X) +mvwadd_wchnstr/\fBcurs_add_wchstr\fR(3X) +mvwadd_wchstr/\fBcurs_add_wchstr\fR(3X) mvwaddch/\fBcurs_addch\fR(3X) mvwaddchnstr/\fBcurs_addchstr\fR(3X) mvwaddchstr/\fBcurs_addchstr\fR(3X) mvwaddnstr/\fBcurs_addstr\fR(3X) +mvwaddnwstr/\fBcurs_addwstr\fR(3X) mvwaddstr/\fBcurs_addstr\fR(3X) +mvwaddwstr/\fBcurs_addwstr\fR(3X) mvwchgat/\fBcurs_attr\fR(3X) mvwdelch/\fBcurs_delch\fR(3X) +mvwget_wch/\fBcurs_get_wch\fR(3X) +mvwget_wstr/\fBcurs_get_wstr\fR(3X) mvwgetch/\fBcurs_getch\fR(3X) +mvwgetn_wstr/\fBcurs_get_wstr\fR(3X) mvwgetnstr/\fBcurs_getstr\fR(3X) mvwgetstr/\fBcurs_getstr\fR(3X) mvwhline/\fBcurs_border\fR(3X) +mvwhline_set/\fBcurs_border_set\fR(3X) mvwin/\fBcurs_window\fR(3X) +mvwin_wch/\fBcurs_in_wch\fR(3X) +mvwin_wchnstr/\fBcurs_in_wchstr\fR(3X) +mvwin_wchstr/\fBcurs_in_wchstr\fR(3X) mvwinch/\fBcurs_inch\fR(3X) mvwinchnstr/\fBcurs_inchstr\fR(3X) mvwinchstr/\fBcurs_inchstr\fR(3X) mvwinnstr/\fBcurs_instr\fR(3X) +mvwinnwstr/\fBcurs_inwstr\fR(3X) +mvwins_nwstr/\fBcurs_ins_wstr\fR(3X) +mvwins_wch/\fBcurs_ins_wch\fR(3X) +mvwins_wstr/\fBcurs_ins_wstr\fR(3X) mvwinsch/\fBcurs_insch\fR(3X) mvwinsnstr/\fBcurs_insstr\fR(3X) mvwinsstr/\fBcurs_insstr\fR(3X) mvwinstr/\fBcurs_instr\fR(3X) +mvwinwstr/\fBcurs_inwstr\fR(3X) mvwprintw/\fBcurs_printw\fR(3X) mvwscanw/\fBcurs_scanw\fR(3X) mvwvline/\fBcurs_border\fR(3X) +mvwvline_set/\fBcurs_border_set\fR(3X) napms/\fBcurs_kernel\fR(3X) newpad/\fBcurs_pad\fR(3X) newterm/\fBcurs_initscr\fR(3X) @@ -399,6 +462,7 @@ scroll/\fBcurs_scroll\fR(3X) scrollok/\fBcurs_outopts\fR(3X) set_curterm/\fBcurs_terminfo\fR(3X) set_term/\fBcurs_initscr\fR(3X) +setcchar/\fBcurs_getcchar\fR(3X) setscrreg/\fBcurs_outopts\fR(3X) setsyx/\fBcurs_kernel\fR(3X) setterm/\fBcurs_terminfo\fR(3X) @@ -425,6 +489,7 @@ start_color/\fBcurs_color\fR(3X) subpad/\fBcurs_pad\fR(3X) subwin/\fBcurs_window\fR(3X) syncok/\fBcurs_window\fR(3X) +term_attrs/\fBcurs_termattrs\fR(3X) termattrs/\fBcurs_termattrs\fR(3X) termname/\fBcurs_termattrs\fR(3X) tgetent/\fBcurs_termcap\fR(3X) @@ -444,24 +509,33 @@ tputs/\fBcurs_terminfo\fR(3X) trace/\fBcurs_trace\fR(3X)* typeahead/\fBcurs_inopts\fR(3X) unctrl/\fBcurs_util\fR(3X) +unget_wch/\fBcurs_get_wch\fR(3X) ungetch/\fBcurs_getch\fR(3X) ungetmouse/\fBcurs_mouse\fR(3X)* untouchwin/\fBcurs_touch\fR(3X) use_default_colors/\fBdefault_colors\fR(3X)* use_env/\fBcurs_util\fR(3X) use_extended_names/\fBcurs_extend\fR(3X)* +vid_attr/\fBcurs_terminfo\fR(3X) +vid_puts/\fBcurs_terminfo\fR(3X) vidattr/\fBcurs_terminfo\fR(3X) vidputs/\fBcurs_terminfo\fR(3X) vline/\fBcurs_border\fR(3X) +vline_set/\fBcurs_border_set\fR(3X) vw_printw/\fBcurs_printw\fR(3X) vw_scanw/\fBcurs_scanw\fR(3X) vwprintw/\fBcurs_printw\fR(3X) vwscanw/\fBcurs_scanw\fR(3X) +wadd_wch/\fBcurs_add_wch\fR(3X) +wadd_wchnstr/\fBcurs_add_wchstr\fR(3X) +wadd_wchstr/\fBcurs_add_wchstr\fR(3X) waddch/\fBcurs_addch\fR(3X) waddchnstr/\fBcurs_addchstr\fR(3X) waddchstr/\fBcurs_addchstr\fR(3X) waddnstr/\fBcurs_addstr\fR(3X) +waddnwstr/\fBcurs_addwstr\fR(3X) waddstr/\fBcurs_addstr\fR(3X) +waddwstr/\fBcurs_addwstr\fR(3X) wattr_get/\fBcurs_attr\fR(3X) wattr_off/\fBcurs_attr\fR(3X) wattr_on/\fBcurs_attr\fR(3X) @@ -471,7 +545,10 @@ wattron/\fBcurs_attr\fR(3X) wattrset/\fBcurs_attr\fR(3X) wbkgd/\fBcurs_bkgd\fR(3X) wbkgdset/\fBcurs_bkgd\fR(3X) +wbkgrnd/\fBcurs_bkgrnd\fR(3X) +wbkgrndset/\fBcurs_bkgrnd\fR(3X) wborder/\fBcurs_border\fR(3X) +wborder_set/\fBcurs_border_set\fR(3X) wchgat/\fBcurs_attr\fR(3X) wclear/\fBcurs_clear\fR(3X) wclrtobot/\fBcurs_clear\fR(3X) @@ -480,23 +557,37 @@ wcolor_set/\fBcurs_attr\fR(3X) wcursyncup/\fBcurs_window\fR(3X) wdelch/\fBcurs_delch\fR(3X) wdeleteln/\fBcurs_deleteln\fR(3X) +wecho_wchar/\fBcurs_add_wch\fR(3X) wechochar/\fBcurs_addch\fR(3X) wenclose/\fBcurs_mouse\fR(3X)* werase/\fBcurs_clear\fR(3X) +wget_wch/\fBcurs_get_wch\fR(3X) +wget_wstr/\fBcurs_get_wstr\fR(3X) +wgetbkgrnd/\fBcurs_bkgrnd\fR(3X) wgetch/\fBcurs_getch\fR(3X) +wgetn_wstr/\fBcurs_get_wstr\fR(3X) wgetnstr/\fBcurs_getstr\fR(3X) wgetstr/\fBcurs_getstr\fR(3X) whline/\fBcurs_border\fR(3X) +whline_set/\fBcurs_border_set\fR(3X) +win_wch/\fBcurs_in_wch\fR(3X) +win_wchnstr/\fBcurs_in_wchstr\fR(3X) +win_wchstr/\fBcurs_in_wchstr\fR(3X) winch/\fBcurs_inch\fR(3X) winchnstr/\fBcurs_inchstr\fR(3X) winchstr/\fBcurs_inchstr\fR(3X) winnstr/\fBcurs_instr\fR(3X) +winnwstr/\fBcurs_inwstr\fR(3X) +wins_nwstr/\fBcurs_ins_wstr\fR(3X) +wins_wch/\fBcurs_ins_wch\fR(3X) +wins_wstr/\fBcurs_ins_wstr\fR(3X) winsch/\fBcurs_insch\fR(3X) winsdelln/\fBcurs_deleteln\fR(3X) winsertln/\fBcurs_deleteln\fR(3X) winsnstr/\fBcurs_insstr\fR(3X) winsstr/\fBcurs_insstr\fR(3X) winstr/\fBcurs_instr\fR(3X) +winwstr/\fBcurs_inwstr\fR(3X) wmouse_trafo/\fBcurs_mouse\fR(3X)* wmove/\fBcurs_move\fR(3X) wnoutrefresh/\fBcurs_refresh\fR(3X) @@ -513,7 +604,9 @@ wsyncdown/\fBcurs_window\fR(3X) wsyncup/\fBcurs_window\fR(3X) wtimeout/\fBcurs_inopts\fR(3X) wtouchln/\fBcurs_touch\fR(3X) +wunctrl/\fBcurs_util\fR(3X) wvline/\fBcurs_border\fR(3X) +wvline_set/\fBcurs_border_set\fR(3X) .TE .SH RETURN VALUE Routines that return an integer return \fBERR\fR upon failure and an @@ -721,7 +814,7 @@ directory containing initialization files for the terminal capability database @TERMINFO@ terminal capability database .SH SEE ALSO -\fBterminfo\fR(\*n) and 3X pages whose names begin "curs_" for detailed routine +\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine descriptions. .SH EXTENSIONS The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR) @@ -752,7 +845,7 @@ 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 \fBuse_default_colors\fR(3X) manual page for details. +See the \fBdefault_colors\fR(3X) manual page for details. The \fBncurses\fR library includes a function for directing application output to a printer attached to the terminal device. See the \fBcurs_print\fR(3X) @@ -762,113 +855,8 @@ The \fBncurses\fR library is intended to be BASE-level conformant with the XSI Curses standard. Certain portions 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: -\fBadd_wch\fP, -\fBadd_wchnstr\fP, -\fBadd_wchstr\fP, -\fBaddnwstr\fP, -\fBaddwstr\fP, -\fBbkgrnd\fP, -\fBbkgrndset\fP, -\fBborder_set\fP, -\fBbox_set\fP, -\fBecho_wchar\fP, -\fBerasewchar\fP, -\fBget_wch\fP, -\fBget_wstr\fP, -\fBgetbkgrnd\fP, -\fBgetcchar\fP, -\fBgetn_wstr\fP, -\fBgetwchtype\fP, -\fBhline_set\fP, -\fBin_wch\fP, -\fBin_wchnstr\fP, -\fBin_wchstr\fP, -\fBinnwstr\fP, -\fBins_nwstr\fP, -\fBins_wch\fP, -\fBins_wstr\fP, -\fBinwchnstr\fP, -\fBinwchstr\fP, -\fBinwstr\fP, -\fBkey_name\fP, -\fBkillwchar\fP, -\fBmvadd_wch\fP, -\fBmvadd_wchnstr\fP, -\fBmvadd_wchstr\fP, -\fBmvaddnwstr\fP, -\fBmvaddwstr\fP, -\fBmvget_wch\fP, -\fBmvget_wstr\fP, -\fBmvgetn_wstr\fP, -\fBmvhline_set\fP, -\fBmvin_wch\fP, -\fBmvinnwstr\fP, -\fBmvins_nwstr\fP, -\fBmvins_wch\fP, -\fBmvins_wstr\fP, -\fBmvinwchnstr\fP, -\fBmvinwchstr\fP, -\fBmvinwchstr\fP, -\fBmvinwstr\fP, -\fBmvvline_set\fP, -\fBmvwadd_wch\fP, -\fBmvwadd_wchnstr\fP, -\fBmvwadd_wchstr\fP, -\fBmvwaddnwstr\fP, -\fBmvwaddwstr\fP, -\fBmvwget_ch\fP, -\fBmvwget_wch\fP, -\fBmvwget_wstr\fP, -\fBmvwgetn_wstr\fP, -\fBmvwhline_set\fP, -\fBmvwin_wch\fP, -\fBmvwin_wchnstr\fP, -\fBmvwin_wchstr\fP, -\fBmvwinnwstr\fP, -\fBmvwins_nwstr\fP, -\fBmvwins_wch\fP, -\fBmvwins_wstr\fP, -\fBmvwinwchnstr\fP. -\fBmvwinwstr\fP, -\fBmvwvline_set\fP, \fBpecho_wchar\fP, -\fBsetcchar\fP, -\fBslk_wset\fP, -\fBterm_attrs\fP, -\fBunget_wch\fP, -\fBvhline_set\fP, -\fBvid_attr\fP, -\fBvid_puts\fP, -\fBvline_set\fP, -\fBwadd_wch\fP, -\fBwadd_wchnstr\fP, -\fBwadd_wchstr\fP, -\fBwaddnwstr\fP, -\fBwaddwstr\fP, -\fBwaddwstr\fP, -\fBwbkgrnd\fP, -\fBwbkgrndset\fP, -\fBwbkgrndset\fP, -\fBwborder_set\fP, -\fBwecho_wchar\fP, -\fBwecho_wchar\fP, -\fBwget_wch\fP, -\fBwget_wstr\fP, -\fBwgetbkgrnd\fP, -\fBwgetn_wstr\fP, -\fBwhline_set\fP, -\fBwin_wch\fP, -\fBwin_wchnstr\fP, -\fBwin_wchstr\fP, -\fBwinnwstr\fP, -\fBwins_nwstr\fP, -\fBwins_wch\fP, -\fBwins_wstr\fP, -\fBwinwchnstr\fP, -\fBwinwchstr\fP, -\fBwinwstr\fP, -\fBwunctrl\fP, -\fBwvline_set\fP, +\fBslk_wset\fP. .PP A small number of local differences (that is, individual differences between the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR diff --git a/contrib/ncurses/man/resizeterm.3x b/contrib/ncurses/man/resizeterm.3x index 9c7cc8f..562c353 100644 --- a/contrib/ncurses/man/resizeterm.3x +++ b/contrib/ncurses/man/resizeterm.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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,18 +26,22 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 +.\" Author: Thomas E. Dickey <dickey@clark.net> 1996,1997,2002 .\" -.\" $Id: resizeterm.3x,v 1.7 1998/03/14 23:42:52 tom Exp $ +.\" $Id: resizeterm.3x,v 1.9 2002/02/16 22:32:24 tom Exp $ .TH resizeterm 3X "" .SH NAME +\fBis_term_resized\fR, +\fBresize_term\fR, \fBresizeterm\fR - change the curses terminal size -.. .SH SYNOPSIS \fB#include <curses.h>\fR +\fBbool is_term_resized(int lines, int columns);\fR +.br +\fBint resize_term(int lines, int columns);\fR +.br \fBint resizeterm(int lines, int columns);\fR -.. .SH DESCRIPTION This is an extension to the curses library. It provides callers with a hook into the \fBncurses\fR data to resize windows, @@ -46,26 +50,29 @@ The function \fBresizeterm\fR resizes the standard and current windows to the specified dimensions, and adjusts other bookkeeping data used by the \fBncurses\fR library that record the window dimensions. -When resizing the windows, the function blank-fills the areas that are -extended. The calling application should fill in these areas with -appropriate data. - -The function attempts to resize all windows. +Most of the work is done by the inner function \fBresize_term\fR. +The outer function \fBresizeterm\fR adds bookkeeping for the SIGWINCH handler. +When resizing the windows, +\fBresize_term\fR blank-fills the areas that are extended. +The calling application should fill in these areas with appropriate data. +The \fBresize_term\fR function attempts to resize all windows. However, due to the calling convention of pads, it is not possible to resize these without additional interaction with the application. -.. + +A support function \fBis_term_resized\fR is provided so that applications +can check if the \fBresize_term\fR function would modify the window structures. +It returns TRUE if the windows would be modified, and FALSE otherwise. .SH RETURN VALUE -The function returns the integer \fBERR\fR upon failure and \fBOK\fR on success. -It will fail if either of the dimensions less than or equal to zero, -or if an error occurs while (re)allocating memory for the windows. -.. +Except as notes, these function return +the integer \fBERR\fR upon failure and \fBOK\fR on success. +They will fail if either of the dimensions are less than or equal to zero, +or if an error occurs while (re)allocating memory for the windows. .SH NOTES -While this function is intended to be used to support a signal handler -(i.e., for SIGWINCH), care should be taken to avoid invoking it in a +While these functions are intended to be used to support a signal handler +(i.e., for SIGWINCH), care should be taken to avoid invoking them in a context where \fBmalloc\fR or \fBrealloc\fR may have been interrupted, since it uses those functions. -.. .PP If ncurses is configured to supply its own SIGWINCH handler, the \fBresizeterm\fR function ungetch's a \fBKEY_RESIZE\fR which @@ -73,10 +80,8 @@ will be read on the next call to \fBgetch\fR. This is used to alert an application that the screen size has changed, and that it should repaint special features such as pads that cannot be done automatically. -.. .SH SEE ALSO \fBwresize\fR(3X). -.. .SH AUTHOR Thomas Dickey (from an equivalent function written in 1988 for BSD curses). .\"# diff --git a/contrib/ncurses/man/term.5 b/contrib/ncurses/man/term.5 index 63a2d35..a8cf6e5 100644 --- a/contrib/ncurses/man/term.5 +++ b/contrib/ncurses/man/term.5 @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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: term.5,v 1.10 2000/08/13 01:56:45 tom Exp $ +.\" $Id: term.5,v 1.13 2002/04/20 16:49:17 tom Exp $ .TH TERM 5 .ds n 5 .ds d @TERMINFO@ @@ -164,7 +164,7 @@ adm3a|lsi adm3a, am, cols#80, lines#24, bel=^G, clear=\032$<1>, cr=^M, cub1=^H, cud1=^J, - cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, + cuf1=^L, cup=\\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, home=^^, ind=^J, .sp .ft CW @@ -198,7 +198,7 @@ Some limitations: total compiled entries cannot exceed 4096 bytes. The name field cannot exceed 128 bytes. .SH FILES \*d/*/* compiled terminal capability data base -.SH "SEE ALSO" +.SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n). .\"# .\"# The following sets edit modes for GNU EMACS diff --git a/contrib/ncurses/man/term.7 b/contrib/ncurses/man/term.7 index 5a48c5a..5d51e92 100644 --- a/contrib/ncurses/man/term.7 +++ b/contrib/ncurses/man/term.7 @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 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: term.7,v 1.12 2000/08/13 01:56:42 tom Exp $ +.\" $Id: term.7,v 1.13 2002/04/20 16:50:47 tom Exp $ .TH TERM 7 .ds n 5 .ds d @TERMINFO@ @@ -194,7 +194,7 @@ tty line initialization (AT&T-like UNIXes). .TP 5 /etc/ttys tty line initialization (BSD-like UNIXes). -.SH "SEE ALSO" +.SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBterm\fR(\*n). .\"# .\"# The following sets edit modes for GNU EMACS diff --git a/contrib/ncurses/man/terminfo.tail b/contrib/ncurses/man/terminfo.tail index e39230f..bd585b1 100644 --- a/contrib/ncurses/man/terminfo.tail +++ b/contrib/ncurses/man/terminfo.tail @@ -1,4 +1,4 @@ -.\" $Id: terminfo.tail,v 1.33 2000/10/14 14:06:50 tom Exp $ +.\" $Id: terminfo.tail,v 1.35 2002/04/20 16:49:33 tom Exp $ .\" Beginning of terminfo.tail file .ps +1 .PP @@ -49,7 +49,8 @@ terminal operations. .PP .SS Types of Capabilities .PP -All capabilities have names. For instance, the fact that +All capabilities have names. +For instance, the fact that ANSI-standard terminals have .I "automatic margins" (i.e., an automatic return and line-feed @@ -66,7 +67,8 @@ sequence) are given by the two-character code, an `=', and then a string ending at the next following `,'. .PP A number of escape sequences are provided in the string valued capabilities -for easy encoding of characters there. Both \fB\eE\fR and \fB\ee\fR +for easy encoding of characters there. +Both \fB\eE\fR and \fB\ee\fR map to an \s-1ESCAPE\s0 character, \fB^x\fR maps to a control-x for any appropriate x, and the sequences \fB\en \el \er \et \eb \ef \es\fR give @@ -77,21 +79,26 @@ Other escapes include \fB\e^\fR for \fB^\fR, \fB\e:\fR for \fB:\fR, and \fB\e0\fR for null. (\fB\e0\fR will produce \e200, which does not terminate a string but behaves -as a null character on most terminals, providing CS7 is specified. See stty(1).) +as a null character on most terminals, providing CS7 is specified. +See stty(1).) Finally, characters may be given as three octal digits after a \fB\e\fR. .PP A delay in milliseconds may appear anywhere in a string capability, enclosed in $<..> brackets, as in \fBel\fP=\eEK$<5>, and padding characters are supplied by .I tputs -to provide this delay. The delay must be a number with at most one decimal -place of precision; it may be followed by suffixes `*' or '/' or both. A `*' +to provide this delay. +The delay must be a number with at most one decimal +place of precision; it may be followed by suffixes `*' or '/' or both. +A `*' indicates that the padding required is proportional to the number of lines affected by the operation, and the amount given is the per-affected-unit -padding required. (In the case of insert character, the factor is still the +padding required. +(In the case of insert character, the factor is still the number of .IR lines affected.) Normally, padding is advisory if the device has the \fBxon\fR -capability; it is used for cost computation but does not trigger delays. A `/' +capability; it is used for cost computation but does not trigger delays. +A `/' suffix indicates that the padding is mandatory and forces a delay of the given number of milliseconds even on devices for which \fBxon\fR is present to indicate flow control. @@ -107,7 +114,8 @@ in the example above. .SS Fetching Compiled Descriptions .PP If the environment variable TERMINFO is set, it is interpreted as the pathname -of a directory containing the compiled description you are working on. Only +of a directory containing the compiled description you are working on. +Only that directory is searched. .PP If TERMINFO is not set, the \fBncurses\fR version of the terminfo reader code @@ -116,7 +124,8 @@ for a compiled description. If it fails to find one there, and the environment variable TERMINFO_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 \fI\*d\fR). If no description is found in any of the +command to search \fI\*d\fR). +If no description is found in any of the TERMINFO_DIRS directories, the fetch fails. .PP If neither TERMINFO nor TERMINFO_DIRS is set, the last place tried will be the @@ -151,7 +160,8 @@ A similar test can be used for insert character. .SS Basic Capabilities .PP The number of columns on each line for the terminal is given by the -\fBcols\fR numeric capability. If the terminal is a \s-1CRT\s0, then the +\fBcols\fR numeric capability. +If the terminal is a \s-1CRT\s0, then the number of lines on the screen is given by the \fBlines\fR capability. If the terminal wraps around to the beginning of the next line when it reaches the right margin, then it should have the \fBam\fR capability. @@ -298,7 +308,8 @@ that can be indicated by .BR mrcup . .PP The parameter mechanism uses a stack and special \fB%\fP codes -to manipulate it. Typically a sequence will push one of the +to manipulate it. +Typically a sequence will push one of the parameters onto the stack and then print it in some format. Often more complex operations are necessary. .PP @@ -338,11 +349,13 @@ The \fB%\fR encodings have the following meanings: .fi .PP Binary operations are in postfix form with the operands in the usual order. -That is, to get x-5 one would use "%gx%{5}%-". %P and %g variables are +That is, to get x-5 one would use "%gx%{5}%-". +%P and %g variables are persistent across escape-string evaluations. .PP Consider the HP2645, which, to get to row 3 and column 12, needs -to be sent \eE&a12c03Y padded for 6 milliseconds. Note that the order +to be sent \eE&a12c03Y padded for 6 milliseconds. +Note that the order of the rows and columns is inverted here, and that the row and column are printed as two digits. Thus its \fBcup\fR capability is \*(lqcup=6\eE&%p2%2dc%p1%2dY\*(rq. @@ -439,7 +452,8 @@ is not available.) .PP If the terminal can open a new blank line before the line where the cursor is, this should be given as \fBil1\fR; this is done only from the first -position of a line. The cursor must then appear on the newly blank line. +position of a line. +The cursor must then appear on the newly blank line. If the terminal can delete the line which the cursor is on, then this should be given as \fBdl1\fR; this is done only from the first position on the line to be deleted. @@ -485,12 +499,15 @@ on many terminals without a true insert/delete line, and is often faster even on terminals with those features. .PP The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling -window is effectively a view port on a screen-sized canvas. To test for +window is effectively a view port on a screen-sized canvas. +To test for this capability, create a scrolling region in the middle of the screen, write something to the bottom line, move the cursor to the top of the region, -and do \fBri\fR followed by \fBdl1\fR or \fBind\fR. If the data scrolled +and do \fBri\fR followed by \fBdl1\fR or \fBind\fR. +If the data scrolled off the bottom of the region by the \fBri\fR re-appears, then scrolling -is non-destructive. System V and XSI Curses expect that \fBind\fR, \fBri\fR, +is non-destructive. +System V and XSI Curses expect that \fBind\fR, \fBri\fR, \fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their documentation cautions you not to define \fBcsr\fR unless this is true. This \fBcurses\fR implementation is more liberal and will do explicit erases @@ -505,7 +522,8 @@ and the starting and ending columns in memory, in that order. .PP If the terminal can retain display memory above, then the \fBda\fR capability should be given; if display memory can be retained -below, then \fBdb\fR should be given. These indicate +below, then \fBdb\fR should be given. +These indicate that deleting a line or scrolling may bring non-blank lines up from below or that scrolling back with \fBri\fR may bring down non-blank lines. .PP @@ -519,19 +537,23 @@ on the current line and shift characters off the end of the line rigidly. Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make a distinction between typed and untyped blanks on the screen, shifting upon an insert or delete only to an untyped blank on the screen which is -either eliminated, or expanded to two untyped blanks. You can determine the +either eliminated, or expanded to two untyped blanks. +You can determine the kind of terminal you have by clearing the screen and then typing -text separated by cursor motions. Type \*(lqabc\ \ \ \ def\*(rq using local +text separated by cursor motions. +Type \*(lqabc\ \ \ \ def\*(rq using local cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq. Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert -mode. If typing characters causes the rest of the line to shift +mode. +If typing characters causes the rest of the line to shift rigidly and characters to fall off the end, then your terminal does -not distinguish between blanks and untyped positions. If the \*(lqabc\*(rq +not distinguish between blanks and untyped positions. +If the \*(lqabc\*(rq shifts over to the \*(lqdef\*(rq which then move together around the end of the current line and onto the next as you insert, you have the second type of terminal, and should give the capability \fBin\fR, which stands for \*(lqinsert null\*(rq. -While these are two logically separate attributes (one line vs. multi-line +While these are two logically separate attributes (one line versus multi-line insert mode, and special treatment of untyped spaces) we have seen no terminals whose insert mode cannot be described with the single attribute. .PP @@ -540,24 +562,30 @@ which send a simple sequence to open a blank position on the current line. Give as \fBsmir\fR the sequence to get into insert mode. Give as \fBrmir\fR the sequence to leave insert mode. Now give as \fBich1\fR any sequence needed to be sent just before sending -the character to be inserted. Most terminals with a true insert mode +the character to be inserted. +Most terminals with a true insert mode will not give \fBich1\fR; terminals which send a sequence to open a screen position should give it here. .PP If your terminal has both, insert mode is usually preferable to \fBich1\fR. Technically, you should not give both unless the terminal actually requires -both to be used in combination. Accordingly, some non-curses applications get +both to be used in combination. +Accordingly, some non-curses applications get confused if both are present; the symptom is doubled characters in an update -using insert. This requirement is now rare; most \fBich\fR sequences do not +using insert. +This requirement is now rare; most \fBich\fR sequences do not require previous smir, and most smir insert modes do not require \fBich1\fR -before each character. Therefore, the new \fBcurses\fR actually assumes this +before each character. +Therefore, the new \fBcurses\fR actually assumes this is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as -appropriate (but not both). If you have to write an entry to be used under +appropriate (but not both). +If you have to write an entry to be used under new curses for a terminal old enough to need both, include the \fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR. .PP If post insert padding is needed, give this as a number of milliseconds -in \fBip\fR (a string option). Any other sequence which may need to be +in \fBip\fR (a string option). +Any other sequence which may need to be sent after an insert of a single character may also be given in \fBip\fR. If your terminal needs both to be placed into an `insert mode' and a special code to precede each inserted character, then both @@ -579,9 +607,12 @@ in insert mode, give this as a number of milliseconds padding in \fBrmp\fP. .PP It is occasionally necessary to move around while in insert mode to delete characters on the same line (e.g., if there is a tab after -the insertion position). If your terminal allows motion while in +the insertion position). +If your terminal allows motion while in insert mode you can give the capability \fBmir\fR to speed up inserting -in this case. Omitting \fBmir\fR will affect only speed. Some terminals +in this case. +Omitting \fBmir\fR will affect only speed. +Some terminals (notably Datamedia's) must not have \fBmir\fR because of the way their insert mode works. .PP @@ -772,7 +803,8 @@ then this should be indicated by giving \fBeo\fR. .SS Keypad and Function Keys .PP If the terminal has a keypad that transmits codes when the keys are pressed, -this information can be given. Note that it is not possible to handle +this information can be given. +Note that it is not possible to handle terminals where the keypad only works in local (this applies, for example, to the unshifted HP 2621 keys). If the keypad can be set to transmit or not transmit, @@ -977,21 +1009,24 @@ or .PP Many older and slower terminals don't support either XON/XOFF or DTR handshaking, including hard copy terminals and some very archaic CRTs -(including, for example, DEC VT100s). These may require padding characters +(including, for example, DEC VT100s). +These may require padding characters after certain cursor motions and screen changes. .PP If the terminal uses xon/xoff handshaking for flow control (that is, it automatically emits ^S back to the host when its input buffers are close to full), set .BR xon . -This capability suppresses the emission of padding. You can also set it +This capability suppresses the emission of padding. +You can also set it for memory-mapped console devices effectively that don't have a speed limit. Padding information should still be included so that routines can make better decisions about relative costs, but actual pad characters will not be transmitted. .PP If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates -below the value of \fBpb\fR. If the entry has no padding baud rate, then +below the value of \fBpb\fR. +If the entry has no padding baud rate, then whether padding is emitted or not is completely controlled by \fBxon\fR. .PP If the terminal requires other than a null (zero) character as a pad, @@ -1007,25 +1042,30 @@ software (and thus not counted in the terminal's \fBlines\fR capability). The simplest case is a status line which is cursor-addressable but not part of the main scrolling region on the screen; the Heathkit H19 has a status line of this kind, as would a 24-line VT100 with a 23-line -scrolling region set up on initialization. This situation is indicated +scrolling region set up on initialization. +This situation is indicated by the \fBhs\fR capability. .PP Some terminals with status lines need special sequences to access the -status line. These may be expressed as a string with single parameter +status line. +These may be expressed as a string with single parameter \fBtsl\fR which takes the cursor to a given zero-origin column on the -status line. The capability \fBfsl\fR must return to the main-screen -cursor positions before the last \fBtsl\fR. You may need to embed the +status line. +The capability \fBfsl\fR must return to the main-screen +cursor positions before the last \fBtsl\fR. +You may need to embed the string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor) in \fBtsl\fR and \fBfsl\fR to accomplish this. .PP The status line is normally assumed to be the same width as the width -of the terminal. If this is untrue, you can specify it with the numeric +of the terminal. +If this is untrue, you can specify it with the numeric capability \fBwsl\fR. .PP A command to erase or blank the status line may be specified as \fBdsl\fR. .PP The boolean capability \fBeslok\fR specifies that escape sequences, tabs, -etc. work ordinarily in the status line. +etc., work ordinarily in the status line. .PP The \fBncurses\fR implementation does not yet use any of these capabilities. They are documented here in case they ever become important. @@ -1082,25 +1122,33 @@ vertical line ACS_VLINE | x The best way to define a new device's graphics set is to add a column to a copy of this table for your terminal, giving the character which (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered -as the corresponding graphic. Then read off the VT100/your terminal +as the corresponding graphic. +Then read off the VT100/your terminal character pairs right to left in sequence; these become the ACSC string. .PP .SS Color Handling .PP -Most color terminals are either `Tektronix-like' or `HP-like'. Tektronix-like +Most color terminals are either `Tektronix-like' or `HP-like'. +Tektronix-like terminals have a predefined set of N colors (where N usually 8), and can set character-cell foreground and background characters independently, mixing them -into N * N color-pairs. On HP-like terminals, the use must set each color +into N * N color-pairs. +On HP-like terminals, the use must set each color pair up separately (foreground and background are not independently settable). -Up to M color-pairs may be set up from 2*M different colors. ANSI-compatible +Up to M color-pairs may be set up from 2*M different colors. +ANSI-compatible terminals are Tektronix-like. .PP -Some basic color capabilities are independent of the color method. The numeric +Some basic color capabilities are independent of the color method. +The numeric capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors -and color-pairs that can be displayed simultaneously. The \fBop\fR (original +and color-pairs that can be displayed simultaneously. +The \fBop\fR (original pair) string resets foreground and background colors to their default values -for the terminal. The \fBoc\fR string resets all colors or color-pairs to -their default values for the terminal. Some terminals (including many PC +for the terminal. +The \fBoc\fR string resets all colors or color-pairs to +their default values for the terminal. +Some terminals (including many PC terminal emulators) erase screen areas with the current background color rather than the power-up default background; these should have the boolean capability \fBbce\fR. @@ -1108,19 +1156,24 @@ than the power-up default background; these should have the boolean capability To change the current foreground or background color on a Tektronix-type terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background). -These take one parameter, the color number. The SVr4 documentation describes +These take one parameter, the color number. +The SVr4 documentation describes only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal supports ANSI escape sequences to set background and foreground, they should -be coded as \fBsetaf\fR and \fBsetab\fR, respectively. If the terminal +be coded as \fBsetaf\fR and \fBsetab\fR, respectively. +If the terminal supports other escape sequences to set background and foreground, they should -be coded as \fBsetf\fR and \fBsetb\fR, respectively. The \fIvidputs()\fR +be coded as \fBsetf\fR and \fBsetb\fR, respectively. +The \fIvidputs()\fR function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are defined." .PP The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a -single numeric argument each. Argument values 0-7 are portably defined as +single numeric argument each. +Argument values 0-7 are portably defined as follows (the middle column is the symbolic #define available in the header for -the \fBcurses\fR or \fBncurses\fR libraries). The terminal hardware is free to +the \fBcurses\fR or \fBncurses\fR libraries). +The terminal hardware is free to map these as it likes, but the RGB values indicate normal locations in color space. .PP @@ -1143,22 +1196,31 @@ On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set which color pair is current. .PP On a Tektronix-like terminal, the capability \fBccc\fR may be present to -indicate that colors can be modified. If so, the \fBinitc\fR capability will +indicate that colors can be modified. +If so, the \fBinitc\fR capability will take a color number (0 to \fBcolors\fR - 1)and three more parameters which -describe the color. These three parameters default to being interpreted as RGB -(Red, Green, Blue) values. If the boolean capability \fBhls\fR is present, -they are instead as HLS (Hue, Lightness, Saturation) indices. The ranges are +describe the color. +These three parameters default to being interpreted as RGB +(Red, Green, Blue) values. +If the boolean capability \fBhls\fR is present, +they are instead as HLS (Hue, Lightness, Saturation) indices. +The ranges are terminal-dependent. .PP On an HP-like terminal, \fBinitp\fR may give a capability for changing a -color-pair value. It will take seven parameters; a color-pair number (0 to +color-pair value. +It will take seven parameters; a color-pair number (0 to \fBmax_pairs\fR - 1), and two triples describing first background and then -foreground colors. These parameters must be (Red, Green, Blue) or +foreground colors. +These parameters must be (Red, Green, Blue) or (Hue, Lightness, Saturation) depending on \fBhls\fR. .PP -On some color terminals, colors collide with highlights. You can register -these collisions with the \fBncv\fR capability. This is a bit-mask of -attributes not to be used when colors are enabled. The correspondence with the +On some color terminals, colors collide with highlights. +You can register +these collisions with the \fBncv\fR capability. +This is a bit-mask of +attributes not to be used when colors are enabled. +The correspondence with the attributes understood by \fBcurses\fR is as follows: .PP .TS @@ -1178,7 +1240,8 @@ A_ALTCHARSET 8 256 .TE .PP For example, on many IBM PC consoles, the underline attribute collides with the -foreground color blue and is not available in color mode. These should have +foreground color blue and is not available in color mode. +These should have an \fBncv\fR capability of 2. .PP SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes @@ -1313,7 +1376,8 @@ older versions, it was teleray_glitch. This glitch is also taken to mean that it is not possible to position the cursor on top of a ``magic cookie'', that to erase standout mode it is instead necessary to use -delete and insert line. The ncurses implementation ignores this glitch. +delete and insert line. +The ncurses implementation ignores this glitch. .PP The Beehive Superbee, which is unable to correctly transmit the escape or control C characters, has @@ -1329,15 +1393,18 @@ capabilities of the form \fBx\fR\fIx\fR. .SS Similar Terminals .PP If there are two very similar terminals, one (the variant) can be defined as -being just like the other (the base) with certain exceptions. In the +being just like the other (the base) with certain exceptions. +In the definition of the variant, the string capability \fBuse\fR can be given with -the name of the base terminal. The capabilities given before +the name of the base terminal. +The capabilities given before .B use override those in the base type named by .BR use . If there are multiple \fBuse\fR capabilities, they are merged in reverse order. That is, the rightmost \fBuse\fR reference is processed first, then the one to -its left, and so forth. Capabilities given explicitly in the entry override +its left, and so forth. +Capabilities given explicitly in the entry override those brought in by \fBuse\fR references. .PP A capability can be canceled by placing \fBxx@\fR to the left of the @@ -1354,30 +1421,37 @@ user preferences. .SS Pitfalls of Long Entries .PP Long terminfo entries are unlikely to be a problem; to date, no entry has even -approached terminfo's 4K string-table maximum. Unfortunately, the termcap +approached terminfo's 4K string-table maximum. +Unfortunately, the termcap translations are much more strictly limited (to 1K), thus termcap translations of long terminfo entries can cause problems. .PP The man pages for 4.3BSD and older versions of tgetent() instruct the user to -allocate a 1K buffer for the termcap entry. The entry gets null-terminated by +allocate a 1K buffer for the termcap entry. +The entry gets null-terminated by the termcap library, so that makes the maximum safe length for a termcap entry -1k-1 (1023) bytes. Depending on what the application and the termcap library +1k-1 (1023) bytes. +Depending on what the application and the termcap library being used does, and where in the termcap file the terminal type that tgetent() is searching for is, several bad things can happen. .PP Some termcap libraries print a warning message or exit if they find an entry that's longer than 1023 bytes; others don't; others truncate the -entries to 1023 bytes. Some application programs allocate more than +entries to 1023 bytes. +Some application programs allocate more than the recommended 1K for the termcap entry; others don't. .PP Each termcap entry has two important sizes associated with it: before -"tc" expansion, and after "tc" expansion. "tc" is the capability that +"tc" expansion, and after "tc" expansion. +"tc" is the capability that tacks on another termcap entry to the end of the current one, to add -on its capabilities. If a termcap entry doesn't use the "tc" +on its capabilities. +If a termcap entry doesn't use the "tc" capability, then of course the two lengths are the same. .PP The "before tc expansion" length is the most important one, because it -affects more than just users of that particular terminal. This is the +affects more than just users of that particular terminal. +This is the length of the entry as it exists in /etc/termcap, minus the backslash-newline pairs, which tgetent() strips out while reading it. Some termcap libraries strip off the final newline, too (GNU termcap does not). @@ -1401,10 +1475,13 @@ doesn't appear in the file at all (so that tgetent() has to search the whole termcap file). .PP Then tgetent() will overwrite memory, perhaps its stack, and probably core dump -the program. Programs like telnet are particularly vulnerable; modern telnets -pass along values like the terminal type automatically. The results are almost +the program. +Programs like telnet are particularly vulnerable; modern telnets +pass along values like the terminal type automatically. +The results are almost as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that -prints warning messages when it reads an overly long termcap entry. If a +prints warning messages when it reads an overly long termcap entry. +If a termcap library truncates long entries, like OSF/1 3.0, it is immune to dying here but will return incorrect data for the terminal. .PP @@ -1415,18 +1492,21 @@ terminal type it was looking for, not while searching. .PP In summary, a termcap entry that is longer than 1023 bytes can cause, on various combinations of termcap libraries and applications, a core -dump, warnings, or incorrect operation. If it's too long even before +dump, warnings, or incorrect operation. +If it's too long even before "tc" expansion, it will have this effect even for users of some other terminal types and users whose TERM variable does not have a termcap entry. .PP When in -C (translate to termcap) mode, the \fBncurses\fR implementation of \fBtic\fR(1) issues warning messages when the pre-tc length of a termcap -translation is too long. The -c (check) option also checks resolved (after tc +translation is too long. +The -c (check) option also checks resolved (after tc expansion) lengths. .SS Binary Compatibility It is not wise to count on portability of binary terminfo entries between -commercial UNIX versions. The problem is that there are at least two versions +commercial UNIX versions. +The problem is that there are at least two versions of terminfo (under HP-UX and AIX) which diverged from System V terminfo after SVr1, and have added extension capabilities to the string table that (in the binary format) collide with System V and XSI Curses extensions. @@ -1438,24 +1518,29 @@ SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in an alternate-character-set mode (such modes may, among other things, map CR and NL to characters that don't trigger local motions). The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR -mode. This raises the possibility that an XPG4 +mode. +This raises the possibility that an XPG4 implementation making the opposite interpretation may need terminfo entries made for \fBncurses\fR to have \fBmsgr\fR turned off. .PP The \fBncurses\fR library handles insert-character and insert-character modes -in a slightly non-standard way in order to get better update efficiency. See +in a slightly non-standard way to get better update efficiency. +See the \fBInsert/Delete Character\fR subsection above. .PP The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are -not documented in SVr4 or the XSI Curses standard. They are deduced from the +not documented in SVr4 or the XSI Curses standard. +They are deduced from the documentation for the AT&T 505 terminal. .PP -Be careful assigning the \fBkmous\fR capability. The \fBncurses\fR wants to +Be careful assigning the \fBkmous\fR capability. +The \fBncurses\fR wants to interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm that can return mouse-tracking information in the keyboard-input stream. .PP Different commercial ports of terminfo and curses support different subsets of -the XSI Curses standard and (in some cases) different extension sets. Here +the XSI Curses standard and (in some cases) different extension sets. +Here is a summary, accurate as of October 1995: .PP \fBSVR4, Solaris, ncurses\fR -- @@ -1466,7 +1551,8 @@ Supports the SVr4 set, adds one undocumented extended string capability (\fBset_pglen\fR). .PP \fBSVr1, Ultrix\fR -- -These support a restricted subset of terminfo capabilities. The booleans +These support a restricted subset of terminfo capabilities. +The booleans end with \fBxon_xoff\fR; the numerics with \fBwidth_status_line\fR; and the strings with \fBprtr_non\fR. .PP @@ -1486,7 +1572,7 @@ Supports both the SVr4 set and the AIX extensions. .TP 25 \*d/?/* files containing terminal descriptions -.SH "SEE ALSO" +.SH SEE ALSO \fBtic\fR(1M), \fBcurses\fR(3X), \fBprintf\fR(3S), \fBterm\fR(\*n). .SH AUTHORS Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey. diff --git a/contrib/ncurses/man/wresize.3x b/contrib/ncurses/man/wresize.3x index 5988f19..62933f1 100644 --- a/contrib/ncurses/man/wresize.3x +++ b/contrib/ncurses/man/wresize.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 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 * @@ -28,38 +28,32 @@ .\" .\" Author: Thomas E. Dickey <dickey@clark.net> 1996 .\" -.\" $Id: wresize.3x,v 1.5 1998/03/14 23:42:44 tom Exp $ +.\" $Id: wresize.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ .TH wresize 3X "" .SH NAME \fBwresize\fR - resize a curses window -.. .SH SYNOPSIS \fB#include <curses.h>\fR \fBint wresize(WINDOW *win, int lines, int columns);\fR -.. .SH DESCRIPTION The \fBwresize\fR function reallocates storage for an \fBncurses\fR window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window's data is filled with blanks that have the current background rendition (as set by \fBwbkgndset\fR) merged into them. -.. .SH RETURN VALUE The function returns the integer \fBERR\fR upon failure and \fBOK\fR on success. It will fail if either of the dimensions less than or equal to zero, or if an error occurs while (re)allocating memory for the window. -.. .SH NOTES The only restriction placed on the dimensions is that they be greater than zero. The dimensions are not compared to \fBcurses\fR screen dimensions to simplify the logic of \fBresizeterm\fR. The caller must ensure that the window's dimensions fit within the actual screen dimensions. -.. .SH SEE ALSO \fBresizeterm\fR(3X). -.. .SH AUTHOR Thomas Dickey (from an equivalent function written in 1988 for BSD curses). .\"# diff --git a/contrib/ncurses/menu/Makefile.in b/contrib/ncurses/menu/Makefile.in index b27651c..b5c7b68 100644 --- a/contrib/ncurses/menu/Makefile.in +++ b/contrib/ncurses/menu/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.32 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.36 2002/01/20 01:49:17 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 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"), # @@ -50,6 +50,7 @@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ @@ -57,6 +58,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -85,7 +87,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ @@ -97,6 +99,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -115,8 +119,9 @@ install :: $(AUTO_SRC) $(LIBRARIES) sources : $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # make copies to simplify include-paths while still keeping menu's include # file in this directory. @@ -142,7 +147,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/contrib/ncurses/menu/menu.priv.h b/contrib/ncurses/menu/menu.priv.h index e9c27d1..1b2c628 100644 --- a/contrib/ncurses/menu/menu.priv.h +++ b/contrib/ncurses/menu/menu.priv.h @@ -35,6 +35,12 @@ * Top level private header file for all libnmenu modules * ***************************************************************************/ +#ifndef MENU_PRIV_H_incl +#define MENU_PRIV_H_incl 1 + +#include <ncurses_cfg.h> +#include <curses.h> + #include "mf_common.h" #include "menu.h" @@ -112,3 +118,5 @@ extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *); extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, int* pY, int* pX); + +#endif /* MENU_PRIV_H_incl */ diff --git a/contrib/ncurses/menu/mf_common.h b/contrib/ncurses/menu/mf_common.h index 6b1e8fe..bf0bf01 100644 --- a/contrib/ncurses/menu/mf_common.h +++ b/contrib/ncurses/menu/mf_common.h @@ -32,9 +32,11 @@ /* Common internal header for menu and form library */ -#if HAVE_CONFIG_H -# include <ncurses_cfg.h> -#endif +#ifndef MF_COMMON_H_incl +#define MF_COMMON_H_incl 1 + +#include <ncurses_cfg.h> +#include <curses.h> #include <stdlib.h> #include <sys/types.h> @@ -91,3 +93,5 @@ extern int errno; # define INLINE inline # endif #endif + +#endif /* MF_COMMON_H_incl */ diff --git a/contrib/ncurses/misc/Makefile.in b/contrib/ncurses/misc/Makefile.in index 4ea0446..b8f25b8 100644 --- a/contrib/ncurses/misc/Makefile.in +++ b/contrib/ncurses/misc/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.29 2000/09/30 20:01:10 tom Exp $ +# $Id: Makefile.in,v 1.34 2002/01/12 23:54:39 Robert.Joop Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001,2002 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"), # @@ -40,7 +40,7 @@ # and the programs with the configured default model. # turn off _all_ suffix rules; we'll generate our own -.SUFFIXES: +.SUFFIXES : SHELL = /bin/sh THIS = Makefile @@ -57,6 +57,9 @@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ +CC = @CC@ +HOSTCC = @BUILD_CC@ + tabsetdir = $(datadir)/tabset ticdir = @TERMINFO@ source = @TERMINFO_SRC@ @@ -65,11 +68,13 @@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ ################################################################################ -all: +all : + +depend : -sources: +sources : -install: install.data +install : install.data install.data : $(DESTDIR)$(libdir) \ $(DESTDIR)$(ticdir) \ @@ -83,9 +88,11 @@ install.data : $(DESTDIR)$(libdir) \ datadir=${datadir} \ ticdir=${ticdir} \ source=${source} \ - $(SHELL) ./run_tic.sh + THIS_CC="$(CC)" \ + THAT_CC="$(HOSTCC)" \ + sh ./run_tic.sh @cd $(srcdir)/tabset && \ - $(SHELL) -c 'for i in * ; do \ + sh -c 'for i in * ; do \ if test -f $$i ; then \ echo installing $$i; \ $(INSTALL_DATA) $$i $(DESTDIR)$(tabsetdir)/$$i; \ @@ -94,27 +101,27 @@ install.data : $(DESTDIR)$(libdir) \ $(DESTDIR)$(libdir) \ $(DESTDIR)$(tabsetdir) \ $(DESTDIR)$(ticdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ -uninstall: uninstall.data +uninstall : uninstall.data -uninstall.data: +uninstall.data : -cd $(DESTDIR)$(ticdir) && rm -rf * -cd $(DESTDIR)$(tabsetdir) && rm -rf * -tags: +tags : -@MAKE_UPPER_TAGS@TAGS: +@MAKE_UPPER_TAGS@TAGS : -mostlyclean: - -rm -f core tags TAGS *~ *.ln *.atac trace +mostlyclean : + -rm -f core tags TAGS *~ *.bak *.ln *.atac trace clean :: mostlyclean -distclean: clean +distclean : clean -rm -f Makefile run_tic.sh -realclean: distclean +realclean : distclean ############################################################################### # The remainder of this file is automatically generated during configuration diff --git a/contrib/ncurses/misc/run_tic.in b/contrib/ncurses/misc/run_tic.in index 59ae327..295ae07 100644 --- a/contrib/ncurses/misc/run_tic.in +++ b/contrib/ncurses/misc/run_tic.in @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996,2000 # -# $Id: run_tic.in,v 1.10 2000/10/09 22:57:35 tom Exp $ +# $Id: run_tic.in,v 1.11 2001/10/14 00:44:33 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. # @@ -52,15 +52,21 @@ echo '** Building terminfo database, please wait...' : ${ticdir=@TERMINFO@} : ${source=@TERMINFO_SRC@} : ${LN_S="@LN_S@"} +: ${THAT_CC=cc} +: ${THIS_CC=cc} test -z "${DESTDIR}" && DESTDIR= -# Allow tic to run either from the install-path, or from the build-directory +# Allow tic to run either from the install-path, or from the build-directory. +# Do not do this if we appear to be cross-compiling. In that case, we rely +# on the host's copy of tic to compile the terminfo database. +if test "$THAT_CC" = "$THIS_CC" ; then case "$PATH" in :*) PATH=../progs:${DESTDIR}$bindir$PATH ;; *) PATH=../progs:${DESTDIR}$bindir:$PATH ;; esac export PATH +fi # # set another env var that doesn't get reset when `shlib' runs, so `shlib' uses diff --git a/contrib/ncurses/misc/terminfo.src b/contrib/ncurses/misc/terminfo.src index 124b023..2285f6a 100644 --- a/contrib/ncurses/misc/terminfo.src +++ b/contrib/ncurses/misc/terminfo.src @@ -1,11 +1,16 @@ ######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE # # This version of terminfo.src is distributed with ncurses. -# Report bugs to +# Report bugs and new terminal descriptions to # bug-ncurses@gnu.org # +# The original header is preserved below for reference. It is noted that there +# is a newer version which differs in some cosmetic details; we have decided +# to not change the header unless there is also a change in content. +# +#------------------------------------------------------------------------------ # Version 10.2.1 -# $Date: 2001/05/05 23:09:00 $ +# $Date: 2002/01/12 17:31:53 $ # terminfo syntax # # Eric S. Raymond (current maintainer) @@ -763,7 +768,7 @@ mach|Mach Console, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I, il=\E[%p1%dL, il1=\E[L, ind=^J, - kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kbs=\177, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[9, kend=\E[Y, kf1=\EOP, kf10=\EOY, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV, kf8=\EOW, kf9=\EOX, khome=\E[H, kich1=\E[@, kll=\E[F, knp=\E[U, @@ -2401,6 +2406,57 @@ crt|crt-vt220|CRT 2.3 emulating VT220, hts=\EH, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, use=vt220, use=ecma+color, +# PuTTY 0.51 (released 14 December 2000) +# http://www.chiark.greenend.org.uk/~sgtatham/putty/ +# +# This emulates vt100 + vt52 (plus a few vt220 features: ech, SRM, DECTCEM, as +# well as SCO and Atari, color palettes from Linux console). Reading the code, +# it is intended to be VT102 plus selected features By default, it sets $TERM +# to xterm, which is incorrect, since several features are misimplemented: +# +# Alt+key always sends ESC+key, so 'km' capability is removed. +# +# Control responses, wrapping and tabs are buggy, failing a couple of +# screens in vttest. +# +# xterm mouse support is not implemented (unrelease version may). +# +# Several features such as backspace/delete are optional; this entry documents +# the default behavior -TD +putty|xterm clone (win32), + am, bw, ccc, km, mir, msgr, xenl, + colors#8, cols#80, it#8, lines#24, pairs#64, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, 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, enacs=\E)0, home=\E[H, + hpa=\E[%i%p1%dG, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, + ind=^J, + initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;, + is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, + kbs=\177, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, + kcuu1=\EOA, kdch1=\E[3~, kf1=\E[11~, 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=\E[12~, kf20=\E[34~, kf3=\E[13~, + kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, + kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, + kpp=\E[5~, kslt=\E[4~, oc=\E]R, op=\E[39;49m, 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, + rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr0=\E[m, smacs=^N, smam=\E[?7h, 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, + vpa=\E[%i%p1%dd, + # This entry is for Tera Term Pro version 2.3, for MS-Windows 95/NT written by # T. Teranishi dated Mar 10, 1998. It is a free software terminal emulator # (communication program) which supports: @@ -2462,11 +2518,31 @@ teraterm|Tera Term Pro, # Tested with WinNT 4.0, the telnet application assumes the screensize is # 25x80. This entry uses the 'Terminal' font, to get line-drawing characters. +# +# Other notes: +# a) Fails tack's cup (cursor-addressing) test, though cup works well enough +# for casual (occasional) use. Also fails several of the vttest screens, +# but that is not unusual for vt100 "emulators". +# b) Does not implement vt100 keypad +# c) Recognizes a subset of vt52 controls. ms-vt100|MS telnet imitating dec vt100, lines#25, acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, - tbc@, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, - use=vt100, + ka1@, ka3@, kb2@, kc1@, kc3@, kent@, kf0@, kf1@, kf10@, kf2@, kf3@, kf4@, + kf5@, kf6@, kf7@, kf8@, kf9@, tbc@, u6=\E[%i%d;%dR, u7=\E[6n, + u8=\E[?6c, u9=\E[c, use=vt100, + +# Tested with Windows 2000, the telnet application runs in a console window, +# also using 'Terminal' font. +# +# Other notes: +# a) This version has no function keys or numeric keypad. Unlike the older +# version, the numeric keypad is entirely ignored. +# b) The program sets $TERM to "ansi", which of course is inaccurate. +ms-vt100-color|windows 2000 ansi (sic), + bce, + dch=\E[%p1%dP, ich=\E[%p1%d@, use=ecma+color, + use=ms-vt100, #### X terminal emulators # @@ -2899,17 +2975,114 @@ nxterm|xterm-color|generic color xterm, op=\E[m, use=xterm-r6, use=klone+color, # this describes the alpha-version of Gnome terminal shipped with Redhat 6.0 -gnome|Gnome terminal, +gnome-rh62|Gnome terminal, bce, kdch1=\177, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, use=xterm-color, +# GNOME Terminal 1.4.0.4 (Redhat 7.2) +# +# This implements a subset of vt102 with a random selection of features from +# other terminals such as color and function-keys. +# +# shift-f1 to shift-f10 are f11 to f20 +# +# NumLock changes the application keypad to approximate vt100 keypad, except +# that there is no escape sequence matching comma (,). +# +# Other defects observed: +# vt100 LNM mode is not implemented. +# vt100 80/132 column mode is not implemented. +# vt100 DECALN is not implemented. +# vt100 DECSCNM mode is not implemented, so flash does not work. +# vt100 TBC (tab reset) is not implemented. +# xterm alternate screen controls do not restore cursor position properly +# it hangs in tack after running function-keys test. +gnome-rh72|GNOME Terminal, + bce, + civis=\E[?25l, cnorm=\E[?25h, kdch1=\E[3~, kf1=\EOP, + kf2=\EOQ, kf3=\EOR, kf4=\EOS, rmam=\E[?7l, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m%?%p9%t\016%e\017%;, + smam=\E[?7h, tbc@, use=xterm-color, + +gnome|GNOME Terminal, + use=gnome-rh72, + # This is kvt 0-18.7, shipped with Redhat 6.0 (though whether it supports bce # or not is debatable). kvt|KDE terminal, bce, km@, kdch1=\177, kend=\E[F, khome=\E[H, use=xterm-color, +# Konsole 1.0.1 +# (formerly known as kvt) +# +# This program hardcodes $TERM to 'xterm', which is not accurate. However, to +# simplify this entry (and point out why konsole isn't xterm), we base this on +# xterm-r6. The default keyboard appears to be 'linux'. +# +# Notes: +# a) konsole implements several features from XFree86 xterm, though none of +# that is documented - except of course in its source code - apparently +# because its implementors are unaccustomed to reading documentation - as +# evidenced by the sparse and poorly edited documentation distributed with +# konsole. Some features such as the 1049 private mode are recognized but +# incorrectly implemented as a duplicate of the 47 private mode. +# b) even with the "vt100 (historical)" keyboard setting, the numeric keypad +# sends PC-style escapes rather than vt100. +# c) fails vttest menu 3 (Test of character sets) because it does not properly +# parse some control sequences. Also fails vttest Primary Device Attributes +# by sending a bogus code (in the source it says it's supposed to be a +# vt220, which is doubly incorrect because it does not implement vt220 +# control sequences except for a few special cases). Treat it as a +# mildly-broken vt102. +konsole-base|KDE console window, + bce, km@, npc, + bel@, blink=\E[5m, civis=\E[?25l, cnorm=\E[?25h, + ech=\E[%p1%dX, flash=\E[?5h$<100/>\E[?5l, + hpa=\E[%i%p1%dG, kbs@, kdch1@, kend@, kf1@, kf10@, kf11@, kf12@, + kf13@, kf14@, kf15@, kf16@, kf17@, kf18@, kf19@, kf2@, kf20@, kf3@, + kf4@, kf5@, kf6@, kf7@, kf8@, kf9@, kfnd@, khome@, kslt@, + rmam=\E[?7l, rmso=\E[27m, rmul=\E[24m, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + smam=\E[?7h, vpa=\E[%i%p1%dd, use=ecma+color, + use=xterm-r6, +konsole-linux|KDE console window with linux keyboard, + kdch1=\E[3~, kf1=\E[[A, kf10=\E[21~, kf11=\E[23~, + kf12=\E[24~, kf13@, kf14@, kf15@, kf16@, kf17@, kf18@, kf19@, + kf2=\E[[B, kf20@, kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, + kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + use=konsole-base, +# KDE's "XFree86 3.x.x" keyboard is based on reading the xterm terminfo rather +# than testing the code. +konsole-xf3x|KDE console window with keyboard for XFree86 3.x xterm, + kend=\E[4~, khome=\E[1~, use=konsole-vt100, +# The value for kbs reflects local customization rather than the settings used +# for XFree86 xterm. +konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm, + kbs=^H, kend=\EOF, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, + khome=\EOH, use=konsole-vt100, +# KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but +# it is still useful for deriving the other entries. +konsole-vt100|KDE console window with vt100 (sic) keyboard, + kbs=\177, kdch1=\E[3~, kend=\E[F, kf1=\E[11~, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13@, kf14@, kf15@, kf16@, kf17@, + kf18@, kf19@, kf2=\E[12~, kf20@, kf3=\E[13~, kf4=\E[14~, + kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + khome=\E[H, use=konsole-base, +konsole-vt420pc|KDE console window with vt420 pc keyboard, + kbs=^H, kdch1=\177, use=konsole-vt100, +konsole-16color|klone of xterm-16color, + colors#16, ncv#32, pairs#256, + setab=\E[%?%p1%{8}%<%t%p1%'('%+%e%p1%{92}%+%;%dm, + setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%'R'%+%;%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=konsole, +# make a default entry for konsole +konsole|KDE console window, + use=konsole-linux, + # From: Thomas Dickey <dickey@clark.net> 04 Oct 1997 # Updated: Oezguer Kesim <kesim@math.fu-berlin.de> 02 Nov 1997 # Notes: @@ -2927,7 +3100,7 @@ kvt|KDE terminal, # # rxvt is normally configured to look for "xterm" or "xterm-color" as $TERM. # Since rxvt is not really compatible with xterm, it should be configured as -# "rxvt" (monochrome) and "rxvt-color". +# "rxvt-basic" (monochrome) and "rxvt". rxvt-basic|rxvt terminal base (X Window System), OTbs, am, bce, eo, km, mir, msgr, xenl, xon, cols#80, it#8, lines#24, @@ -2967,7 +3140,6 @@ rxvt|rxvt terminal emulator (X Window System), # From: Michael Jennings <mej@valinux.com> # removed kf0 which conflicts with kf10 -TD # remove cvvis which conflicts with cnorm -TD -# There's no u6 because Eterm appears to lack CPR (cursor position report). Eterm|Eterm-color|Eterm with xterm-style color support (X Window System), am, bce, bw, eo, km, mc5i, mir, msgr, xenl, xon, btns#5, cols#80, it#8, lines#24, lm#0, ncv@, @@ -3003,8 +3175,8 @@ Eterm|Eterm-color|Eterm with xterm-style color support (X Window System), sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h, smir=\E[4h, smkx=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u7=\E[6n, u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, - use=ecma+color, + u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + vpa=\E[%i%p1%dd, use=ecma+color, # These (xtermc and xtermm) are distributed with Solaris. They refer to a # variant of xterm which is apparently no longer supported, but are interesting @@ -3399,6 +3571,45 @@ pilot|tgtelnet|Top Gun Telnet on the Palm Pilot Professional, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, knp=^L, kpp=^K, nel=\Em~\s, rmso=\EB, smso=\Eb, +# From: Federico Bianchi <bianchi@www.arte.unipi.it> +# These entries are for the Embeddable Linux Kernel System (ELKS) +# project - an heavily stripped down Linux to be run on 16 bit +# boxes or, eventually, to be used in embedded systems - and have been +# adapted from the stock ELKS termcap. The project itself looks stalled, +# and the latest improvements I know of date back to March 2000. +# +# To cope with the ELKS dumb console I added an "elks-glasstty" entry; +# as an added bonus, this deals with all the capabilities common to +# both VT52 and ANSI (or, eventually, "special") modes. + +elks-glasstty|ELKS glass-TTY capabilities, + OTbs, am, + cols#80, it#8, lines#25, + bel=^G, cr=^M, ht=^I, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, + nel=^M^J, + +elks-vt52|ELKS vt52 console, + clear=\EH\EJ, cub1=\ED, cud1=\EB, cuf1=\EC, + cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, el=\EK, + home=\EH, use=elks-glasstty, + +elks-ansi|ELKS ANSI console, + clear=\E[H\E[2J, cub1=\E[D, cud1=\E[B, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, el=\E[K, home=\E[H, + rmso=\E[m, smso=\E[7m, use=elks-glasstty, + +# As a matter of fact, ELKS 0.0.83 on PCs defaults to ANSI emulation +# instead of VT52, but the "elks" entry still refers to the latter. + +elks|default ELKS console, + use=elks-vt52, + +# Project SIBO (for Psion 3 palmtops) console is identical to the ELKS +# one but in screen size + +sibo|ELKS SIBO console, + cols#61, it#8, lines#20, use=elks-vt52, + ######## COMMERCIAL WORKSTATION CONSOLES # @@ -14416,69 +14627,497 @@ mac|macintosh|Macintosh with MacTerminal, mac-w|macterminal-w|Apple Macintosh with Macterminal in 132 column mode, cols#132, use=mac, -# Apple's MacOS X includes a Terminal.app derived from the old NeXT -# Terminal.app. It is a partial VT100 emulation with some extensions. -# -# There are no function keys, at least not in version 41. -# -# It supports mouse pointer position reporting using xterm-like -# sequences (not used in these entries.) When using emacs, the cursor -# can be positioned using option-click. -# -# It provides partial ANSI color support (background colors interact -# badly with bold, though.) The monochrome (-m) entries are useful if -# you've disabled color support. +# The AppKit Terminal.app descriptions all have names beginning with +# "nsterm". Note that the statusline (-s) versions use the window +# titlebar as a phony status line, and may produce warnings during +# compilation as a result ("tsl uses 0 parameters, expected 1".) Ignore +# these warnings, or even ignore these entries entirely. Apps which +# need to position the cursor or do other fancy stuff inside the status +# line won't work with these entries. They're primarily useful for +# programs like Pine which provide simple notifications in the status +# line. Please note that non-ASCII characters don't work right in the +# status line, since Terminal.app incorrectly interprets their Unicode +# codepoints as MacRoman codepoints. +# +# * Renamed the AppKit Terminal.app entry from "Apple_Terminal" to +# "nsterm" to comply with the name length and case conventions and +# limitations of various software packages [notably Solaris terminfo +# and UNIX.] A single Apple_Terminal alias is retained for +# backwards-compatbility. +# +# * Added function key support (F1-F4). These only work in Terminal.app +# version 51, hopefully the capabilities won't cause problems for people +# using version 41. +# +# * Added "full color" (-c) entries which support the 16-color mode in +# version 51. +# +# * By default, version 51 uses UTF-8 encoding with broken altcharset +# support, so "ASCII" (-7) entries without altcharset support were +# added. + +# nsterm - AppKit Terminal.app +# +# Apple's Mac OS X includes a Terminal.app derived from the old NeXT +# Terminal.app. It is a partial VT100 emulation with some xterm-like +# extensions. This terminfo was written to describe versions 41 +# (shipped with Mac OS X version 10.0) and 51 (shipped with Mac OS X +# version 10.1) of Terminal.app. +# +# Terminal.app runs under the Mac OS X Quartz windowing system (and +# other AppKit-supported windowing systems.) On the Mac OS X machine I +# use, the executable for Terminal.app is: +# /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal +# +# If you're looking for a description of the full-screen system +# console which runs under Apple's Darwin operating system on PowerPC +# platforms, see the "xnuppc" entry instead. +# +# There were no function keys in version 41. In version 51, there are +# four working function keys (F1, F2, F3 and F4.) The function keys +# are included in all of these entries. +# +# It does not support mouse pointer position reporting. Under some +# circumstances the cursor can be positioned using option-click; this +# works by comparing the cursor position and the selected position, +# and simulating enough cursor-key presses to move the cursor to the +# selected position. This technique fails in all but the simplest +# applications. +# +# It provides partial ANSI color support (background colors interacted +# badly with bold in version 41, though, as reflected in :ncv:.) The +# monochrome (-m) entries are useful if you've disabled color support +# or use a monochrome monitor. The full color (-c) entries are useful +# in version 51, which doesn't exhibit the background color bug. They +# also enable an xterm-compatible 16-color mode. # # The configurable titlebar is set using xterm-compatible sequences; -# it is used as a status bar in these entries. +# it is used as a status bar in the statusline (-s) entries. Its width +# depends on font sizes and window sizes, but 50 characters seems to +# be the default for an 80x24 window. # # The MacRoman character encoding is used for some of the alternate -# characters in the "MacRoman" entries; the "ASCII" (-ascii) entries -# rely instead on Terminal.app's own buggy VT100 graphics emulation, -# which seems to think the character encoding is the old NeXT charset -# instead of MacRoman. +# characters in the "MacRoman" entries; the "ASCII" (-7) entries +# disable alternate character set support entirely, and the "VT100" +# (-acs) entries rely instead on Terminal.app's own buggy VT100 +# graphics emulation, which seems to think the character encoding is +# the old NeXT charset instead of MacRoman. The "ASCII" (-7) entries +# are useful in Terminal.app version 51, which supports UTF-8 and +# other ASCII-compatible character encodings but does not correctly +# implement VT100 graphics; once VT100 graphics are correctly +# implemented in Terminal.app, the "VT100" (-acs) entries should be +# usable in any ASCII-compatible character encoding [except perhaps +# in UTF-8, where some experts argue for disallowing alternate +# characters entirely.] # # Terminal.app reports "vt100" as the terminal type, but exports # several environment variables which may aid detection in a shell -# profile: +# profile (i.e. .profile or .login): # # TERM=vt100 # TERM_PROGRAM=Apple_Terminal -# TERM_PROGRAM_VERSION=41 - -Apple_Terminal-ascii-m|Apple MacOS X Terminal.app v41 w/ASCII charset (monochrome), - am, bw, hs, msgr, xenl, xon, - cols#80, it#8, lines#24, vt#3, wsl#40, - acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, +# TERM_PROGRAM_VERSION=41 # in Terminal.app version 41 +# TERM_PROGRAM_VERSION=51 # in Terminal.app version 51 +# +# For example, the following Bourne shell script would detect the +# correct terminal type: +# +# if [ :"$TERM" = :"vt100" -a :"$TERM_PROGRAM" = :"Apple_Terminal" ] +# then +# export TERM +# if [ :"$TERM_PROGRAM_VERSION" = :41 ] +# then +# TERM="nsterm" +# else +# TERM="nsterm-c-7" +# fi +# fi +# +# In a C shell derivative, this would be accomplished by: +# +# if ( $?TERM && $?TERM_PROGRAM && $?TERM_PROGRAM_VERSION) then +# if ( :"$TERM" == :"vt100" && :"$TERM_PROGRAM" == :"Apple_Terminal" ) then +# if ( :"$TERM_PROGRAM_VERSION" == :41 ) then +# setenv TERM "nsterm" +# else +# setenv TERM "nsterm-c-7" +# endif +# endif +# endif + +# The '+' entries are building blocks +nsterm+7|AppKit Terminal.app v41+ basic capabilities w/ASCII charset, + am, bw, msgr, xenl, xon, + cols#80, it#8, lines#24, bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, 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, - dl=\E[%p1%dM, dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, - el1=\E[1K, enacs=\E(B\E)0, fsl=^G, home=\E[H, ht=^I, hts=\EH, - il=\E[%p1%dL, il1=\E[L, ind=^J, ka1=\EOq, ka3=\EOs, kb2=\EOr, - kbs=\177, kc1=\EOp, kc3=\EOn, kcub1=\EOD, kcud1=\EOB, - kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, rc=\E8, rev=\E[7m, ri=\EM, - rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, - rmul=\E[m, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, - sc=\E7, - sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, - sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, - smso=\E[7m, smul=\E[4m, tbc=\E[3g, tsl=\E]2;, u8=\E[?1;2c, - u9=\E[c, + dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, + home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=^J, + ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, + kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, rc=\E8, rev=\E[7m, + ri=\EM, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, + rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m, + sgr0=\E[m\017, smam=\E[?7h, 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, + +nsterm+acs|AppKit Terminal.app v41+ basic capabilities w/VT100 alternate-charset, + acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + enacs=\E(B\E)0, rmacs=^O, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + smacs=^N, use=nsterm+7, + +nsterm+mac|AppKit Terminal.app v41+ basic capabilities w/MacRoman alternate-charset, + acsc=0#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245+\335-\366\,\334.\377, + enacs=\E(B\E)0, rmacs=^O, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + smacs=^N, use=nsterm+7, + +nsterm+s|AppKit Terminal.app v41+ status-line (window titlebar) support, + hs, + wsl#50, + dsl=\E]2;\007, fsl=^G, tsl=\E]2;, -Apple_Terminal-ascii|Apple MacOS X Terminal.app v41 w/ASCII charset (color), +nsterm+c|AppKit Terminal.app v51+ full color support (including 16 colors), + colors#16, pairs#256, + op=\E[0m, + setab=\E[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm, + setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm, + +nsterm+c41|AppKit Terminal.app v41 color support, colors#8, ncv#37, pairs#64, + op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + +# These are different combinations of the building blocks + +# ASCII charset (-7) +nsterm-m-7|nsterm-7-m|AppKit Terminal.app v41+ w/ASCII charset (monochrome), + use=nsterm+7, + +nsterm-m-s-7|nsterm-7-m-s|AppKit Terminal.app v41+ w/ASCII charset (monochrome w/statusline), + use=nsterm+s, use=nsterm+7, + +nsterm-7|AppKit Terminal.app v41+ w/ASCII charset (color), + use=nsterm+c41, use=nsterm+7, + +nsterm-7-c|nsterm-c-7|AppKit Terminal.app v51+ w/ASCII charset (full color), + use=nsterm+c, use=nsterm+7, + +nsterm-s-7|nsterm-7-s|AppKit Terminal.app v41+ w/ASCII charset (color w/statusline), + use=nsterm+s, use=nsterm+c41, use=nsterm+7, + +nsterm-c-s-7|nsterm-7-c-s|AppKit Terminal.app v51+ w/ASCII charset (full color w/statusline), + use=nsterm+s, use=nsterm+c, use=nsterm+7, + +# VT100 alternate-charset (-acs) +nsterm-m-acs|nsterm-acs-m|AppKit Terminal.app v41+ w/VT100 alternate-charset (monochrome), + use=nsterm+acs, + +nsterm-m-s-acs|nsterm-acs-m-s|AppKit Terminal.app v41+ w/VT100 alternate-charset (monochrome w/statusline), + use=nsterm+s, use=nsterm+acs, + +nsterm-acs|AppKit Terminal.app v41+ w/VT100 alternate-charset (color), + use=nsterm+c41, use=nsterm+acs, + +nsterm-c-acs|nsterm-acs-c|AppKit Terminal.app v51+ w/VT100 alternate-charset (full color), + use=nsterm+c, use=nsterm+acs, + +nsterm-s-acs|nsterm-acs-s|AppKit Terminal.app v41+ w/VT100 alternate-charset (color w/statusline), + use=nsterm+s, use=nsterm+c41, use=nsterm+acs, + +nsterm-c-s-acs|nsterm-acs-c-s|AppKit Terminal.app v51+ w/VT100 alternate-charset (full color w/statusline), + use=nsterm+s, use=nsterm+c, use=nsterm+acs, + +# MacRoman charset +nsterm-m|AppKit Terminal.app v41+ w/MacRoman charset (monochrome), + use=nsterm+mac, + +nsterm-m-s|AppKit Terminal.app v41+ w/MacRoman charset (monochrome w/statusline), + use=nsterm+s, use=nsterm+mac, + +nsterm|Apple_Terminal|AppKit Terminal.app v41+ w/MacRoman charset (color), + use=nsterm+c41, use=nsterm+mac, + +nsterm-c|AppKit Terminal.app v51+ w/MacRoman charset (full color), + use=nsterm+c, use=nsterm+mac, + +nsterm-s|AppKit Terminal.app v41+ w/MacRoman charset (color w/statusline), + use=nsterm+s, use=nsterm+c41, use=nsterm+mac, + +nsterm-c-s|AppKit Terminal.app v51+ w/MacRoman charset (full color w/statusline), + use=nsterm+s, use=nsterm+c, use=nsterm+mac, + +# xnuppc - Darwin PowerPC Console (a.k.a. "darwin") +# +# On PowerPC platforms, Apple's Darwin operating system uses a +# full-screen system console derived from a NetBSD framebuffer +# console. It is an ANSI-style terminal, and is not really VT-100 +# compatible. +# +# Under Mac OS X, this is the system console driver used while in +# single-user mode [reachable by holding down Command-S during the +# boot process] and when logged in using console mode [reachable by +# typing ">console" at the graphical login prompt.] +# +# If you're looking for a description of the Terminal.app terminal +# emulator which runs under the Mac OS X Quartz windowing system (and +# other AppKit-supported windowing systems,) see the "nsterm" +# entry instead. +# +# NOTE: Under Mac OS X version 10.1, the default login window does not +# prompt for user name, instead requiring an icon to be selected from +# a list of known users. Since the special ">console" login is not in +# this list, you must make one of two changes in the Login Window +# panel of the Login section of System Prefs to make the special +# ">console" login accessible. The first option is to enable 'Show +# "Other User" in list for network users', which will add a special +# "Other..." icon to the graphical login panel. Selecting "Other..." +# will present the regular graphical login prompt. The second option +# is to change the 'Display Login Window as:' setting to 'Name and +# password entry fields', which replaces the login panel with a +# graphical login prompt. +# +# There are no function keys, at least not in Darwin 1.3. +# +# It has no mouse support. +# +# It has full ANSI color support, and color combines correctly with +# all three supported attributes: bold, inverse-video and underline. +# However, bold colored text is almost unreadable (bolding is +# accomplished using shifting and or-ing, and looks smeared) so bold +# has been excluded from the list of color-compatible attributes +# [using (ncv)]. The monochrome entry (-m) is useful if you use a +# monochrome monitor. +# +# There is one serious bug with this terminal emulation's color +# support: repositioning the cursor onto a cell with non-matching +# colors obliterates that cell's contents, replacing it with a blank +# and displaying a colored cursor in the "current" colors. There is +# no complete workaround at present [other than using the monochrome +# (-m) entries,] but removing the (msgr) capability seemed to help. +# +# The "standout" chosen was simple reverse-video, although a colorful +# standout might be more aesthetically pleasing. Similarly, the bold +# chosen is the terminal's own smeared bold, although a simple +# color-change might be more readable. The color-bold (-b) entries +# uses magenta colored text for bolding instead. The fancy color (-f +# and -f2) entries use color for bold, standout and underlined text +# (underlined text is still underlined, though.) +# +# Apparently the terminal emulator does support a VT-100-style +# alternate character set, but all the alternate character set +# positions have been left blank in the font. For this reason, no +# alternate character set capabilities have been included in this +# description. The console driver appears to be ASCII-only, so (enacs) +# has been excluded [although the VT-100 sequence does work.] +# +# The default Mac OS X and Darwin installation reports "vt100" as the +# terminal type, and exports no helpful environment variables. To fix +# this, change the "console" entry in /etc/ttys from "vt100" to +# "xnuppc-WxH", where W and H are the character dimensions of your +# console (see below.) +# +# The font used by the terminal emulator is apparently one originally +# drawn by Ka-Ping Yee, and uses 8x16-pixel characters. This +# file includes descriptions for the following geometries: +# +# Pixels Characters Entry Name (append -m for monochrome) +# ------------------------------------------------------------------- +# 640x400 80x25 xnuppc-80x25 +# 640x480 80x30 xnuppc-80x30 +# 720x480 90x30 xnuppc-90x30 +# 800x600 100x37 xnuppc-100x37 +# 896x600 112x37 xnuppc-112x37 +# 1024x640 128x40 xnuppc-128x40 +# 1024x768 128x48 xnuppc-128x48 +# 1152x768 144x48 xnuppc-144x48 +# 1280x1024 160x64 xnuppc-160x64 +# 1600x1024 200x64 xnuppc-200x64 +# 1600x1200 200x75 xnuppc-200x75 +# 2048x1536 256x96 xnuppc-256x96 +# +# The basic "xnuppc" entry includes no size information, and the +# emulator includes no reporting capability, so you'll be at the mercy +# of the TTY device (which reports incorrectly on my hardware.) The +# color-bold entries do not include size information. + +# The '+' entries are building blocks +xnuppc+basic|Darwin PowerPC Console basic capabilities, + am, bce, mir, xenl, + it#8, + bold=\E[1m, clear=\E[H\E[J, 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, dsl=\E]2;\007, ed=\E[J, el=\E[K, + el1=\E[1K, home=\E[H, ht=^I, hts=\EH, ind=^J, ka1=\EOq, + ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcub1=\EOD, + kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, rc=\E8, rev=\E[7m, + ri=\EM, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, + rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m, + sgr0=\E[m\017, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m, + smul=\E[4m, tbc=\E[3g, + +xnuppc+c|Darwin PowerPC Console ANSI color support, + colors#8, ncv#32, pairs#64, op=\E[37;40m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, - use=Apple_Terminal-ascii-m, -Apple_Terminal-m|Apple MacOS X Terminal.app v41 w/MacRoman charset (monochrome), - acsc=0#`\327a*f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245+\335-\366\,\334.\377, - use=Apple_Terminal-ascii-m, +xnuppc+b|Darwin PowerPC Console color-bold support, + ncv#32, + bold=\E[35m, + sgr=\E[0%?%p6%t;35%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m, + use=xnuppc+basic, + +xnuppc+f|Darwin PowerPC Console fancy color support, + ncv#35, + sgr=\E[0%?%p6%t;35%;%?%p2%t;36;4%;%?%p1%t;33;44%;%p3%t;7%;m, + smso=\E[33;44m, smul=\E[36;4m, use=xnuppc+b, + +xnuppc+f2|Darwin PowerPC Console alternate fancy color support, + ncv#35, + bold=\E[33m, + sgr=\E[0%?%p6%t;33%;%?%p2%t;34%;%?%p1%t;31;47%;%p3%t;7%;m, + smso=\E[31;47m, smul=\E[34m, use=xnuppc+basic, + +# Building blocks for specific screen sizes +xnuppc+80x25|Darwin PowerPC Console 80x25 support (640x400 pixels), + cols#80, lines#25, + +xnuppc+80x30|Darwin PowerPC Console 80x30 support (640x480 pixels), + cols#80, lines#30, + +xnuppc+90x30|Darwin PowerPC Console 90x30 support (720x480 pixels), + cols#90, lines#30, + +xnuppc+100x37|Darwin PowerPC Console 100x37 support (800x600 pixels), + cols#100, lines#37, + +xnuppc+112x37|Darwin PowerPC Console 112x37 support (896x600 pixels), + cols#112, lines#37, + +xnuppc+128x40|Darwin PowerPC Console 128x40 support (1024x640 pixels), + cols#128, lines#40, + +xnuppc+128x48|Darwin PowerPC Console 128x48 support (1024x768 pixels), + cols#128, lines#48, + +xnuppc+144x48|Darwin PowerPC Console 144x48 support (1152x768 pixels), + cols#144, lines#48, -Apple_Terminal|Apple MacOS X Terminal.app v41 w/MacRoman charset (color), - acsc=0#`\327a*f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245+\335-\366\,\334.\377, - use=Apple_Terminal-ascii, +xnuppc+160x64|Darwin PowerPC Console 160x64 support (1280x1024 pixels), + cols#160, lines#64, + +xnuppc+200x64|Darwin PowerPC Console 200x64 support (1600x1024 pixels), + cols#200, lines#64, + +xnuppc+200x75|Darwin PowerPC Console 200x75 support (1600x1200 pixels), + cols#200, lines#75, + +xnuppc+256x96|Darwin PowerPC Console 256x96 support (2048x1536 pixels), + cols#256, lines#96, + +# These are different combinations of the building blocks + +xnuppc-m|darwin-m|Darwin PowerPC Console (monochrome), + use=xnuppc+basic, + +xnuppc|darwin|Darwin PowerPC Console (color), + use=xnuppc+c, use=xnuppc+basic, + +xnuppc-m-b|darwin-m-b|Darwin PowerPC Console (monochrome w/color-bold), + use=xnuppc+b, + +xnuppc-b|darwin-b|Darwin PowerPC Console (color w/color-bold), + use=xnuppc+b, use=xnuppc+c, + +xnuppc-m-f|darwin-m-f|Darwin PowerPC Console (fancy monochrome), + use=xnuppc+f, + +xnuppc-f|darwin-f|Darwin PowerPC Console (fancy color), + use=xnuppc+f, use=xnuppc+c, + +xnuppc-m-f2|darwin-m-f2|Darwin PowerPC Console (alternate fancy monochrome), + use=xnuppc+f2, + +xnuppc-f2|darwin-f2|Darwin PowerPC Console (alternate fancy color), + use=xnuppc+f2, use=xnuppc+c, + +# Combinations for specific screen sizes +xnuppc-80x25-m|darwin-80x25-m|Darwin PowerPC Console (monochrome) 80x25, + use=xnuppc+80x25, use=xnuppc+basic, + +xnuppc-80x25|darwin-80x25|Darwin PowerPC Console (color) 80x25, + use=xnuppc+c, use=xnuppc+80x25, use=xnuppc+basic, + +xnuppc-80x30-m|darwin-80x30-m|Darwin PowerPC Console (monochrome) 80x30, + use=xnuppc+80x30, use=xnuppc+basic, + +xnuppc-80x30|darwin-80x30|Darwin PowerPC Console (color) 80x30, + use=xnuppc+c, use=xnuppc+80x30, use=xnuppc+basic, + +xnuppc-90x30-m|darwin-90x30-m|Darwin PowerPC Console (monochrome) 90x30, + use=xnuppc+90x30, use=xnuppc+basic, + +xnuppc-90x30|darwin-90x30|Darwin PowerPC Console (color) 90x30, + use=xnuppc+c, use=xnuppc+90x30, use=xnuppc+basic, + +xnuppc-100x37-m|darwin-100x37-m|Darwin PowerPC Console (monochrome) 100x37, + use=xnuppc+100x37, use=xnuppc+basic, + +xnuppc-100x37|darwin-100x37|Darwin PowerPC Console (color) 100x37, + use=xnuppc+c, use=xnuppc+100x37, use=xnuppc+basic, + +xnuppc-112x37-m|darwin-112x37-m|Darwin PowerPC Console (monochrome) 112x37, + use=xnuppc+112x37, use=xnuppc+basic, + +xnuppc-112x37|darwin-112x37|Darwin PowerPC Console (color) 112x37, + use=xnuppc+c, use=xnuppc+112x37, use=xnuppc+basic, + +xnuppc-128x40-m|darwin-128x40-m|Darwin PowerPC Console (monochrome) 128x40, + use=xnuppc+128x40, use=xnuppc+basic, + +xnuppc-128x40|darwin-128x40|Darwin PowerPC Console (color) 128x40, + use=xnuppc+c, use=xnuppc+128x40, use=xnuppc+basic, + +xnuppc-128x48-m|darwin-128x48-m|Darwin PowerPC Console (monochrome) 128x48, + use=xnuppc+128x48, use=xnuppc+basic, + +xnuppc-128x48|darwin-128x48|Darwin PowerPC Console (color) 128x48, + use=xnuppc+c, use=xnuppc+128x48, use=xnuppc+basic, + +xnuppc-144x48-m|darwin-144x48-m|Darwin PowerPC Console (monochrome) 144x48, + use=xnuppc+144x48, use=xnuppc+basic, + +xnuppc-144x48|darwin-144x48|Darwin PowerPC Console (color) 144x48, + use=xnuppc+c, use=xnuppc+144x48, use=xnuppc+basic, + +xnuppc-160x64-m|darwin-160x64-m|Darwin PowerPC Console (monochrome) 160x64, + use=xnuppc+160x64, use=xnuppc+basic, + +xnuppc-160x64|darwin-160x64|Darwin PowerPC Console (color) 160x64, + use=xnuppc+c, use=xnuppc+160x64, use=xnuppc+basic, + +xnuppc-200x64-m|darwin-200x64-m|Darwin PowerPC Console (monochrome) 200x64, + use=xnuppc+200x64, use=xnuppc+basic, + +xnuppc-200x64|darwin-200x64|Darwin PowerPC Console (color) 200x64, + use=xnuppc+c, use=xnuppc+200x64, use=xnuppc+basic, + +xnuppc-200x75-m|darwin-200x75-m|Darwin PowerPC Console (monochrome) 200x75, + use=xnuppc+200x75, use=xnuppc+basic, + +xnuppc-200x75|darwin-200x75|Darwin PowerPC Console (color) 200x75, + use=xnuppc+c, use=xnuppc+200x75, use=xnuppc+basic, + +xnuppc-256x96-m|darwin-256x96-m|Darwin PowerPC Console (monochrome) 256x96, + use=xnuppc+256x96, use=xnuppc+basic, + +xnuppc-256x96|darwin-256x96|Darwin PowerPC Console (color) 256x96, + use=xnuppc+c, use=xnuppc+256x96, use=xnuppc+basic, #### Radio Shack/Tandy # @@ -18780,6 +19419,30 @@ v3220|LANPAR Vision II model 3220/3221/3222, # 2001-05-05 # * corrected/updated screen.xterm-xfree86 # +# 2001-05-19 +# * ELKS descriptions, from Federico Bianchi +# * add u6 (CSR) to Eterm (Michael Jennings). +# +# 2001-07-21 +# * renamed "Apple_Terminal" entries to "nsterm" to work with Solaris's +# tic which handles names no longer than 14 characters. Add +# corresponding descriptions for the Darwin PowerPC console named +# "xnuppc" -Benjamin Sittler +# +# 2001-09-01 +# * change kbs in mach entries to ^? (Marcus Brinkmann). +# +# 2001-11-17 +# * add "putty" entry -TD +# * updated "Apple_Terminal" entries -Benjamin Sittler +# +# 2001-11-24 +# * add ms-vt100-color entry -TD +# * add "konsole" entries -TD +# +# 2001-12-08 +# * update gnome entry to Redhat 7.2 -TD +# # The following sets edit modes for GNU EMACS. # Local Variables: # fill-prefix:"\t" diff --git a/contrib/ncurses/mk-0th.awk b/contrib/ncurses/mk-0th.awk index 61a636c..b71d66a 100644 --- a/contrib/ncurses/mk-0th.awk +++ b/contrib/ncurses/mk-0th.awk @@ -1,6 +1,6 @@ -# $Id: mk-0th.awk,v 1.9 2001/03/24 19:31:22 tom Exp $ +# $Id: mk-0th.awk,v 1.13 2002/02/23 20:38:11 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998-2001 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"), # @@ -32,7 +32,7 @@ # Generate list of sources for a library, together with lint/lintlib rules # # Variables: -# name (library name, e.g., "ncurses", "panel", "forms", "menus") +# libname (library name, e.g., "ncurses", "panel", "forms", "menus") # BEGIN { print "" @@ -53,13 +53,21 @@ BEGIN { { if ( found == 0 ) { + if ( subsets ~ /widechar/ ) + widechar = 1; + else + widechar = 0; printf "C_SRC =" if ( $2 == "lib" ) found = 1 else found = 2 } - printf " \\\n\t%s/%s.c", $3, $1 + if ( libname == "c++" || libname == "c++w" ) { + printf " \\\n\t%s/%s.cc", $3, $1 + } else if ( widechar == 1 || $3 != "$(wide)" ) { + printf " \\\n\t%s/%s.c", $3, $1 + } } } END { @@ -67,19 +75,19 @@ END { if ( found == 1 ) { print "" - printf "# Producing llib-l%s is time-consuming, so there's no direct-dependency for\n", name + printf "# Producing llib-l%s is time-consuming, so there's no direct-dependency for\n", libname print "# it in the lintlib rule. We'll only remove in the cleanest setup." print "clean ::" - printf "\trm -f llib-l%s.*\n", name + printf "\trm -f llib-l%s.*\n", libname print "" print "realclean ::" - printf "\trm -f llib-l%s\n", name + printf "\trm -f llib-l%s\n", libname print "" - printf "llib-l%s : $(C_SRC)\n", name + printf "llib-l%s : $(C_SRC)\n", libname printf "\tcproto -a -l -DLINT $(CPPFLAGS) $(C_SRC) >$@\n" print "" print "lintlib :" - printf "\t$(srcdir)/../misc/makellib %s $(CPPFLAGS)", name + printf "\tsh $(srcdir)/../misc/makellib %s $(CPPFLAGS)", libname print "" print "lint :" print "\t$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(C_SRC) $(LINT_LIBS)" diff --git a/contrib/ncurses/mk-1st.awk b/contrib/ncurses/mk-1st.awk index c14219c..bbd7c40 100644 --- a/contrib/ncurses/mk-1st.awk +++ b/contrib/ncurses/mk-1st.awk @@ -1,6 +1,6 @@ -# $Id: mk-1st.awk,v 1.46 2000/10/14 17:57:02 Johnny.C.Lam Exp $ +# $Id: mk-1st.awk,v 1.55 2002/04/20 17:32:47 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2002 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"), # @@ -40,6 +40,7 @@ # subset ("none", "base", "base+ext_funcs" or "termlib") # target (cross-compile target, if any) # ShlibVer ("rel", "abi" or "auto", to augment DoLinks variable) +# ShlibVerInfix ("yes" or "no", determines location of version #) # DoLinks ("yes", "reverse" or "no", flag to add symbolic links) # rmSoLocs ("yes" or "no", flag to add extra clean target) # overwrite ("yes" or "no", flag to add link to libcurses.a @@ -77,7 +78,7 @@ function removelinks(directory) { } } function sharedlinks(directory) { - if ( ShlibVer != "auto" ) { + if ( ShlibVer != "auto" && ShlibVer != "cygdll" ) { printf "\tcd %s && (", directory if ( DoLinks == "reverse" ) { if ( ShlibVer == "rel" ) { @@ -131,6 +132,7 @@ BEGIN { } { if (using \ + && ( $1 != "link_test" ) \ && ( $2 == "lib" \ || $2 == "progs" \ || $2 == "c++" \ @@ -159,35 +161,76 @@ END { lib_name = sprintf("%s%s%s", prefix, name, suffix) if ( MODEL == "SHARED" ) { - abi_name = sprintf("%s.$(ABI_VERSION)", lib_name); - rel_name = sprintf("%s.$(REL_VERSION)", lib_name); + if (ShlibVerInfix == "cygdll") { + abi_name = sprintf("%s%s$(ABI_VERSION)%s", prefix, name, suffix); + rel_name = sprintf("%s%s$(REL_VERSION)%s", prefix, name, suffix); + imp_name = sprintf("%s%s%s.a", prefix, name, suffix); + } else if (ShlibVerInfix == "yes") { + abi_name = sprintf("%s%s.$(ABI_VERSION)%s", prefix, name, suffix); + rel_name = sprintf("%s%s.$(REL_VERSION)%s", prefix, name, suffix); + } else { + abi_name = sprintf("%s.$(ABI_VERSION)", lib_name); + rel_name = sprintf("%s.$(REL_VERSION)", lib_name); + } if ( DoLinks == "reverse") { end_name = lib_name; } else { if ( ShlibVer == "rel" ) { end_name = rel_name; - } else if ( ShlibVer == "abi" ) { + } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" ) { end_name = abi_name; } else { end_name = lib_name; } } - printf "../lib/%s : $(%s_OBJS)\n", end_name, OBJS - print "\t-@rm -f $@" + + if ( ShlibVer == "cygdll" ) { + dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)"; + printf "$(SHARED_LIB) $(IMPORT_LIB) : $(%s_OBJS)\n", OBJS; + print "\t-@rm -f $(SHARED_LIB) $(IMPORT_LIB)"; + } else { + dst_dirs = "$(DESTDIR)$(libdir)"; + printf "../lib/%s : $(%s_OBJS)\n", end_name, OBJS + print "\t-@rm -f $@"; + } if ( subset == "termlib") { printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(TINFO_LIST)\n", OBJS } else { - printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(SHLIB_LIST)\n", OBJS + printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(SHLIB_LIST) $(LDFLAGS)\n", OBJS } sharedlinks("../lib") + print "" print "install \\" print "install.libs \\" - 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)") + printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs + + if ( ShlibVer == "cygdll" ) { + + src_name = sprintf("../lib/%s", end_name); + dst_name = sprintf("$(DESTDIR)$(bindir)/%s", end_name); + printf "\t@echo installing %s as %s\n", src_name, dst_name + printf "\t-@rm -f %s\n", dst_name + printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name + + src_name = sprintf("../lib/%s", imp_name); + dst_name = sprintf("$(DESTDIR)$(libdir)/%s", imp_name); + printf "\t@echo installing %s as %s\n", src_name, dst_name + printf "\t-@rm -f %s\n", dst_name + printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name + + } else { + + src_name = sprintf("../lib/%s", end_name); + dst_name = sprintf("$(DESTDIR)$(libdir)/%s", end_name); + printf "\t@echo installing %s as %s\n", src_name, dst_name + printf "\t-@rm -f %s\n", dst_name + printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name + + sharedlinks("$(DESTDIR)$(libdir)") + + } + if ( overwrite == "yes" && name == "ncurses" ) { ovr_name = sprintf("libcurses%s", suffix) @@ -201,12 +244,22 @@ END { print "uninstall \\" print "uninstall.libs \\" printf "uninstall.%s ::\n", name - 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 $(DESTDIR)$(libdir)/%s\n", ovr_name + if ( ShlibVer == "cygdll" ) { + + printf "\t@echo uninstalling $(DESTDIR)$(bindir)/%s\n", end_name + printf "\t-@rm -f $(DESTDIR)$(bindir)/%s\n", end_name + + printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", imp_name + printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", imp_name + + } else { + 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 $(DESTDIR)$(libdir)/%s\n", ovr_name + } } if ( rmSoLocs == "yes" ) { print "" diff --git a/contrib/ncurses/ncurses/Makefile.in b/contrib/ncurses/ncurses/Makefile.in index 0061f82..9b9a39e 100644 --- a/contrib/ncurses/ncurses/Makefile.in +++ b/contrib/ncurses/ncurses/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.72 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.83 2002/04/20 22:02:39 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 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"), # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 +# Author: Thomas E. Dickey 1996-2001 # # Makefile for ncurses source code. # @@ -55,9 +55,11 @@ CF_MFLAGS = @cf_cv_makeflags@ MODEL = @DFT_LWR_MODEL@ DESTDIR = @DESTDIR@ +top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ @@ -66,6 +68,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -85,8 +88,9 @@ CPPFLAGS = -I../ncurses -I$(srcdir) @CPPFLAGS@ \ CCFLAGS = $(CPPFLAGS) $(CFLAGS) HOSTCC = @BUILD_CC@ -HOSTCCFLAGS = @CFLAGS@ $(CPPFLAGS) -HOSTLDFLAGS = @LDFLAGS@ @LIBS@ +HOSTCCFLAGS = @BUILD_CFLAGS@ $(CPPFLAGS) +HOSTLDFLAGS = @BUILD_LDFLAGS@ +HOSTLIBS = @BUILD_LIBS@ CFLAGS_LIBTOOL = $(CCFLAGS) CFLAGS_NORMAL = $(CCFLAGS) @@ -99,7 +103,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) @SHLIB_LIST@ TINFO_LIST = $(SHLIB_DIRS) @TINFO_LIST@ @@ -112,6 +116,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -120,17 +126,21 @@ LINT_LIBS = -lncurses @LIBS@ FALLBACK_LIST = @FALLBACK_LIST@ +TERMINFO_CAPS = $(top_srcdir)/include/@TERMINFO_CAPS@ + AUTO_SRC = \ ../include/nomacros.h \ - ./comp_captab.c \ - ./expanded.c \ - ./fallback.c \ + codes.c \ + comp_captab.c \ + expanded.c \ + fallback.c \ init_keytry.h \ - ./lib_keyname.c \ - ./lib_gen.c \ - ./codes.c \ - ./names.c \ - ./unctrl.c + keys.list \ + lib_gen.c \ + lib_keyname.c \ + link_test.c \ + names.c \ + unctrl.c TEST_DEPS = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@ TEST_ARGS = -L../lib -lncurses@DFT_ARG_SUFFIX@ @@ -139,6 +149,7 @@ TEST_LDFLAGS = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFL TEST_PROGS = \ captoinfo$x \ hardscroll$x \ + link_test$x \ hashmap$x \ lib_mvcur$x @@ -146,6 +157,7 @@ base = $(srcdir)/base serial = $(srcdir)/tty tinfo = $(srcdir)/tinfo trace = $(srcdir)/trace +wide = $(srcdir)/widechar ################################################################################ all \ @@ -153,53 +165,57 @@ libs :: $(AUTO_SRC) ../lib $(LIBRARIES) sources: $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ ../lib : ; mkdir $@ -./fallback.c : $(tinfo)/MKfallback.sh - sh $(tinfo)/MKfallback.sh $(FALLBACK_LIST) >$@ +fallback.c : $(tinfo)/MKfallback.sh + sh $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@ -./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h - sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h >$@ +lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h + sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@ ../include/nomacros.h : $(base)/MKlib_gen.sh ../include/curses.h - sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h | \ + sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h | \ fgrep undef >$@ -init_keytry.h: make_keys$x $(tinfo)/keys.list - ./make_keys $(tinfo)/keys.list > $@ +init_keytry.h: make_keys$x keys.list + ./make_keys keys.list > $@ + +keys.list : $(tinfo)/MKkeys_list.sh + AWK=$(AWK) sh $(tinfo)/MKkeys_list.sh $(TERMINFO_CAPS) | sort >$@ make_keys$x : \ $(tinfo)/make_keys.c \ - ./names.c - $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS) + names.c + $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS) $(HOSTLIBS) make_hash$x : \ $(tinfo)/comp_hash.c \ ../include/hashsize.h - $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS) + $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS) $(HOSTLIBS) -./expanded.c : $(serial)/MKexpanded.sh +expanded.c : $(serial)/MKexpanded.sh sh $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@ -./comp_captab.c: \ +comp_captab.c: \ make_hash$x \ ../include/hashsize.h \ $(tinfo)/MKcaptab.awk - sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/Caps > $@ + sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ > $@ -./lib_keyname.c: $(tinfo)/keys.list $(base)/MKkeyname.awk - $(AWK) -f $(base)/MKkeyname.awk $(tinfo)/keys.list > $@ +lib_keyname.c: keys.list $(base)/MKkeyname.awk + $(AWK) -f $(base)/MKkeyname.awk keys.list > $@ -./names.c ./codes.c: $(tinfo)/MKnames.awk - $(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/Caps - cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >./names.c - cat namehdr boolcodes numcodes strcodes codeftr >./codes.c +names.c codes.c: $(tinfo)/MKnames.awk + $(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/@TERMINFO_CAPS@ + cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >names.c + cat namehdr boolcodes numcodes strcodes codeftr >codes.c -rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes -./unctrl.c: $(base)/MKunctrl.awk +unctrl.c: $(base)/MKunctrl.awk echo | $(AWK) -f $(base)/MKunctrl.awk >$@ tags: @@ -209,7 +225,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace -rm -f $(TEST_PROGS) clean :: mostlyclean @@ -232,6 +248,9 @@ realclean :: distclean # These rules build test-programs for the modules that have test-drivers test_progs : $(TEST_PROGS) +link_test.c : $(base)/MKlib_gen.sh ../include/curses.h + sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@ + captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS) @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS) @@ -245,6 +264,10 @@ lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \ ../@DFT_OBJ_SUBDIR@/dump_entry.o @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry.o $(TEST_LDFLAGS) +link_test$x : link_test.c $(TEST_DEPS) \ + ../@DFT_OBJ_SUBDIR@/link_test.o + @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test.o $(TEST_LDFLAGS) + ../@DFT_OBJ_SUBDIR@/dump_entry.o: cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry.o diff --git a/contrib/ncurses/ncurses/base/MKkeyname.awk b/contrib/ncurses/ncurses/base/MKkeyname.awk index c067733..5aab936 100644 --- a/contrib/ncurses/ncurses/base/MKkeyname.awk +++ b/contrib/ncurses/ncurses/base/MKkeyname.awk @@ -1,6 +1,6 @@ -# $Id: MKkeyname.awk,v 1.18 2000/12/10 02:25:23 tom Exp $ +# $Id: MKkeyname.awk,v 1.21 2002/02/23 22:36:33 tom Exp $ ############################################################################## -# Copyright (c) 1999,2000 Free Software Foundation, Inc. # +# Copyright (c) 1999-2001,2002 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,10 +29,7 @@ BEGIN { print "/* generated by MKkeyname.awk */" print "" - print "#include <ncurses_cfg.h>" - print "#include <stdlib.h>" - print "#include <string.h>" - print "#include <curses.h>" + print "#include <curses.priv.h>" print "#include <tic.h>" print "" print "const struct kn _nc_key_names[] = {" @@ -47,28 +44,47 @@ END { print "" print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)" print "{" + print "static char **table;" print "int i;" - print "static char name[20];" + print "char name[20];" print "char *p;" print "" print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)" print "\t\tif (_nc_key_names[i].code == c)" print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;" print "\tif (c >= 256) return \"UNKNOWN KEY\";" - print "\tp = name;" - print "\tif (c >= 128) {" - print "\t\tstrcpy(p, \"M-\");" - print "\t\tp += 2;" - print "\t\tc -= 128;" + print "" + print "\tif (table == 0)" + print "\t\ttable = typeCalloc(char *, 256);" + print "\tif (table == 0)" + print "\t\treturn keyname(256);" + print "" + print "\tif (table[c] == 0) {" + print "\t\tp = name;" + print "\t\tif (c >= 128) {" + print "\t\t\tstrcpy(p, \"M-\");" + print "\t\t\tp += 2;" + print "\t\t\tc -= 128;" + print "\t\t}" + print "\t\tif (c < 0)" + print "\t\t\tsprintf(p, \"%d\", c);" + print "\t\telse if (c < 32)" + print "\t\t\tsprintf(p, \"^%c\", c + '@');" + print "\t\telse if (c == 127)" + print "\t\t\tstrcpy(p, \"^?\");" + print "\t\telse" + print "\t\t\tsprintf(p, \"%c\", c);" + print "\t\ttable[c] = strdup(name);" print "\t}" - print "\tif (c < 0)" - print "\t\tsprintf(p, \"%d\", c);" - print "\telse if (c < 32)" - print "\t\tsprintf(p, \"^%c\", c + '@');" - print "\telse if (c == 127)" - print "\t\tstrcpy(p, \"^?\");" - print "\telse" - print "\t\tsprintf(p, \"%c\", c);" - print "\treturn (NCURSES_CONST char *)name;" + print "\treturn (NCURSES_CONST char *)table[c];" + print "}" + print "" + print "#if USE_WIDEC_SUPPORT" + print "NCURSES_EXPORT(NCURSES_CONST char *) key_name (wchar_t c)" + print "{" + print "\tchar *result = keyname((int)c);" + print "\tif (!strncmp(result, \"M-\", 2)) result = \"UNKNOWN KEY\";" + print "\treturn result;" print "}" + print "#endif" } diff --git a/contrib/ncurses/ncurses/base/MKlib_gen.sh b/contrib/ncurses/ncurses/base/MKlib_gen.sh index 4de2a5a..e172feb 100755 --- a/contrib/ncurses/ncurses/base/MKlib_gen.sh +++ b/contrib/ncurses/ncurses/base/MKlib_gen.sh @@ -2,7 +2,35 @@ # # MKlib_gen.sh -- generate sources from curses.h macro definitions # -# ($Id: MKlib_gen.sh,v 1.13 2000/12/10 00:30:25 tom Exp $) +# ($Id: MKlib_gen.sh,v 1.18 2002/04/30 00:37:55 tom Exp $) +# +############################################################################## +# Copyright (c) 1998-2001,2002 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. # +############################################################################## # # The XSI Curses standard requires all curses entry points to exist as # functions, even though many definitions would normally be shadowed @@ -28,21 +56,30 @@ preprocessor="$1 -I../include" AWK="$2" -ED1=sed1$$.sed -ED2=sed2$$.sed -ED3=sed3$$.sed -AW1=awk1$$.awk -TMP=gen$$.c -trap "rm -f $ED1 $ED2 $ED3 $AW1 $TMP" 0 1 2 5 15 - -(cat <<EOF -#include <ncurses_cfg.h> -#include <curses.h> +USE="$3" -DECLARATIONS +PID=$$ +ED1=sed1_${PID}.sed +ED2=sed2_${PID}.sed +ED3=sed3_${PID}.sed +ED4=sed4_${PID}.sed +AW1=awk1_${PID}.awk +AW2=awk2_${PID}.awk +TMP=gen__${PID}.c +trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 5 15 -EOF -cat >$ED1 <<EOF1 +ALL=$USE +if test "$USE" = implemented ; then + CALL="call_" + cat >$ED1 <<EOF1 +/^extern.*implemented/{ + h + s/^.*implemented:\([^ *]*\).*/P_#if_USE_\1_SUPPORT/p + g + s/^extern \([^;]*\);.*/\1/p + g + s/^.*implemented:\([^ *]*\).*/P_#endif/p +} /^extern.*generated/{ h s/^.*generated:\([^ *]*\).*/P_#if_USE_\1_SUPPORT/p @@ -52,6 +89,19 @@ cat >$ED1 <<EOF1 s/^.*generated:\([^ *]*\).*/P_#endif/p } EOF1 +else + CALL="" + cat >$ED1 <<EOF1 +/^extern.*${ALL}/{ + h + s/^.*${ALL}:\([^ *]*\).*/P_#if_USE_\1_SUPPORT/p + g + s/^extern \([^;]*\);.*/\1/p + g + s/^.*${ALL}:\([^ *]*\).*/P_#endif/p +} +EOF1 +fi cat >$ED2 <<EOF2 /^P_/b nc @@ -74,6 +124,7 @@ cat >$ED2 <<EOF2 s/*/ * /g s/%/ , /g s/)/ z)/ + s/\.\.\. z)/...)/ :nc /(/s// ( / s/)/ )/ @@ -88,6 +139,7 @@ cat >$ED3 <<EOF3 s/ */ /g s/ */ /g s/ ,/,/g + s/( /(/g s/ )/)/g s/ gen_/ / s/^M_/#undef / @@ -95,34 +147,74 @@ cat >$ED3 <<EOF3 :done EOF3 +if test "$USE" = generated ; then +cat >$ED4 <<EOF + s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) \2 (\3)/ +EOF +else +cat >$ED4 <<EOF +/^\(.*\) \(.*\) (\(.*\))\$/ { + h + s/^\(.*\) \(.*\) (\(.*\))\$/extern \1 call_\2 (\3);/ + p + g + s/^\(.*\) \(.*\) (\(.*\))\$/\1 call_\2 (\3)/ + } +EOF +fi + cat >$AW1 <<\EOF1 BEGIN { skip=0; } - /^P_#if/ { +/^P_#if/ { print "\n" print $0 skip=0; - } - /^P_#endif/ { +} +/^P_#endif/ { print $0 skip=1; - } - $0 !~ /^P_/ { +} +$0 !~ /^P_/ { if (skip) print "\n" skip=1; - if ( $1 == "chtype" ) { + first=$1 + for (i = 1; i <= NF; i++) { + if ( $i != "NCURSES_CONST" ) { + first = i; + break; + } + } + second = first + 1; + if ( $first == "chtype" ) { returnType = "Char"; + } else if ( $first == "SCREEN" ) { + returnType = "SP"; + } else if ( $first == "WINDOW" ) { + returnType = "Win"; + } else if ( $second == "*" ) { + returnType = "Ptr"; } else { returnType = "Code"; } - print "M_" $2 + myfunc = second; + for (i = second; i <= NF; i++) { + if ($i != "*") { + myfunc = i; + break; + } + } + if (using == "generated") { + print "M_" $myfunc + } print $0; print "{"; argcount = 1; - if (NF == 5 && $4 == "void") + check = NF - 1; + if ($check == "void") argcount = 0; if (argcount != 0) { for (i = 1; i <= NF; i++) @@ -133,8 +225,19 @@ BEGIN { # suppress trace-code for functions that we cannot do properly here, # since they return data. dotrace = 1; - if ($2 == "innstr") + if ($myfunc ~ /innstr/) + dotrace = 0; + if ($myfunc ~ /innwstr/) + dotrace = 0; + + # workaround functions that we do not parse properly + if ($myfunc ~ /ripoffline/) { dotrace = 0; + argcount = 2; + } + if ($myfunc ~ /wunctrl/) { + dotrace = 0; + } call = "%%T((T_CALLED(\"" args = "" @@ -142,7 +245,7 @@ BEGIN { num = 0; pointer = 0; argtype = "" - for (i = 1; i <= NF; i++) { + for (i = myfunc; i <= NF; i++) { ch = $i; if ( ch == "*" ) pointer = 1; @@ -181,7 +284,7 @@ BEGIN { } if (ch == ",") args = args comma "a" ++num; - else if (argcount != 0) + else if ( argcount != 0 && $check != "..." ) args = args comma "z" call = call ch if (pointer == 0 && argcount != 0 && argtype != "" ) @@ -209,11 +312,17 @@ BEGIN { else call = "%%return "; - call = call $2 "("; - for (i = 1; i < argcount; i++) - call = call "a" i ", "; - if (argcount != 0) + call = call $myfunc "("; + for (i = 1; i < argcount; i++) { + if (i != 1) + call = call ", "; + call = call "a" i; + } + if ( argcount != 0 && $check != "..." ) { + if (argcount != 1) + call = call ", "; call = call "z"; + } if (!match($0, "^void")) call = call ") "; if (dotrace) @@ -226,38 +335,54 @@ BEGIN { } EOF1 -sed -n -f $ED1 \ -| sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \ -| sed -f $ED2 \ -| $AWK -f $AW1 ) \ -| sed \ - -e '/^\([a-z_][a-z_]*\) /s//\1 gen_/' >$TMP - $preprocessor $TMP 2>/dev/null \ -| $AWK ' +cat >$AW2 <<EOF1 BEGIN { - print "/*" - print " * DO NOT EDIT THIS FILE BY HAND!" - print " * It is generated by MKlib_gen.sh." - print " *" - print " * This is a file of trivial functions generated from macro" - print " * definitions in curses.h to satisfy the XSI Curses requirement" - print " * that every macro also exist as a callable function." - print " *" - print " * It will never be linked unless you call one of the entry" - print " * points with its normal macro definition disabled. In that" - print " * case, if you have no shared libraries, it will indirectly" - print " * pull most of the rest of the library into your link image." - print " */" - print "#include <curses.priv.h>" - print "" + print "/*" + print " * DO NOT EDIT THIS FILE BY HAND!" + printf " * It is generated by $0 %s.\n", "$USE" + if ( "$USE" == "generated" ) { + print " *" + print " * This is a file of trivial functions generated from macro" + print " * definitions in curses.h to satisfy the XSI Curses requirement" + print " * that every macro also exist as a callable function." + print " *" + print " * It will never be linked unless you call one of the entry" + print " * points with its normal macro definition disabled. In that" + print " * case, if you have no shared libraries, it will indirectly" + print " * pull most of the rest of the library into your link image." + } + print " */" + print "#include <curses.priv.h>" + print "" } /^DECLARATIONS/ {start = 1; next;} - {if (start) print $0;} -' \ + {if (start) print \$0;} +END { + if ( "$USE" != "generated" ) { + print "int main(void) { return 0; }" + } + } +EOF1 + +cat >$TMP <<EOF +#include <ncurses_cfg.h> +#include <curses.h> + +DECLARATIONS + +EOF + +sed -n -f $ED1 \ +| sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \ +| sed -f $ED2 \ +| $AWK -f $AW1 using=$USE \ +| sed -e 's/^\([a-z_][a-z_]*[ *]*\)/\1 gen_/' -e 's/ / /g' >>$TMP + +$preprocessor $TMP 2>/dev/null \ +| sed -e 's/ / /g' -e 's/^ //' \ +| $AWK -f $AW2 \ | sed -f $ED3 \ | sed \ -e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \ -e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' \ -| sed \ - -e 's/^\(.*\) \(.*\) (\(.*\))$/NCURSES_EXPORT(\1) \2 (\3)/' - +| sed -f $ED4 diff --git a/contrib/ncurses/ncurses/base/MKunctrl.awk b/contrib/ncurses/ncurses/base/MKunctrl.awk index d9d5da5..d8a6587 100644 --- a/contrib/ncurses/ncurses/base/MKunctrl.awk +++ b/contrib/ncurses/ncurses/base/MKunctrl.awk @@ -1,6 +1,6 @@ -# $Id: MKunctrl.awk,v 1.8 2000/12/10 02:25:37 tom Exp $ +# $Id: MKunctrl.awk,v 1.9 2001/06/02 23:59:20 skimo Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 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"), # @@ -64,6 +64,6 @@ END { } print "};" print "" - print "\treturn (NCURSES_CONST char *)table[TextOf(ch)];" + print "\treturn (NCURSES_CONST char *)table[ChCharOf(ch)];" print "}" } diff --git a/contrib/ncurses/ncurses/base/lib_addch.c b/contrib/ncurses/ncurses/base/lib_addch.c index 799fbf6..423a45e 100644 --- a/contrib/ncurses/ncurses/base/lib_addch.c +++ b/contrib/ncurses/ncurses/base/lib_addch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,11 +26,6 @@ * authorization. * ****************************************************************************/ -/**************************************************************************** - * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * - * and: Eric S. Raymond <esr@snark.thyrsus.com> * - ****************************************************************************/ - /* ** lib_addch.c ** @@ -41,7 +36,7 @@ #include <curses.priv.h> #include <ctype.h> -MODULE_ID("$Id: lib_addch.c,v 1.47 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.64 2002/05/11 18:16:43 tom Exp $") /* * Ugly microtweaking alert. Everything from here to end of module is @@ -54,41 +49,35 @@ MODULE_ID("$Id: lib_addch.c,v 1.47 2000/12/10 02:43:26 tom Exp $") */ /* Return bit mask for clearing color pair number if given ch has color */ -#define COLOR_MASK(ch) (~(chtype)((ch)&A_COLOR?A_COLOR:0)) +#define COLOR_MASK(ch) (~(attr_t)((ch)&A_COLOR?A_COLOR:0)) -static inline chtype -render_char(WINDOW *win, chtype ch) +static inline NCURSES_CH_T +render_char(WINDOW *win, NCURSES_CH_T ch) /* compute a rendition of the given char correct for the current context */ { - chtype a = win->_attrs; + attr_t a = win->_attrs; - if (ch == ' ') { - /* color in attrs has precedence over bkgd */ - ch = a | (win->_bkgd & COLOR_MASK(a)); + if (ISBLANK(ch) && AttrOf(ch) == A_NORMAL) { + /* color in attrs has precedence over bkgrnd */ + ch = win->_nc_bkgd; + SetAttr(ch, a | (AttrOf(win->_nc_bkgd) & COLOR_MASK(a))); } else { - /* color in attrs has precedence over bkgd */ - a |= (win->_bkgd & A_ATTRIBUTES) & COLOR_MASK(a); + /* color in attrs has precedence over bkgrnd */ + a |= (AttrOf(win->_nc_bkgd) & A_ATTRIBUTES) & COLOR_MASK(a); /* color in ch has precedence */ - ch |= (a & COLOR_MASK(ch)); + AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); } - TR(TRACE_VIRTPUT, ("bkg = %lx, attrs = %lx -> ch = %lx", win->_bkgd, - win->_attrs, ch)); + TR(TRACE_VIRTPUT, ("bkg = %s, attrs = %s -> ch = %s", + _tracech_t2(1, CHREF(win->_nc_bkgd)), + _traceattr(win->_attrs), + _tracech_t2(3, CHREF(ch)))); return (ch); } -NCURSES_EXPORT(chtype) -_nc_background -(WINDOW *win) -/* make render_char() visible while still allowing us to inline it below */ -{ - return (win->_bkgd); -} - -NCURSES_EXPORT(chtype) -_nc_render -(WINDOW *win, chtype ch) +NCURSES_EXPORT(NCURSES_CH_T) +_nc_render(WINDOW *win, NCURSES_CH_T ch) /* make render_char() visible while still allowing us to inline it below */ { return render_char(win, ch); @@ -111,7 +100,7 @@ _nc_render #endif static inline int -waddch_literal(WINDOW *win, chtype ch) +waddch_literal(WINDOW *win, NCURSES_CH_T ch) { int x; struct ldat *line; @@ -140,8 +129,12 @@ waddch_literal(WINDOW *win, chtype ch) CHANGED_CELL(line, x); line->text[x++] = ch; + if_WIDEC({ + if (wcwidth(CharOf(ch)) > 1) + AddAttr(line->text[x++], WA_NAC); + }); - TR(TRACE_VIRTPUT, ("(%d, %d) = %s", win->_cury, x, _tracechtype(ch))); + TR(TRACE_VIRTPUT, ("(%d, %d) = %s", win->_cury, x, _tracech_t(CHREF(ch)))); if (x > win->_maxx) { /* * The _WRAPPED flag is useful only for telling an application that @@ -169,15 +162,15 @@ waddch_literal(WINDOW *win, chtype ch) } static inline int -waddch_nosync(WINDOW *win, const chtype ch) +waddch_nosync(WINDOW *win, const NCURSES_CH_T ch) /* the workhorse function -- add a character to the given window */ { int x, y; chtype t = 0; const char *s = 0; - if ((ch & A_ALTCHARSET) - || ((t = TextOf(ch)) > 127) + if ((AttrOf(ch) & A_ALTCHARSET) + || ((t = CharOf(ch)) > 127) || ((s = unctrl(t))[1] == 0)) return waddch_literal(win, ch); @@ -194,7 +187,8 @@ waddch_nosync(WINDOW *win, const chtype ch) */ if ((!win->_scroll && (y == win->_regbottom)) || (x <= win->_maxx)) { - chtype blank = (' ' | AttrOf(ch)); + NCURSES_CH_T blank = NewChar2(BLANK_TEXT, BLANK_ATTR); + AddAttr(blank, AttrOf(ch)); while (win->_curx < x) { if (waddch_literal(win, blank) == ERR) return (ERR); @@ -236,9 +230,12 @@ waddch_nosync(WINDOW *win, const chtype ch) win->_flags &= ~_WRAPPED; break; default: - while (*s) - if (waddch_literal(win, (*s++) | AttrOf(ch)) == ERR) + while (*s) { + NCURSES_CH_T sch; + SetChar(sch, *s++, AttrOf(ch)); + if (waddch_literal(win, sch) == ERR) return ERR; + } return (OK); } @@ -249,8 +246,7 @@ waddch_nosync(WINDOW *win, const chtype ch) } NCURSES_EXPORT(int) -_nc_waddch_nosync -(WINDOW *win, const chtype c) +_nc_waddch_nosync(WINDOW *win, const NCURSES_CH_T c) /* export copy of waddch_nosync() so the string-put functions can use it */ { return (waddch_nosync(win, c)); @@ -265,15 +261,16 @@ _nc_waddch_nosync /* These are actual entry points */ NCURSES_EXPORT(int) -waddch -(WINDOW *win, const chtype ch) +waddch(WINDOW *win, const chtype ch) { int code = ERR; + NCURSES_CH_T wch; + SetChar2(wch, ch); TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win, _tracechtype(ch))); - if (win && (waddch_nosync(win, ch) != ERR)) { + if (win && (waddch_nosync(win, wch) != ERR)) { _nc_synchook(win); code = OK; } @@ -283,15 +280,53 @@ waddch } NCURSES_EXPORT(int) -wechochar -(WINDOW *win, const chtype ch) +wechochar(WINDOW *win, const chtype ch) { int code = ERR; + NCURSES_CH_T wch; + SetChar2(wch, ch); TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win, _tracechtype(ch))); - if (win && (waddch_nosync(win, ch) != ERR)) { + if (win && (waddch_nosync(win, wch) != ERR)) { + bool save_immed = win->_immed; + win->_immed = TRUE; + _nc_synchook(win); + win->_immed = save_immed; + code = OK; + } + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} + +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(int) +wadd_wch(WINDOW *win, const cchar_t * wch) +{ + int code = ERR; + + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, + _tracech_t(wch))); + + if (win && (waddch_nosync(win, *wch) != ERR)) { + _nc_synchook(win); + code = OK; + } + + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} + +NCURSES_EXPORT(int) +wecho_wchar(WINDOW *win, const cchar_t * wch) +{ + int code = ERR; + + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win, + _tracech_t(wch))); + + if (win && (waddch_nosync(win, *wch) != ERR)) { bool save_immed = win->_immed; win->_immed = TRUE; _nc_synchook(win); @@ -301,3 +336,4 @@ wechochar TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); return (code); } +#endif /* USE_WIDEC_SUPPORT */ diff --git a/contrib/ncurses/ncurses/base/lib_addstr.c b/contrib/ncurses/ncurses/base/lib_addstr.c index 60bf944..343555a3 100644 --- a/contrib/ncurses/ncurses/base/lib_addstr.c +++ b/contrib/ncurses/ncurses/base/lib_addstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,27 +40,69 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_addstr.c,v 1.19 2000/12/10 01:24:50 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.31 2001/12/19 01:05:52 tom Exp $") + +#if USE_WIDEC_SUPPORT +#define CONV_DATA mbstate_t state; wchar_t cached; int clen = 0 +#define CONV_INIT memset (&state, '\0', sizeof (state)); cached = (wchar_t)WEOF +#define NEXT_CHAR(s,ch, n) \ + { \ + int len, i = 0; \ + memset(&ch, 0, sizeof(cchar_t)); \ + if (cached != (wchar_t) WEOF) { \ + ch.chars[i++] = cached; \ + cached = (wchar_t) WEOF; \ + n -= clen; \ + s += clen; \ + } \ + for (; i < CCHARW_MAX && n > 0; ++i) { \ + if ((len = mbrtowc(&ch.chars[i], s, n, &state)) < 0) { \ + code = ERR; \ + break; \ + } \ + if (i == 0 || wcwidth(ch.chars[i]) == 0) { \ + n -= len; \ + s += len; \ + } else { \ + cached = ch.chars[i]; \ + clen = len; \ + ch.chars[i] = L'\0'; \ + break; \ + } \ + } \ + if (code == ERR) \ + break; \ + } +#else +#define CONV_DATA +#define CONV_INIT +#define NEXT_CHAR(s,ch, n) \ + ch = *s++; \ + --n +#endif NCURSES_EXPORT(int) -waddnstr -(WINDOW *win, const char *const astr, int n) +waddnstr(WINDOW *win, const char *const astr, int n) { unsigned const char *str = (unsigned const char *) astr; int code = ERR; + CONV_DATA; T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbuf(astr), n)); if (win && (str != 0)) { TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs))); - TR(TRACE_VIRTPUT, ("str is not null")); code = OK; if (n < 0) n = (int) strlen(astr); - while ((n-- > 0) && (*str != '\0')) { + TR(TRACE_VIRTPUT, ("str is not null, length = %d", n)); + CONV_INIT; + while ((n > 0) && (*str != '\0')) { + NCURSES_CH_T ch; TR(TRACE_VIRTPUT, ("*str = %#x", *str)); - if (_nc_waddch_nosync(win, (chtype) * str++) == ERR) { + NEXT_CHAR(str, ch, n); + if (_nc_waddch_nosync(win, ch) == ERR) { code = ERR; break; } @@ -72,8 +114,7 @@ waddnstr } NCURSES_EXPORT(int) -waddchnstr -(WINDOW *win, const chtype * const astr, int n) +waddchnstr(WINDOW *win, const chtype * const astr, int n) { NCURSES_SIZE_T y = win->_cury; NCURSES_SIZE_T x = win->_curx; @@ -97,9 +138,116 @@ waddchnstr returnCode(code); line = &(win->_line[y]); +#if USE_WIDEC_SUPPORT + { + int i; + for (i = 0; i < n; ++i) + SetChar(line->text[i + x], ChCharOf(astr[i]), ChAttrOf(astr[i])); + } +#else memcpy(line->text + x, astr, n * sizeof(*astr)); +#endif CHANGED_RANGE(line, x, x + n - 1); _nc_synchook(win); returnCode(code); } + +#if USE_WIDEC_SUPPORT + +int +_nc_wchstrlen(const cchar_t * s) +{ + int result = 0; + while (CharOf(s[result]) != L'\0') { + result++; + } + return result; +} + +NCURSES_EXPORT(int) +wadd_wchnstr(WINDOW *win, const cchar_t * const astr, int n) +{ + NCURSES_SIZE_T y = win->_cury; + NCURSES_SIZE_T x = win->_curx; + int code = OK; + struct ldat *line; + int i, start, end; + + T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), win, _nc_viscbuf(astr, n), n)); + + if (!win) + returnCode(ERR); + + if (n < 0) { + n = _nc_wchstrlen(astr); + } + if (n > win->_maxx - x + 1) + n = win->_maxx - x + 1; + if (n == 0) + returnCode(code); + + line = &(win->_line[y]); + start = x; + end = x + n - 1; + if (isnac(line->text[x])) { + line->text[x - 1] = win->_nc_bkgd; + --start; + } + for (i = 0; i < n && x <= win->_maxx; ++i) { + line->text[x++] = astr[i]; + if (wcwidth(CharOf(astr[i])) > 1) { + if (x <= win->_maxx) + AddAttr(line->text[x++], WA_NAC); + else + line->text[x - 1] = win->_nc_bkgd; + } + } + if (x <= win->_maxx && isnac(line->text[x])) { + line->text[x] = win->_nc_bkgd; + ++end; + } + CHANGED_RANGE(line, start, end); + + _nc_synchook(win); + returnCode(code); +} + +NCURSES_EXPORT(int) +waddnwstr(WINDOW *win, const wchar_t * str, int n) +{ + int code = ERR; + int i; + + T((T_CALLED("waddnwstr(%p,%s,%d)"), win, _nc_viswbuf(str), n)); + + if (win && (str != 0)) { + TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs))); + code = OK; + if (n < 0) + n = (int) wcslen(str); + + TR(TRACE_VIRTPUT, ("str is not null, length = %d", n)); + while ((n-- > 0) && (*str != L('\0'))) { + NCURSES_CH_T ch; + TR(TRACE_VIRTPUT, ("*str[0] = %#lx", *str)); + SetChar(ch, *str++, A_NORMAL); + i = 1; + while (i < CCHARW_MAX && n > 0 && (*str != L('\0')) + && wcwidth(*str) == 0) { + TR(TRACE_VIRTPUT, ("*str[%d] = %#lx", i, *str)); + ch.chars[i++] = *str++; + --n; + } + if (_nc_waddch_nosync(win, ch) == ERR) { + code = ERR; + break; + } + } + _nc_synchook(win); + } + TR(TRACE_VIRTPUT, ("waddnwstr returns %d", code)); + returnCode(code); +} + +#endif diff --git a/contrib/ncurses/ncurses/base/lib_bkgd.c b/contrib/ncurses/ncurses/base/lib_bkgd.c index 071924c..a3d7c30 100644 --- a/contrib/ncurses/ncurses/base/lib_bkgd.c +++ b/contrib/ncurses/ncurses/base/lib_bkgd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,51 +33,93 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_bkgd.c,v 1.14 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_bkgd.c,v 1.26 2001/12/19 01:36:58 tom Exp $") +/* + * Set the window's background information. + */ +#if USE_WIDEC_SUPPORT NCURSES_EXPORT(void) -wbkgdset(WINDOW *win, chtype ch) +#else +static inline void +#endif +wbkgrndset(WINDOW *win, const ARG_CH_T ch) { - T((T_CALLED("wbkgdset(%p,%s)"), win, _tracechtype(ch))); + T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch))); if (win) { - chtype off = AttrOf(win->_bkgd); - chtype on = AttrOf(ch); + attr_t off = AttrOf(win->_nc_bkgd); + attr_t on = AttrOf(CHDEREF(ch)); toggle_attr_off(win->_attrs, off); toggle_attr_on(win->_attrs, on); - if (TextOf(ch) == 0) - ch |= BLANK; - win->_bkgd = ch; + if (CharOf(CHDEREF(ch)) == L('\0')) + SetChar(win->_nc_bkgd, BLANK_TEXT, AttrOf(CHDEREF(ch))); + else + win->_nc_bkgd = CHDEREF(ch); +#if USE_WIDEC_SUPPORT + /* + * If we're compiled for wide-character support, _bkgrnd is the + * preferred location for the background information since it stores + * more than _bkgd. Update _bkgd each time we modify _bkgrnd, so the + * macro getbkgd() will work. + */ + { + cchar_t wch; + int tmp; + + wgetbkgrnd(win, &wch); + tmp = wctob(CharOf(wch)); + + win->_bkgd = ((tmp == EOF) ? ' ' : (chtype) tmp) | AttrOf(wch); + } +#endif } returnVoid; } +NCURSES_EXPORT(void) +wbkgdset(WINDOW *win, chtype ch) +{ + NCURSES_CH_T wch; + SetChar2(wch, ch); + wbkgrndset(win, CHREF(wch)); +} + +/* + * Set the window's background information and apply it to each cell. + */ +#if USE_WIDEC_SUPPORT NCURSES_EXPORT(int) -wbkgd(WINDOW *win, const chtype ch) +#else +static inline int +#undef wbkgrnd +#endif +wbkgrnd(WINDOW *win, const ARG_CH_T ch) { int code = ERR; int x, y; - chtype new_bkgd = ch; + NCURSES_CH_T new_bkgd = CHDEREF(ch); - T((T_CALLED("wbkgd(%p,%s)"), win, _tracechtype(new_bkgd))); + T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch))); if (win) { - chtype old_bkgd = getbkgd(win); + NCURSES_CH_T old_bkgrnd; + wgetbkgrnd(win, &old_bkgrnd); - wbkgdset(win, new_bkgd); - wattrset(win, AttrOf(win->_bkgd)); + wbkgrndset(win, CHREF(new_bkgd)); + wattrset(win, AttrOf(win->_nc_bkgd)); for (y = 0; y <= win->_maxy; y++) { for (x = 0; x <= win->_maxx; x++) { - if (win->_line[y].text[x] == old_bkgd) - win->_line[y].text[x] = win->_bkgd; - else - win->_line[y].text[x] = - _nc_render(win, (A_ALTCHARSET & - AttrOf(win->_line[y].text[x])) - | TextOf(win->_line[y].text[x])); + if (CharEq(win->_line[y].text[x], old_bkgrnd)) + win->_line[y].text[x] = win->_nc_bkgd; + else { + NCURSES_CH_T wch = win->_line[y].text[x]; + RemAttr(wch, ~A_ALTCHARSET); + win->_line[y].text[x] = _nc_render(win, wch); + } } } touchwin(win); @@ -86,3 +128,11 @@ wbkgd(WINDOW *win, const chtype ch) } returnCode(code); } + +NCURSES_EXPORT(int) +wbkgd(WINDOW *win, const chtype ch) +{ + NCURSES_CH_T wch; + SetChar2(wch, ch); + return wbkgrnd(win, CHREF(wch)); +} diff --git a/contrib/ncurses/ncurses/base/lib_box.c b/contrib/ncurses/ncurses/base/lib_box.c index d018fd89..7181edb 100644 --- a/contrib/ncurses/ncurses/base/lib_box.c +++ b/contrib/ncurses/ncurses/base/lib_box.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001,2002 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,16 +40,18 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_box.c,v 1.13 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_box.c,v 1.18 2002/02/23 20:40:06 tom Exp $") NCURSES_EXPORT(int) -wborder -(WINDOW *win, - chtype ls, chtype rs, chtype ts, chtype bs, - chtype tl, chtype tr, chtype bl, chtype br) +wborder(WINDOW *win, + chtype ls, chtype rs, + chtype ts, chtype bs, + chtype tl, chtype tr, + chtype bl, chtype br) { NCURSES_SIZE_T i; NCURSES_SIZE_T endx, endy; + chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), win, @@ -65,55 +67,47 @@ wborder if (!win) returnCode(ERR); - if (ls == 0) - ls = ACS_VLINE; - if (rs == 0) - rs = ACS_VLINE; - if (ts == 0) - ts = ACS_HLINE; - if (bs == 0) - bs = ACS_HLINE; - if (tl == 0) - tl = ACS_ULCORNER; - if (tr == 0) - tr = ACS_URCORNER; - if (bl == 0) - bl = ACS_LLCORNER; - if (br == 0) - br = ACS_LRCORNER; +#define RENDER_WITH_DEFAULT(ch,def) w ## ch = (ch == 0) ? def : ch - ls = _nc_render(win, ls); - rs = _nc_render(win, rs); - ts = _nc_render(win, ts); - bs = _nc_render(win, bs); - tl = _nc_render(win, tl); - tr = _nc_render(win, tr); - bl = _nc_render(win, bl); - br = _nc_render(win, br); + RENDER_WITH_DEFAULT(ls, ACS_VLINE); + RENDER_WITH_DEFAULT(rs, ACS_VLINE); + RENDER_WITH_DEFAULT(ts, ACS_HLINE); + RENDER_WITH_DEFAULT(bs, ACS_HLINE); + RENDER_WITH_DEFAULT(tl, ACS_ULCORNER); + RENDER_WITH_DEFAULT(tr, ACS_URCORNER); + RENDER_WITH_DEFAULT(bl, ACS_LLCORNER); + RENDER_WITH_DEFAULT(br, ACS_LRCORNER); - T(("using %#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx", - ls, rs, ts, bs, tl, tr, bl, br)); + T(("using %s, %s, %s, %s, %s, %s, %s, %s", + _tracechtype2(1, wls), + _tracechtype2(2, wrs), + _tracechtype2(3, wts), + _tracechtype2(4, wbs), + _tracechtype2(5, wtl), + _tracechtype2(6, wtr), + _tracechtype2(7, wbl), + _tracechtype2(8, wbr))); endx = win->_maxx; endy = win->_maxy; for (i = 0; i <= endx; i++) { - win->_line[0].text[i] = ts; - win->_line[endy].text[i] = bs; + SetChar(win->_line[0].text[i], ChCharOf(wts), ChAttrOf(wts)); + SetChar(win->_line[endy].text[i], ChCharOf(wbs), ChAttrOf(wbs)); } win->_line[endy].firstchar = win->_line[0].firstchar = 0; win->_line[endy].lastchar = win->_line[0].lastchar = endx; for (i = 0; i <= endy; i++) { - win->_line[i].text[0] = ls; - win->_line[i].text[endx] = rs; + SetChar(win->_line[i].text[0], ChCharOf(wls), ChAttrOf(wls)); + SetChar(win->_line[i].text[endx], ChCharOf(wrs), ChAttrOf(wrs)); win->_line[i].firstchar = 0; win->_line[i].lastchar = endx; } - win->_line[0].text[0] = tl; - win->_line[0].text[endx] = tr; - win->_line[endy].text[0] = bl; - win->_line[endy].text[endx] = br; + SetChar(win->_line[0].text[0], ChCharOf(wtl), ChAttrOf(wtl)); + SetChar(win->_line[0].text[endx], ChCharOf(wtr), ChAttrOf(wtr)); + SetChar(win->_line[endy].text[0], ChCharOf(wbl), ChAttrOf(wbl)); + SetChar(win->_line[endy].text[endx], ChCharOf(wbr), ChAttrOf(wbr)); _nc_synchook(win); returnCode(OK); diff --git a/contrib/ncurses/ncurses/base/lib_chgat.c b/contrib/ncurses/ncurses/base/lib_chgat.c index 66c6a09..54e66ed 100644 --- a/contrib/ncurses/ncurses/base/lib_chgat.c +++ b/contrib/ncurses/ncurses/base/lib_chgat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_chgat.c,v 1.4 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_chgat.c,v 1.5 2001/06/03 00:05:02 skimo Exp $") NCURSES_EXPORT(int) wchgat @@ -54,8 +54,7 @@ wchgat toggle_attr_on(attr, COLOR_PAIR(color)); for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) - win->_line[win->_cury].text[i] - = TextOf(win->_line[win->_cury].text[i]) | attr; + SetAttr(win->_line[win->_cury].text[i], attr); returnCode(OK); } else diff --git a/contrib/ncurses/ncurses/base/lib_clrbot.c b/contrib/ncurses/ncurses/base/lib_clrbot.c index 805e7c2..bc12960 100644 --- a/contrib/ncurses/ncurses/base/lib_clrbot.c +++ b/contrib/ncurses/ncurses/base/lib_clrbot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_clrbot.c,v 1.17 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_clrbot.c,v 1.19 2001/12/19 01:05:59 tom Exp $") NCURSES_EXPORT(int) wclrtobot(WINDOW *win) @@ -52,15 +52,15 @@ wclrtobot(WINDOW *win) if (win) { NCURSES_SIZE_T y; NCURSES_SIZE_T startx = win->_curx; - chtype blank = _nc_background(win); + NCURSES_CH_T blank = win->_nc_bkgd; T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx)); for (y = win->_cury; y <= win->_maxy; y++) { struct ldat *line = &(win->_line[y]); - chtype *ptr = &(line->text[startx]); - chtype *end = &(line->text[win->_maxx]); + NCURSES_CH_T *ptr = &(line->text[startx]); + NCURSES_CH_T *end = &(line->text[win->_maxx]); CHANGED_TO_EOL(line, startx, win->_maxx); diff --git a/contrib/ncurses/ncurses/base/lib_clreol.c b/contrib/ncurses/ncurses/base/lib_clreol.c index fa0afe4..c46ebd9 100644 --- a/contrib/ncurses/ncurses/base/lib_clreol.c +++ b/contrib/ncurses/ncurses/base/lib_clreol.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_clreol.c,v 1.19 2000/12/10 02:43:26 tom Exp $") +MODULE_ID("$Id: lib_clreol.c,v 1.21 2001/12/19 01:06:04 tom Exp $") NCURSES_EXPORT(int) wclrtoeol(WINDOW *win) @@ -50,8 +50,8 @@ wclrtoeol(WINDOW *win) T((T_CALLED("wclrtoeol(%p)"), win)); if (win) { - chtype blank; - chtype *ptr, *end; + NCURSES_CH_T blank; + NCURSES_CH_T *ptr, *end; struct ldat *line; NCURSES_SIZE_T y = win->_cury; NCURSES_SIZE_T x = win->_curx; @@ -74,7 +74,7 @@ wclrtoeol(WINDOW *win) || x > win->_maxx) returnCode(ERR); - blank = _nc_background(win); + blank = win->_nc_bkgd; line = &win->_line[y]; CHANGED_TO_EOL(line, x, win->_maxx); diff --git a/contrib/ncurses/ncurses/base/lib_color.c b/contrib/ncurses/ncurses/base/lib_color.c index 1fa5732..42d301d 100644 --- a/contrib/ncurses/ncurses/base/lib_color.c +++ b/contrib/ncurses/ncurses/base/lib_color.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,17 +41,15 @@ #include <term.h> #include <tic.h> -MODULE_ID("$Id: lib_color.c,v 1.55 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.58 2001/09/01 21:42:59 tom Exp $") /* * These should be screen structure members. They need to be globals for * historical reasons. So we assign them in start_color() and also in * set_term()'s screen-switching logic. */ -NCURSES_EXPORT_VAR(int) -COLOR_PAIRS = 0; -NCURSES_EXPORT_VAR(int) -COLORS = 0; +NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; +NCURSES_EXPORT_VAR(int) COLORS = 0; /* * Given a RGB range of 0..1000, we'll normally set the individual values @@ -92,8 +90,8 @@ static const color_t hls_palette[] = * These are called from _nc_do_color(), which in turn is called from * vidattr - so we have to assume that SP may be null. */ - static int - default_fg(void) +static int +default_fg(void) { return (SP != 0) ? SP->_default_fg : COLOR_WHITE; } @@ -113,8 +111,8 @@ default_bg(void) * to maintain compatibility with a pre-ANSI scheme. The same scheme is * also used in the FreeBSD syscons. */ - static int - toggled_colors(int c) +static int +toggled_colors(int c) { if (c < 16) { static const int table[] = @@ -259,8 +257,7 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s) * values. */ NCURSES_EXPORT(int) -init_pair -(short pair, short f, short b) +init_pair(short pair, short f, short b) { unsigned result; @@ -302,10 +299,10 @@ init_pair struct ldat *ptr = &(curscr->_line[y]); bool changed = FALSE; for (x = 0; x <= curscr->_maxx; x++) { - if ((ptr->text[x] & A_COLOR) == z) { + if ((AttrOf(ptr->text[x]) & A_COLOR) == z) { /* Set the old cell to zero to ensure it will be updated on the next doupdate() */ - ptr->text[x] = 0; + SetChar(ptr->text[x], 0, 0); CHANGED_CELL(ptr, x); changed = TRUE; } @@ -339,8 +336,7 @@ init_pair } NCURSES_EXPORT(int) -init_color -(short color, short r, short g, short b) +init_color(short color, short r, short g, short b) { T((T_CALLED("init_color(%d,%d,%d,%d)"), color, r, g, b)); @@ -390,8 +386,7 @@ has_colors(void) } NCURSES_EXPORT(int) -color_content -(short color, short *r, short *g, short *b) +color_content(short color, short *r, short *g, short *b) { T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b)); if (color < 0 || color >= COLORS) @@ -407,8 +402,7 @@ color_content } NCURSES_EXPORT(int) -pair_content -(short pair, short *f, short *b) +pair_content(short pair, short *f, short *b) { T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b)); @@ -423,8 +417,7 @@ pair_content } NCURSES_EXPORT(void) -_nc_do_color -(int old_pair, int pair, bool reverse, int (*outc) (int)) +_nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int)) { NCURSES_COLOR_T fg = C_MASK, bg = C_MASK; NCURSES_COLOR_T old_fg, old_bg; diff --git a/contrib/ncurses/ncurses/base/lib_delch.c b/contrib/ncurses/ncurses/base/lib_delch.c index 918e225..0c30f2d 100644 --- a/contrib/ncurses/ncurses/base/lib_delch.c +++ b/contrib/ncurses/ncurses/base/lib_delch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_delch.c,v 1.10 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_delch.c,v 1.12 2001/12/19 01:06:09 tom Exp $") NCURSES_EXPORT(int) wdelch(WINDOW *win) @@ -50,11 +50,11 @@ wdelch(WINDOW *win) T((T_CALLED("wdelch(%p)"), win)); if (win) { - chtype blank = _nc_background(win); + NCURSES_CH_T blank = win->_nc_bkgd; struct ldat *line = &(win->_line[win->_cury]); - chtype *end = &(line->text[win->_maxx]); - chtype *temp2 = &(line->text[win->_curx + 1]); - chtype *temp1 = temp2 - 1; + NCURSES_CH_T *end = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = &(line->text[win->_curx + 1]); + NCURSES_CH_T *temp1 = temp2 - 1; CHANGED_TO_EOL(line, win->_curx, win->_maxx); while (temp1 < end) diff --git a/contrib/ncurses/ncurses/base/lib_delwin.c b/contrib/ncurses/ncurses/base/lib_delwin.c index 7c56869..89d8e7c3 100644 --- a/contrib/ncurses/ncurses/base/lib_delwin.c +++ b/contrib/ncurses/ncurses/base/lib_delwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_delwin.c,v 1.12 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_delwin.c,v 1.13 2001/08/26 00:40:20 tom Exp $") static bool cannot_delete(WINDOW *win) @@ -49,10 +49,10 @@ cannot_delete(WINDOW *win) bool result = TRUE; for (p = _nc_windows; p != 0; p = p->next) { - if (p->win == win) { + if (&(p->win) == win) { result = FALSE; - } else if ((p->win->_flags & _SUBWIN) != 0 - && p->win->_parent == win) { + } else if ((p->win._flags & _SUBWIN) != 0 + && p->win._parent == win) { result = TRUE; break; } diff --git a/contrib/ncurses/ncurses/base/lib_erase.c b/contrib/ncurses/ncurses/base/lib_erase.c index 87673b7..5e39731 100644 --- a/contrib/ncurses/ncurses/base/lib_erase.c +++ b/contrib/ncurses/ncurses/base/lib_erase.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,20 +40,20 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_erase.c,v 1.13 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_erase.c,v 1.15 2001/12/19 01:06:13 tom Exp $") NCURSES_EXPORT(int) werase(WINDOW *win) { int code = ERR; int y; - chtype blank; - chtype *sp, *end, *start; + NCURSES_CH_T blank; + NCURSES_CH_T *sp, *end, *start; T((T_CALLED("werase(%p)"), win)); if (win) { - blank = _nc_background(win); + blank = win->_nc_bkgd; for (y = 0; y <= win->_maxy; y++) { start = win->_line[y].text; end = &start[win->_maxx]; diff --git a/contrib/ncurses/ncurses/base/lib_freeall.c b/contrib/ncurses/ncurses/base/lib_freeall.c index bbd8c0e..2063c6f 100644 --- a/contrib/ncurses/ncurses/base/lib_freeall.c +++ b/contrib/ncurses/ncurses/base/lib_freeall.c @@ -39,7 +39,7 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.18 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_freeall.c,v 1.19 2001/09/15 21:32:48 tom Exp $") static void free_slk(SLK * p) @@ -85,15 +85,15 @@ _nc_freeall(void) for (q = _nc_windows; q != 0; q = q->next) { if ((p != q) - && (q->win->_flags & _SUBWIN) - && (p->win == q->win->_parent)) { + && (q->win._flags & _SUBWIN) + && (&(p->win) == q->win._parent)) { found = TRUE; break; } } if (!found) { - delwin(p->win); + delwin(&(p->win)); break; } } @@ -104,6 +104,9 @@ _nc_freeall(void) free_slk(SP->_slk); FreeIfNeeded(SP->_color_pairs); FreeIfNeeded(SP->_color_table); + FreeIfNeeded(SP->oldhash); + FreeIfNeeded(SP->newhash); + FreeIfNeeded(SP->hashtab); #if !BROKEN_LINKER FreeAndNull(SP); #endif diff --git a/contrib/ncurses/ncurses/base/lib_getch.c b/contrib/ncurses/ncurses/base/lib_getch.c index 9deafec..f4ecbda 100644 --- a/contrib/ncurses/ncurses/base/lib_getch.c +++ b/contrib/ncurses/ncurses/base/lib_getch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,15 +40,15 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_getch.c,v 1.54 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.60 2002/03/17 00:46:01 tom Exp $") #include <fifo_defs.h> NCURSES_EXPORT_VAR(int) ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */ - static inline int - fifo_peek(void) +static inline int +fifo_peek(void) { int ch = SP->_fifo[peek]; TR(TRACE_IEVENT, ("peeking at %d", peek)); @@ -62,7 +62,7 @@ fifo_pull(void) { int ch; ch = SP->_fifo[head]; - TR(TRACE_IEVENT, ("pulling %d from %d", ch, head)); + TR(TRACE_IEVENT, ("pulling %s from %d", _tracechar(ch), head)); if (peek == head) { h_inc(); @@ -102,7 +102,7 @@ fifo_push(void) { unsigned char c2 = 0; n = read(SP->_ifd, &c2, 1); - ch = CharOf(c2); + ch = c2; } #ifdef HIDE_EINTR @@ -130,7 +130,7 @@ fifo_push(void) if (head == -1) head = peek = tail; t_inc(); - TR(TRACE_IEVENT, ("pushed %#x at %d", ch, tail)); + TR(TRACE_IEVENT, ("pushed %s at %d", _tracechar(ch), tail)); #ifdef TRACE if (_nc_tracing & TRACE_IEVENT) _nc_fifo_dump(); @@ -141,26 +141,25 @@ fifo_push(void) static inline void fifo_clear(void) { - int i; - for (i = 0; i < FIFO_SIZE; i++) - SP->_fifo[i] = 0; + memset(SP->_fifo, 0, sizeof(SP->_fifo)); head = -1; tail = peek = 0; } -static int kgetch(WINDOW *); +static int kgetch(void); #define wgetch_should_refresh(win) (\ (is_wintouched(win) || (win->_flags & _HASMOVED)) \ && !(win->_flags & _ISPAD)) NCURSES_EXPORT(int) -wgetch(WINDOW *win) +_nc_wgetch(WINDOW *win, unsigned long *result, int use_meta) { int ch; T((T_CALLED("wgetch(%p)"), win)); + *result = 0; if (!win) returnCode(ERR); @@ -168,9 +167,8 @@ wgetch(WINDOW *win) if (wgetch_should_refresh(win)) wrefresh(win); - ch = fifo_pull(); - T(("wgetch returning (pre-cooked): %#x = %s", ch, _trace_key(ch))); - returnCode(ch); + *result = fifo_pull(); + returnCode(OK); } /* @@ -190,9 +188,13 @@ wgetch(WINDOW *win) for (sp = buf + strlen(buf); sp > buf; sp--) ungetch(sp[-1]); - returnCode(fifo_pull()); + *result = fifo_pull(); + returnCode(OK); } + if (win->_use_keypad != SP->_keypad_on) + _nc_keypad(win->_use_keypad); + if (wgetch_should_refresh(win)) wrefresh(win); @@ -228,12 +230,14 @@ wgetch(WINDOW *win) int runcount = 0; do { - ch = kgetch(win); + ch = kgetch(); if (ch == KEY_MOUSE) { ++runcount; if (SP->_mouse_inline(SP)) break; } + if (SP->_maxclick < 0) + break; } while (ch == KEY_MOUSE && (_nc_timed_wait(3, SP->_maxclick, (int *) 0) @@ -255,13 +259,11 @@ wgetch(WINDOW *win) _nc_update_screensize(); /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { - ch = fifo_pull(); - T(("wgetch returning (pre-cooked): %#x = %s", ch, _trace_key(ch))); - returnCode(ch); + *result = fifo_pull(); + returnCode(OK); } } #endif - T(("wgetch returning ERR")); returnCode(ERR); } @@ -300,13 +302,27 @@ wgetch(WINDOW *win) * that display only 7-bit characters. Note that 'ch' may be a * function key at this point, so we mustn't strip _those_. */ - if ((ch < KEY_MIN) && (ch & 0x80)) - if (!SP->_use_meta) + if (!use_meta) + if ((ch < KEY_MIN) && (ch & 0x80)) ch &= 0x7f; - T(("wgetch returning : %#x = %s", ch, _trace_key(ch))); + T(("wgetch returning : %s", _tracechar(ch))); + + *result = ch; + returnCode(ch >= KEY_MIN ? KEY_CODE_YES : OK); +} + +NCURSES_EXPORT(int) +wgetch(WINDOW *win) +{ + int code; + unsigned long value; - returnCode(ch); + T((T_CALLED("wgetch(%p)"), win)); + code = _nc_wgetch(win, &value, SP->_use_meta); + if (code != ERR) + code = value; + returnCode(code); } /* @@ -319,19 +335,19 @@ wgetch(WINDOW *win) ** sequence is received by the time the alarm goes off, pass through ** the sequence gotten so far. ** -** This function must be called when there is no cooked keys in queue. +** This function must be called when there are no cooked keys in queue. ** (that is head==-1 || peek==head) ** */ static int -kgetch(WINDOW *win GCC_UNUSED) +kgetch(void) { struct tries *ptr; int ch = 0; int timeleft = ESCDELAY; - TR(TRACE_IEVENT, ("kgetch(%p) called", win)); + TR(TRACE_IEVENT, ("kgetch() called")); ptr = SP->_keytry; @@ -350,19 +366,16 @@ kgetch(WINDOW *win GCC_UNUSED) return ch; } - TR(TRACE_IEVENT, ("ch: %s", _trace_key((unsigned char) ch))); + TR(TRACE_IEVENT, ("ch: %s", _tracechar((unsigned char) ch))); while ((ptr != NULL) && (ptr->ch != (unsigned char) ch)) ptr = ptr->sibling; -#ifdef TRACE + if (ptr == NULL) { TR(TRACE_IEVENT, ("ptr is null")); - } else - TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d", - ptr, ptr->ch, ptr->value)); -#endif /* TRACE */ - - if (ptr == NULL) break; + } + TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d", + ptr, ptr->ch, ptr->value)); if (ptr->value != 0) { /* sequence terminated */ TR(TRACE_IEVENT, ("end of sequence")); diff --git a/contrib/ncurses/ncurses/base/lib_hline.c b/contrib/ncurses/ncurses/base/lib_hline.c index 72d1ddb..2cb6cc5 100644 --- a/contrib/ncurses/ncurses/base/lib_hline.c +++ b/contrib/ncurses/ncurses/base/lib_hline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_hline.c,v 1.8 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_hline.c,v 1.10 2001/06/03 00:39:24 skimo Exp $") NCURSES_EXPORT(int) whline(WINDOW *win, chtype ch, int n) @@ -53,6 +53,7 @@ whline(WINDOW *win, chtype ch, int n) if (win) { struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T wch; start = win->_curx; end = start + n - 1; @@ -62,11 +63,13 @@ whline(WINDOW *win, chtype ch, int n) CHANGED_RANGE(line, start, end); if (ch == 0) - ch = ACS_HLINE; - ch = _nc_render(win, ch); + SetChar(wch, ChCharOf(ACS_HLINE), ChAttrOf(ACS_HLINE)); + else + SetChar(wch, ChCharOf(ch), ChAttrOf(ch)); + wch = _nc_render(win, wch); while (end >= start) { - line->text[end] = ch; + line->text[end] = wch; end--; } diff --git a/contrib/ncurses/ncurses/base/lib_inchstr.c b/contrib/ncurses/ncurses/base/lib_inchstr.c index 31625bb..6ff0168 100644 --- a/contrib/ncurses/ncurses/base/lib_inchstr.c +++ b/contrib/ncurses/ncurses/base/lib_inchstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_inchstr.c,v 1.9 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_inchstr.c,v 1.10 2001/06/02 23:37:58 skimo Exp $") NCURSES_EXPORT(int) winchnstr(WINDOW *win, chtype * str, int n) @@ -54,7 +54,9 @@ winchnstr(WINDOW *win, chtype * str, int n) if (win) { for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++) - str[i] = win->_line[win->_cury].text[win->_curx + i]; + str[i] = + CharOf(win->_line[win->_cury].text[win->_curx + i]) | + AttrOf(win->_line[win->_cury].text[win->_curx + i]); } str[i] = (chtype) 0; diff --git a/contrib/ncurses/ncurses/base/lib_initscr.c b/contrib/ncurses/ncurses/base/lib_initscr.c index b6e34ef..832da74 100644 --- a/contrib/ncurses/ncurses/base/lib_initscr.c +++ b/contrib/ncurses/ncurses/base/lib_initscr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -45,7 +45,7 @@ #include <sys/termio.h> /* needed for ISC */ #endif -MODULE_ID("$Id: lib_initscr.c,v 1.28 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_initscr.c,v 1.29 2001/08/26 01:05:05 tom Exp $") NCURSES_EXPORT(WINDOW *) initscr(void) @@ -53,6 +53,12 @@ initscr(void) static bool initialized = FALSE; NCURSES_CONST char *name; int value; +#ifdef TRACE + int t = _nc_getenv_num("NCURSES_TRACE"); + + if (t >= 0) + trace(t); +#endif T((T_CALLED("initscr()"))); /* Portable applications must not call initscr() more than once */ diff --git a/contrib/ncurses/ncurses/base/lib_insch.c b/contrib/ncurses/ncurses/base/lib_insch.c index 8d495f5..c3671e5 100644 --- a/contrib/ncurses/ncurses/base/lib_insch.c +++ b/contrib/ncurses/ncurses/base/lib_insch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_insch.c,v 1.12 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_insch.c,v 1.15 2001/06/09 23:47:38 skimo Exp $") NCURSES_EXPORT(int) winsch(WINDOW *win, chtype c) @@ -51,15 +51,17 @@ winsch(WINDOW *win, chtype c) if (win) { struct ldat *line = &(win->_line[win->_cury]); - chtype *end = &(line->text[win->_curx]); - chtype *temp1 = &(line->text[win->_maxx]); - chtype *temp2 = temp1 - 1; + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - 1; + NCURSES_CH_T wch; + SetChar2(wch, c); CHANGED_TO_EOL(line, win->_curx, win->_maxx); while (temp1 > end) *temp1-- = *temp2--; - *temp1 = _nc_render(win, c); + *temp1 = _nc_render(win, wch); code = OK; } returnCode(code); diff --git a/contrib/ncurses/ncurses/base/lib_insdel.c b/contrib/ncurses/ncurses/base/lib_insdel.c index 1a23a86..432bcac 100644 --- a/contrib/ncurses/ncurses/base/lib_insdel.c +++ b/contrib/ncurses/ncurses/base/lib_insdel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -42,7 +42,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_insdel.c,v 1.10 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_insdel.c,v 1.11 2001/12/19 01:10:49 tom Exp $") NCURSES_EXPORT(int) winsdelln(WINDOW *win, int n) @@ -54,7 +54,7 @@ winsdelln(WINDOW *win, int n) if (win) { if (n != 0) { _nc_scroll_window(win, -n, win->_cury, win->_maxy, - _nc_background(win)); + win->_nc_bkgd); _nc_synchook(win); } code = OK; diff --git a/contrib/ncurses/ncurses/base/lib_insstr.c b/contrib/ncurses/ncurses/base/lib_insstr.c index f4c215d..a16ab13 100644 --- a/contrib/ncurses/ncurses/base/lib_insstr.c +++ b/contrib/ncurses/ncurses/base/lib_insstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +41,7 @@ #include <curses.priv.h> #include <ctype.h> -MODULE_ID("$Id: lib_insstr.c,v 1.17 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_insstr.c,v 1.19 2001/06/09 23:43:02 skimo Exp $") NCURSES_EXPORT(int) winsnstr(WINDOW *win, const char *s, int n) @@ -58,9 +58,11 @@ winsnstr(WINDOW *win, const char *s, int n) oy = win->_cury; ox = win->_curx; for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) { - if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') - _nc_waddch_nosync(win, (chtype) (*cp)); - else if (is7bits(*cp) && iscntrl(*cp)) { + if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') { + NCURSES_CH_T wch; + SetChar2(wch, *cp); + _nc_waddch_nosync(win, wch); + } else if (is7bits(*cp) && iscntrl(*cp)) { winsch(win, ' ' + (chtype) (*cp)); winsch(win, (chtype) '^'); win->_curx += 2; diff --git a/contrib/ncurses/ncurses/base/lib_instr.c b/contrib/ncurses/ncurses/base/lib_instr.c index 588f6c4..3eaf989 100644 --- a/contrib/ncurses/ncurses/base/lib_instr.c +++ b/contrib/ncurses/ncurses/base/lib_instr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_instr.c,v 1.10 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_instr.c,v 1.11 2001/06/02 23:42:06 skimo Exp $") NCURSES_EXPORT(int) winnstr(WINDOW *win, char *str, int n) @@ -59,7 +59,7 @@ winnstr(WINDOW *win, char *str, int n) n = win->_maxx - win->_curx + 1; for (; i < n;) { - str[i++] = TextOf(win->_line[row].text[col]); + str[i++] = CharOf(win->_line[row].text[col]); if (++col > win->_maxx) { col = 0; if (++row > win->_maxy) diff --git a/contrib/ncurses/ncurses/base/lib_mouse.c b/contrib/ncurses/ncurses/base/lib_mouse.c index 01d3057..69af58d 100644 --- a/contrib/ncurses/ncurses/base/lib_mouse.c +++ b/contrib/ncurses/ncurses/base/lib_mouse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2002 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 * @@ -84,7 +84,7 @@ #endif #endif -MODULE_ID("$Id: lib_mouse.c,v 1.57 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.58 2002/01/12 22:38:07 tom Exp $") #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT @@ -655,7 +655,7 @@ _nc_mouse_parse(int runcount) /* first pass; merge press/release pairs */ do { merge = FALSE; - for (ep = runp; next = NEXT(ep), next != eventp; ep = next) { + for (ep = runp; (next = NEXT(ep)) != eventp; ep = next) { if (ep->x == next->x && ep->y == next->y && (ep->bstate & (BUTTON1_PRESSED | BUTTON2_PRESSED | BUTTON3_PRESSED)) && (!(ep->bstate & BUTTON1_PRESSED) @@ -720,7 +720,7 @@ _nc_mouse_parse(int runcount) MEVENT *follower; merge = FALSE; - for (ep = runp; next = NEXT(ep), next != eventp; ep = next) + for (ep = runp; (next = NEXT(ep)) != eventp; ep = next) if (ep->id != INVALID_EVENT) { if (next->id != INVALID_EVENT) continue; diff --git a/contrib/ncurses/ncurses/base/lib_mvwin.c b/contrib/ncurses/ncurses/base/lib_mvwin.c index 28b78f8..63d54cc 100644 --- a/contrib/ncurses/ncurses/base/lib_mvwin.c +++ b/contrib/ncurses/ncurses/base/lib_mvwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_mvwin.c,v 1.9 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_mvwin.c,v 1.12 2001/12/19 01:06:22 tom Exp $") NCURSES_EXPORT(int) mvwin(WINDOW *win, int by, int bx) @@ -69,7 +69,8 @@ mvwin(WINDOW *win, int by, int bx) /* now we have the clone, so relocate win */ werase(win); /* Erase the original place */ - wbkgd(win, parent->_bkgd); /* fill with parents background */ + /* fill with parents background */ + wbkgrnd(win, CHREF(parent->_nc_bkgd)); wsyncup(win); /* Tell the parent(s) */ err = mvderwin(win, diff --git a/contrib/ncurses/ncurses/base/lib_newterm.c b/contrib/ncurses/ncurses/base/lib_newterm.c index 02f6ff5..d95c4a9 100644 --- a/contrib/ncurses/ncurses/base/lib_newterm.c +++ b/contrib/ncurses/ncurses/base/lib_newterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -47,7 +47,7 @@ #include <term.h> /* clear_screen, cup & friends, cur_term */ #include <tic.h> -MODULE_ID("$Id: lib_newterm.c,v 1.50 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.52 2001/08/04 16:47:48 tom Exp $") #ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */ #define ONLCR 0 @@ -89,7 +89,9 @@ static int filter_mode = FALSE; NCURSES_EXPORT(void) filter(void) { + T((T_CALLED("filter"))); filter_mode = TRUE; + returnVoid; } NCURSES_EXPORT(SCREEN *) @@ -110,7 +112,7 @@ newterm /* this loads the capability entry, then sets LINES and COLS */ if (setupterm(name, fileno(ofp), &errret) == ERR) - return 0; + returnSP(0); /* implement filter mode */ if (filter_mode) { @@ -140,7 +142,7 @@ newterm if (slk_format) { if (ERR == _nc_ripoffline(-SLK_LINES(slk_format), _nc_slk_initialize)) - return 0; + returnSP(0); } /* this actually allocates the screen structure, and saves the * original terminal settings. @@ -149,7 +151,7 @@ newterm _nc_set_screen(0); if (_nc_setupscreen(LINES, COLS, ofp) == ERR) { _nc_set_screen(current); - return 0; + returnSP(0); } /* if the terminal type has real soft labels, set those up */ @@ -192,26 +194,6 @@ newterm SP->_use_rmso = SGR0_TEST(exit_standout_mode); SP->_use_rmul = SGR0_TEST(exit_underline_mode); -#if USE_WIDEC_SUPPORT - /* - * XFree86 xterm can be configured to support UTF-8 based on environment - * variable settings. - */ - { - char *s; - 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; - } - } -#endif - /* compute movement costs so we can do better move optimization */ _nc_mvcur_init(); @@ -223,6 +205,5 @@ newterm _nc_signal_handler(TRUE); - T((T_RETURN("%p"), SP)); - return (SP); + returnSP(SP); } diff --git a/contrib/ncurses/ncurses/base/lib_newwin.c b/contrib/ncurses/ncurses/base/lib_newwin.c index 08921f2..3cd8238 100644 --- a/contrib/ncurses/ncurses/base/lib_newwin.c +++ b/contrib/ncurses/ncurses/base/lib_newwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_newwin.c,v 1.27 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_newwin.c,v 1.33 2001/12/19 01:06:30 tom Exp $") NCURSES_EXPORT(int) _nc_freewin(WINDOW *win) @@ -51,19 +51,18 @@ _nc_freewin(WINDOW *win) if (win != 0) { for (p = _nc_windows, q = 0; p != 0; q = p, p = p->next) { - if (p->win == win) { + if (&(p->win) == win) { if (q == 0) _nc_windows = p->next; else q->next = p->next; - free(p); if (!(win->_flags & _SUBWIN)) { for (i = 0; i <= win->_maxy; i++) FreeIfNeeded(win->_line[i].text); } free(win->_line); - free(win); + free(p); if (win == curscr) curscr = 0; @@ -82,11 +81,10 @@ _nc_freewin(WINDOW *win) } NCURSES_EXPORT(WINDOW *) -newwin -(int num_lines, int num_columns, int begy, int begx) +newwin(int num_lines, int num_columns, int begy, int begx) { WINDOW *win; - chtype *ptr; + NCURSES_CH_T *ptr; int i; T((T_CALLED("newwin(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx)); @@ -106,24 +104,22 @@ newwin returnWin(0); for (i = 0; i < num_lines; i++) { - win->_line[i].text = typeCalloc(chtype, (unsigned) num_columns); + win->_line[i].text = typeCalloc(NCURSES_CH_T, (unsigned) num_columns); if (win->_line[i].text == 0) { (void) _nc_freewin(win); returnWin(0); } - for (ptr = win->_line[i].text; ptr < win->_line[i].text + - num_columns;) - *ptr++ = ' '; + for (ptr = win->_line[i].text; + ptr < win->_line[i].text + num_columns; + ptr++) + SetChar(*ptr, BLANK_TEXT, BLANK_ATTR); } - T(("newwin: returned window is %p", win)); - returnWin(win); } NCURSES_EXPORT(WINDOW *) -derwin -(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) +derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) { WINDOW *win; int i; @@ -133,7 +129,7 @@ derwin begy, begx)); /* - ** make sure window fits inside the original one + * make sure window fits inside the original one */ if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0) returnWin(0); @@ -157,21 +153,18 @@ derwin win->_pary = begy; win->_parx = begx; win->_attrs = orig->_attrs; - win->_bkgd = orig->_bkgd; + win->_nc_bkgd = orig->_nc_bkgd; for (i = 0; i < num_lines; i++) win->_line[i].text = &orig->_line[begy++].text[begx]; win->_parent = orig; - T(("derwin: returned window is %p", win)); - returnWin(win); } NCURSES_EXPORT(WINDOW *) -subwin -(WINDOW *w, int l, int c, int y, int x) +subwin(WINDOW *w, int l, int c, int y, int x) { T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), w, l, c, y, x)); T(("parent has begy = %d, begx = %d", w->_begy, w->_begx)); @@ -187,8 +180,7 @@ dimension_limit(int value) } NCURSES_EXPORT(WINDOW *) -_nc_makenew -(int num_lines, int num_columns, int begy, int begx, int flags) +_nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags) { int i; WINDOWLIST *wp; @@ -203,8 +195,7 @@ _nc_makenew if ((wp = typeCalloc(WINDOWLIST, 1)) == 0) return 0; - if ((win = typeCalloc(WINDOW, 1)) == 0) - return 0; + win = &(wp->win); if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) { free(win); @@ -221,7 +212,7 @@ _nc_makenew win->_flags = flags; win->_attrs = A_NORMAL; - win->_bkgd = BLANK; + SetChar(win->_nc_bkgd, BLANK_TEXT, BLANK_ATTR); win->_clear = is_pad ? FALSE : (num_lines == screen_lines && num_columns == screen_columns); @@ -284,7 +275,6 @@ _nc_makenew } wp->next = _nc_windows; - wp->win = win; _nc_windows = wp; T((T_CREATE("window %p"), win)); diff --git a/contrib/ncurses/ncurses/base/lib_overlay.c b/contrib/ncurses/ncurses/base/lib_overlay.c index 592e7ad..010e6d1 100644 --- a/contrib/ncurses/ncurses/base/lib_overlay.c +++ b/contrib/ncurses/ncurses/base/lib_overlay.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_overlay.c,v 1.14 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_overlay.c,v 1.20 2001/12/19 01:06:37 tom Exp $") static int overlap(const WINDOW *const s, WINDOW *const d, int const flag) @@ -109,8 +109,8 @@ copywin { int sx, sy, dx, dy; bool touched; - chtype bk = AttrOf(dst->_bkgd); - chtype mask = ~(chtype) ((bk & A_COLOR) ? A_COLOR : 0); + attr_t bk = AttrOf(dst->_nc_bkgd); + attr_t mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0); T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"), src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over)); @@ -137,14 +137,15 @@ copywin touched = FALSE; for (dx = dmincol, sx = smincol; dx <= dmaxcol; sx++, dx++) { if (over) { - if ((TextOf(src->_line[sy].text[sx]) != ' ') && - (dst->_line[dy].text[dx] != src->_line[sy].text[sx])) { - dst->_line[dy].text[dx] = - (src->_line[sy].text[sx] & mask) | bk; + if ((CharOf(src->_line[sy].text[sx]) != L(' ')) && + (!CharEq(dst->_line[dy].text[dx], src->_line[sy].text[sx]))) { + dst->_line[dy].text[dx] = src->_line[sy].text[sx]; + SetAttr(dst->_line[dy].text[dx], + (AttrOf(src->_line[sy].text[sx]) & mask) | bk); touched = TRUE; } } else { - if (dst->_line[dy].text[dx] != src->_line[sy].text[sx]) { + if (!CharEq(dst->_line[dy].text[dx], src->_line[sy].text[sx])) { dst->_line[dy].text[dx] = src->_line[sy].text[sx]; touched = TRUE; } diff --git a/contrib/ncurses/ncurses/base/lib_pad.c b/contrib/ncurses/ncurses/base/lib_pad.c index 8a9dae8..556fb19 100644 --- a/contrib/ncurses/ncurses/base/lib_pad.c +++ b/contrib/ncurses/ncurses/base/lib_pad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,13 +40,13 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_pad.c,v 1.32 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_pad.c,v 1.36 2002/05/18 21:28:44 Kriang.Lerdsuwanakij Exp $") NCURSES_EXPORT(WINDOW *) newpad(int l, int c) { WINDOW *win; - chtype *ptr; + NCURSES_CH_T *ptr; int i; T((T_CALLED("newpad(%d, %d)"), l, c)); @@ -59,12 +59,12 @@ newpad(int l, int c) for (i = 0; i < l; i++) { if_USE_SCROLL_HINTS(win->_line[i].oldindex = _NEWINDEX); - if ((win->_line[i].text = typeCalloc(chtype, ((size_t) c))) == 0) { + if ((win->_line[i].text = typeCalloc(NCURSES_CH_T, ((size_t) c))) == 0) { (void) _nc_freewin(win); returnWin(0); } - for (ptr = win->_line[i].text; ptr < win->_line[i].text + c;) - *ptr++ = ' '; + for (ptr = win->_line[i].text; ptr < win->_line[i].text + c; ptr++) + SetChar(*ptr, BLANK_TEXT, BLANK_ATTR); } returnWin(win); @@ -193,9 +193,23 @@ pnoutrefresh i++, m++) { register struct ldat *nline = &newscr->_line[m]; register struct ldat *oline = &win->_line[i]; + NCURSES_CH_T ch; + + /* + * Special case for leftmost character of the displayed area. + * Only half of a double-width character may be visible. + */ + ch = oline->text[pmincol]; + if_WIDEC(isnac(ch)) { + SetChar(ch, L(' '), AttrOf(oline->text[pmincol - 1])); + } + if (!CharEq(ch, nline->text[smincol])) { + nline->text[smincol] = ch; + CHANGED_CELL(nline, smincol); + } - for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) { - if (oline->text[j] != nline->text[n]) { + for (j = pmincol + 1, n = smincol + 1; j <= pmaxcol; j++, n++) { + if (!CharEq(oline->text[j], nline->text[n])) { nline->text[n] = oline->text[j]; CHANGED_CELL(nline, n); } diff --git a/contrib/ncurses/ncurses/base/lib_printw.c b/contrib/ncurses/ncurses/base/lib_printw.c index f6b7036..f821a96 100644 --- a/contrib/ncurses/ncurses/base/lib_printw.c +++ b/contrib/ncurses/ncurses/base/lib_printw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +39,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_printw.c,v 1.9 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_printw.c,v 1.12 2001/10/20 20:33:46 tom Exp $") NCURSES_EXPORT(int) printw(NCURSES_CONST char *fmt,...) @@ -47,13 +47,18 @@ printw(NCURSES_CONST char *fmt,...) va_list argp; int code; - T(("printw(%s,...) called", _nc_visbuf(fmt))); +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("printw(%s%s)"), + _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif va_start(argp, fmt); code = vwprintw(stdscr, fmt, argp); va_end(argp); - return code; + returnCode(code); } NCURSES_EXPORT(int) @@ -62,56 +67,76 @@ wprintw(WINDOW *win, NCURSES_CONST char *fmt,...) va_list argp; int code; - T(("wprintw(%p,%s,...) called", win, _nc_visbuf(fmt))); +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("wprintw(%p,%s%s)"), + win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif va_start(argp, fmt); code = vwprintw(win, fmt, argp); va_end(argp); - return code; + returnCode(code); } NCURSES_EXPORT(int) mvprintw(int y, int x, NCURSES_CONST char *fmt,...) { va_list argp; - int code = move(y, x); + int code; - if (code != ERR) { +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("mvprintw(%d,%d,%s%s)"), + y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif + + if ((code = move(y, x)) != ERR) { va_start(argp, fmt); code = vwprintw(stdscr, fmt, argp); va_end(argp); } - return code; + returnCode(code); } NCURSES_EXPORT(int) -mvwprintw -(WINDOW *win, int y, int x, NCURSES_CONST char *fmt,...) +mvwprintw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt,...) { va_list argp; - int code = wmove(win, y, x); + int code; + +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"), + y, x, win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif - if (code != ERR) { + if ((code = wmove(win, y, x)) != ERR) { va_start(argp, fmt); code = vwprintw(win, fmt, argp); va_end(argp); } - return code; + returnCode(code); } NCURSES_EXPORT(int) -vwprintw -(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) +vwprintw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) { - char *buf = _nc_printf_string(fmt, argp); + char *buf; int code = ERR; - if (buf != 0) { + T((T_CALLED("wprintw(%p,%s,%p)"), + win, _nc_visbuf(fmt), argp)); + + if ((buf = _nc_printf_string(fmt, argp)) != 0) { code = waddstr(win, buf); #if USE_SAFE_SPRINTF free(buf); #endif } - return code; + returnCode(code); } diff --git a/contrib/ncurses/ncurses/base/lib_redrawln.c b/contrib/ncurses/ncurses/base/lib_redrawln.c index dd0a51e..91a0371 100644 --- a/contrib/ncurses/ncurses/base/lib_redrawln.c +++ b/contrib/ncurses/ncurses/base/lib_redrawln.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,14 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_redrawln.c,v 1.9 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_redrawln.c,v 1.10 2001/09/29 17:41:31 tom Exp $") NCURSES_EXPORT(int) wredrawln(WINDOW *win, int beg, int num) { int i; int end; - size_t len = (win->_maxx + 1) * sizeof(chtype); + size_t len = (win->_maxx + 1); T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num)); @@ -57,9 +57,15 @@ wredrawln(WINDOW *win, int beg, int num) returnCode(ERR); end = beg + num; + if (end > curscr->_maxy + 1) + end = curscr->_maxy + 1; if (end > win->_maxy + 1) end = win->_maxy + 1; + if (len > (size_t) (curscr->_maxx + 1)) + len = (size_t) (curscr->_maxx + 1); + len *= sizeof(curscr->_line[0].text[0]); + for (i = beg; i < end; i++) { memset(curscr->_line[i + win->_begy].text + win->_begx, 0, len); _nc_make_oldhash(i + win->_begy); diff --git a/contrib/ncurses/ncurses/base/lib_refresh.c b/contrib/ncurses/ncurses/base/lib_refresh.c index bd03ce7..42c1f49 100644 --- a/contrib/ncurses/ncurses/base/lib_refresh.c +++ b/contrib/ncurses/ncurses/base/lib_refresh.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_refresh.c,v 1.28 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.31 2001/12/19 01:06:41 tom Exp $") NCURSES_EXPORT(int) wrefresh(WINDOW *win) @@ -96,7 +96,7 @@ wnoutrefresh(WINDOW *win) begx = win->_begx; begy = win->_begy; - newscr->_bkgd = win->_bkgd; + newscr->_nc_bkgd = win->_nc_bkgd; newscr->_attrs = win->_attrs; /* merge in change information from all subwindows of this window */ @@ -148,7 +148,7 @@ wnoutrefresh(WINDOW *win) last = limit_x; for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) { - if (oline->text[j] != nline->text[n]) { + if (!CharEq(oline->text[j], nline->text[n])) { nline->text[n] = oline->text[j]; CHANGED_CELL(nline, n); } diff --git a/contrib/ncurses/ncurses/base/lib_scanw.c b/contrib/ncurses/ncurses/base/lib_scanw.c index 3e1c9d0..b8a5a22 100644 --- a/contrib/ncurses/ncurses/base/lib_scanw.c +++ b/contrib/ncurses/ncurses/base/lib_scanw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,15 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_scanw.c,v 1.10 2000/12/10 02:43:27 tom Exp $") - -#if !HAVE_VSSCANF -#if defined(__QNX__) -extern int vsscanf(const char *str, const char *format, __va_list __arg); -#else -extern int vsscanf(const char *str, const char *format,...); -#endif -#endif +MODULE_ID("$Id: lib_scanw.c,v 1.11 2001/06/30 23:39:41 tom Exp $") NCURSES_EXPORT(int) vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) diff --git a/contrib/ncurses/ncurses/base/lib_screen.c b/contrib/ncurses/ncurses/base/lib_screen.c index 5e674b3..3b2d929 100644 --- a/contrib/ncurses/ncurses/base/lib_screen.c +++ b/contrib/ncurses/ncurses/base/lib_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -37,7 +37,7 @@ #include <time.h> #include <term.h> /* exit_ca_mode, non_rev_rmcup */ -MODULE_ID("$Id: lib_screen.c,v 1.17 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.19 2001/12/19 00:55:28 tom Exp $") static time_t dumptime; @@ -71,7 +71,7 @@ getwin(FILE * filep) nwin->_flags = tmp._flags & ~(_SUBWIN | _ISPAD); nwin->_attrs = tmp._attrs; - nwin->_bkgd = tmp._bkgd; + nwin->_nc_bkgd = tmp._nc_bkgd; nwin->_clear = tmp._clear; nwin->_scroll = tmp._scroll; diff --git a/contrib/ncurses/ncurses/base/lib_scroll.c b/contrib/ncurses/ncurses/base/lib_scroll.c index dcde0fc..39c62d0 100644 --- a/contrib/ncurses/ncurses/base/lib_scroll.c +++ b/contrib/ncurses/ncurses/base/lib_scroll.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * + * Author: Thomas E. Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ @@ -42,18 +43,26 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_scroll.c,v 1.20 2000/12/10 02:54:03 tom Exp $") +MODULE_ID("$Id: lib_scroll.c,v 1.23 2001/12/19 01:06:55 tom Exp $") NCURSES_EXPORT(void) -_nc_scroll_window -(WINDOW *win, int const n, NCURSES_SIZE_T const top, - NCURSES_SIZE_T const bottom, chtype blank) +_nc_scroll_window(WINDOW *win, int const n, NCURSES_SIZE_T const top, + NCURSES_SIZE_T const bottom, NCURSES_CH_T blank) { - int line, j; - size_t to_copy = (size_t) (sizeof(chtype) * (win->_maxx + 1)); + int limit; + int line; + int j; + size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1)); TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %d, %d)", win, n, top, bottom)); + if (top < 0 + || bottom < top + || bottom > win->_maxy) { + TR(TRACE_MOVE, ("nothing to scroll")); + return; + } + /* * This used to do a line-text pointer-shuffle instead of text copies. * That (a) doesn't work when the window is derived and doesn't have @@ -67,15 +76,26 @@ _nc_scroll_window /* shift n lines downwards */ if (n < 0) { - for (line = bottom; line >= top - n; line--) { - memcpy(win->_line[line].text, - win->_line[line + n].text, - to_copy); - if_USE_SCROLL_HINTS( - win->_line[line].oldindex = - win->_line[line + n].oldindex); + limit = top - n; + if (limit > win->_maxy) + limit = win->_maxy; + for (line = bottom; line >= limit; line--) { + if (line + n >= 0) { + TR(TRACE_MOVE, ("...copying %d to %d", line + n, line)); + memcpy(win->_line[line].text, + win->_line[line + n].text, + to_copy); + if_USE_SCROLL_HINTS(win->_line[line].oldindex = + win->_line[line + n].oldindex); + } else { + TR(TRACE_MOVE, ("...filling %d", line)); + for (j = 0; j <= win->_maxx; j++) + win->_line[line].text[j] = blank; + if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); + } } - for (line = top; line < top - n; line++) { + for (line = top; line < limit; line++) { + TR(TRACE_MOVE, ("...filling %d", line)); for (j = 0; j <= win->_maxx; j++) win->_line[line].text[j] = blank; if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); @@ -84,14 +104,26 @@ _nc_scroll_window /* shift n lines upwards */ if (n > 0) { - for (line = top; line <= bottom - n; line++) { - memcpy(win->_line[line].text, - win->_line[line + n].text, - to_copy); - if_USE_SCROLL_HINTS(win->_line[line].oldindex = - win->_line[line + n].oldindex); + limit = bottom - n; + if (limit < 0) + limit = 0; + for (line = top; line <= limit; line++) { + if (line + n <= win->_maxy) { + TR(TRACE_MOVE, ("...copying %d to %d", line + n, line)); + memcpy(win->_line[line].text, + win->_line[line + n].text, + to_copy); + if_USE_SCROLL_HINTS(win->_line[line].oldindex = + win->_line[line + n].oldindex); + } else { + TR(TRACE_MOVE, ("...filling %d", line)); + for (j = 0; j <= win->_maxx; j++) + win->_line[line].text[j] = blank; + if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); + } } - for (line = bottom; line > bottom - n; line--) { + for (line = bottom; line > limit; line--) { + TR(TRACE_MOVE, ("...filling %d", line)); for (j = 0; j <= win->_maxx; j++) win->_line[line].text[j] = blank; if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); @@ -105,17 +137,15 @@ wscrl(WINDOW *win, int n) { T((T_CALLED("wscrl(%p,%d)"), win, n)); - if (!win || !win->_scroll) + if (!win || !win->_scroll) { + TR(TRACE_MOVE, ("...scrollok is false")); returnCode(ERR); + } if (n == 0) returnCode(OK); - if ((n > (win->_regbottom - win->_regtop)) || - (-n > (win->_regbottom - win->_regtop))) - returnCode(ERR); - - _nc_scroll_window(win, n, win->_regtop, win->_regbottom, _nc_background(win)); + _nc_scroll_window(win, n, win->_regtop, win->_regbottom, win->_nc_bkgd); _nc_synchook(win); returnCode(OK); diff --git a/contrib/ncurses/ncurses/base/lib_set_term.c b/contrib/ncurses/ncurses/base/lib_set_term.c index e2afbec..03bb5bf 100644 --- a/contrib/ncurses/ncurses/base/lib_set_term.c +++ b/contrib/ncurses/ncurses/base/lib_set_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -43,7 +43,7 @@ #include <term.h> /* cur_term */ #include <tic.h> -MODULE_ID("$Id: lib_set_term.c,v 1.61 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.64 2002/02/10 00:21:10 tom Exp $") NCURSES_EXPORT(SCREEN *) set_term(SCREEN * screenp) @@ -268,8 +268,13 @@ _nc_setupscreen */ if (getenv("COLORFGBG") != 0) { char *p = getenv("COLORFGBG"); + TR(TRACE_CHARPUT | TRACE_MOVE, ("decoding COLORFGBG %s", p)); p = extract_fgbg(p, &(SP->_default_fg)); p = extract_fgbg(p, &(SP->_default_bg)); + if (*p) /* assume rxvt was compiled with xpm support */ + p = extract_fgbg(p, &(SP->_default_bg)); + TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d", + SP->_default_fg, SP->_default_bg)); } #endif #endif /* NCURSES_EXT_FUNCS */ @@ -319,6 +324,9 @@ _nc_setupscreen acs_chars = 0; #endif } +#if USE_WIDEC_SUPPORT + _nc_init_wacs(); +#endif _nc_init_acs(); memcpy(SP->_acs_map, acs_map, sizeof(chtype) * ACS_LEN); @@ -347,6 +355,9 @@ _nc_setupscreen newscr->_clear = TRUE; curscr->_clear = FALSE; + def_shell_mode(); + def_prog_mode(); + for (i = 0, rsp = rippedoff; rsp->line && (i < N_RIPS); rsp++, i++) { if (rsp->hook) { WINDOW *w; @@ -382,9 +393,6 @@ _nc_setupscreen return ERR; SP->_stdscr = stdscr; - def_shell_mode(); - def_prog_mode(); - return OK; } diff --git a/contrib/ncurses/ncurses/base/lib_slkclear.c b/contrib/ncurses/ncurses/base/lib_slkclear.c index 47e5245..03e6721 100644 --- a/contrib/ncurses/ncurses/base/lib_slkclear.c +++ b/contrib/ncurses/ncurses/base/lib_slkclear.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -38,7 +38,7 @@ */ #include <curses.priv.h> -MODULE_ID("$Id: lib_slkclear.c,v 1.6 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_slkclear.c,v 1.8 2001/12/19 01:07:01 tom Exp $") NCURSES_EXPORT(int) slk_clear(void) @@ -50,7 +50,7 @@ slk_clear(void) SP->_slk->hidden = TRUE; /* For simulated SLK's it's looks much more natural to inherit those attributes from the standard screen */ - SP->_slk->win->_bkgd = stdscr->_bkgd; + SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd; SP->_slk->win->_attrs = stdscr->_attrs; if (SP->_slk->win == stdscr) { returnCode(OK); diff --git a/contrib/ncurses/ncurses/base/lib_slkset.c b/contrib/ncurses/ncurses/base/lib_slkset.c index c3fb1a1..d15002f 100644 --- a/contrib/ncurses/ncurses/base/lib_slkset.c +++ b/contrib/ncurses/ncurses/base/lib_slkset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -38,7 +38,7 @@ #include <curses.priv.h> #include <ctype.h> -MODULE_ID("$Id: lib_slkset.c,v 1.6 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_slkset.c,v 1.7 2001/06/02 22:50:29 skimo Exp $") NCURSES_EXPORT(int) slk_set(int i, const char *astr, int format) @@ -55,10 +55,10 @@ slk_set(int i, const char *astr, int format) if (str == NULL) str = ""; - while (isspace(CharOf(*str))) + while (isspace(UChar(*str))) str++; /* skip over leading spaces */ p = str; - while (isprint(CharOf(*p))) + while (isprint(UChar(*p))) p++; /* The first non-print stops */ --i; /* Adjust numbering of labels */ diff --git a/contrib/ncurses/ncurses/base/lib_ungetch.c b/contrib/ncurses/ncurses/base/lib_ungetch.c index d28d3de..ba057c0 100644 --- a/contrib/ncurses/ncurses/base/lib_ungetch.c +++ b/contrib/ncurses/ncurses/base/lib_ungetch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_ungetch.c,v 1.4 2000/12/10 02:43:27 tom Exp $") +MODULE_ID("$Id: lib_ungetch.c,v 1.7 2001/12/29 23:01:09 tom Exp $") #include <fifo_defs.h> @@ -51,15 +51,17 @@ _nc_fifo_dump(void) int i; T(("head = %d, tail = %d, peek = %d", head, tail, peek)); for (i = 0; i < 10; i++) - T(("char %d = %s", i, _trace_key(SP->_fifo[i]))); + T(("char %d = %s", i, _tracechar(SP->_fifo[i]))); } #endif /* TRACE */ NCURSES_EXPORT(int) ungetch(int ch) { + T((T_CALLED("ungetch(%d)"), ch)); + if (tail == -1) - return ERR; + returnCode(ERR); if (head == -1) { head = 0; t_inc() @@ -73,5 +75,5 @@ ungetch(int ch) if (_nc_tracing & TRACE_IEVENT) _nc_fifo_dump(); #endif - return OK; + returnCode(OK); } diff --git a/contrib/ncurses/ncurses/base/lib_vline.c b/contrib/ncurses/ncurses/base/lib_vline.c index 0174baa..c19570b 100644 --- a/contrib/ncurses/ncurses/base/lib_vline.c +++ b/contrib/ncurses/ncurses/base/lib_vline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_vline.c,v 1.7 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: lib_vline.c,v 1.9 2001/06/03 00:39:24 skimo Exp $") NCURSES_EXPORT(int) wvline(WINDOW *win, chtype ch, int n) @@ -52,6 +52,7 @@ wvline(WINDOW *win, chtype ch, int n) T((T_CALLED("wvline(%p,%s,%d)"), win, _tracechtype(ch), n)); if (win) { + NCURSES_CH_T wch; row = win->_cury; col = win->_curx; end = row + n - 1; @@ -59,12 +60,14 @@ wvline(WINDOW *win, chtype ch, int n) end = win->_maxy; if (ch == 0) - ch = ACS_VLINE; - ch = _nc_render(win, ch); + SetChar(wch, ChCharOf(ACS_VLINE), ChAttrOf(ACS_VLINE)); + else + SetChar(wch, ChCharOf(ch), ChAttrOf(ch)); + wch = _nc_render(win, wch); while (end >= row) { struct ldat *line = &(win->_line[end]); - line->text[col] = ch; + line->text[col] = wch; CHANGED_CELL(line, col); end--; } diff --git a/contrib/ncurses/ncurses/base/lib_winch.c b/contrib/ncurses/ncurses/base/lib_winch.c index 236b11a..18da9c5 100644 --- a/contrib/ncurses/ncurses/base/lib_winch.c +++ b/contrib/ncurses/ncurses/base/lib_winch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 <curses.priv.h> -MODULE_ID("$Id: lib_winch.c,v 1.4 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: lib_winch.c,v 1.5 2001/06/02 23:42:08 skimo Exp $") NCURSES_EXPORT(chtype) winch(WINDOW *win) { T((T_CALLED("winch(%p)"), win)); if (win != 0) { - returnChar(win->_line[win->_cury].text[win->_curx]); + returnChar(CharOf(win->_line[win->_cury].text[win->_curx]) | + AttrOf(win->_line[win->_cury].text[win->_curx])); } else { returnChar(0); } diff --git a/contrib/ncurses/ncurses/base/lib_window.c b/contrib/ncurses/ncurses/base/lib_window.c index 9cef79c..943f6e0 100644 --- a/contrib/ncurses/ncurses/base/lib_window.c +++ b/contrib/ncurses/ncurses/base/lib_window.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +39,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_window.c,v 1.15 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: lib_window.c,v 1.18 2001/12/19 01:07:15 tom Exp $") NCURSES_EXPORT(void) _nc_synchook(WINDOW *win) @@ -98,7 +98,8 @@ wsyncup(WINDOW *win) { WINDOW *wp; - if (win && win->_parent) + T((T_CALLED("wsyncup(%p)"), win)); + if (win && win->_parent) { for (wp = win; wp->_parent; wp = wp->_parent) { int y; WINDOW *pp = wp->_parent; @@ -118,6 +119,8 @@ wsyncup(WINDOW *win) } } } + } + returnVoid; } NCURSES_EXPORT(void) @@ -125,6 +128,8 @@ wsyncdown(WINDOW *win) /* mark changed every cell in win that is changed in any of its ancestors */ /* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */ { + T((T_CALLED("wsyncdown(%p)"), win)); + if (win && win->_parent) { WINDOW *pp = win->_parent; int y; @@ -153,6 +158,7 @@ wsyncdown(WINDOW *win) } } } + returnVoid; } NCURSES_EXPORT(void) @@ -160,9 +166,12 @@ wcursyncup(WINDOW *win) /* sync the cursor in all derived windows to its value in the base window */ { WINDOW *wp; + + T((T_CALLED("wcursyncup(%p)"), win)); for (wp = win; wp && wp->_parent; wp = wp->_parent) { wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx); } + returnVoid; } NCURSES_EXPORT(WINDOW *) @@ -177,7 +186,7 @@ dupwin(WINDOW *win) if ((win == NULL) || ((nwin = newwin(win->_maxy + 1, win->_maxx + 1, win->_begy, - win->_begx)) == NULL)) + win->_begx)) == NULL)) returnWin(0); nwin->_curx = win->_curx; @@ -194,7 +203,7 @@ dupwin(WINDOW *win) */ nwin->_attrs = win->_attrs; - nwin->_bkgd = win->_bkgd; + nwin->_nc_bkgd = win->_nc_bkgd; nwin->_clear = win->_clear; nwin->_scroll = win->_scroll; diff --git a/contrib/ncurses/ncurses/base/resizeterm.c b/contrib/ncurses/ncurses/base/resizeterm.c index 303aa5e..f454b20 100644 --- a/contrib/ncurses/ncurses/base/resizeterm.c +++ b/contrib/ncurses/ncurses/base/resizeterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,39 +41,34 @@ #include <curses.priv.h> #include <term.h> -MODULE_ID("$Id: resizeterm.c,v 1.9 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: resizeterm.c,v 1.13 2002/02/02 19:26:27 tom Exp $") + +NCURSES_EXPORT(bool) +is_term_resized(int ToLines, int ToCols) +{ + return (ToLines != screen_lines + || ToCols != screen_columns); +} /* - * This function reallocates NCURSES window structures. It is invoked in - * response to a SIGWINCH interrupt. Other user-defined windows may also need - * to be reallocated. - * - * Because this performs memory allocation, it should not (in general) be - * invoked directly from the signal handler. + * This function reallocates NCURSES window structures, with no side-effects + * such as ungetch(). */ NCURSES_EXPORT(int) -resizeterm(int ToLines, int ToCols) +resize_term(int ToLines, int ToCols) { int stolen = screen_lines - SP->_lines_avail; int bottom = screen_lines + SP->_topstolen - stolen; - T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"), + T((T_CALLED("resize_term(%d,%d) old(%d,%d)"), ToLines, ToCols, screen_lines, screen_columns)); - SP->_sig_winch = FALSE; - - if (ToLines != screen_lines - || ToCols != screen_columns) { + if (is_term_resized(ToLines, ToCols)) { WINDOWLIST *wp; -#if USE_SIGWINCH - ungetch(KEY_RESIZE); /* so application can know this */ - clearok(curscr, TRUE); /* screen contents are unknown */ -#endif - for (wp = _nc_windows; wp != 0; wp = wp->next) { - WINDOW *win = wp->win; + WINDOW *win = &(wp->win); int myLines = win->_maxy + 1; int myCols = win->_maxx + 1; @@ -122,3 +117,35 @@ resizeterm(int ToLines, int ToCols) returnCode(OK); } + +/* + * This function reallocates NCURSES window structures. It is invoked in + * response to a SIGWINCH interrupt. Other user-defined windows may also need + * to be reallocated. + * + * Because this performs memory allocation, it should not (in general) be + * invoked directly from the signal handler. + */ +NCURSES_EXPORT(int) +resizeterm(int ToLines, int ToCols) +{ + int result = OK; + + SP->_sig_winch = FALSE; + + T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"), + ToLines, ToCols, + screen_lines, screen_columns)); + + if (is_term_resized(ToLines, ToCols)) { + +#if USE_SIGWINCH + ungetch(KEY_RESIZE); /* so application can know this */ + clearok(curscr, TRUE); /* screen contents are unknown */ +#endif + + result = resize_term(ToLines, ToCols); + } + + returnCode(result); +} diff --git a/contrib/ncurses/ncurses/base/safe_sprintf.c b/contrib/ncurses/ncurses/base/safe_sprintf.c index e534776..cb48365 100644 --- a/contrib/ncurses/ncurses/base/safe_sprintf.c +++ b/contrib/ncurses/ncurses/base/safe_sprintf.c @@ -33,7 +33,7 @@ #include <curses.priv.h> #include <ctype.h> -MODULE_ID("$Id: safe_sprintf.c,v 1.13 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: safe_sprintf.c,v 1.14 2001/07/08 00:58:34 tom Exp $") #if USE_SAFE_SPRINTF @@ -84,7 +84,7 @@ _nc_printf_length(const char *fmt, va_list ap) while (*++fmt != '\0' && len >= 0 && !done) { format[f++] = *fmt; - if (isdigit(*fmt)) { + if (isdigit(UChar(*fmt))) { int num = *fmt - '0'; if (state == Flags && num != 0) state = Width; @@ -108,7 +108,7 @@ _nc_printf_length(const char *fmt, va_list ap) } sprintf(&format[--f], "%d", ival); f = strlen(format); - } else if (isalpha(*fmt)) { + } else if (isalpha(UChar(*fmt))) { done = TRUE; switch (*fmt) { case 'Z': /* FALLTHRU */ diff --git a/contrib/ncurses/ncurses/base/sigaction.c b/contrib/ncurses/ncurses/base/sigaction.c index 8819638..8ba8629 100644 --- a/contrib/ncurses/ncurses/base/sigaction.c +++ b/contrib/ncurses/ncurses/base/sigaction.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,7 +33,6 @@ #include <curses.priv.h> -#include <signal.h> #include <SigAction.h> /* This file provides sigaction() emulation using sigvec() */ @@ -41,7 +40,7 @@ #if !HAVE_SIGACTION && HAVE_SIGVEC -MODULE_ID("$Id: sigaction.c,v 1.11 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: sigaction.c,v 1.13 2002/05/18 19:56:26 tom Exp $") NCURSES_EXPORT(int) sigaction diff --git a/contrib/ncurses/ncurses/base/tries.c b/contrib/ncurses/ncurses/base/tries.c index 04f8b91..fe7d93e 100644 --- a/contrib/ncurses/ncurses/base/tries.c +++ b/contrib/ncurses/ncurses/base/tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +39,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: tries.c,v 1.14 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: tries.c,v 1.15 2001/12/16 00:50:40 tom Exp $") /* * Expand a keycode into the string that it corresponds to, returning null if @@ -73,7 +73,7 @@ _nc_expand_try *((unsigned char *) (result + len)) = 128; #ifdef TRACE if (len == 0) - _tracef("expand_key %s %s", _trace_key(code), _nc_visbuf(result)); + _tracef("expand_key %s %s", _tracechar(code), _nc_visbuf(result)); #endif } return result; diff --git a/contrib/ncurses/ncurses/base/vsscanf.c b/contrib/ncurses/ncurses/base/vsscanf.c index 70d0517..65794b7 100644 --- a/contrib/ncurses/ncurses/base/vsscanf.c +++ b/contrib/ncurses/ncurses/base/vsscanf.c @@ -1,3 +1,35 @@ +/**************************************************************************** + * Copyright (c) 1998,2000,2001,2002 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. * + ****************************************************************************/ + +/**************************************************************************** + * State-machine fallback written by Thomas E. Dickey 2002 * + ****************************************************************************/ + /* * This function is needed to support vwscanw */ @@ -6,14 +38,132 @@ #if !HAVE_VSSCANF -MODULE_ID("$Id: vsscanf.c,v 1.12 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: vsscanf.c,v 1.15 2002/02/03 00:49:45 tom Exp $") + +#if !(HAVE_VFSCANF || HAVE__DOSCAN) + +#include <ctype.h> + +#define L_SQUARE '[' +#define R_SQUARE ']' + +typedef enum { + cUnknown + ,cError /* anything that isn't ANSI */ + ,cAssigned + ,cChar + ,cInt + ,cFloat + ,cDouble + ,cPointer + ,cLong + ,cShort + ,cRange + ,cString +} ChunkType; + +typedef enum { + oUnknown + ,oShort + ,oLong +} OtherType; + +typedef enum { + sUnknown + ,sPercent /* last was '%' beginning a format */ + ,sNormal /* ...somewhere in the middle */ + ,sLeft /* last was left square bracket beginning a range */ + ,sRange /* ...somewhere in the middle */ + ,sFinal /* last finished a format */ +} ScanState; + +static ChunkType +final_ch(int ch, OtherType other) +{ + ChunkType result = cUnknown; + + switch (ch) { + case 'c': + if (other == oUnknown) + result = cChar; + else + result = cError; + break; + case 'd': + case 'i': + case 'X': + case 'x': + switch (other) { + case oUnknown: + result = cInt; + break; + case oShort: + result = cShort; + break; + case oLong: + result = cLong; + break; + } + break; + case 'E': + case 'e': + case 'f': + case 'g': + switch (other) { + case oUnknown: + result = cFloat; + break; + case oShort: + result = cError; + break; + case oLong: + result = cDouble; + break; + } + break; + case 'n': + if (other == oUnknown) + result = cAssigned; + else + result = cError; + break; + case 'p': + if (other == oUnknown) + result = cPointer; + else + result = cError; + break; + case 's': + if (other == oUnknown) + result = cString; + else + result = cError; + break; + } + return result; +} + +static OtherType +other_ch(int ch) +{ + OtherType result = oUnknown; + switch (ch) { + case 'h': + result = oShort; + break; + case 'l': + result = oLong; + break; + } + return result; +} +#endif -#if defined(_IOREAD) && defined(_NFILE) /*VARARGS2*/ NCURSES_EXPORT(int) -vsscanf -(const char *str, const char *format, va_list ap) +vsscanf(const char *str, const char *format, va_list ap) { +#if HAVE_VFSCANF || HAVE__DOSCAN /* * This code should work on anything descended from AT&T SVr1. */ @@ -29,22 +179,171 @@ vsscanf #else return (_doscan(&strbuf, format, ap)); #endif -} #else -/*VARARGS2*/ -NCURSES_EXPORT(int) -vsscanf -(const char *str, const char *format, va_list ap) -{ + static int can_convert = -1; + + int assigned = 0; + int consumed = 0; + + T((T_CALLED("vsscanf(%s,%s,...)"), + _nc_visbuf2(1, str), + _nc_visbuf2(2, format))); + /* - * You don't have a native vsscanf(3), and you don't have System-V - * compatible stdio internals. You're probably using a BSD - * older than 4.4 or a really old Linux. You lose. Upgrade - * to a current C library to win. + * This relies on having a working "%n" format conversion. Check if it + * works. Only very old C libraries do not support it. + * + * FIXME: move this check into the configure script. */ - return -1; /* not implemented */ -} + if (can_convert < 0) { + int check1; + int check2; + if (sscanf("123", "%d%n", &check1, &check2) > 0 + && check1 == 123 + && check2 == 3) { + can_convert = 1; + } else { + can_convert = 0; + } + } + + if (can_convert) { + size_t len_fmt = strlen(format) + 32; + char *my_fmt = malloc(len_fmt); + ChunkType other, chunk, check; + ScanState state; + unsigned n; + int eaten; + void *pointer; + + if (my_fmt != 0) { + /* + * Split the original format into chunks, adding a "%n" to the end + * of each (except of course if it used %n), and use that + * information to decide where to start scanning the next chunk. + * + * FIXME: does %n count bytes or characters? If the latter, this + * will require further work for multibyte strings. + */ + while (*format != '\0') { + /* find a chunk */ + state = sUnknown; + chunk = cUnknown; + other = cUnknown; + pointer = 0; + for (n = 0; format[n] != 0 && state != sFinal; ++n) { + my_fmt[n] = format[n]; + switch (state) { + case sUnknown: + if (format[n] == '%') + state = sPercent; + break; + case sPercent: + if (format[n] == '%') { + state = sUnknown; + } else if (format[n] == L_SQUARE) { + state = sLeft; + } else { + state = sNormal; + --n; + } + break; + case sLeft: + state = sRange; + if (format[n] == '^') { + ++n; + my_fmt[n] = format[n]; + } + break; + case sRange: + if (format[n] == R_SQUARE) { + state = sFinal; + chunk = cRange; + } + break; + case sNormal: + if (format[n] == '*') { + state = sUnknown; + } else { + if ((check = final_ch(format[n], other)) != cUnknown) { + state = sFinal; + chunk = check; + } else if ((check = other_ch(format[n])) != oUnknown) { + other = check; + } else if (isalpha(format[n])) { + state = sFinal; + chunk = cError; + } + } + break; + case sFinal: + break; + } + } + my_fmt[n] = '\0'; + format += n; + + if (chunk == cUnknown + || chunk == cError) { + if (assigned == 0) + assigned = EOF; + break; + } + + /* add %n, if the format was not that */ + if (chunk != cAssigned) { + strcat(my_fmt, "%n"); + } + + switch (chunk) { + case cAssigned: + strcat(my_fmt, "%n"); + pointer = &eaten; + break; + case cInt: + pointer = va_arg(ap, int *); + break; + case cShort: + pointer = va_arg(ap, short *); + break; + case cFloat: + pointer = va_arg(ap, float *); + break; + case cDouble: + pointer = va_arg(ap, double *); + break; + case cLong: + pointer = va_arg(ap, long *); + break; + case cPointer: + pointer = va_arg(ap, void *); + break; + case cChar: + case cRange: + case cString: + pointer = va_arg(ap, char *); + break; + case cError: + case cUnknown: + break; + } + /* do the conversion */ + T(("...converting chunk #%d type %d(%s,%s)", + assigned + 1, chunk, + _nc_visbuf2(1, str + consumed), + _nc_visbuf2(2, my_fmt))); + if (sscanf(str + consumed, my_fmt, pointer, &eaten) > 0) + consumed += eaten; + else + break; + ++assigned; + } + free(my_fmt); + } + } + returnCode(assigned); #endif +} #else extern NCURSES_EXPORT(void) diff --git a/contrib/ncurses/ncurses/base/wresize.c b/contrib/ncurses/ncurses/base/wresize.c index 4889ee0..fa97a2b 100644 --- a/contrib/ncurses/ncurses/base/wresize.c +++ b/contrib/ncurses/ncurses/base/wresize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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 * @@ -32,7 +32,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: wresize.c,v 1.18 2000/12/10 02:43:28 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.21 2002/05/11 19:36:29 tom Exp $") /* * Reallocate a curses WINDOW struct to either shrink or grow to the specified @@ -42,7 +42,7 @@ MODULE_ID("$Id: wresize.c,v 1.18 2000/12/10 02:43:28 tom Exp $") #define DOALLOC(p,t,n) typeRealloc(t, n, p) #define ld_ALLOC(p,n) DOALLOC(p,struct ldat,n) -#define c_ALLOC(p,n) DOALLOC(p,chtype,n) +#define c_ALLOC(p,n) DOALLOC(p,NCURSES_CH_T,n) NCURSES_EXPORT(int) wresize(WINDOW *win, int ToLines, int ToCols) @@ -50,7 +50,7 @@ wresize(WINDOW *win, int ToLines, int ToCols) register int row; int size_x, size_y; struct ldat *pline; - chtype blank; + NCURSES_CH_T blank; #ifdef TRACE T((T_CALLED("wresize(%p,%d,%d)"), win, ToLines, ToCols)); @@ -117,9 +117,9 @@ wresize(WINDOW *win, int ToLines, int ToCols) /* * Adjust the width of the columns: */ - blank = _nc_background(win); + blank = win->_nc_bkgd; for (row = 0; row <= ToLines; row++) { - chtype *s = win->_line[row].text; + NCURSES_CH_T *s = win->_line[row].text; int begin = (s == 0) ? 0 : size_x + 1; int end = ToCols; @@ -130,7 +130,7 @@ wresize(WINDOW *win, int ToLines, int ToCols) win->_line[row].text = s = c_ALLOC(s, ToCols + 1); if (win->_line[row].text == 0) returnCode(ERR); - } else if (s == 0) { + } else { win->_line[row].text = s = &pline[win->_pary + row].text[win->_parx]; } @@ -138,14 +138,15 @@ wresize(WINDOW *win, int ToLines, int ToCols) if (end >= begin) { /* growing */ if (win->_line[row].firstchar < begin) win->_line[row].firstchar = begin; - win->_line[row].lastchar = ToCols; - do { - s[end] = blank; - } while (--end >= begin); + if (!(win->_flags & _SUBWIN)) { + do { + s[end] = blank; + } while (--end >= begin); + } } else { /* shrinking */ win->_line[row].firstchar = 0; - win->_line[row].lastchar = ToCols; } + win->_line[row].lastchar = ToCols; } } diff --git a/contrib/ncurses/ncurses/curses.priv.h b/contrib/ncurses/ncurses/curses.priv.h index 042fdd1..d901eca 100644 --- a/contrib/ncurses/ncurses/curses.priv.h +++ b/contrib/ncurses/ncurses/curses.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,11 +29,12 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * + * and: Thomas E. Dickey 1996-2002 * ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.171 2000/12/10 00:13:52 tom Exp $ + * $Id: curses.priv.h,v 1.218 2002/05/18 19:48:38 tom Exp $ * * curses.priv.h * @@ -110,6 +111,9 @@ extern int errno; #define USE_FUNC_POLL 0 #endif +/* include signal.h before curses.h to work-around defect in glibc 2.1.3 */ +#include <signal.h> + /* Alessandro Rubini's GPM (general-purpose mouse) */ #if HAVE_LIBGPM && HAVE_GPM_H #define USE_GPM_SUPPORT 1 @@ -140,7 +144,7 @@ extern int errno; #undef HAVE_SIZECHANGE #endif -#if HAVE_SIZECHANGE +#if HAVE_SIZECHANGE && defined(SIGWINCH) #define USE_SIZECHANGE 1 #else #undef USE_SIGWINCH @@ -214,6 +218,7 @@ struct tries { #define L_BRACE '{' #define R_BRACE '}' #define S_QUOTE '\'' +#define D_QUOTE '"' /* * Structure for palette tables @@ -233,8 +238,25 @@ color_t; #define WINDOWLIST struct _win_list +#if USE_WIDEC_SUPPORT +#define _nc_bkgd _bkgrnd +#else +#undef _XOPEN_SOURCE_EXTENDED +#define _nc_bkgd _bkgd +#define wgetbkgrnd(win, wch) *wch = win->_bkgd +#define wbkgrnd wbkgd +#endif + #include <curses.h> /* we'll use -Ipath directive to get the right one! */ +struct ldat +{ + NCURSES_CH_T *text; /* text of the line */ + NCURSES_SIZE_T firstchar; /* first changed character in the line */ + NCURSES_SIZE_T lastchar; /* last changed character in the line */ + NCURSES_SIZE_T oldindex; /* index of the line at last update */ +}; + /* * Structure for soft labels. */ @@ -260,6 +282,12 @@ typedef struct { chtype attr; /* soft label attribute */ } SLK; +typedef struct { + unsigned long hashval; + int oldcount, newcount; + int oldindex, newindex; +} HASHMAP; + struct screen { int _ifd; /* input file ptr for screen */ FILE *_ofp; /* output file ptr for screen */ @@ -278,7 +306,8 @@ struct screen { struct tries *_keytry; /* "Try" for use with keypad mode */ struct tries *_key_ok; /* Disabled keys via keyok(,FALSE) */ - int _tried; /* keypad mode was initialized */ + bool _tried; /* keypad mode was initialized */ + bool _keypad_on; /* keypad mode is currently on */ unsigned int _fifo[FIFO_SIZE]; /* input push-back buffer */ short _fifohead, /* head of fifo queue */ @@ -287,7 +316,7 @@ struct screen { _fifohold; /* set if breakout marked */ int _endwin; /* are we out of window mode? */ - unsigned long _current_attr; /* terminal attribute current set */ + attr_t _current_attr; /* terminal attribute current set */ int _coloron; /* is color enabled? */ int _cursor; /* visibility of the cursor */ int _cursrow; /* physical cursor row */ @@ -411,6 +440,8 @@ struct screen { /* hashes for old and new lines */ unsigned long *oldhash, *newhash; + HASHMAP *hashtab; + int hashtab_len; bool _cleanup; /* cleanup after int/quit signal */ int (*_outch)(int); /* output handler if not putc */ @@ -422,9 +453,19 @@ extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain; #include <nomacros.h> #endif +/* + * The margins are used in resizeterm() to retain the original layout after + * resizing. + */ WINDOWLIST { WINDOWLIST *next; - WINDOW *win; +#if HAVE_RESIZETERM + int l_margin; + int r_margin; + int t_margin; + int b_margin; +#endif + WINDOW win; }; typedef struct { @@ -486,11 +527,89 @@ typedef struct { #define O_BINARY 0 #endif -#define CharOf(c) ((unsigned char)(c)) -#define TextOf(c) ((c) & (chtype)A_CHARTEXT) -#define AttrOf(c) ((c) & (chtype)A_ATTRIBUTES) - -#define BLANK (' '|A_NORMAL) +#define UChar(c) ((unsigned char)(c)) +#define ChCharOf(c) ((c) & (chtype)A_CHARTEXT) +#define ChAttrOf(c) ((c) & (chtype)A_ATTRIBUTES) + +#if USE_WIDEC_SUPPORT /* { */ +#define CharOf(c) ((c).chars[0]) +#define AttrOf(c) ((c).attr) +#define AddAttr(c,a) (c).attr |= a +#define RemAttr(c,a) (c).attr &= ~(a) +#define SetAttr(c,a) (c).attr = a +#define NewChar(ch) { ChAttrOf(ch), { ChCharOf(ch) } } +#define NewChar2(c,a) { a, { c } } +#define CharEq(a,b) (!memcmp(&a, &b, sizeof(a))) +#define SetChar(ch,c,a) do { \ + NCURSES_CH_T *_cp = &ch; \ + memset(_cp,0,sizeof(ch)); _cp->chars[0] = c; _cp->attr = a; \ + } while (0) +#define CHREF(wch) (&wch) +#define CHDEREF(wch) (*wch) +#define ARG_CH_T NCURSES_CH_T * +#define CARG_CH_T const NCURSES_CH_T * +#define PUTC_DATA char PUTC_buf[MB_LEN_MAX]; int PUTC_i, PUTC_n; \ + mbstate_t PUT_st; wchar_t PUTC_ch +#define PUTC(ch,b) do { if(!isnac(ch)) { \ + memset (&PUT_st, '\0', sizeof (PUT_st)); \ + PUTC_i = 0; \ + do { \ + PUTC_ch = PUTC_i < CCHARW_MAX ? \ + (ch).chars[PUTC_i] : L'\0'; \ + PUTC_n = wcrtomb(PUTC_buf, \ + (ch).chars[PUTC_i], &PUT_st); \ + if (PUTC_ch == L'\0') \ + --PUTC_n; \ + if (PUTC_n <= 0) \ + break; \ + fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b); \ + ++PUTC_i; \ + } while (PUTC_ch != L'\0'); \ + } } while (0) + +#define BLANK { WA_NORMAL, ' ' } +#define ISBLANK(ch) ((ch).chars[0] == L' ' && (ch).chars[1] == L'\0') + +#define WA_NAC 1 +#define isnac(ch) (AttrOf(ch) & WA_NAC) +#define if_WIDEC(code) code +#define Charable(ch) (!isnac(ch) && \ + (ch).chars[1] == L'\0' && \ + (wctob(CharOf(ch)) == (char)CharOf(ch))) + +#define L(ch) L ## ch +#else /* }{ */ +#define CharOf(c) ChCharOf(c) +#define AttrOf(c) ChAttrOf(c) +#define AddAttr(c,a) c |= a +#define RemAttr(c,a) c &= ~(a & A_ATTRIBUTES) +#define SetAttr(c,a) c = (c & ~A_ATTRIBUTES) | a +#define NewChar(ch) (ch) +#define NewChar2(c,a) (c | a) +#define CharEq(a,b) (a == b) +#define SetChar(ch,c,a) ch = c | a +#define CHREF(wch) wch +#define CHDEREF(wch) wch +#define ARG_CH_T NCURSES_CH_T +#define CARG_CH_T NCURSES_CH_T +#define PUTC_DATA int data = 0 +#define PUTC(a,b) do { data = CharOf(ch); putc(data,b); } while (0) + +#define BLANK (' '|A_NORMAL) +#define ISBLANK(ch) (CharOf(ch) == ' ') + +#define isnac(ch) (0) +#define if_WIDEC(code) /* nothing */ + +#define L(ch) ch +#endif /* } */ + +#define AttrOfD(ch) AttrOf(CHDEREF(ch)) +#define CharOfD(ch) CharOf(CHDEREF(ch)) +#define SetChar2(wch,ch) SetChar(wch,ChCharOf(ch),ChAttrOf(ch)) + +#define BLANK_ATTR A_NORMAL +#define BLANK_TEXT L(' ') #define CHANGED -1 @@ -532,9 +651,9 @@ typedef struct { * instrument the public functions so that the traces can be easily transformed * into regression scripts. */ -#define T_CALLED(fmt) "called " fmt -#define T_CREATE(fmt) "create " fmt -#define T_RETURN(fmt) "return " fmt +#define T_CALLED(fmt) "called {" fmt +#define T_CREATE(fmt) "create :" fmt +#define T_RETURN(fmt) "return }" fmt #ifdef TRACE #define TR(n, a) if (_nc_tracing & (n)) _tracef a @@ -545,16 +664,26 @@ typedef struct { #define returnChar(code) TRACE_RETURN(code,chtype) #define returnCode(code) TRACE_RETURN(code,int) #define returnPtr(code) TRACE_RETURN(code,ptr) +#define returnSP(code) TRACE_RETURN(code,sp) #define returnVoid T((T_RETURN(""))); return #define returnWin(code) TRACE_RETURN(code,win) +extern NCURSES_EXPORT(SCREEN *) _nc_retrace_sp (SCREEN *); extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *); extern NCURSES_EXPORT(attr_t) _nc_retrace_attr_t (attr_t); extern NCURSES_EXPORT(attr_t) _nc_retrace_chtype (chtype); extern NCURSES_EXPORT(char *) _nc_retrace_ptr (char *); -extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace; +extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list); +extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype); extern NCURSES_EXPORT(int) _nc_retrace_int (int); -extern NCURSES_EXPORT_VAR(long) _nc_outchars; extern NCURSES_EXPORT(void) _nc_fifo_dump (void); +extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace; +extern NCURSES_EXPORT_VAR(long) _nc_outchars; +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +#if USE_WIDEC_SUPPORT +extern NCURSES_EXPORT(const char *) _nc_viswbuf2 (int, const wchar_t *); +extern NCURSES_EXPORT(const char *) _nc_viscbuf2 (int, const cchar_t *, int); +extern NCURSES_EXPORT(const char *) _nc_viscbuf (const cchar_t *, int); +#endif #else #define T(a) #define TR(n, a) @@ -563,14 +692,17 @@ extern NCURSES_EXPORT(void) _nc_fifo_dump (void); #define returnChar(code) return code #define returnCode(code) return code #define returnPtr(code) return code +#define returnSP(code) return code #define returnVoid return #define returnWin(code) return code #endif -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; -extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); +#define empty_module(name) \ +extern NCURSES_EXPORT(void) name (void); \ + NCURSES_EXPORT(void) name (void) { } -#define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch)) +/* used in _nc_visbuf() whether or not we're tracing */ +extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); #define ALL_BUT_COLOR ((chtype)~(A_COLOR)) #define IGNORE_COLOR_OFF FALSE @@ -617,13 +749,12 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); : INFINITY))) #if USE_XMC_SUPPORT -#define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) { \ +#define UpdateAttrs(a) if (SP->_current_attr != (a)) { \ attr_t chg = SP->_current_attr; \ - vidattr(AttrOf(c)); \ + vidattr((a)); \ if (magic_cookie_glitch > 0 \ && XMC_CHANGES((chg ^ SP->_current_attr))) { \ - TR(TRACE_ATTRS, \ - ("%s @%d before glitch %d,%d", \ + T(("%s @%d before glitch %d,%d", \ __FILE__, __LINE__, \ SP->_cursrow, \ SP->_curscol)); \ @@ -631,8 +762,8 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); } \ } #else -#define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) \ - vidattr(AttrOf(c)) +#define UpdateAttrs(a) if (SP->_current_attr != (a)) \ + vidattr((a)); #endif #if NCURSES_EXPANDED && NCURSES_EXT_FUNCS @@ -681,6 +812,14 @@ extern NCURSES_EXPORT(void) _nc_linedump (void); extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */ extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int); /* used by 'tack' program */ +/* lib_addstr.c */ +#if USE_WIDEC_SUPPORT +extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *); +#endif + +/* lib_getch.c */ +extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int); + /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ @@ -700,6 +839,11 @@ extern NCURSES_EXPORT(int) _nc_has_mouse (void); /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ +/* lib_wacs.c */ +#if USE_WIDEC_SUPPORT +extern NCURSES_EXPORT(void) _nc_init_wacs(void); +#endif + typedef struct { char *s_head; char *s_tail; @@ -707,11 +851,11 @@ typedef struct { } string_desc; /* strings.c */ -extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc * dst, char *src, size_t len); -extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc * dst, size_t len); -extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc * dst, string_desc * src); -extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc * dst, const char *src); -extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc * dst, const char *src); +extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc *, char *, size_t); +extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc *, size_t); +extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, string_desc *); +extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc *, const char *); +extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc *, const char *); extern NCURSES_EXPORT(void) _nc_mvcur_init (void); extern NCURSES_EXPORT(void) _nc_mvcur_resume (void); @@ -729,30 +873,29 @@ extern NCURSES_EXPORT(char *) _nc_strstr (const char *, const char *); #endif /* safe_sprintf.c */ -extern NCURSES_EXPORT(char *) _nc_printf_string (const char *fmt, va_list ap); +extern NCURSES_EXPORT(char *) _nc_printf_string (const char *, va_list); /* tries.c */ -extern NCURSES_EXPORT(void) _nc_add_to_try (struct tries **tree, const char *str, unsigned short code); -extern NCURSES_EXPORT(char *) _nc_expand_try (struct tries *tree, unsigned short code, int *count, size_t len); -extern NCURSES_EXPORT(int) _nc_remove_key (struct tries **tree, unsigned short code); -extern NCURSES_EXPORT(int) _nc_remove_string (struct tries **tree, char *string); +extern NCURSES_EXPORT(void) _nc_add_to_try (struct tries **, const char *, unsigned short); +extern NCURSES_EXPORT(char *) _nc_expand_try (struct tries *, unsigned short, int *, size_t); +extern NCURSES_EXPORT(int) _nc_remove_key (struct tries **, unsigned short); +extern NCURSES_EXPORT(int) _nc_remove_string (struct tries **, char *); /* elsewhere ... */ extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int); extern NCURSES_EXPORT(char *) _nc_home_terminfo (void); extern NCURSES_EXPORT(char *) _nc_trace_buf (int, size_t); -extern NCURSES_EXPORT(chtype) _nc_background (WINDOW *); -extern NCURSES_EXPORT(chtype) _nc_render (WINDOW *, chtype); +extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T); extern NCURSES_EXPORT(int) _nc_access (const char *, int); extern NCURSES_EXPORT(int) _nc_baudrate (int); -extern NCURSES_EXPORT(int) _nc_freewin (WINDOW *win); +extern NCURSES_EXPORT(int) _nc_freewin (WINDOW *); extern NCURSES_EXPORT(int) _nc_getenv_num (const char *); extern NCURSES_EXPORT(int) _nc_keypad (bool); extern NCURSES_EXPORT(int) _nc_ospeed (int); extern NCURSES_EXPORT(int) _nc_outch (int); extern NCURSES_EXPORT(int) _nc_setupscreen (short, short const, FILE *); extern NCURSES_EXPORT(int) _nc_timed_wait (int, int, int *); -extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const chtype); +extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T); extern NCURSES_EXPORT(void) _nc_do_color (int, int, bool, int (*)(int)); extern NCURSES_EXPORT(void) _nc_flush (void); extern NCURSES_EXPORT(void) _nc_freeall (void); @@ -763,18 +906,27 @@ extern NCURSES_EXPORT(void) _nc_make_oldhash (int i); extern NCURSES_EXPORT(void) _nc_outstr (const char *str); extern NCURSES_EXPORT(void) _nc_scroll_oldhash (int n, int top, int bot); extern NCURSES_EXPORT(void) _nc_scroll_optimize (void); -extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, short const, short const, chtype); +extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, short const, short const, NCURSES_CH_T); extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, bool); extern NCURSES_EXPORT(void) _nc_signal_handler (bool); -extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *win); -extern NCURSES_EXPORT(void) _nc_trace_tries (struct tries *tree); +extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *); +extern NCURSES_EXPORT(void) _nc_trace_tries (struct tries *); #if USE_SIZECHANGE extern NCURSES_EXPORT(void) _nc_update_screensize (void); #endif -#if USE_WIDEC_SUPPORT -extern NCURSES_EXPORT(int) _nc_utf8_outch (int); +#if HAVE_RESIZETERM +extern NCURSES_EXPORT(void) _nc_resize_margins (WINDOW *); +#else +#define _nc_resize_margins(wp) /* nothing */ +#endif + +/* + * Not everyone has vsscanf(), but we'd like to use it for scanw(). + */ +#if !HAVE_VSSCANF +extern int vsscanf(const char *str, const char *format, va_list __arg); #endif /* scroll indices */ @@ -805,10 +957,9 @@ extern NCURSES_EXPORT_VAR(SCREEN *) SP; #endif /* - * We don't want to use the lines or columns capabilities internally, - * because if the application is running multiple screens under - * X windows, it's quite possible they could all have type xterm - * but have different sizes! So... + * We don't want to use the lines or columns capabilities internally, because + * if the application is running multiple screens under X, it's quite possible + * they could all have type xterm but have different sizes! So... */ #define screen_lines SP->_lines #define screen_columns SP->_columns diff --git a/contrib/ncurses/ncurses/fifo_defs.h b/contrib/ncurses/ncurses/fifo_defs.h index f4dd7be..6779957 100644 --- a/contrib/ncurses/ncurses/fifo_defs.h +++ b/contrib/ncurses/ncurses/fifo_defs.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2002 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,7 +34,7 @@ /* * Common macros for lib_getch.c, lib_ungetch.c * - * $Id: fifo_defs.h,v 1.2 1998/02/11 12:13:56 tom Exp $ + * $Id: fifo_defs.h,v 1.4 2002/03/16 20:47:50 tom Exp $ */ #ifndef FIFO_DEFS_H @@ -46,13 +46,13 @@ #define peek SP->_fifopeek #define h_inc() { head == FIFO_SIZE-1 ? head = 0 : head++; if (head == tail) head = -1, tail = 0;} -#define h_dec() { head == 0 ? head = FIFO_SIZE-1 : head--; if (head == tail) tail = -1;} +#define h_dec() { head == 0 ? head = FIFO_SIZE-1 : head--; if (head == tail) tail = -1;} #define t_inc() { tail == FIFO_SIZE-1 ? tail = 0 : tail++; if (tail == head) tail = -1;} -#define t_dec() { tail == 0 ? tail = FIFO_SIZE-1 : tail--; if (head == tail) fifo_clear();} +#define t_dec() { tail == 0 ? tail = FIFO_SIZE-1 : tail--; if (head == tail) fifo_clear();} #define p_inc() { peek == FIFO_SIZE-1 ? peek = 0 : peek++;} -#define cooked_key_in_fifo() (head!=-1 && peek!=head) -#define raw_key_in_fifo() (head!=-1 && peek!=tail) +#define cooked_key_in_fifo() ((head != -1) && (peek != head)) +#define raw_key_in_fifo() ((head != -1) && (peek != tail)) #undef HIDE_EINTR diff --git a/contrib/ncurses/ncurses/llib-lncurses b/contrib/ncurses/ncurses/llib-lncurses index 8ea89d1..1a6e5cf 100644 --- a/contrib/ncurses/ncurses/llib-lncurses +++ b/contrib/ncurses/ncurses/llib-lncurses @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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 <dickey@clark.net> 1996-2000 * + * Author: Thomas E. Dickey 1996-2001,2002 * ****************************************************************************/ /* LINTLIBRARY */ @@ -50,12 +50,6 @@ void _nc_linedump(void) #include <term.h> -typedef struct { - unsigned long hashval; - int oldcount, newcount; - int oldindex, newindex; -} sym; - #undef _nc_hash_map void _nc_hash_map(void) { /* void */ } @@ -76,11 +70,6 @@ void _nc_scroll_oldhash( #include <ctype.h> -#undef _nc_background -chtype _nc_background( - WINDOW *win) - { return(*(chtype *)0); } - #undef _nc_render chtype _nc_render( WINDOW *win, @@ -179,7 +168,7 @@ int wclear( #undef clearok int clearok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_clrbot.c */ @@ -225,12 +214,12 @@ int init_color( { return(*(int *)0); } #undef can_change_color -bool can_change_color(void) - { return(*(bool *)0); } +NCURSES_BOOL can_change_color(void) + { return(*(NCURSES_BOOL *)0); } #undef has_colors -bool has_colors(void) - { return(*(bool *)0); } +NCURSES_BOOL has_colors(void) + { return(*(NCURSES_BOOL *)0); } #undef color_content int color_content( @@ -251,7 +240,7 @@ int pair_content( void _nc_do_color( int old_pair, int pair, - bool reverse, + NCURSES_BOOL reverse, int (*outc)( int p1)) { /* void */ } @@ -1025,11 +1014,11 @@ int wstandend( { return(*(int *)0); } #undef mouse_trafo -bool mouse_trafo( +NCURSES_BOOL mouse_trafo( int *a1, int *a2, - bool z) - { return(*(bool *)0); } + NCURSES_BOOL z) + { return(*(NCURSES_BOOL *)0); } /* ./base/lib_getch.c */ @@ -1038,6 +1027,13 @@ bool mouse_trafo( #undef ESCDELAY int ESCDELAY; +#undef _nc_wgetch +int _nc_wgetch( + WINDOW *win, + unsigned long *result, + int use_meta) + { return(*(int *)0); } + #undef wgetch int wgetch( WINDOW *win) @@ -1066,7 +1062,7 @@ int whline( #undef immedok void immedok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { /* void */ } /* ./base/lib_inchstr.c */ @@ -1121,15 +1117,15 @@ int winnstr( /* ./base/lib_isendwin.c */ #undef isendwin -bool isendwin(void) - { return(*(bool *)0); } +NCURSES_BOOL isendwin(void) + { return(*(NCURSES_BOOL *)0); } /* ./base/lib_leaveok.c */ #undef leaveok int leaveok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_mouse.c */ @@ -1151,11 +1147,11 @@ mmask_t mousemask( { return(*(mmask_t *)0); } #undef wenclose -bool wenclose( +NCURSES_BOOL wenclose( const WINDOW *win, int y, int x) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef mouseinterval int mouseinterval( @@ -1167,12 +1163,12 @@ int _nc_has_mouse(void) { return(*(int *)0); } #undef wmouse_trafo -bool wmouse_trafo( +NCURSES_BOOL wmouse_trafo( const WINDOW *win, int *pY, int *pX, - bool to_screen) - { return(*(bool *)0); } + NCURSES_BOOL to_screen) + { return(*(NCURSES_BOOL *)0); } /* ./base/lib_move.c */ @@ -1470,7 +1466,6 @@ int mvwscanw( /* ./base/lib_screen.c */ -#include <sys/stat.h> #include <time.h> #undef getwin @@ -1526,7 +1521,7 @@ int wscrl( #undef scrollok int scrollok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_scrreg.c */ @@ -1679,15 +1674,15 @@ int slk_touch(void) /* ./base/lib_touch.c */ #undef is_linetouched -bool is_linetouched( +NCURSES_BOOL is_linetouched( WINDOW *win, int line) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef is_wintouched -bool is_wintouched( +NCURSES_BOOL is_wintouched( WINDOW *win) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef wtouchln int wtouchln( @@ -1715,6 +1710,12 @@ attr_t _nc_retrace_attr_t( attr_t code) { return(*(attr_t *)0); } +#undef _nc_altcharset_name +const char *_nc_altcharset_name( + attr_t attr, + chtype ch) + { return(*(const char **)0); } + #undef _tracechtype2 char *_tracechtype2( int bufnum, @@ -1753,7 +1754,7 @@ char *_tracemouse( #undef _nc_signal_handler void _nc_signal_handler( - bool enable) + NCURSES_BOOL enable) { /* void */ } /* ./base/lib_ungetch.c */ @@ -1771,14 +1772,14 @@ int ungetch( #undef vidputs int vidputs( - attr_t newmode, + chtype newmode, int (*outc)( int p1)) { return(*(int *)0); } #undef vidattr int vidattr( - attr_t newmode) + chtype newmode) { return(*(int *)0); } #undef termattrs @@ -1836,7 +1837,7 @@ int mvderwin( #undef syncok int syncok( WINDOW *win, - bool bf) + NCURSES_BOOL bf) { return(*(int *)0); } #undef wsyncup @@ -1912,6 +1913,18 @@ void _nc_do_xmc_glitch( attr_t previous) { /* void */ } +/* ./trace/varargs.c */ + +typedef enum { + atUnknown = 0, atInteger, atFloat, atPoint, atString +} ARGTYPE; + +#undef _nc_varargs +char *_nc_varargs( + const char *fmt, + va_list ap) + { return(*(char **)0); } + /* ./base/memmove.c */ #undef _nc_memmove @@ -1980,7 +1993,7 @@ char *keybound( #undef keyok int keyok( int c, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_dft_fgbg.c */ @@ -2013,6 +2026,18 @@ int mcprint( /* ./base/resizeterm.c */ +#undef is_term_resized +NCURSES_BOOL is_term_resized( + int ToLines, + int ToCols) + { return(*(NCURSES_BOOL *)0); } + +#undef resize_term +int resize_term( + int ToLines, + int ToCols) + { return(*(int *)0); } + #undef resizeterm int resizeterm( int ToLines, @@ -2065,6 +2090,11 @@ int wresize( /* ./tinfo/access.c */ +#undef _nc_rootname +char *_nc_rootname( + char *path) + { return(*(char **)0); } + #undef _nc_basename char *_nc_basename( char *path) @@ -2109,7 +2139,7 @@ char *_nc_save_str( #undef _nc_wrap_entry void _nc_wrap_entry( ENTRY *const ep, - bool copy_strings) + NCURSES_BOOL copy_strings) { /* void */ } #undef _nc_merge_entry @@ -2172,18 +2202,18 @@ const struct alias _nc_infoalias_table[] = {0}; #undef _nc_get_table const struct name_table_entry *_nc_get_table( - bool termcap) + NCURSES_BOOL termcap) { return(*(const struct name_table_entry **)0); } #undef _nc_get_hash_table const struct name_table_entry *const *_nc_get_hash_table( - bool termcap) + NCURSES_BOOL termcap) { return(*(const struct name_table_entry **)0); } /* ./tinfo/comp_error.c */ #undef _nc_suppress_warnings -bool _nc_suppress_warnings; +NCURSES_BOOL _nc_suppress_warnings; #undef _nc_curr_line int _nc_curr_line; #undef _nc_curr_col @@ -2227,7 +2257,7 @@ void _nc_syserr_abort( #undef _nc_tic_expand char *_nc_tic_expand( const char *srcp, - bool tic_format, + NCURSES_BOOL tic_format, int numbers) { return(*(char **)0); } @@ -2264,24 +2294,24 @@ void _nc_free_entries( { /* void */ } #undef _nc_entry_match -bool _nc_entry_match( +NCURSES_BOOL _nc_entry_match( char *n1, char *n2) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_read_entry_source void _nc_read_entry_source( FILE *fp, char *buf, int literal, - bool silent, - bool (*hook)( + NCURSES_BOOL silent, + NCURSES_BOOL (*hook)( ENTRY *p1)) { /* void */ } #undef _nc_resolve_uses int _nc_resolve_uses( - bool fullresolve) + NCURSES_BOOL fullresolve) { return(*(int *)0); } /* ./tinfo/comp_scan.c */ @@ -2299,11 +2329,11 @@ long _nc_start_line; #undef _nc_curr_token struct token _nc_curr_token; #undef _nc_disable_period -bool _nc_disable_period; +NCURSES_BOOL _nc_disable_period; #undef _nc_get_token int _nc_get_token( - bool silent) + NCURSES_BOOL silent) { return(*(int *)0); } #undef _nc_trans_string @@ -2351,11 +2381,11 @@ void _nc_free_termtype( { /* void */ } #undef _nc_user_definable -bool _nc_user_definable; +NCURSES_BOOL _nc_user_definable; #undef use_extended_names int use_extended_names( - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./tinfo/getenv_num.c */ @@ -2449,12 +2479,12 @@ SCREEN *SP; /* ./tinfo/lib_has_cap.c */ #undef has_ic -bool has_ic(void) - { return(*(bool *)0); } +NCURSES_BOOL has_ic(void) + { return(*(NCURSES_BOOL *)0); } #undef has_il -bool has_il(void) - { return(*(bool *)0); } +NCURSES_BOOL has_il(void) + { return(*(NCURSES_BOOL *)0); } /* ./tinfo/lib_kernel.c */ @@ -2472,10 +2502,6 @@ int flushinp(void) /* ./lib_keyname.c */ -#include <stdlib.h> -#include <string.h> -#include <curses.h> - #undef _nc_key_names const struct kn _nc_key_names[] = {0}; @@ -2502,13 +2528,13 @@ int napms( #undef idlok int idlok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef idcok void idcok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { /* void */ } #undef halfdelay @@ -2519,13 +2545,13 @@ int halfdelay( #undef nodelay int nodelay( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef notimeout int notimeout( WINDOW *win, - bool f) + NCURSES_BOOL f) { return(*(int *)0); } #undef wtimeout @@ -2537,13 +2563,13 @@ void wtimeout( #undef keypad int keypad( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef meta int meta( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef curs_set @@ -2563,7 +2589,7 @@ int has_key( #undef _nc_keypad int _nc_keypad( - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./tinfo/lib_raw.c */ @@ -2595,7 +2621,7 @@ void noqiflush(void) #undef intrflush int intrflush( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./tinfo/lib_setup.c */ @@ -2604,7 +2630,7 @@ int intrflush( #undef use_env void use_env( - bool f) + NCURSES_BOOL f) { /* void */ } #undef LINES @@ -2702,9 +2728,12 @@ typedef struct { unsigned int num; char *str; } data; - bool num_type; + NCURSES_BOOL num_type; } stack_frame; +#undef _nc_tparm_err +int _nc_tparm_err; + #undef tparm char *tparm( char *string, @@ -2761,17 +2790,6 @@ void trace( const unsigned int tracelevel) { /* void */ } -#undef _nc_visbuf2 -const char *_nc_visbuf2( - int bufnum, - const char *buf) - { return(*(const char **)0); } - -#undef _nc_visbuf -const char *_nc_visbuf( - const char *buf) - { return(*(const char **)0); } - #undef _tracef void _tracef( const char *fmt, @@ -2788,6 +2806,11 @@ char *_nc_retrace_ptr( char *code) { return(*(char **)0); } +#undef _nc_retrace_sp +SCREEN *_nc_retrace_sp( + SCREEN *code) + { return(*(SCREEN **)0); } + #undef _nc_retrace_win WINDOW *_nc_retrace_win( WINDOW *code) @@ -2808,7 +2831,7 @@ char *_nc_tracebits(void) #undef _tracechar char *_tracechar( - const unsigned char ch) + int ch) { return(*(char **)0); } /* ./tinfo/lib_ttyflags.c */ @@ -2891,7 +2914,7 @@ char *const strfnames[] = {0}; int _nc_parse_entry( struct entry *entryp, int literal, - bool silent) + NCURSES_BOOL silent) { return(*(int *)0); } #undef _nc_capcmp @@ -2932,10 +2955,6 @@ int _nc_read_entry( /* ./tinfo/read_termcap.c */ -#undef _nc_read_termcap -void _nc_read_termcap(void) - { /* void */ } - #undef _nc_read_termcap_entry int _nc_read_termcap_entry( const char *const tn, @@ -2947,7 +2966,7 @@ int _nc_read_termcap_entry( #undef _nc_set_buffer void _nc_set_buffer( FILE *ofp, - bool buffered) + NCURSES_BOOL buffered) { /* void */ } /* ./tinfo/strings.c */ @@ -2972,16 +2991,16 @@ string_desc *_nc_str_copy( { return(*(string_desc **)0); } #undef _nc_safe_strcat -bool _nc_safe_strcat( +NCURSES_BOOL _nc_safe_strcat( string_desc *dst, const char *src) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_safe_strcpy -bool _nc_safe_strcpy( +NCURSES_BOOL _nc_safe_strcpy( string_desc *dst, const char *src) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./trace/trace_buf.c */ @@ -3010,6 +3029,19 @@ char *unctrl( chtype ch) { return(*(char **)0); } +/* ./trace/visbuf.c */ + +#undef _nc_visbuf2 +const char *_nc_visbuf2( + int bufnum, + const char *buf) + { return(*(const char **)0); } + +#undef _nc_visbuf +const char *_nc_visbuf( + const char *buf) + { return(*(const char **)0); } + /* ./tinfo/write_entry.c */ #undef _nc_set_writedir diff --git a/contrib/ncurses/ncurses/llib-lncursesw b/contrib/ncurses/ncurses/llib-lncursesw new file mode 100644 index 0000000..ffb0af6 --- /dev/null +++ b/contrib/ncurses/ncurses/llib-lncursesw @@ -0,0 +1,3756 @@ +/**************************************************************************** + * Copyright (c) 2001,2002 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 2001,2002 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./tty/hardscroll.c */ + +#include <curses.priv.h> + +#undef _nc_oldnums +int *_nc_oldnums; + +#undef _nc_scroll_optimize +void _nc_scroll_optimize(void) + { /* void */ } + +#undef _nc_linedump +void _nc_linedump(void) + { /* void */ } + +/* ./tty/hashmap.c */ + +#include <term.h> + +#undef _nc_hash_map +void _nc_hash_map(void) + { /* void */ } + +#undef _nc_make_oldhash +void _nc_make_oldhash( + int i) + { /* void */ } + +#undef _nc_scroll_oldhash +void _nc_scroll_oldhash( + int n, + int top, + int bot) + { /* void */ } + +/* ./base/lib_addch.c */ + +#include <ctype.h> + +#undef _nc_render +cchar_t _nc_render( + WINDOW *win, + cchar_t ch) + { return(*(cchar_t *)0); } + +#undef _nc_waddch_nosync +int _nc_waddch_nosync( + WINDOW *win, + const cchar_t c) + { return(*(int *)0); } + +#undef waddch +int waddch( + WINDOW *win, + const chtype ch) + { return(*(int *)0); } + +#undef wechochar +int wechochar( + WINDOW *win, + const chtype ch) + { return(*(int *)0); } + +#undef wadd_wch +int wadd_wch( + WINDOW *win, + const cchar_t *wch) + { return(*(int *)0); } + +#undef wecho_wchar +int wecho_wchar( + WINDOW *win, + const cchar_t *wch) + { return(*(int *)0); } + +/* ./base/lib_addstr.c */ + +#undef waddnstr +int waddnstr( + WINDOW *win, + const char *const astr, + int n) + { return(*(int *)0); } + +#undef waddchnstr +int waddchnstr( + WINDOW *win, + const chtype *const astr, + int n) + { return(*(int *)0); } + +#undef _nc_wchstrlen +int _nc_wchstrlen( + const cchar_t *s) + { return(*(int *)0); } + +#undef wadd_wchnstr +int wadd_wchnstr( + WINDOW *win, + const cchar_t *const astr, + int n) + { return(*(int *)0); } + +#undef waddnwstr +int waddnwstr( + WINDOW *win, + const wchar_t *str, + int n) + { return(*(int *)0); } + +/* ./base/lib_beep.c */ + +#undef beep +int beep(void) + { return(*(int *)0); } + +/* ./base/lib_bkgd.c */ + +#undef wbkgrndset +void wbkgrndset( + WINDOW *win, + const cchar_t *ch) + { /* void */ } + +#undef wbkgdset +void wbkgdset( + WINDOW *win, + chtype ch) + { /* void */ } + +#undef wbkgrnd +int wbkgrnd( + WINDOW *win, + const cchar_t *ch) + { return(*(int *)0); } + +#undef wbkgd +int wbkgd( + WINDOW *win, + const chtype ch) + { return(*(int *)0); } + +/* ./base/lib_box.c */ + +#undef wborder +int wborder( + WINDOW *win, + chtype ls, + chtype rs, + chtype ts, + chtype bs, + chtype tl, + chtype tr, + chtype bl, + chtype br) + { return(*(int *)0); } + +/* ./base/lib_chgat.c */ + +#undef wchgat +int wchgat( + WINDOW *win, + int n, + attr_t attr, + short color, + const void *opts) + { return(*(int *)0); } + +/* ./base/lib_clear.c */ + +#undef wclear +int wclear( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_clearok.c */ + +#undef clearok +int clearok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_clrbot.c */ + +#undef wclrtobot +int wclrtobot( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_clreol.c */ + +#undef wclrtoeol +int wclrtoeol( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_color.c */ + +#include <tic.h> + +#undef COLOR_PAIRS +int COLOR_PAIRS; +#undef COLORS +int COLORS; + +#undef start_color +int start_color(void) + { return(*(int *)0); } + +#undef init_pair +int init_pair( + short pair, + short f, + short b) + { return(*(int *)0); } + +#undef init_color +int init_color( + short color, + short r, + short g, + short b) + { return(*(int *)0); } + +#undef can_change_color +NCURSES_BOOL can_change_color(void) + { return(*(NCURSES_BOOL *)0); } + +#undef has_colors +NCURSES_BOOL has_colors(void) + { return(*(NCURSES_BOOL *)0); } + +#undef color_content +int color_content( + short color, + short *r, + short *g, + short *b) + { return(*(int *)0); } + +#undef pair_content +int pair_content( + short pair, + short *f, + short *b) + { return(*(int *)0); } + +#undef _nc_do_color +void _nc_do_color( + int old_pair, + int pair, + NCURSES_BOOL reverse, + int (*outc)( + int p1)) + { /* void */ } + +/* ./base/lib_colorset.c */ + +#undef wcolor_set +int wcolor_set( + WINDOW *win, + short color_pair_number, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_delch.c */ + +#undef wdelch +int wdelch( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_delwin.c */ + +#undef delwin +int delwin( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_echo.c */ + +#undef echo +int echo(void) + { return(*(int *)0); } + +#undef noecho +int noecho(void) + { return(*(int *)0); } + +/* ./base/lib_endwin.c */ + +#undef endwin +int endwin(void) + { return(*(int *)0); } + +/* ./base/lib_erase.c */ + +#undef werase +int werase( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_flash.c */ + +#undef flash +int flash(void) + { return(*(int *)0); } + +/* ./lib_gen.c */ + +#undef addch +int addch( + const chtype z) + { return(*(int *)0); } + +#undef addchnstr +int addchnstr( + const chtype *a1, + int z) + { return(*(int *)0); } + +#undef addchstr +int addchstr( + const chtype *z) + { return(*(int *)0); } + +#undef addnstr +int addnstr( + const char *a1, + int z) + { return(*(int *)0); } + +#undef addstr +int addstr( + const char *z) + { return(*(int *)0); } + +#undef attroff +int attroff( + NCURSES_ATTR_T z) + { return(*(int *)0); } + +#undef attron +int attron( + NCURSES_ATTR_T z) + { return(*(int *)0); } + +#undef attrset +int attrset( + NCURSES_ATTR_T z) + { return(*(int *)0); } + +#undef attr_get +int attr_get( + attr_t *a1, + short *a2, + void *z) + { return(*(int *)0); } + +#undef attr_off +int attr_off( + attr_t a1, + void *z) + { return(*(int *)0); } + +#undef attr_on +int attr_on( + attr_t a1, + void *z) + { return(*(int *)0); } + +#undef attr_set +int attr_set( + attr_t a1, + short a2, + void *z) + { return(*(int *)0); } + +#undef bkgd +int bkgd( + chtype z) + { return(*(int *)0); } + +#undef bkgdset +void bkgdset( + chtype z) + { /* void */ } + +#undef border +int border( + chtype a1, + chtype a2, + chtype a3, + chtype a4, + chtype a5, + chtype a6, + chtype a7, + chtype z) + { return(*(int *)0); } + +#undef box +int box( + WINDOW *a1, + chtype a2, + chtype z) + { return(*(int *)0); } + +#undef chgat +int chgat( + int a1, + attr_t a2, + short a3, + const void *z) + { return(*(int *)0); } + +#undef clear +int clear(void) + { return(*(int *)0); } + +#undef clrtobot +int clrtobot(void) + { return(*(int *)0); } + +#undef clrtoeol +int clrtoeol(void) + { return(*(int *)0); } + +#undef color_set +int color_set( + short a1, + void *z) + { return(*(int *)0); } + +#undef COLOR_PAIR +int COLOR_PAIR( + int z) + { return(*(int *)0); } + +#undef delch +int delch(void) + { return(*(int *)0); } + +#undef deleteln +int deleteln(void) + { return(*(int *)0); } + +#undef echochar +int echochar( + const chtype z) + { return(*(int *)0); } + +#undef erase +int erase(void) + { return(*(int *)0); } + +#undef getbkgd +chtype getbkgd( + WINDOW *z) + { return(*(chtype *)0); } + +#undef getch +int getch(void) + { return(*(int *)0); } + +#undef getnstr +int getnstr( + char *a1, + int z) + { return(*(int *)0); } + +#undef getstr +int getstr( + char *z) + { return(*(int *)0); } + +#undef hline +int hline( + chtype a1, + int z) + { return(*(int *)0); } + +#undef inch +chtype inch(void) + { return(*(chtype *)0); } + +#undef inchnstr +int inchnstr( + chtype *a1, + int z) + { return(*(int *)0); } + +#undef inchstr +int inchstr( + chtype *z) + { return(*(int *)0); } + +#undef innstr +int innstr( + char *a1, + int z) + { return(*(int *)0); } + +#undef insch +int insch( + chtype z) + { return(*(int *)0); } + +#undef insdelln +int insdelln( + int z) + { return(*(int *)0); } + +#undef insertln +int insertln(void) + { return(*(int *)0); } + +#undef insnstr +int insnstr( + const char *a1, + int z) + { return(*(int *)0); } + +#undef insstr +int insstr( + const char *z) + { return(*(int *)0); } + +#undef instr +int instr( + char *z) + { return(*(int *)0); } + +#undef move +int move( + int a1, + int z) + { return(*(int *)0); } + +#undef mvaddch +int mvaddch( + int a1, + int a2, + const chtype z) + { return(*(int *)0); } + +#undef mvaddchnstr +int mvaddchnstr( + int a1, + int a2, + const chtype *a3, + int z) + { return(*(int *)0); } + +#undef mvaddchstr +int mvaddchstr( + int a1, + int a2, + const chtype *z) + { return(*(int *)0); } + +#undef mvaddnstr +int mvaddnstr( + int a1, + int a2, + const char *a3, + int z) + { return(*(int *)0); } + +#undef mvaddstr +int mvaddstr( + int a1, + int a2, + const char *z) + { return(*(int *)0); } + +#undef mvchgat +int mvchgat( + int a1, + int a2, + int a3, + attr_t a4, + short a5, + const void *z) + { return(*(int *)0); } + +#undef mvdelch +int mvdelch( + int a1, + int z) + { return(*(int *)0); } + +#undef mvgetch +int mvgetch( + int a1, + int z) + { return(*(int *)0); } + +#undef mvgetnstr +int mvgetnstr( + int a1, + int a2, + char *a3, + int z) + { return(*(int *)0); } + +#undef mvgetstr +int mvgetstr( + int a1, + int a2, + char *z) + { return(*(int *)0); } + +#undef mvhline +int mvhline( + int a1, + int a2, + chtype a3, + int z) + { return(*(int *)0); } + +#undef mvinch +chtype mvinch( + int a1, + int z) + { return(*(chtype *)0); } + +#undef mvinchnstr +int mvinchnstr( + int a1, + int a2, + chtype *a3, + int z) + { return(*(int *)0); } + +#undef mvinchstr +int mvinchstr( + int a1, + int a2, + chtype *z) + { return(*(int *)0); } + +#undef mvinnstr +int mvinnstr( + int a1, + int a2, + char *a3, + int z) + { return(*(int *)0); } + +#undef mvinsch +int mvinsch( + int a1, + int a2, + chtype z) + { return(*(int *)0); } + +#undef mvinsnstr +int mvinsnstr( + int a1, + int a2, + const char *a3, + int z) + { return(*(int *)0); } + +#undef mvinsstr +int mvinsstr( + int a1, + int a2, + const char *z) + { return(*(int *)0); } + +#undef mvinstr +int mvinstr( + int a1, + int a2, + char *z) + { return(*(int *)0); } + +#undef mvvline +int mvvline( + int a1, + int a2, + chtype a3, + int z) + { return(*(int *)0); } + +#undef mvwaddch +int mvwaddch( + WINDOW *a1, + int a2, + int a3, + const chtype z) + { return(*(int *)0); } + +#undef mvwaddchnstr +int mvwaddchnstr( + WINDOW *a1, + int a2, + int a3, + const chtype *a4, + int z) + { return(*(int *)0); } + +#undef mvwaddchstr +int mvwaddchstr( + WINDOW *a1, + int a2, + int a3, + const chtype *z) + { return(*(int *)0); } + +#undef mvwaddnstr +int mvwaddnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, + int z) + { return(*(int *)0); } + +#undef mvwaddstr +int mvwaddstr( + WINDOW *a1, + int a2, + int a3, + const char *z) + { return(*(int *)0); } + +#undef mvwchgat +int mvwchgat( + WINDOW *a1, + int a2, + int a3, + int a4, + attr_t a5, + short a6, + const void *z) + { return(*(int *)0); } + +#undef mvwdelch +int mvwdelch( + WINDOW *a1, + int a2, + int z) + { return(*(int *)0); } + +#undef mvwgetch +int mvwgetch( + WINDOW *a1, + int a2, + int z) + { return(*(int *)0); } + +#undef mvwgetnstr +int mvwgetnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, + int z) + { return(*(int *)0); } + +#undef mvwgetstr +int mvwgetstr( + WINDOW *a1, + int a2, + int a3, + char *z) + { return(*(int *)0); } + +#undef mvwhline +int mvwhline( + WINDOW *a1, + int a2, + int a3, + chtype a4, + int z) + { return(*(int *)0); } + +#undef mvwinch +chtype mvwinch( + WINDOW *a1, + int a2, + int z) + { return(*(chtype *)0); } + +#undef mvwinchnstr +int mvwinchnstr( + WINDOW *a1, + int a2, + int a3, + chtype *a4, + int z) + { return(*(int *)0); } + +#undef mvwinchstr +int mvwinchstr( + WINDOW *a1, + int a2, + int a3, + chtype *z) + { return(*(int *)0); } + +#undef mvwinnstr +int mvwinnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, + int z) + { return(*(int *)0); } + +#undef mvwinsch +int mvwinsch( + WINDOW *a1, + int a2, + int a3, + chtype z) + { return(*(int *)0); } + +#undef mvwinsnstr +int mvwinsnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, + int z) + { return(*(int *)0); } + +#undef mvwinsstr +int mvwinsstr( + WINDOW *a1, + int a2, + int a3, + const char *z) + { return(*(int *)0); } + +#undef mvwinstr +int mvwinstr( + WINDOW *a1, + int a2, + int a3, + char *z) + { return(*(int *)0); } + +#undef mvwvline +int mvwvline( + WINDOW *a1, + int a2, + int a3, + chtype a4, + int z) + { return(*(int *)0); } + +#undef PAIR_NUMBER +int PAIR_NUMBER( + int z) + { return(*(int *)0); } + +#undef redrawwin +int redrawwin( + WINDOW *z) + { return(*(int *)0); } + +#undef refresh +int refresh(void) + { return(*(int *)0); } + +#undef scrl +int scrl( + int z) + { return(*(int *)0); } + +#undef scroll +int scroll( + WINDOW *z) + { return(*(int *)0); } + +#undef setscrreg +int setscrreg( + int a1, + int z) + { return(*(int *)0); } + +#undef slk_attr_off +int slk_attr_off( + const attr_t a1, + void *z) + { return(*(int *)0); } + +#undef slk_attr_on +int slk_attr_on( + attr_t a1, + void *z) + { return(*(int *)0); } + +#undef standout +int standout(void) + { return(*(int *)0); } + +#undef standend +int standend(void) + { return(*(int *)0); } + +#undef timeout +void timeout( + int z) + { /* void */ } + +#undef touchline +int touchline( + WINDOW *a1, + int a2, + int z) + { return(*(int *)0); } + +#undef touchwin +int touchwin( + WINDOW *z) + { return(*(int *)0); } + +#undef untouchwin +int untouchwin( + WINDOW *z) + { return(*(int *)0); } + +#undef vid_attr +int vid_attr( + attr_t a1, + short a2, + void *z) + { return(*(int *)0); } + +#undef vline +int vline( + chtype a1, + int z) + { return(*(int *)0); } + +#undef vw_printw +int vw_printw( + WINDOW *a1, + char *a2, + va_list z) + { return(*(int *)0); } + +#undef vw_scanw +int vw_scanw( + WINDOW *a1, + char *a2, + va_list z) + { return(*(int *)0); } + +#undef waddchstr +int waddchstr( + WINDOW *a1, + const chtype *z) + { return(*(int *)0); } + +#undef waddstr +int waddstr( + WINDOW *a1, + const char *z) + { return(*(int *)0); } + +#undef wattron +int wattron( + WINDOW *a1, + int z) + { return(*(int *)0); } + +#undef wattroff +int wattroff( + WINDOW *a1, + int z) + { return(*(int *)0); } + +#undef wattrset +int wattrset( + WINDOW *a1, + int z) + { return(*(int *)0); } + +#undef wattr_get +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, + void *z) + { return(*(int *)0); } + +#undef wattr_set +int wattr_set( + WINDOW *a1, + attr_t a2, + short a3, + void *z) + { return(*(int *)0); } + +#undef wdeleteln +int wdeleteln( + WINDOW *z) + { return(*(int *)0); } + +#undef wgetstr +int wgetstr( + WINDOW *a1, + char *z) + { return(*(int *)0); } + +#undef winchstr +int winchstr( + WINDOW *a1, + chtype *z) + { return(*(int *)0); } + +#undef winsertln +int winsertln( + WINDOW *z) + { return(*(int *)0); } + +#undef winsstr +int winsstr( + WINDOW *a1, + const char *z) + { return(*(int *)0); } + +#undef winstr +int winstr( + WINDOW *a1, + char *z) + { return(*(int *)0); } + +#undef wstandout +int wstandout( + WINDOW *z) + { return(*(int *)0); } + +#undef wstandend +int wstandend( + WINDOW *z) + { return(*(int *)0); } + +#undef add_wch +int add_wch( + const cchar_t *z) + { return(*(int *)0); } + +#undef add_wchnstr +int add_wchnstr( + const cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef add_wchstr +int add_wchstr( + const cchar_t *z) + { return(*(int *)0); } + +#undef addnwstr +int addnwstr( + const wchar_t *a1, + int z) + { return(*(int *)0); } + +#undef addwstr +int addwstr( + const wchar_t *z) + { return(*(int *)0); } + +#undef bkgrnd +int bkgrnd( + const cchar_t *z) + { return(*(int *)0); } + +#undef bkgrndset +void bkgrndset( + const cchar_t *z) + { /* void */ } + +#undef border_set +int border_set( + const cchar_t *a1, + const cchar_t *a2, + const cchar_t *a3, + const cchar_t *a4, + const cchar_t *a5, + const cchar_t *a6, + const cchar_t *a7, + const cchar_t *z) + { return(*(int *)0); } + +#undef box_set +int box_set( + WINDOW *a1, + const cchar_t *a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef echo_wchar +int echo_wchar( + const cchar_t *z) + { return(*(int *)0); } + +#undef get_wch +int get_wch( + wint_t *z) + { return(*(int *)0); } + +#undef get_wstr +int get_wstr( + wint_t *z) + { return(*(int *)0); } + +#undef getbkgrnd +int getbkgrnd( + cchar_t *z) + { return(*(int *)0); } + +#undef getn_wstr +int getn_wstr( + wint_t *a1, + int z) + { return(*(int *)0); } + +#undef hline_set +int hline_set( + const cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef in_wch +int in_wch( + cchar_t *z) + { return(*(int *)0); } + +#undef in_wchnstr +int in_wchnstr( + cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef in_wchstr +int in_wchstr( + cchar_t *z) + { return(*(int *)0); } + +#undef innwstr +int innwstr( + wchar_t *a1, + int z) + { return(*(int *)0); } + +#undef ins_nwstr +int ins_nwstr( + const wchar_t *a1, + int z) + { return(*(int *)0); } + +#undef ins_wch +int ins_wch( + const cchar_t *z) + { return(*(int *)0); } + +#undef ins_wstr +int ins_wstr( + const wchar_t *z) + { return(*(int *)0); } + +#undef inwstr +int inwstr( + wchar_t *z) + { return(*(int *)0); } + +#undef mvadd_wch +int mvadd_wch( + int a1, + int a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvadd_wchnstr +int mvadd_wchnstr( + int a1, + int a2, + const cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvadd_wchstr +int mvadd_wchstr( + int a1, + int a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvaddnwstr +int mvaddnwstr( + int a1, + int a2, + const wchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvaddwstr +int mvaddwstr( + int a1, + int a2, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvget_wch +int mvget_wch( + int a1, + int a2, + wint_t *z) + { return(*(int *)0); } + +#undef mvget_wstr +int mvget_wstr( + int a1, + int a2, + wint_t *z) + { return(*(int *)0); } + +#undef mvgetn_wstr +int mvgetn_wstr( + int a1, + int a2, + wint_t *a3, + int z) + { return(*(int *)0); } + +#undef mvhline_set +int mvhline_set( + int a1, + int a2, + const cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvin_wch +int mvin_wch( + int a1, + int a2, + cchar_t *z) + { return(*(int *)0); } + +#undef mvin_wchnstr +int mvin_wchnstr( + int a1, + int a2, + cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvin_wchstr +int mvin_wchstr( + int a1, + int a2, + cchar_t *z) + { return(*(int *)0); } + +#undef mvinnwstr +int mvinnwstr( + int a1, + int a2, + wchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvins_nwstr +int mvins_nwstr( + int a1, + int a2, + const wchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvins_wch +int mvins_wch( + int a1, + int a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvins_wstr +int mvins_wstr( + int a1, + int a2, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvinwstr +int mvinwstr( + int a1, + int a2, + wchar_t *z) + { return(*(int *)0); } + +#undef mvvline_set +int mvvline_set( + int a1, + int a2, + const cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvwadd_wch +int mvwadd_wch( + WINDOW *a1, + int a2, + int a3, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvwadd_wchnstr +int mvwadd_wchnstr( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwadd_wchstr +int mvwadd_wchstr( + WINDOW *a1, + int a2, + int a3, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvwaddnwstr +int mvwaddnwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwaddwstr +int mvwaddwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvwget_wch +int mvwget_wch( + WINDOW *a1, + int a2, + int a3, + wint_t *z) + { return(*(int *)0); } + +#undef mvwget_wstr +int mvwget_wstr( + WINDOW *a1, + int a2, + int a3, + wint_t *z) + { return(*(int *)0); } + +#undef mvwgetn_wstr +int mvwgetn_wstr( + WINDOW *a1, + int a2, + int a3, + wint_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwhline_set +int mvwhline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwin_wch +int mvwin_wch( + WINDOW *a1, + int a2, + int a3, + cchar_t *z) + { return(*(int *)0); } + +#undef mvwin_wchnstr +int mvwin_wchnstr( + WINDOW *a1, + int a2, + int a3, + cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwin_wchstr +int mvwin_wchstr( + WINDOW *a1, + int a2, + int a3, + cchar_t *z) + { return(*(int *)0); } + +#undef mvwinnwstr +int mvwinnwstr( + WINDOW *a1, + int a2, + int a3, + wchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwins_nwstr +int mvwins_nwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwins_wch +int mvwins_wch( + WINDOW *a1, + int a2, + int a3, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvwins_wstr +int mvwins_wstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvwinwstr +int mvwinwstr( + WINDOW *a1, + int a2, + int a3, + wchar_t *z) + { return(*(int *)0); } + +#undef mvwvline_set +int mvwvline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef vline_set +int vline_set( + const cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef wadd_wchstr +int wadd_wchstr( + WINDOW *a1, + const cchar_t *z) + { return(*(int *)0); } + +#undef waddwstr +int waddwstr( + WINDOW *a1, + const wchar_t *z) + { return(*(int *)0); } + +#undef wget_wstr +int wget_wstr( + WINDOW *a1, + wint_t *z) + { return(*(int *)0); } + +#undef win_wchstr +int win_wchstr( + WINDOW *a1, + cchar_t *z) + { return(*(int *)0); } + +#undef wins_wstr +int wins_wstr( + WINDOW *a1, + const wchar_t *z) + { return(*(int *)0); } + +#undef mouse_trafo +NCURSES_BOOL mouse_trafo( + int *a1, + int *a2, + NCURSES_BOOL z) + { return(*(NCURSES_BOOL *)0); } + +/* ./base/lib_getch.c */ + +#include <fifo_defs.h> + +#undef ESCDELAY +int ESCDELAY; + +#undef _nc_wgetch +int _nc_wgetch( + WINDOW *win, + unsigned long *result, + int use_meta) + { return(*(int *)0); } + +#undef wgetch +int wgetch( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_getstr.c */ + +#undef wgetnstr +int wgetnstr( + WINDOW *win, + char *str, + int maxlen) + { return(*(int *)0); } + +/* ./base/lib_hline.c */ + +#undef whline +int whline( + WINDOW *win, + chtype ch, + int n) + { return(*(int *)0); } + +/* ./base/lib_immedok.c */ + +#undef immedok +void immedok( + WINDOW *win, + NCURSES_BOOL flag) + { /* void */ } + +/* ./base/lib_inchstr.c */ + +#undef winchnstr +int winchnstr( + WINDOW *win, + chtype *str, + int n) + { return(*(int *)0); } + +/* ./base/lib_initscr.c */ + +#undef initscr +WINDOW *initscr(void) + { return(*(WINDOW **)0); } + +/* ./base/lib_insch.c */ + +#undef winsch +int winsch( + WINDOW *win, + chtype c) + { return(*(int *)0); } + +/* ./base/lib_insdel.c */ + +#undef winsdelln +int winsdelln( + WINDOW *win, + int n) + { return(*(int *)0); } + +/* ./base/lib_insstr.c */ + +#undef winsnstr +int winsnstr( + WINDOW *win, + const char *s, + int n) + { return(*(int *)0); } + +/* ./base/lib_instr.c */ + +#undef winnstr +int winnstr( + WINDOW *win, + char *str, + int n) + { return(*(int *)0); } + +/* ./base/lib_isendwin.c */ + +#undef isendwin +NCURSES_BOOL isendwin(void) + { return(*(NCURSES_BOOL *)0); } + +/* ./base/lib_leaveok.c */ + +#undef leaveok +int leaveok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_mouse.c */ + +#undef getmouse +int getmouse( + MEVENT *aevent) + { return(*(int *)0); } + +#undef ungetmouse +int ungetmouse( + MEVENT *aevent) + { return(*(int *)0); } + +#undef mousemask +mmask_t mousemask( + mmask_t newmask, + mmask_t *oldmask) + { return(*(mmask_t *)0); } + +#undef wenclose +NCURSES_BOOL wenclose( + const WINDOW *win, + int y, + int x) + { return(*(NCURSES_BOOL *)0); } + +#undef mouseinterval +int mouseinterval( + int maxclick) + { return(*(int *)0); } + +#undef _nc_has_mouse +int _nc_has_mouse(void) + { return(*(int *)0); } + +#undef wmouse_trafo +NCURSES_BOOL wmouse_trafo( + const WINDOW *win, + int *pY, + int *pX, + NCURSES_BOOL to_screen) + { return(*(NCURSES_BOOL *)0); } + +/* ./base/lib_move.c */ + +#undef wmove +int wmove( + WINDOW *win, + int y, + int x) + { return(*(int *)0); } + +/* ./tty/lib_mvcur.c */ + +#undef _nc_msec_cost +int _nc_msec_cost( + const char *const cap, + int affcnt) + { return(*(int *)0); } + +#undef _nc_mvcur_resume +void _nc_mvcur_resume(void) + { /* void */ } + +#undef _nc_mvcur_init +void _nc_mvcur_init(void) + { /* void */ } + +#undef _nc_mvcur_wrap +void _nc_mvcur_wrap(void) + { /* void */ } + +#undef mvcur +int mvcur( + int yold, + int xold, + int ynew, + int xnew) + { return(*(int *)0); } + +#undef _nc_optimize_enable +int _nc_optimize_enable; + +/* ./base/lib_mvwin.c */ + +#undef mvwin +int mvwin( + WINDOW *win, + int by, + int bx) + { return(*(int *)0); } + +/* ./base/lib_newterm.c */ + +#undef filter +void filter(void) + { /* void */ } + +#undef newterm +SCREEN *newterm( + char *name, + FILE *ofp, + FILE *ifp) + { return(*(SCREEN **)0); } + +/* ./base/lib_newwin.c */ + +#undef _nc_freewin +int _nc_freewin( + WINDOW *win) + { return(*(int *)0); } + +#undef newwin +WINDOW *newwin( + int num_lines, + int num_columns, + int begy, + int begx) + { return(*(WINDOW **)0); } + +#undef derwin +WINDOW *derwin( + WINDOW *orig, + int num_lines, + int num_columns, + int begy, + int begx) + { return(*(WINDOW **)0); } + +#undef subwin +WINDOW *subwin( + WINDOW *w, + int l, + int c, + int y, + int x) + { return(*(WINDOW **)0); } + +#undef _nc_makenew +WINDOW *_nc_makenew( + int num_lines, + int num_columns, + int begy, + int begx, + int flags) + { return(*(WINDOW **)0); } + +/* ./base/lib_nl.c */ + +#undef nl +int nl(void) + { return(*(int *)0); } + +#undef nonl +int nonl(void) + { return(*(int *)0); } + +/* ./base/lib_overlay.c */ + +#undef overlay +int overlay( + const WINDOW *win1, + WINDOW *win2) + { return(*(int *)0); } + +#undef overwrite +int overwrite( + const WINDOW *win1, + WINDOW *win2) + { return(*(int *)0); } + +#undef copywin +int copywin( + const WINDOW *src, + WINDOW *dst, + int sminrow, + int smincol, + int dminrow, + int dmincol, + int dmaxrow, + int dmaxcol, + int over) + { return(*(int *)0); } + +/* ./base/lib_pad.c */ + +#undef newpad +WINDOW *newpad( + int l, + int c) + { return(*(WINDOW **)0); } + +#undef subpad +WINDOW *subpad( + WINDOW *orig, + int l, + int c, + int begy, + int begx) + { return(*(WINDOW **)0); } + +#undef prefresh +int prefresh( + WINDOW *win, + int pminrow, + int pmincol, + int sminrow, + int smincol, + int smaxrow, + int smaxcol) + { return(*(int *)0); } + +#undef pnoutrefresh +int pnoutrefresh( + WINDOW *win, + int pminrow, + int pmincol, + int sminrow, + int smincol, + int smaxrow, + int smaxcol) + { return(*(int *)0); } + +#undef pechochar +int pechochar( + WINDOW *pad, + const chtype ch) + { return(*(int *)0); } + +/* ./base/lib_printw.c */ + +#undef printw +int printw( + char *fmt, + ...) + { return(*(int *)0); } + +#undef wprintw +int wprintw( + WINDOW *win, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvprintw +int mvprintw( + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvwprintw +int mvwprintw( + WINDOW *win, + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +#undef vwprintw +int vwprintw( + WINDOW *win, + char *fmt, + va_list argp) + { return(*(int *)0); } + +/* ./base/lib_redrawln.c */ + +#undef wredrawln +int wredrawln( + WINDOW *win, + int beg, + int num) + { return(*(int *)0); } + +/* ./base/lib_refresh.c */ + +#undef wrefresh +int wrefresh( + WINDOW *win) + { return(*(int *)0); } + +#undef wnoutrefresh +int wnoutrefresh( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_restart.c */ + +#undef restartterm +int restartterm( + char *termp, + int filenum, + int *errret) + { return(*(int *)0); } + +/* ./base/lib_scanw.c */ + +#undef vwscanw +int vwscanw( + WINDOW *win, + char *fmt, + va_list argp) + { return(*(int *)0); } + +#undef scanw +int scanw( + char *fmt, + ...) + { return(*(int *)0); } + +#undef wscanw +int wscanw( + WINDOW *win, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvscanw +int mvscanw( + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvwscanw +int mvwscanw( + WINDOW *win, + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +/* ./base/lib_screen.c */ + +#include <time.h> + +#undef getwin +WINDOW *getwin( + FILE *filep) + { return(*(WINDOW **)0); } + +#undef putwin +int putwin( + WINDOW *win, + FILE *filep) + { return(*(int *)0); } + +#undef scr_restore +int scr_restore( + const char *file) + { return(*(int *)0); } + +#undef scr_dump +int scr_dump( + const char *file) + { return(*(int *)0); } + +#undef scr_init +int scr_init( + const char *file) + { return(*(int *)0); } + +#undef scr_set +int scr_set( + const char *file) + { return(*(int *)0); } + +/* ./base/lib_scroll.c */ + +#undef _nc_scroll_window +void _nc_scroll_window( + WINDOW *win, + int const n, + short const top, + short const bottom, + cchar_t blank) + { /* void */ } + +#undef wscrl +int wscrl( + WINDOW *win, + int n) + { return(*(int *)0); } + +/* ./base/lib_scrollok.c */ + +#undef scrollok +int scrollok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_scrreg.c */ + +#undef wsetscrreg +int wsetscrreg( + WINDOW *win, + int top, + int bottom) + { return(*(int *)0); } + +/* ./base/lib_set_term.c */ + +#undef set_term +SCREEN *set_term( + SCREEN *screenp) + { return(*(SCREEN **)0); } + +#undef delscreen +void delscreen( + SCREEN *sp) + { /* void */ } + +#undef _nc_setupscreen +int _nc_setupscreen( + short slines, + short const scolumns, + FILE *output) + { return(*(int *)0); } + +#undef _nc_ripoffline +int _nc_ripoffline( + int line, + int (*init)( + WINDOW *p1, + int p2)) + { return(*(int *)0); } + +#undef ripoffline +int ripoffline( + int line, + int (*init)( + WINDOW *p1, + int p2)) + { return(*(int *)0); } + +/* ./base/lib_slk.c */ + +#undef _nc_slk_format +int _nc_slk_format; + +#undef _nc_slk_initialize +int _nc_slk_initialize( + WINDOW *stwin, + int cols) + { return(*(int *)0); } + +#undef slk_restore +int slk_restore(void) + { return(*(int *)0); } + +/* ./base/lib_slkatr_set.c */ + +#undef slk_attr_set +int slk_attr_set( + const attr_t attr, + short color_pair_number, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_slkatrof.c */ + +#undef slk_attroff +int slk_attroff( + const chtype attr) + { return(*(int *)0); } + +/* ./base/lib_slkatron.c */ + +#undef slk_attron +int slk_attron( + const chtype attr) + { return(*(int *)0); } + +/* ./base/lib_slkatrset.c */ + +#undef slk_attrset +int slk_attrset( + const chtype attr) + { return(*(int *)0); } + +/* ./base/lib_slkattr.c */ + +#undef slk_attr +attr_t slk_attr(void) + { return(*(attr_t *)0); } + +/* ./base/lib_slkclear.c */ + +#undef slk_clear +int slk_clear(void) + { return(*(int *)0); } + +/* ./base/lib_slkcolor.c */ + +#undef slk_color +int slk_color( + short color_pair_number) + { return(*(int *)0); } + +/* ./base/lib_slkinit.c */ + +#undef slk_init +int slk_init( + int format) + { return(*(int *)0); } + +/* ./base/lib_slklab.c */ + +#undef slk_label +char *slk_label( + int n) + { return(*(char **)0); } + +/* ./base/lib_slkrefr.c */ + +#undef slk_noutrefresh +int slk_noutrefresh(void) + { return(*(int *)0); } + +#undef slk_refresh +int slk_refresh(void) + { return(*(int *)0); } + +/* ./base/lib_slkset.c */ + +#undef slk_set +int slk_set( + int i, + const char *astr, + int format) + { return(*(int *)0); } + +/* ./base/lib_slktouch.c */ + +#undef slk_touch +int slk_touch(void) + { return(*(int *)0); } + +/* ./base/lib_touch.c */ + +#undef is_linetouched +NCURSES_BOOL is_linetouched( + WINDOW *win, + int line) + { return(*(NCURSES_BOOL *)0); } + +#undef is_wintouched +NCURSES_BOOL is_wintouched( + WINDOW *win) + { return(*(NCURSES_BOOL *)0); } + +#undef wtouchln +int wtouchln( + WINDOW *win, + int y, + int n, + int changed) + { return(*(int *)0); } + +/* ./trace/lib_traceatr.c */ + +#undef _traceattr2 +char *_traceattr2( + int bufnum, + attr_t newmode) + { return(*(char **)0); } + +#undef _traceattr +char *_traceattr( + attr_t newmode) + { return(*(char **)0); } + +#undef _nc_retrace_attr_t +attr_t _nc_retrace_attr_t( + attr_t code) + { return(*(attr_t *)0); } + +#undef _nc_altcharset_name +const char *_nc_altcharset_name( + attr_t attr, + chtype ch) + { return(*(const char **)0); } + +#undef _tracechtype2 +char *_tracechtype2( + int bufnum, + chtype ch) + { return(*(char **)0); } + +#undef _tracechtype +char *_tracechtype( + chtype ch) + { return(*(char **)0); } + +#undef _nc_retrace_chtype +attr_t _nc_retrace_chtype( + attr_t code) + { return(*(attr_t *)0); } + +#undef _tracecchar_t2 +char *_tracecchar_t2( + int bufnum, + const cchar_t *ch) + { return(*(char **)0); } + +#undef _tracecchar_t +char *_tracecchar_t( + const cchar_t *ch) + { return(*(char **)0); } + +/* ./trace/lib_tracedmp.c */ + +#undef _tracedump +void _tracedump( + const char *name, + WINDOW *win) + { /* void */ } + +/* ./trace/lib_tracemse.c */ + +#undef _tracemouse +char *_tracemouse( + MEVENT const *ep) + { return(*(char **)0); } + +/* ./tty/lib_tstp.c */ + +#include <signal.h> +#include <SigAction.h> + +#undef _nc_signal_handler +void _nc_signal_handler( + NCURSES_BOOL enable) + { /* void */ } + +/* ./base/lib_ungetch.c */ + +#undef _nc_fifo_dump +void _nc_fifo_dump(void) + { /* void */ } + +#undef ungetch +int ungetch( + int ch) + { return(*(int *)0); } + +/* ./tty/lib_vidattr.c */ + +#undef vidputs +int vidputs( + chtype newmode, + int (*outc)( + int p1)) + { return(*(int *)0); } + +#undef vidattr +int vidattr( + chtype newmode) + { return(*(int *)0); } + +#undef termattrs +chtype termattrs(void) + { return(*(chtype *)0); } + +/* ./base/lib_vline.c */ + +#undef wvline +int wvline( + WINDOW *win, + chtype ch, + int n) + { return(*(int *)0); } + +/* ./base/lib_wattroff.c */ + +#undef wattr_off +int wattr_off( + WINDOW *win, + attr_t at, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_wattron.c */ + +#undef wattr_on +int wattr_on( + WINDOW *win, + attr_t at, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_winch.c */ + +#undef winch +chtype winch( + WINDOW *win) + { return(*(chtype *)0); } + +/* ./base/lib_window.c */ + +#undef _nc_synchook +void _nc_synchook( + WINDOW *win) + { /* void */ } + +#undef mvderwin +int mvderwin( + WINDOW *win, + int y, + int x) + { return(*(int *)0); } + +#undef syncok +int syncok( + WINDOW *win, + NCURSES_BOOL bf) + { return(*(int *)0); } + +#undef wsyncup +void wsyncup( + WINDOW *win) + { /* void */ } + +#undef wsyncdown +void wsyncdown( + WINDOW *win) + { /* void */ } + +#undef wcursyncup +void wcursyncup( + WINDOW *win) + { /* void */ } + +#undef dupwin +WINDOW *dupwin( + WINDOW *win) + { return(*(WINDOW **)0); } + +/* ./base/nc_panel.c */ + +#undef _nc_panelhook +struct panelhook *_nc_panelhook(void) + { return(*(struct panelhook **)0); } + +/* ./base/safe_sprintf.c */ + +#undef _nc_printf_string +char *_nc_printf_string( + const char *fmt, + va_list ap) + { return(*(char **)0); } + +/* ./tty/tty_update.c */ + +#include <sys/time.h> +#include <sys/times.h> + +#undef doupdate +int doupdate(void) + { return(*(int *)0); } + +#undef _nc_outstr +void _nc_outstr( + const char *str) + { /* void */ } + +#undef _nc_scrolln +int _nc_scrolln( + int n, + int top, + int bot, + int maxy) + { return(*(int *)0); } + +#undef _nc_screen_resume +void _nc_screen_resume(void) + { /* void */ } + +#undef _nc_screen_init +void _nc_screen_init(void) + { /* void */ } + +#undef _nc_screen_wrap +void _nc_screen_wrap(void) + { /* void */ } + +#undef _nc_do_xmc_glitch +void _nc_do_xmc_glitch( + attr_t previous) + { /* void */ } + +/* ./trace/varargs.c */ + +typedef enum { + atUnknown = 0, atInteger, atFloat, atPoint, atString +} ARGTYPE; + +#undef _nc_varargs +char *_nc_varargs( + const char *fmt, + va_list ap) + { return(*(char **)0); } + +/* ./base/memmove.c */ + +#undef _nc_memmove +void _nc_memmove(void) + { /* void */ } + +/* ./base/sigaction.c */ + +#undef _nc_sigaction +void _nc_sigaction(void) + { /* void */ } + +/* ./base/vsscanf.c */ + +#undef _nc_vsscanf +void _nc_vsscanf(void) + { /* void */ } + +/* ./widechar/lib_box_set.c */ + +#undef wborder_set +int wborder_set( + WINDOW *win, + const cchar_t *ls, + const cchar_t *rs, + const cchar_t *ts, + const cchar_t *bs, + const cchar_t *tl, + const cchar_t *tr, + const cchar_t *bl, + const cchar_t *br) + { return(*(int *)0); } + +/* ./widechar/lib_cchar.c */ + +#undef setcchar +int setcchar( + cchar_t *wcval, + const wchar_t *wch, + const attr_t attrs, + short color_pair, + const void *opts) + { return(*(int *)0); } + +#undef getcchar +int getcchar( + const cchar_t *wcval, + wchar_t *wch, + attr_t *attrs, + short *color_pair, + void *opts) + { return(*(int *)0); } + +/* ./widechar/lib_get_wch.c */ + +#undef wget_wch +int wget_wch( + WINDOW *win, + wint_t *result) + { return(*(int *)0); } + +/* ./widechar/lib_get_wstr.c */ + +#undef wgetn_wstr +int wgetn_wstr( + WINDOW *win, + wint_t *str, + int maxlen) + { return(*(int *)0); } + +/* ./widechar/lib_hline_set.c */ + +#undef whline_set +int whline_set( + WINDOW *win, + const cchar_t *ch, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_in_wch.c */ + +#undef win_wch +int win_wch( + WINDOW *win, + cchar_t *wcval) + { return(*(int *)0); } + +/* ./widechar/lib_in_wchnstr.c */ + +#undef win_wchnstr +int win_wchnstr( + WINDOW *win, + cchar_t *wchstr, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_ins_nwstr.c */ + +#undef wins_nwstr +int wins_nwstr( + WINDOW *win, + const wchar_t *wstr, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_ins_wch.c */ + +#undef wins_wch +int wins_wch( + WINDOW *win, + const cchar_t *wch) + { return(*(int *)0); } + +/* ./widechar/lib_inwstr.c */ + +#undef winnwstr +int winnwstr( + WINDOW *win, + wchar_t *wstr, + int n) + { return(*(int *)0); } + +#undef winwstr +int winwstr( + WINDOW *win, + wchar_t *wstr) + { return(*(int *)0); } + +/* ./widechar/lib_unget_wch.c */ + +#undef unget_wch +int unget_wch( + const wchar_t wch) + { return(*(int *)0); } + +/* ./widechar/lib_vline_set.c */ + +#undef wvline_set +int wvline_set( + WINDOW *win, + const cchar_t *ch, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_wacs.c */ + +#undef _nc_wacs +cchar_t *_nc_wacs; + +#undef _nc_init_wacs +void _nc_init_wacs(void) + { /* void */ } + +/* ./widechar/lib_wunctrl.c */ + +#undef wunctrl +wchar_t *wunctrl( + cchar_t *wc) + { return(*(wchar_t **)0); } + +/* ./base/define_key.c */ + +#undef define_key +int define_key( + char *str, + int keycode) + { return(*(int *)0); } + +/* ./expanded.c */ + +#undef _nc_toggle_attr_on +void _nc_toggle_attr_on( + attr_t *S, + attr_t at) + { /* void */ } + +#undef _nc_toggle_attr_off +void _nc_toggle_attr_off( + attr_t *S, + attr_t at) + { /* void */ } + +#undef _nc_DelCharCost +int _nc_DelCharCost( + int count) + { return(*(int *)0); } + +#undef _nc_InsCharCost +int _nc_InsCharCost( + int count) + { return(*(int *)0); } + +#undef _nc_UpdateAttrs +void _nc_UpdateAttrs( + chtype c) + { /* void */ } + +/* ./base/keybound.c */ + +#undef keybound +char *keybound( + int code, + int count) + { return(*(char **)0); } + +/* ./base/keyok.c */ + +#undef keyok +int keyok( + int c, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_dft_fgbg.c */ + +#undef use_default_colors +int use_default_colors(void) + { return(*(int *)0); } + +#undef assume_default_colors +int assume_default_colors( + int fg, + int bg) + { return(*(int *)0); } + +/* ./base/lib_freeall.c */ + +#include <term_entry.h> + +#undef _nc_freeall +void _nc_freeall(void) + { /* void */ } + +/* ./tinfo/lib_print.c */ + +#undef mcprint +int mcprint( + char *data, + int len) + { return(*(int *)0); } + +/* ./base/resizeterm.c */ + +#undef is_term_resized +NCURSES_BOOL is_term_resized( + int ToLines, + int ToCols) + { return(*(NCURSES_BOOL *)0); } + +#undef resize_term +int resize_term( + int ToLines, + int ToCols) + { return(*(int *)0); } + +#undef resizeterm +int resizeterm( + int ToLines, + int ToCols) + { return(*(int *)0); } + +/* ./trace/trace_xnames.c */ + +#undef _nc_trace_xnames +void _nc_trace_xnames( + TERMTYPE *tp) + { /* void */ } + +/* ./base/tries.c */ + +#undef _nc_expand_try +char *_nc_expand_try( + struct tries *tree, + unsigned short code, + int *count, + size_t len) + { return(*(char **)0); } + +#undef _nc_remove_key +int _nc_remove_key( + struct tries **tree, + unsigned short code) + { return(*(int *)0); } + +#undef _nc_remove_string +int _nc_remove_string( + struct tries **tree, + char *string) + { return(*(int *)0); } + +/* ./base/version.c */ + +#undef curses_version +const char *curses_version(void) + { return(*(const char **)0); } + +/* ./base/wresize.c */ + +#undef wresize +int wresize( + WINDOW *win, + int ToLines, + int ToCols) + { return(*(int *)0); } + +/* ./tinfo/access.c */ + +#undef _nc_rootname +char *_nc_rootname( + char *path) + { return(*(char **)0); } + +#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 +void _nc_add_to_try( + struct tries **tree, + const char *str, + unsigned short code) + { /* void */ } + +/* ./tinfo/alloc_entry.c */ + +#undef _nc_init_entry +void _nc_init_entry( + TERMTYPE *const tp) + { /* void */ } + +#undef _nc_copy_entry +ENTRY *_nc_copy_entry( + ENTRY *oldp) + { return(*(ENTRY **)0); } + +#undef _nc_save_str +char *_nc_save_str( + const char *const string) + { return(*(char **)0); } + +#undef _nc_wrap_entry +void _nc_wrap_entry( + ENTRY *const ep, + NCURSES_BOOL copy_strings) + { /* void */ } + +#undef _nc_merge_entry +void _nc_merge_entry( + TERMTYPE *const to, + TERMTYPE *const from) + { /* void */ } + +/* ./tinfo/alloc_ttype.c */ + +#undef _nc_align_termtype +void _nc_align_termtype( + TERMTYPE *to, + TERMTYPE *from) + { /* void */ } + +#undef _nc_copy_termtype +void _nc_copy_termtype( + TERMTYPE *dst, + TERMTYPE *src) + { /* void */ } + +/* ./tinfo/captoinfo.c */ + +#undef _nc_captoinfo +char *_nc_captoinfo( + const char *cap, + const char *s, + int const parametrized) + { return(*(char **)0); } + +#undef _nc_infotocap +char *_nc_infotocap( + const char *cap, + const char *str, + int const parametrized) + { return(*(char **)0); } + +/* ./codes.c */ + +#undef boolcodes +char *const boolcodes[] = {0}; +#undef numcodes +char *const numcodes[] = {0}; +#undef strcodes +char *const strcodes[] = {0}; + +/* ./comp_captab.c */ + +#include <ncurses_cfg.h> + +#undef _nc_info_hash_table +const struct name_table_entry *const _nc_info_hash_table[995] = {0}; +#undef _nc_cap_hash_table +const struct name_table_entry *const _nc_cap_hash_table[995] = {0}; +#undef _nc_capalias_table +const struct alias _nc_capalias_table[] = {0}; +#undef _nc_infoalias_table +const struct alias _nc_infoalias_table[] = {0}; + +#undef _nc_get_table +const struct name_table_entry *_nc_get_table( + NCURSES_BOOL termcap) + { return(*(const struct name_table_entry **)0); } + +#undef _nc_get_hash_table +const struct name_table_entry *const *_nc_get_hash_table( + NCURSES_BOOL termcap) + { return(*(const struct name_table_entry **)0); } + +/* ./tinfo/comp_error.c */ + +#undef _nc_suppress_warnings +NCURSES_BOOL _nc_suppress_warnings; +#undef _nc_curr_line +int _nc_curr_line; +#undef _nc_curr_col +int _nc_curr_col; + +#undef _nc_set_source +void _nc_set_source( + const char *const name) + { /* void */ } + +#undef _nc_set_type +void _nc_set_type( + const char *const name) + { /* void */ } + +#undef _nc_get_type +void _nc_get_type( + char *name) + { /* void */ } + +#undef _nc_warning +void _nc_warning( + const char *const fmt, + ...) + { /* void */ } + +#undef _nc_err_abort +void _nc_err_abort( + const char *const fmt, + ...) + { /* void */ } + +#undef _nc_syserr_abort +void _nc_syserr_abort( + const char *const fmt, + ...) + { /* void */ } + +/* ./tinfo/comp_expand.c */ + +#undef _nc_tic_expand +char *_nc_tic_expand( + const char *srcp, + NCURSES_BOOL tic_format, + int numbers) + { return(*(char **)0); } + +/* ./tinfo/comp_hash.c */ + +#include <hashsize.h> + +#undef _nc_find_entry +struct name_table_entry const *_nc_find_entry( + const char *string, + const struct name_table_entry *const *hash_table) + { return(*(struct name_table_entry const **)0); } + +#undef _nc_find_type_entry +struct name_table_entry const *_nc_find_type_entry( + const char *string, + int type, + const struct name_table_entry *table) + { return(*(struct name_table_entry const **)0); } + +/* ./tinfo/comp_parse.c */ + +#undef _nc_check_termtype +void (*_nc_check_termtype)( + TERMTYPE *p1); +#undef _nc_head +ENTRY *_nc_head; +#undef _nc_tail +ENTRY *_nc_tail; + +#undef _nc_free_entries +void _nc_free_entries( + ENTRY *headp) + { /* void */ } + +#undef _nc_entry_match +NCURSES_BOOL _nc_entry_match( + char *n1, + char *n2) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_read_entry_source +void _nc_read_entry_source( + FILE *fp, + char *buf, + int literal, + NCURSES_BOOL silent, + NCURSES_BOOL (*hook)( + ENTRY *p1)) + { /* void */ } + +#undef _nc_resolve_uses +int _nc_resolve_uses( + NCURSES_BOOL fullresolve) + { return(*(int *)0); } + +/* ./tinfo/comp_scan.c */ + +#undef _nc_syntax +int _nc_syntax; +#undef _nc_curr_file_pos +long _nc_curr_file_pos; +#undef _nc_comment_start +long _nc_comment_start; +#undef _nc_comment_end +long _nc_comment_end; +#undef _nc_start_line +long _nc_start_line; +#undef _nc_curr_token +struct token _nc_curr_token; +#undef _nc_disable_period +NCURSES_BOOL _nc_disable_period; + +#undef _nc_get_token +int _nc_get_token( + NCURSES_BOOL silent) + { return(*(int *)0); } + +#undef _nc_trans_string +char _nc_trans_string( + char *ptr, + char *last) + { return(*(char *)0); } + +#undef _nc_push_token +void _nc_push_token( + int tokclass) + { /* void */ } + +#undef _nc_panic_mode +void _nc_panic_mode( + char ch) + { /* void */ } + +#undef _nc_reset_input +void _nc_reset_input( + FILE *fp, + char *buf) + { /* void */ } + +/* ./tinfo/doalloc.c */ + +#undef _nc_doalloc +void *_nc_doalloc( + void *oldp, + size_t amount) + { return(*(void **)0); } + +/* ./fallback.c */ + +#undef _nc_fallback +const TERMTYPE *_nc_fallback( + const char *name) + { return(*(const TERMTYPE **)0); } + +/* ./tinfo/free_ttype.c */ + +#undef _nc_free_termtype +void _nc_free_termtype( + TERMTYPE *ptr) + { /* void */ } + +#undef _nc_user_definable +NCURSES_BOOL _nc_user_definable; + +#undef use_extended_names +int use_extended_names( + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./tinfo/getenv_num.c */ + +#undef _nc_getenv_num +int _nc_getenv_num( + const char *name) + { return(*(int *)0); } + +/* ./tinfo/home_terminfo.c */ + +#undef _nc_home_terminfo +char *_nc_home_terminfo(void) + { return(*(char **)0); } + +/* ./tinfo/init_keytry.c */ + +#if 0 + +#include <init_keytry.h> + +#undef _nc_tinfo_fkeys +struct tinfo_fkeys _nc_tinfo_fkeys[]; + +#endif + +#undef _nc_init_keytry +void _nc_init_keytry(void) + { /* void */ } + +/* ./tinfo/lib_acs.c */ + +#undef acs_map +chtype acs_map[128 ]; + +#undef _nc_init_acs +void _nc_init_acs(void) + { /* void */ } + +/* ./tinfo/lib_baudrate.c */ + +#include <termcap.h> + +struct speed { + int s; + int sp; +}; + +#undef _nc_baudrate +int _nc_baudrate( + int OSpeed) + { return(*(int *)0); } + +#undef _nc_ospeed +int _nc_ospeed( + int BaudRate) + { return(*(int *)0); } + +#undef baudrate +int baudrate(void) + { return(*(int *)0); } + +/* ./tinfo/lib_cur_term.c */ + +#undef cur_term +TERMINAL *cur_term; + +#undef set_curterm +TERMINAL *set_curterm( + TERMINAL *termp) + { return(*(TERMINAL **)0); } + +#undef del_curterm +int del_curterm( + TERMINAL *termp) + { return(*(int *)0); } + +/* ./tinfo/lib_data.c */ + +#undef stdscr +WINDOW *stdscr; +#undef curscr +WINDOW *curscr; +#undef newscr +WINDOW *newscr; +#undef _nc_screen_chain +SCREEN *_nc_screen_chain; +#undef SP +SCREEN *SP; + +/* ./tinfo/lib_has_cap.c */ + +#undef has_ic +NCURSES_BOOL has_ic(void) + { return(*(NCURSES_BOOL *)0); } + +#undef has_il +NCURSES_BOOL has_il(void) + { return(*(NCURSES_BOOL *)0); } + +/* ./tinfo/lib_kernel.c */ + +#undef erasechar +char erasechar(void) + { return(*(char *)0); } + +#undef killchar +char killchar(void) + { return(*(char *)0); } + +#undef flushinp +int flushinp(void) + { return(*(int *)0); } + +/* ./lib_keyname.c */ + +#undef _nc_key_names +const struct kn _nc_key_names[] = {0}; + +#undef keyname +char *keyname( + int c) + { return(*(char **)0); } + +#undef key_name +char *key_name( + wchar_t c) + { return(*(char **)0); } + +/* ./tinfo/lib_longname.c */ + +#undef longname +char *longname(void) + { return(*(char **)0); } + +/* ./tinfo/lib_napms.c */ + +#undef napms +int napms( + int ms) + { return(*(int *)0); } + +/* ./tinfo/lib_options.c */ + +#undef idlok +int idlok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef idcok +void idcok( + WINDOW *win, + NCURSES_BOOL flag) + { /* void */ } + +#undef halfdelay +int halfdelay( + int t) + { return(*(int *)0); } + +#undef nodelay +int nodelay( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef notimeout +int notimeout( + WINDOW *win, + NCURSES_BOOL f) + { return(*(int *)0); } + +#undef wtimeout +void wtimeout( + WINDOW *win, + int delay) + { /* void */ } + +#undef keypad +int keypad( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef meta +int meta( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef curs_set +int curs_set( + int vis) + { return(*(int *)0); } + +#undef typeahead +int typeahead( + int fd) + { return(*(int *)0); } + +#undef has_key +int has_key( + int keycode) + { return(*(int *)0); } + +#undef _nc_keypad +int _nc_keypad( + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./tinfo/lib_raw.c */ + +#undef raw +int raw(void) + { return(*(int *)0); } + +#undef cbreak +int cbreak(void) + { return(*(int *)0); } + +#undef qiflush +void qiflush(void) + { /* void */ } + +#undef noraw +int noraw(void) + { return(*(int *)0); } + +#undef nocbreak +int nocbreak(void) + { return(*(int *)0); } + +#undef noqiflush +void noqiflush(void) + { /* void */ } + +#undef intrflush +int intrflush( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./tinfo/lib_setup.c */ + +#include <sys/ioctl.h> + +#undef use_env +void use_env( + NCURSES_BOOL f) + { /* void */ } + +#undef LINES +int LINES; +#undef COLS +int COLS; +#undef TABSIZE +int TABSIZE; + +#undef _nc_update_screensize +void _nc_update_screensize(void) + { /* void */ } + +#undef ttytype +char ttytype[256 ]; + +#undef setupterm +int setupterm( + char *tname, + int Filedes, + int *errret) + { return(*(int *)0); } + +/* ./tinfo/lib_termcap.c */ + +#undef UP +char *UP; +#undef BC +char *BC; + +#undef tgetent +int tgetent( + char *bufp, + const char *name) + { return(*(int *)0); } + +#if 0 + +#include <capdefaults.c> + +#endif + +#undef tgetflag +int tgetflag( + char *id) + { return(*(int *)0); } + +#undef tgetnum +int tgetnum( + char *id) + { return(*(int *)0); } + +#undef tgetstr +char *tgetstr( + char *id, + 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, + int x, + int y) + { return(*(char **)0); } + +/* ./tinfo/lib_ti.c */ + +#undef tigetflag +int tigetflag( + char *str) + { return(*(int *)0); } + +#undef tigetnum +int tigetnum( + char *str) + { return(*(int *)0); } + +#undef tigetstr +char *tigetstr( + char *str) + { return(*(char **)0); } + +/* ./tinfo/lib_tparm.c */ + +typedef struct { + union { + unsigned int num; + char *str; + } data; + NCURSES_BOOL num_type; +} stack_frame; + +#undef _nc_tparm_err +int _nc_tparm_err; + +#undef tparm +char *tparm( + char *string, + ...) + { return(*(char **)0); } + +/* ./tinfo/lib_tputs.c */ + +#undef PC +char PC; +#undef ospeed +short ospeed; +#undef _nc_nulls_sent +int _nc_nulls_sent; + +#undef delay_output +int delay_output( + int ms) + { return(*(int *)0); } + +#undef _nc_flush +void _nc_flush(void) + { /* void */ } + +#undef _nc_outch +int _nc_outch( + int ch) + { return(*(int *)0); } + +#undef putp +int putp( + const char *string) + { return(*(int *)0); } + +#undef tputs +int tputs( + const char *string, + int affcnt, + int (*outc)( + int p1)) + { return(*(int *)0); } + +/* ./trace/lib_trace.c */ + +#undef _nc_tracing +unsigned _nc_tracing; +#undef _nc_tputs_trace +const char *_nc_tputs_trace = {0}; +#undef _nc_outchars +long _nc_outchars; + +#undef trace +void trace( + const unsigned int tracelevel) + { /* void */ } + +#undef _tracef +void _tracef( + const char *fmt, + ...) + { /* void */ } + +#undef _nc_retrace_int +int _nc_retrace_int( + int code) + { return(*(int *)0); } + +#undef _nc_retrace_ptr +char *_nc_retrace_ptr( + char *code) + { return(*(char **)0); } + +#undef _nc_retrace_sp +SCREEN *_nc_retrace_sp( + SCREEN *code) + { return(*(SCREEN **)0); } + +#undef _nc_retrace_win +WINDOW *_nc_retrace_win( + WINDOW *code) + { return(*(WINDOW **)0); } + +/* ./trace/lib_tracebits.c */ + +typedef struct { + unsigned int val; + const char *name; +} BITNAMES; + +#undef _nc_tracebits +char *_nc_tracebits(void) + { return(*(char **)0); } + +/* ./trace/lib_tracechr.c */ + +#undef _tracechar +char *_tracechar( + int ch) + { return(*(char **)0); } + +/* ./tinfo/lib_ttyflags.c */ + +#undef _nc_get_tty_mode +int _nc_get_tty_mode( + struct termios *buf) + { return(*(int *)0); } + +#undef _nc_set_tty_mode +int _nc_set_tty_mode( + struct termios *buf) + { return(*(int *)0); } + +#undef def_shell_mode +int def_shell_mode(void) + { return(*(int *)0); } + +#undef def_prog_mode +int def_prog_mode(void) + { return(*(int *)0); } + +#undef reset_prog_mode +int reset_prog_mode(void) + { return(*(int *)0); } + +#undef reset_shell_mode +int reset_shell_mode(void) + { return(*(int *)0); } + +#undef savetty +int savetty(void) + { return(*(int *)0); } + +#undef resetty +int resetty(void) + { return(*(int *)0); } + +/* ./tty/lib_twait.c */ + +#undef _nc_timed_wait +int _nc_timed_wait( + int mode, + int milliseconds, + int *timeleft) + { return(*(int *)0); } + +/* ./tinfo/name_match.c */ + +#undef _nc_first_name +char *_nc_first_name( + const char *const sp) + { return(*(char **)0); } + +#undef _nc_name_match +int _nc_name_match( + const char *const namelst, + const char *const name, + const char *const delim) + { return(*(int *)0); } + +/* ./names.c */ + +#undef boolnames +char *const boolnames[] = {0}; +#undef boolfnames +char *const boolfnames[] = {0}; +#undef numnames +char *const numnames[] = {0}; +#undef numfnames +char *const numfnames[] = {0}; +#undef strnames +char *const strnames[] = {0}; +#undef strfnames +char *const strfnames[] = {0}; + +/* ./tinfo/parse_entry.c */ + +#undef _nc_parse_entry +int _nc_parse_entry( + struct entry *entryp, + int literal, + NCURSES_BOOL silent) + { return(*(int *)0); } + +#undef _nc_capcmp +int _nc_capcmp( + const char *s, + const char *t) + { return(*(int *)0); } + +typedef struct { + const char *from; + const char *to; +} assoc; + +/* ./tinfo/read_entry.c */ + +#undef _nc_tic_dir +const char *_nc_tic_dir( + const char *path) + { return(*(const char **)0); } + +#undef _nc_keep_tic_dir +void _nc_keep_tic_dir( + const char *path) + { /* void */ } + +#undef _nc_read_file_entry +int _nc_read_file_entry( + const char *const filename, + TERMTYPE *ptr) + { return(*(int *)0); } + +#undef _nc_read_entry +int _nc_read_entry( + const char *const tn, + char *const filename, + TERMTYPE *const tp) + { return(*(int *)0); } + +/* ./tinfo/read_termcap.c */ + +#undef _nc_read_termcap_entry +int _nc_read_termcap_entry( + const char *const tn, + TERMTYPE *const tp) + { return(*(int *)0); } + +/* ./tinfo/setbuf.c */ + +#undef _nc_set_buffer +void _nc_set_buffer( + FILE *ofp, + NCURSES_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 +NCURSES_BOOL _nc_safe_strcat( + string_desc *dst, + const char *src) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_safe_strcpy +NCURSES_BOOL _nc_safe_strcpy( + string_desc *dst, + const char *src) + { return(*(NCURSES_BOOL *)0); } + +/* ./trace/trace_buf.c */ + +typedef struct { + char *text; + size_t size; +} LIST; + +#undef _nc_trace_buf +char *_nc_trace_buf( + int bufnum, + size_t want) + { return(*(char **)0); } + +/* ./trace/trace_tries.c */ + +#undef _nc_trace_tries +void _nc_trace_tries( + struct tries *tree) + { /* void */ } + +/* ./unctrl.c */ + +#undef unctrl +char *unctrl( + chtype ch) + { return(*(char **)0); } + +/* ./trace/visbuf.c */ + +#undef _nc_visbuf2 +const char *_nc_visbuf2( + int bufnum, + const char *buf) + { return(*(const char **)0); } + +#undef _nc_visbuf +const char *_nc_visbuf( + const char *buf) + { return(*(const char **)0); } + +#undef _nc_viswbuf2 +const char *_nc_viswbuf2( + int bufnum, + const wchar_t *buf) + { return(*(const char **)0); } + +#undef _nc_viswbuf +const char *_nc_viswbuf( + const wchar_t *buf) + { return(*(const char **)0); } + +#undef _nc_viscbuf2 +const char *_nc_viscbuf2( + int bufnum, + const cchar_t *buf, + int len) + { return(*(const char **)0); } + +#undef _nc_viscbuf +const char *_nc_viscbuf( + const cchar_t *buf, + int len) + { return(*(const char **)0); } + +/* ./tinfo/write_entry.c */ + +#undef _nc_set_writedir +void _nc_set_writedir( + char *dir) + { /* void */ } + +#undef _nc_write_entry +void _nc_write_entry( + TERMTYPE *const tp) + { /* void */ } + +#undef _nc_tic_written +int _nc_tic_written(void) + { return(*(int *)0); } diff --git a/contrib/ncurses/ncurses/modules b/contrib/ncurses/ncurses/modules index eb84a07..541df6f 100644 --- a/contrib/ncurses/ncurses/modules +++ b/contrib/ncurses/ncurses/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.74 2000/10/03 08:51:18 tom Exp $ +# $Id: modules,v 1.90 2002/05/11 20:14:41 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998-2001,2002 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"), # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey <dickey@clark.net> 1996-1998 +# Author: Thomas E. Dickey <dickey@clark.net> 1996-1998, etc. # @ base @@ -109,15 +109,36 @@ lib_wattroff lib $(base) lib_wattron lib $(base) lib_winch lib $(base) lib_window lib $(base) +link_test lib . ../include/curses.h nc_panel lib $(base) safe_sprintf lib $(base) tty_update lib $(serial) ../include/term.h +varargs lib $(trace) # Modules for porting memmove lib $(base) sigaction lib $(base) vsscanf lib $(base) +# XSI extensions to the base library (wide-character) +@ widechar +lib_box_set lib $(wide) +lib_cchar lib $(wide) +lib_get_wch lib $(wide) +lib_erasewchar lib $(wide) +lib_get_wstr lib $(wide) +lib_hline_set lib $(wide) +lib_in_wch lib $(wide) +lib_in_wchnstr lib $(wide) +lib_ins_nwstr lib $(wide) +lib_ins_wch lib $(wide) +lib_inwstr lib $(wide) +lib_unget_wch lib $(wide) +lib_vid_attr lib $(wide) ../include/term.h +lib_vline_set lib $(wide) +lib_wacs lib $(wide) +lib_wunctrl lib $(wide) + # Extensions to the base library @ ext_funcs define_key lib $(base) @@ -186,4 +207,5 @@ strings lib $(tinfo) trace_buf lib $(trace) trace_tries lib $(trace) unctrl lib . +visbuf lib $(trace) $(INCDIR)/tic.h write_entry lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h diff --git a/contrib/ncurses/ncurses/tinfo/MKfallback.sh b/contrib/ncurses/ncurses/tinfo/MKfallback.sh index de3e23a..d1abcd2 100755 --- a/contrib/ncurses/ncurses/tinfo/MKfallback.sh +++ b/contrib/ncurses/ncurses/tinfo/MKfallback.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: MKfallback.sh,v 1.10 2000/12/10 00:14:39 tom Exp $ +# $Id: MKfallback.sh,v 1.11 2001/12/02 01:55:30 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -8,6 +8,28 @@ # from an on-disk terminfo tree) tries to match the type with one of a # specified list of types generated in. # + +terminfo_dir=$1 +shift + +terminfo_src=$1 +shift + +if test $# != 0 ; then + tmp_info=tmp_info + echo creating temporary terminfo directory... >&2 + + TERMINFO=`pwd`/$tmp_info + export TERMINFO + + TERMINFO_DIRS=$TERMINFO:$terminfo_dir + export TERMINFO_DIRS + + tic $terminfo_src >&2 +else + tmp_info= +fi + cat <<EOF /* * DO NOT EDIT THIS FILE BY HAND! It is generated by MKfallback.sh. @@ -73,3 +95,8 @@ cat <<EOF return((TERMTYPE *)0); } EOF + +if test -n "$tmp_info" ; then + echo removing temporary terminfo directory... >&2 + rm -rf $tmp_info +fi diff --git a/contrib/ncurses/ncurses/tinfo/MKkeys_list.sh b/contrib/ncurses/ncurses/tinfo/MKkeys_list.sh new file mode 100755 index 0000000..98d5b13 --- /dev/null +++ b/contrib/ncurses/ncurses/tinfo/MKkeys_list.sh @@ -0,0 +1,62 @@ +#! /bin/sh +# $Id: MKkeys_list.sh,v 1.2 2001/06/16 16:50:35 tom Exp $ +############################################################################## +# Copyright (c) 2001 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. # +############################################################################## +# +# MKkey_defs.sh -- generate list of function-keys for terminfo database +# +# Author: Thomas E. Dickey <dickey@herndon4.his.com> 2001 +# +# Extract function-key names from the Caps file +# +: ${AWK-awk} +DATA=${1-../../include/Caps} + +data=data$$ +trap 'rm -f $data' 0 1 2 5 15 +sed -e 's/[ ]\+/ /g' < $DATA >$data + +cat <<EOF +# These definitions were generated by $0 $DATA +KEY_BREAK +KEY_SRESET +KEY_RESET +KEY_RESIZE +EOF + +${AWK-awk} <$data ' +/^#/ {next;} +/^capalias/ {next;} +/^infoalias/ {next;} + +$5 != "-" { + if (substr($5, 1, 4) == "KEY_" ) { + printf "%s %s\n", $5, $1 + } +} +' diff --git a/contrib/ncurses/ncurses/tinfo/access.c b/contrib/ncurses/ncurses/tinfo/access.c index c8071d8..f5240c1 100644 --- a/contrib/ncurses/ncurses/tinfo/access.c +++ b/contrib/ncurses/ncurses/tinfo/access.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,13 +27,42 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey <dickey@clark.net> 1998,2000 * + * Author: Thomas E. Dickey <dickey@clark.net> 1998,2000,2001 * ****************************************************************************/ #include <curses.priv.h> #include <tic.h> +#include <nc_alloc.h> -MODULE_ID("$Id: access.c,v 1.7 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: access.c,v 1.9 2001/06/23 22:11:49 tom Exp $") + +#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) + +NCURSES_EXPORT(char *) +_nc_rootname(char *path) +{ + char *result = _nc_basename(path); +#if !defined(MIXEDCASE_FILENAMES) || defined(PROG_EXT) + static char *temp; + char *s; + + temp = strdup(result); + result = temp; +#if !defined(MIXEDCASE_FILENAMES) + int n; + for (s = result; *s != '\0'; ++s) { + *s = LOWERCASE(*s); + } +#endif +#if defined(PROG_EXT) + if ((s = strrchr(result, '.')) != 0) { + if (!strcmp(s, PROG_EXT)) + *s = '\0'; + } +#endif +#endif + return result; +} NCURSES_EXPORT(char *) _nc_basename(char *path) diff --git a/contrib/ncurses/ncurses/tinfo/alloc_entry.c b/contrib/ncurses/ncurses/tinfo/alloc_entry.c index e668e36..5c064cf 100644 --- a/contrib/ncurses/ncurses/tinfo/alloc_entry.c +++ b/contrib/ncurses/ncurses/tinfo/alloc_entry.c @@ -47,14 +47,14 @@ #include <tic.h> #include <term_entry.h> -MODULE_ID("$Id: alloc_entry.c,v 1.35 2001/01/13 22:40:17 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.36 2001/09/22 21:10:26 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 #define MAX_STRTAB 4096 /* documented maximum entry size */ -static char stringbuf[MAX_STRTAB]; /* buffer for string capabilities */ +static char *stringbuf; /* buffer for string capabilities */ static size_t next_free; /* next free character in stringbuf */ NCURSES_EXPORT(void) @@ -63,6 +63,9 @@ _nc_init_entry(TERMTYPE * const tp) { int i; + if (stringbuf == 0) + stringbuf = malloc(MAX_STRTAB); + #if NCURSES_XNAMES tp->num_Booleans = BOOLCOUNT; tp->num_Numbers = NUMCOUNT; diff --git a/contrib/ncurses/ncurses/tinfo/captoinfo.c b/contrib/ncurses/ncurses/tinfo/captoinfo.c index 9b68cd2..bf3116a 100644 --- a/contrib/ncurses/ncurses/tinfo/captoinfo.c +++ b/contrib/ncurses/ncurses/tinfo/captoinfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -92,7 +92,7 @@ #include <ctype.h> #include <tic.h> -MODULE_ID("$Id: captoinfo.c,v 1.40 2000/11/05 00:22:36 tom Exp $") +MODULE_ID("$Id: captoinfo.c,v 1.41 2001/06/02 22:50:31 skimo Exp $") #define MAX_PUSHED 16 /* max # args we can push onto the stack */ @@ -194,7 +194,7 @@ cvtchar(register const char *sp) case '2': case '3': len = 1; - while (isdigit(CharOf(*sp))) { + while (isdigit(UChar(*sp))) { c = 8 * c + (*sp++ - '0'); len++; } @@ -294,9 +294,9 @@ _nc_captoinfo(const char *cap, const char *s, int const parametrized) capstart = 0; if (s == 0) s = ""; - if (parametrized >= 0 && isdigit(CharOf(*s))) + if (parametrized >= 0 && isdigit(UChar(*s))) for (capstart = s;; s++) - if (!(isdigit(CharOf(*s)) || *s == '*' || *s == '.')) + if (!(isdigit(UChar(*s)) || *s == '*' || *s == '.')) break; while (*s != '\0') { @@ -464,7 +464,7 @@ _nc_captoinfo(const char *cap, const char *s, int const parametrized) dp = save_char(dp, '%'); s--; _nc_warning("unknown %% code %s (%#x) in %s", - unctrl((chtype) * s), CharOf(*s), cap); + unctrl((chtype) * s), UChar(*s), cap); break; } break; @@ -545,7 +545,7 @@ _nc_captoinfo(const char *cap, const char *s, int const parametrized) if (capstart) { dp = save_string(dp, "$<"); for (s = capstart;; s++) - if (isdigit(CharOf(*s)) || *s == '*' || *s == '.') + if (isdigit(UChar(*s)) || *s == '*' || *s == '.') dp = save_char(dp, *s); else break; @@ -569,8 +569,8 @@ bcd_expression(const char *str) char ch1, ch2; if (sscanf(str, fmt, &ch1, &ch2) == 2 - && isdigit(CharOf(ch1)) - && isdigit(CharOf(ch2)) + && isdigit(UChar(ch1)) + && isdigit(UChar(ch2)) && (ch1 == ch2)) { len = 28; #ifndef NDEBUG @@ -651,13 +651,13 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parametrize padding = str + strlen(str) - 1; if (*padding == '>' && *--padding == '/') { --padding; - while (isdigit(CharOf(*padding)) || *padding == '.' || *padding == '*') + while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*') padding--; if (*padding == '<' && *--padding == '$') trimmed = padding; padding += 2; - while (isdigit(CharOf(*padding)) || *padding == '.' || *padding == '*') + while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*') bufptr = save_char(bufptr, *padding++); } @@ -669,7 +669,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parametrize bufptr = save_char(bufptr, *++str); } else if (str[0] == '$' && str[1] == '<') { /* discard padding */ str += 2; - while (isdigit(CharOf(*str)) + while (isdigit(UChar(*str)) || *str == '.' || *str == '*' || *str == '/' @@ -737,7 +737,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parametrize case '8': case '9': bufptr = save_char(bufptr, '%'); - while (isdigit(CharOf(*str))) + while (isdigit(UChar(*str))) bufptr = save_char(bufptr, *str++); if (strchr("doxX.", *str)) { if (*str != 'd') /* termcap doesn't have octal, hex */ diff --git a/contrib/ncurses/ncurses/tinfo/comp_error.c b/contrib/ncurses/ncurses/tinfo/comp_error.c index a39de81..e67cb79 100644 --- a/contrib/ncurses/ncurses/tinfo/comp_error.c +++ b/contrib/ncurses/ncurses/tinfo/comp_error.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,16 +40,14 @@ #include <tic.h> -MODULE_ID("$Id: comp_error.c,v 1.21 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: comp_error.c,v 1.23 2001/09/23 00:58:30 tom Exp $") NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE; -NCURSES_EXPORT_VAR(int) -_nc_curr_line = 0; /* current line # in input */ -NCURSES_EXPORT_VAR(int) -_nc_curr_col = 0; /* current column # in input */ +NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */ +NCURSES_EXPORT_VAR(int) _nc_curr_col = 0; /* current column # in input */ - static const char *sourcename; - static char termtype[MAX_NAME_SIZE + 1]; +static const char *sourcename; +static char *termtype; NCURSES_EXPORT(void) _nc_set_source(const char *const name) @@ -60,15 +58,17 @@ _nc_set_source(const char *const name) NCURSES_EXPORT(void) _nc_set_type(const char *const name) { + if (termtype == 0) + termtype = _nc_doalloc(termtype, MAX_NAME_SIZE + 1); termtype[0] = '\0'; if (name) - strncat(termtype, name, sizeof(termtype) - 1); + strncat(termtype, name, MAX_NAME_SIZE); } NCURSES_EXPORT(void) _nc_get_type(char *name) { - strcpy(name, termtype); + strcpy(name, termtype != 0 ? termtype : ""); } static inline void @@ -79,7 +79,7 @@ where_is_problem(void) fprintf(stderr, ", line %d", _nc_curr_line); if (_nc_curr_col >= 0) fprintf(stderr, ", col %d", _nc_curr_col); - if (termtype[0]) + if (termtype != 0 && termtype[0] != '\0') fprintf(stderr, ", terminal '%s'", termtype); fputc(':', stderr); fputc(' ', stderr); diff --git a/contrib/ncurses/ncurses/tinfo/comp_expand.c b/contrib/ncurses/ncurses/tinfo/comp_expand.c index cf6339d..7ba438a 100644 --- a/contrib/ncurses/ncurses/tinfo/comp_expand.c +++ b/contrib/ncurses/ncurses/tinfo/comp_expand.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -35,7 +35,7 @@ #include <ctype.h> #include <tic.h> -MODULE_ID("$Id: comp_expand.c,v 1.15 2000/12/10 01:30:10 tom Exp $") +MODULE_ID("$Id: comp_expand.c,v 1.17 2001/09/22 19:16:52 tom Exp $") static int trailing_spaces(const char *src) @@ -46,9 +46,8 @@ trailing_spaces(const char *src) } /* this deals with differences over whether 0x7f and 0x80..0x9f are controls */ -#define CHAR_OF(s) (*(unsigned const char *)(s)) -#define REALCTL(s) (CHAR_OF(s) < 127 && iscntrl(CHAR_OF(s))) -#define REALPRINT(s) (CHAR_OF(s) < 127 && isprint(CHAR_OF(s))) +#define REALCTL(s) (UChar(*(s)) < 127 && iscntrl(UChar(*(s)))) +#define REALPRINT(s) (UChar(*(s)) < 127 && isprint(UChar(*(s)))) NCURSES_EXPORT(char *) _nc_tic_expand @@ -69,7 +68,7 @@ _nc_tic_expand } bufp = 0; - while ((ch = CharOf(*str)) != 0) { + while ((ch = UChar(*str)) != 0) { if (ch == '%' && REALPRINT(str + 1)) { buffer[bufp++] = *str++; /* @@ -99,7 +98,7 @@ _nc_tic_expand */ case 1: if (str[0] == L_BRACE - && isdigit(CharOf(str[1]))) { + && isdigit(UChar(str[1]))) { char *dst = 0; long value = strtol(str + 1, &dst, 0); if (dst != 0 @@ -169,7 +168,7 @@ _nc_tic_expand } #define UnCtl(c) ((c) + '@') else if (REALCTL(str) && ch != '\\' - && (!islong || isdigit(CharOf(str[1])))) { + && (!islong || isdigit(UChar(str[1])))) { (void) sprintf(&buffer[bufp], "^%c", UnCtl(ch)); bufp += 2; } else { diff --git a/contrib/ncurses/ncurses/tinfo/comp_hash.c b/contrib/ncurses/ncurses/tinfo/comp_hash.c index fb18e3a..9f2ee71 100644 --- a/contrib/ncurses/ncurses/tinfo/comp_hash.c +++ b/contrib/ncurses/ncurses/tinfo/comp_hash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -48,7 +48,7 @@ #define DEBUG(level, params) /*nothing */ #endif -MODULE_ID("$Id: comp_hash.c,v 1.24 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: comp_hash.c,v 1.25 2001/06/02 22:50:42 skimo Exp $") static int hash_function(const char *); @@ -201,7 +201,7 @@ parse_columns(char *buffer) if (*buffer != '#') { while (*buffer != '\0') { char *s; - for (s = buffer; (*s != '\0') && !isspace(CharOf(*s)); s++) + for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++) /*EMPTY */ ; if (s != buffer) { char mark = *s; @@ -216,7 +216,7 @@ parse_columns(char *buffer) col++; if (mark == '\0') break; - while (*++s && isspace(CharOf(*s))) + while (*++s && isspace(UChar(*s))) /*EMPTY */ ; buffer = s; } else diff --git a/contrib/ncurses/ncurses/tinfo/comp_parse.c b/contrib/ncurses/ncurses/tinfo/comp_parse.c index 917f95c..d59e4a5 100644 --- a/contrib/ncurses/ncurses/tinfo/comp_parse.c +++ b/contrib/ncurses/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -52,7 +52,7 @@ #include <tic.h> #include <term_entry.h> -MODULE_ID("$Id: comp_parse.c,v 1.48 2001/01/15 00:44:51 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.50 2001/06/16 17:52:18 tom Exp $") static void sanity_check(TERMTYPE *); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check; @@ -180,7 +180,7 @@ _nc_read_entry_source(FILE * fp, char *buf, memset(&thisentry, 0, sizeof(thisentry)); if (_nc_parse_entry(&thisentry, literal, silent) == ERR) break; - if (!isalnum(CharOf(thisentry.tterm.term_names[0]))) + if (!isalnum(UChar(thisentry.tterm.term_names[0]))) _nc_err_abort("terminal names must start with letter or digit"); /* @@ -486,6 +486,8 @@ sanity_check(TERMTYPE * tp) PAIRED(enter_xon_mode, exit_xon_mode); PAIRED(enter_am_mode, exit_am_mode); ANDMISSING(label_off, label_on); +#ifdef remove_clock PAIRED(display_clock, remove_clock); +#endif ANDMISSING(set_color_pair, initialize_pair); } diff --git a/contrib/ncurses/ncurses/tinfo/lib_acs.c b/contrib/ncurses/ncurses/tinfo/lib_acs.c index 54554a8..b84d8e2 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_acs.c +++ b/contrib/ncurses/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,12 +34,23 @@ #include <curses.priv.h> #include <term.h> /* ena_acs, acs_chars */ -MODULE_ID("$Id: lib_acs.c,v 1.18 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.21 2001/12/23 00:15:10 tom Exp $") +#if BROKEN_LINKER +NCURSES_EXPORT_VAR(chtype *) +_nc_acs_map(void) +{ + static chtype *the_map = 0; + if (the_map == 0) + the_map = typeCalloc(chtype, ACS_LEN); + return the_map; +} +#else NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = { 0 }; +#endif NCURSES_EXPORT(void) _nc_init_acs(void) @@ -143,11 +154,11 @@ _nc_init_acs(void) */ if (_nc_tracing & TRACE_CALLS) { size_t n, m; - char show[SIZEOF(acs_map) + 1]; - for (n = 1, m = 0; n < SIZEOF(acs_map); n++) { + char show[ACS_LEN + 1]; + for (n = 1, m = 0; n < ACS_LEN; n++) { if (acs_map[n] != 0) { show[m++] = (char) n; - show[m++] = TextOf(acs_map[n]); + show[m++] = ChCharOf(acs_map[n]); } } show[m] = 0; diff --git a/contrib/ncurses/ncurses/tinfo/lib_baudrate.c b/contrib/ncurses/ncurses/tinfo/lib_baudrate.c index ec62810..5238924 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_baudrate.c +++ b/contrib/ncurses/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2002 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 * @@ -69,13 +69,14 @@ #undef B115200 #undef B230400 #undef B460800 +#undef B921600 #define USE_OLD_TTY #include <sys/ttydev.h> #else #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.21 2001/06/30 22:59:22 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.22 2002/01/19 23:07:53 Andrey.A.Chernov Exp $") /* * int @@ -132,6 +133,9 @@ static struct speed const speeds[] = #ifdef B460800 {B460800, 460800}, #endif +#ifdef B921600 + {B921600, 921600}, +#endif }; NCURSES_EXPORT(int) @@ -203,14 +207,14 @@ baudrate(void) #ifdef USE_OLD_TTY result = cfgetospeed(&cur_term->Nttyb); ospeed = _nc_ospeed(result); -#else +#else /* !USE_OLD_TTY */ #ifdef TERMIOS ospeed = cfgetospeed(&cur_term->Nttyb); #else ospeed = cur_term->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); -#endif /* __FreeBSD__ */ +#endif if (cur_term != 0) cur_term->_baudrate = result; diff --git a/contrib/ncurses/ncurses/tinfo/lib_kernel.c b/contrib/ncurses/ncurses/tinfo/lib_kernel.c index ab8e4db..b4d3c7f 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_kernel.c +++ b/contrib/ncurses/ncurses/tinfo/lib_kernel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 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,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * + * and: Thomas E. Dickey 2002 * ****************************************************************************/ /* @@ -47,7 +48,28 @@ #include <curses.priv.h> #include <term.h> /* cur_term */ -MODULE_ID("$Id: lib_kernel.c,v 1.21 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.22 2002/05/11 20:32:18 tom Exp $") + +static int +_nc_vdisable(void) +{ + int value; +#if defined(_POSIX_VDISABLE) && defined(HAVE_UNISTD_H) + value = _POSIX_VDISABLE; +#endif +#if defined(_PC_VDISABLE) + if (value == -1) { + value = fpathconf(0, _PC_VDISABLE); + if (value == -1) { + value = 0377; + } + } +#elif defined(VDISABLE) + if (value == -1) + value = VDISABLE; +#endif + return value; +} /* * erasechar() @@ -59,16 +81,19 @@ MODULE_ID("$Id: lib_kernel.c,v 1.21 2000/12/10 02:55:07 tom Exp $") NCURSES_EXPORT(char) erasechar(void) { + int result = ERR; T((T_CALLED("erasechar()"))); if (cur_term != 0) { #ifdef TERMIOS - returnCode(cur_term->Ottyb.c_cc[VERASE]); + result = cur_term->Ottyb.c_cc[VERASE]; + if (result == _nc_vdisable()) + result = ERR; #else - returnCode(cur_term->Ottyb.sg_erase); + result = cur_term->Ottyb.sg_erase; #endif } - returnCode(ERR); + returnCode(result); } /* @@ -81,16 +106,19 @@ erasechar(void) NCURSES_EXPORT(char) killchar(void) { + int result = ERR; T((T_CALLED("killchar()"))); if (cur_term != 0) { #ifdef TERMIOS - returnCode(cur_term->Ottyb.c_cc[VKILL]); + result = cur_term->Ottyb.c_cc[VKILL]; + if (result == _nc_vdisable()) + result = ERR; #else - returnCode(cur_term->Ottyb.sg_kill); + result = cur_term->Ottyb.sg_kill; #endif } - returnCode(ERR); + returnCode(result); } /* diff --git a/contrib/ncurses/ncurses/tinfo/lib_napms.c b/contrib/ncurses/ncurses/tinfo/lib_napms.c index df1c2e4..20537be 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_napms.c +++ b/contrib/ncurses/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -45,20 +45,9 @@ #if HAVE_SYS_TIME_H #include <sys/time.h> /* needed for MacOS X DP3 */ #endif -#elif USE_FUNC_POLL -#if HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#elif HAVE_SELECT -#if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT -#include <sys/time.h> -#endif -#if HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.11 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.12 2001/12/22 22:20:40 tom Exp $") NCURSES_EXPORT(int) napms(int ms) @@ -72,18 +61,9 @@ napms(int ms) ts.tv_nsec = (ms % 1000) * 1000000; nanosleep(&ts, NULL); } -#elif USE_FUNC_POLL - { - struct pollfd fds[1]; - poll(fds, 0, ms); - } -#elif HAVE_SELECT - { - struct timeval tval; - tval.tv_sec = ms / 1000; - tval.tv_usec = (ms % 1000) * 1000; - select(0, NULL, NULL, NULL, &tval); - } +#else + _nc_timed_wait(0, ms, (int *) 0); #endif + returnCode(OK); } diff --git a/contrib/ncurses/ncurses/tinfo/lib_options.c b/contrib/ncurses/ncurses/tinfo/lib_options.c index 581357d..05bd476 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_options.c +++ b/contrib/ncurses/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001,2002 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 * @@ -42,7 +42,7 @@ #include <term.h> -MODULE_ID("$Id: lib_options.c,v 1.42 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.46 2002/02/02 19:40:54 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) @@ -115,6 +115,7 @@ wtimeout(WINDOW *win, int delay) if (win) { win->_delay = delay; } + returnVoid; } NCURSES_EXPORT(int) @@ -251,5 +252,6 @@ _nc_keypad(bool flag) _nc_init_keytry(); SP->_tried = TRUE; } + SP->_keypad_on = flag; return (OK); } diff --git a/contrib/ncurses/ncurses/tinfo/lib_print.c b/contrib/ncurses/ncurses/tinfo/lib_print.c index 291e84c..01540ea 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_print.c +++ b/contrib/ncurses/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 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 * @@ -35,7 +35,7 @@ #include <term.h> -MODULE_ID("$Id: lib_print.c,v 1.13 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.14 2002/03/16 21:45:08 tom Exp $") NCURSES_EXPORT(int) mcprint(char *data, int len) @@ -66,7 +66,7 @@ mcprint(char *data, int len) } (void) strcpy(mybuf, switchon); - memcpy(mybuf + onsize, data, len); + memcpy(mybuf + onsize, data, (unsigned) len); if (offsize) (void) strcpy(mybuf + onsize + len, prtr_off); diff --git a/contrib/ncurses/ncurses/tinfo/lib_setup.c b/contrib/ncurses/ncurses/tinfo/lib_setup.c index e73e7e0..1e49b2b 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_setup.c +++ b/contrib/ncurses/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -48,7 +48,7 @@ #include <term.h> /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_setup.c,v 1.64 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.68 2001/12/08 22:14:18 tom Exp $") /**************************************************************************** * @@ -97,18 +97,17 @@ static void do_prototype(void); NCURSES_EXPORT(void) use_env(bool f) { + T((T_CALLED("use_env()"))); _use_env = f; + returnVoid; } -NCURSES_EXPORT_VAR(int) -LINES = 0; -NCURSES_EXPORT_VAR(int) -COLS = 0; -NCURSES_EXPORT_VAR(int) -TABSIZE = 0; +NCURSES_EXPORT_VAR(int) LINES = 0; +NCURSES_EXPORT_VAR(int) COLS = 0; +NCURSES_EXPORT_VAR(int) TABSIZE = 0; - static void - _nc_get_screensize(int *linep, int *colp) +static void +_nc_get_screensize(int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ { /* figure out the size of the screen */ @@ -178,8 +177,10 @@ TABSIZE = 0; } /* the ultimate fallback, assume fixed 24x80 size */ - if (*linep <= 0 || *colp <= 0) { + if (*linep <= 0) { *linep = 24; + } + if (*colp <= 0) { *colp = 80; } @@ -235,7 +236,7 @@ _nc_update_screensize(void) exit(EXIT_FAILURE);\ } -#if USE_DATABASE +#if USE_DATABASE || USE_TERMCAP static int grab_entry(const char *const tn, TERMTYPE * const tp) /* return 1 if entry found, 0 if not found, -1 if database not accessible */ @@ -249,6 +250,7 @@ grab_entry(const char *const tn, TERMTYPE * const tp) if (strchr(tn, '/')) return 0; +#if USE_DATABASE if ((status = _nc_read_entry(tn, filename, tp)) != 1) { #if !PURE_TERMINFO @@ -262,6 +264,9 @@ grab_entry(const char *const tn, TERMTYPE * const tp) #endif /* PURE_TERMINFO */ } +#else + status = _nc_read_termcap_entry(tn, tp); +#endif /* * If we have an entry, force all of the cancelled strings to null @@ -295,8 +300,7 @@ NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; */ NCURSES_EXPORT(int) -setupterm -(NCURSES_CONST char *tname, int Filedes, int *errret) +setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) { struct term *term_ptr; int status; @@ -321,7 +325,7 @@ setupterm if (term_ptr == 0) { ret_error0(-1, "Not enough memory to create terminal structure.\n"); } -#if USE_DATABASE +#if USE_DATABASE || USE_TERMCAP status = grab_entry(tname, &term_ptr->type); #else status = 0; diff --git a/contrib/ncurses/ncurses/tinfo/lib_termname.c b/contrib/ncurses/ncurses/tinfo/lib_termname.c index 6b287e0..57ce807 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_termname.c +++ b/contrib/ncurses/ncurses/tinfo/lib_termname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,7 +29,7 @@ #include <curses.priv.h> #include <tic.h> /* for MAX_ALIAS */ -MODULE_ID("$Id: lib_termname.c,v 1.6 2000/12/10 02:55:08 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.7 2001/08/04 19:29:38 tom Exp $") NCURSES_EXPORT(char *) termname(void) @@ -37,12 +37,12 @@ termname(void) char *name = getenv("TERM"); static char ret[MAX_ALIAS + 1]; - T(("termname() called")); + T((T_CALLED("termname()"))); if (name != 0) { ret[0] = '\0'; (void) strncat(ret, name, sizeof(ret) - 1); name = ret; } - return name; + returnPtr(name); } diff --git a/contrib/ncurses/ncurses/tinfo/lib_tgoto.c b/contrib/ncurses/ncurses/tinfo/lib_tgoto.c index 19edb4f..17649d5 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_tgoto.c +++ b/contrib/ncurses/ncurses/tinfo/lib_tgoto.c @@ -35,7 +35,7 @@ #include <ctype.h> #include <termcap.h> -MODULE_ID("$Id: lib_tgoto.c,v 1.7 2001/03/24 22:25:55 tom Exp $") +MODULE_ID("$Id: lib_tgoto.c,v 1.8 2001/06/02 22:44:42 tom Exp $") #if !PURE_TERMINFO static bool @@ -112,7 +112,7 @@ tgoto_internal(const char *string, int x, int y) *value %= 1000; break; case '+': - *value += CharOf(*++string); + *value += UChar(*++string); /* FALLTHRU */ case '.': /* diff --git a/contrib/ncurses/ncurses/tinfo/lib_tparm.c b/contrib/ncurses/ncurses/tinfo/lib_tparm.c index e62b824..931669e 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_tparm.c +++ b/contrib/ncurses/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -42,7 +42,7 @@ #include <term.h> #include <tic.h> -MODULE_ID("$Id: lib_tparm.c,v 1.52 2001/03/11 15:12:48 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.53 2001/06/02 22:53:59 tom Exp $") /* * char * @@ -301,7 +301,7 @@ parse_format(const char *s, char *format, int *len) } break; default: - if (isdigit(CharOf(*s))) { + if (isdigit(UChar(*s))) { value = (value * 10) + (*s - '0'); if (value > 10000) err = TRUE; diff --git a/contrib/ncurses/ncurses/tinfo/lib_tputs.c b/contrib/ncurses/ncurses/tinfo/lib_tputs.c index 63dbbd9..26d805b 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_tputs.c +++ b/contrib/ncurses/ncurses/tinfo/lib_tputs.c @@ -45,7 +45,7 @@ #include <termcap.h> /* ospeed */ #include <tic.h> -MODULE_ID("$Id: lib_tputs.c,v 1.56 2001/04/21 18:53:53 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.59 2001/09/22 18:35:23 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ @@ -104,72 +104,6 @@ _nc_outch(int ch) return OK; } -#if USE_WIDEC_SUPPORT -/* - * Reference: The Unicode Standard 2.0 - * - * No surrogates supported (we're storing only one 16-bit Unicode value per - * cell). - */ -NCURSES_EXPORT(int) -_nc_utf8_outch(int ch) -{ - static const unsigned byteMask = 0xBF; - static const unsigned otherMark = 0x80; - static const unsigned firstMark[] = - {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC}; - - int result[7], *ptr; - int count = 0; - - if ((unsigned int) ch < 0x80) - count = 1; - else if ((unsigned int) ch < 0x800) - count = 2; - else if ((unsigned int) ch < 0x10000) - count = 3; - else if ((unsigned int) ch < 0x200000) - count = 4; - else if ((unsigned int) ch < 0x4000000) - count = 5; - else if ((unsigned int) ch <= 0x7FFFFFFF) - count = 6; - else { - count = 3; - ch = 0xFFFD; - } - ptr = result + count; - switch (count) { - 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++); - return OK; -} -#endif - NCURSES_EXPORT(int) putp(const char *string) { @@ -228,19 +162,19 @@ tputs * (like nethack) actually do the likes of tputs("50") to get delays. */ trailpad = 0; - if (isdigit(*string)) { - while (isdigit(*string)) { + if (isdigit(UChar(*string))) { + while (isdigit(UChar(*string))) { trailpad = trailpad * 10 + (*string - '0'); string++; } trailpad *= 10; if (*string == '.') { string++; - if (isdigit(*string)) { + if (isdigit(UChar(*string))) { trailpad += (*string - '0'); string++; } - while (isdigit(*string)) + while (isdigit(UChar(*string))) string++; } @@ -265,7 +199,7 @@ tputs bool mandatory; string++; - if ((!isdigit(CharOf(*string)) && *string != '.') + if ((!isdigit(UChar(*string)) && *string != '.') || !strchr(string, '>')) { (*outc) ('$'); (*outc) ('<'); @@ -273,18 +207,18 @@ tputs } number = 0; - while (isdigit(CharOf(*string))) { + while (isdigit(UChar(*string))) { number = number * 10 + (*string - '0'); string++; } number *= 10; if (*string == '.') { string++; - if (isdigit(CharOf(*string))) { + if (isdigit(UChar(*string))) { number += (*string - '0'); string++; } - while (isdigit(CharOf(*string))) + while (isdigit(UChar(*string))) string++; } diff --git a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c index d72df2d..e71be89 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c +++ b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -38,7 +38,7 @@ #include <curses.priv.h> #include <term.h> /* cur_term */ -MODULE_ID("$Id: lib_ttyflags.c,v 1.5 2000/12/10 02:55:08 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.6 2001/12/16 01:19:01 tom Exp $") #undef tabs @@ -121,7 +121,7 @@ reset_prog_mode(void) if (cur_term != 0) { _nc_set_tty_mode(&cur_term->Nttyb); if (SP) { - if (stdscr && stdscr->_use_keypad) + if (SP->_keypad_on) _nc_keypad(TRUE); NC_BUFFERED(TRUE); } diff --git a/contrib/ncurses/ncurses/tinfo/name_match.c b/contrib/ncurses/ncurses/tinfo/name_match.c index 934b24a..e7205d5 100644 --- a/contrib/ncurses/ncurses/tinfo/name_match.c +++ b/contrib/ncurses/ncurses/tinfo/name_match.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000,2001 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,7 +34,7 @@ #include <term.h> #include <tic.h> -MODULE_ID("$Id: name_match.c,v 1.10 2000/12/10 02:55:08 tom Exp $") +MODULE_ID("$Id: name_match.c,v 1.11 2001/09/22 21:11:34 tom Exp $") /* * _nc_first_name(char *names) @@ -46,10 +46,12 @@ NCURSES_EXPORT(char *) _nc_first_name(const char *const sp) /* get the first name from the given name list */ { - static char buf[MAX_NAME_SIZE + 1]; + static char *buf; register unsigned n; - for (n = 0; n < sizeof(buf) - 1; n++) { + if (buf == 0) + buf = _nc_doalloc(buf, MAX_NAME_SIZE + 1); + for (n = 0; n < MAX_NAME_SIZE; n++) { if ((buf[n] = sp[n]) == '\0' || (buf[n] == '|')) break; diff --git a/contrib/ncurses/ncurses/tinfo/parse_entry.c b/contrib/ncurses/ncurses/tinfo/parse_entry.c index ef66b30..797974c 100644 --- a/contrib/ncurses/ncurses/tinfo/parse_entry.c +++ b/contrib/ncurses/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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 * @@ -47,7 +47,7 @@ #define __INTERNAL_CAPS_VISIBLE #include <term_entry.h> -MODULE_ID("$Id: parse_entry.c,v 1.53 2001/03/03 21:13:09 Todd.C.Miller Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.55 2002/04/22 00:01:30 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -243,7 +243,7 @@ _nc_parse_entry (base == entryp->tterm.term_names) ? "primary name" : "alias", - ptr - base, base); + (int) (ptr - base), base); } } @@ -482,7 +482,7 @@ _nc_capcmp(const char *s, const char *t) for (;;) { if (s[0] == '$' && s[1] == '<') { for (s += 2;; s++) - if (!(isdigit(CharOf(*s)) + if (!(isdigit(UChar(*s)) || *s == '.' || *s == '*' || *s == '/' @@ -492,7 +492,7 @@ _nc_capcmp(const char *s, const char *t) if (t[0] == '$' && t[1] == '<') { for (t += 2;; t++) - if (!(isdigit(CharOf(*t)) + if (!(isdigit(UChar(*t)) || *t == '.' || *t == '*' || *t == '/' diff --git a/contrib/ncurses/ncurses/tinfo/read_termcap.c b/contrib/ncurses/ncurses/tinfo/read_termcap.c index da88f0b..c6e7e35 100644 --- a/contrib/ncurses/ncurses/tinfo/read_termcap.c +++ b/contrib/ncurses/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -52,10 +52,12 @@ #include <curses.priv.h> #include <ctype.h> +#include <sys/types.h> +#include <sys/stat.h> #include <tic.h> #include <term_entry.h> -MODULE_ID("$Id: read_termcap.c,v 1.55 2000/12/10 02:55:08 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.58 2001/10/28 01:11:34 tom Exp $") #if !PURE_TERMINFO @@ -72,6 +74,17 @@ MODULE_ID("$Id: read_termcap.c,v 1.55 2000/12/10 02:55:08 tom Exp $") #define TC_SYS_ERR -3 #define TC_REF_LOOP -4 +static char * +get_termpath(void) +{ + char *result; + + if (!use_terminfo_vars() || (result = getenv("TERMPATH")) == 0) + result = TERMPATH; + T(("TERMPATH is %s", result)); + return result; +} + #if USE_GETCAP #if HAVE_BSD_CGETENT @@ -125,13 +138,7 @@ static int _nc_nfcmp(const char *, char *); #define BFRAG 1024 #define BSIZE 1024 -#define ESC ('[' & 037) /* ASCII ESC */ #define MAX_RECURSION 32 /* maximum getent recursion */ -#define SFRAG 100 /* cgetstr mallocs in SFRAG chunks */ - -#define RECOK (char)0 -#define TCERR (char)1 -#define SHADOW (char)2 static size_t topreclen; /* toprec length */ static char *toprec; /* Additional record specified by cgetset() */ @@ -797,9 +804,9 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) */ _nc_str_init(&desc, pathbuf, sizeof(pathbuf)); if (cp == NULL) { - _nc_safe_strcpy(&desc, "/etc/termcap /usr/share/misc/termcap"); + _nc_safe_strcpy(&desc, get_termpath()); } else if (!is_pathname(cp)) { /* TERMCAP holds an entry */ - if ((termpath = getenv("TERMPATH")) != 0) { + if ((termpath = get_termpath()) != 0) { _nc_safe_strcat(&desc, termpath); } else { char temp[PBUFSIZ]; @@ -812,8 +819,8 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) /* 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"); + _nc_safe_strcat(&desc, " "); + _nc_safe_strcat(&desc, get_termpath()); } } else { /* user-defined name in TERMCAP */ _nc_safe_strcat(&desc, cp); /* still can be tokenized */ @@ -908,18 +915,24 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) static int add_tc(char *termpaths[], char *path, int count) { + char *save = strchr(path, NCURSES_PATHSEP); + if (save != 0) + *save = '\0'; if (count < MAXPATHS - && _nc_access(path, R_OK) == 0) + && _nc_access(path, R_OK) == 0) { termpaths[count++] = path; + T(("Adding termpath %s", path)); + } termpaths[count] = 0; + if (save != 0) + *save = NCURSES_PATHSEP; return count; } #define ADD_TC(path, count) filecount = add_tc(termpaths, path, count) #endif /* !USE_GETCAP */ NCURSES_EXPORT(int) -_nc_read_termcap_entry -(const char *const tn, TERMTYPE * const tp) +_nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) { int found = FALSE; ENTRY *ep; @@ -931,6 +944,7 @@ _nc_read_termcap_entry static char *source; static int lineno; + T(("read termcap entry for %s", tn)); if (use_terminfo_vars() && (p = getenv("TERMCAP")) != 0 && !is_pathname(p) && _nc_name_match(p, tn, "|:")) { /* TERMCAP holds a termcap entry */ @@ -976,41 +990,38 @@ _nc_read_termcap_entry FILE *fp; char *tc, *termpaths[MAXPATHS]; int filecount = 0; + int j, k; bool use_buffer = FALSE; + bool normal = TRUE; char tc_buf[1024]; char pathbuf[PATH_MAX]; + char *copied = 0; + char *cp; + struct stat test_stat[MAXPATHS]; termpaths[filecount] = 0; if (use_terminfo_vars() && (tc = getenv("TERMCAP")) != 0) { if (is_pathname(tc)) { /* interpret as a filename */ ADD_TC(tc, 0); + normal = FALSE; } else if (_nc_name_match(tc, tn, "|:")) { /* treat as a capability file */ use_buffer = TRUE; (void) sprintf(tc_buf, "%.*s\n", (int) sizeof(tc_buf) - 2, tc); - } else if ((tc = getenv("TERMPATH")) != 0) { - char *cp; - - for (cp = tc; *cp; cp++) { - if (*cp == NCURSES_PATHSEP) - *cp = '\0'; - else if (cp == tc || cp[-1] == '\0') { - ADD_TC(cp, filecount); - } - } + normal = FALSE; } - } else { /* normal case */ - char envhome[PATH_MAX], *h; + } - filecount = 0; + if (normal) { /* normal case */ + char envhome[PATH_MAX], *h; - /* - * Probably /etc/termcap is a symlink to /usr/share/misc/termcap. - * Avoid reading the same file twice. - */ - if (_nc_access("/etc/termcap", F_OK) == 0) - ADD_TC("/etc/termcap", filecount); - else - ADD_TC("/usr/share/misc/termcap", filecount); + copied = strdup(get_termpath()); + for (cp = copied; *cp; cp++) { + if (*cp == NCURSES_PATHSEP) + *cp = '\0'; + else if (cp == copied || cp[-1] == '\0') { + ADD_TC(cp, filecount); + } + } #define PRIVATE_CAP "%s/.termcap" @@ -1023,6 +1034,37 @@ _nc_read_termcap_entry } } + /* + * Probably /etc/termcap is a symlink to /usr/share/misc/termcap. + * Avoid reading the same file twice. + */ +#ifdef HAVE_LINK + for (j = 0; j < filecount; j++) { + bool omit = FALSE; + if (stat(termpaths[j], &test_stat[j]) != 0 + || (test_stat[j].st_mode & S_IFMT) != S_IFREG) { + omit = TRUE; + } else { + for (k = 0; k < j; k++) { + if (test_stat[k].st_dev == test_stat[j].st_dev + && test_stat[k].st_ino == test_stat[j].st_ino) { + omit = TRUE; + break; + } + } + } + if (omit) { + T(("Path %s is a duplicate", termpaths[j])); + for (k = j + 1; k < filecount; k++) { + termpaths[k - 1] = termpaths[k]; + test_stat[k - 1] = test_stat[k]; + } + --filecount; + --j; + } + } +#endif + /* parse the sources */ if (use_buffer) { _nc_set_source("TERMCAP"); @@ -1038,7 +1080,8 @@ _nc_read_termcap_entry for (i = 0; i < filecount; i++) { T(("Looking for %s in %s", tn, termpaths[i])); - if ((fp = fopen(termpaths[i], "r")) != (FILE *) 0) { + if (_nc_access(termpaths[i], R_OK) == 0 + && (fp = fopen(termpaths[i], "r")) != (FILE *) 0) { _nc_set_source(termpaths[i]); /* @@ -1052,6 +1095,8 @@ _nc_read_termcap_entry } } } + if (copied != 0) + free(copied); #endif /* USE_GETCAP */ if (_nc_head == 0) diff --git a/contrib/ncurses/ncurses/tinfo/write_entry.c b/contrib/ncurses/ncurses/tinfo/write_entry.c index ffcf402..9750dff 100644 --- a/contrib/ncurses/ncurses/tinfo/write_entry.c +++ b/contrib/ncurses/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 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 * @@ -52,7 +52,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.56 2000/12/10 02:55:08 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.58 2002/04/21 20:35:08 tom Exp $") static int total_written; @@ -214,6 +214,10 @@ _nc_write_entry(TERMTYPE * const tp) char linkname[PATH_MAX]; #if USE_SYMLINKS char symlinkname[PATH_MAX]; +#if !HAVE_LINK +#undef HAVE_LINK +#define HAVE_LINK 1 +#endif #endif /* USE_SYMLINKS */ static int call_count; static time_t start_time; /* time at start of writes */ @@ -361,10 +365,10 @@ _nc_write_entry(TERMTYPE * const tp) #define WRITE_STRING(str) (fwrite(str, sizeof(char), strlen(str) + 1, fp) == strlen(str) + 1) static int -compute_offsets(char **Strings, int strmax, short *offsets) +compute_offsets(char **Strings, unsigned strmax, short *offsets) { size_t nextfree = 0; - int i; + unsigned i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -381,9 +385,9 @@ compute_offsets(char **Strings, int strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, int count) +convert_shorts(unsigned char *buf, short *Numbers, unsigned count) { - int i; + unsigned i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; diff --git a/contrib/ncurses/ncurses/trace/lib_trace.c b/contrib/ncurses/ncurses/trace/lib_trace.c index 08790bb..29eecc0 100644 --- a/contrib/ncurses/ncurses/trace/lib_trace.c +++ b/contrib/ncurses/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +40,7 @@ #include <ctype.h> -MODULE_ID("$Id: lib_trace.c,v 1.38 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.48 2001/10/20 20:35:25 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -59,10 +59,10 @@ trace(const unsigned int tracelevel GCC_UNUSED) static bool been_here = FALSE; static char my_name[] = "trace"; - _nc_tracing = tracelevel; if (!been_here && tracelevel) { been_here = TRUE; + _nc_tracing = tracelevel; if (_nc_access(my_name, W_OK) < 0 || (tracefp = fopen(my_name, "wb")) == 0) { perror("curses: Can't open 'trace' file: "); @@ -77,73 +77,14 @@ trace(const unsigned int tracelevel GCC_UNUSED) #elif HAVE_SETBUF /* POSIX */ (void) setbuffer(tracefp, (char *) 0); #endif - _tracef("TRACING NCURSES version %s", curses_version()); + _tracef("TRACING NCURSES version %s (tracelevel=%#x)", + curses_version(), tracelevel); + } else if (_nc_tracing != tracelevel) { + _nc_tracing = tracelevel; + _tracef("tracelevel=%#x", tracelevel); } } -#endif - -NCURSES_EXPORT(const char *) -_nc_visbuf2(int bufnum, const char *buf) -/* visibilize a given string */ -{ - char *vbuf; - char *tp; - int c; - - if (buf == 0) - return ("(null)"); - if (buf == CANCELLED_STRING) - return ("(cancelled)"); - -#ifdef TRACE - tp = vbuf = _nc_trace_buf(bufnum, (strlen(buf) * 4) + 5); -#else - { - static char *mybuf[2]; - mybuf[bufnum] = _nc_doalloc(mybuf[bufnum], (strlen(buf) * 4) + 5); - tp = vbuf = mybuf[bufnum]; - } -#endif - *tp++ = '"'; - while ((c = *buf++) != '\0') { - if (c == '"') { - *tp++ = '\\'; - *tp++ = '"'; - } else if (is7bits(c) && (isgraph(c) || c == ' ')) { - *tp++ = c; - } else if (c == '\n') { - *tp++ = '\\'; - *tp++ = 'n'; - } else if (c == '\r') { - *tp++ = '\\'; - *tp++ = 'r'; - } else if (c == '\b') { - *tp++ = '\\'; - *tp++ = 'b'; - } else if (c == '\033') { - *tp++ = '\\'; - *tp++ = 'e'; - } else if (is7bits(c) && iscntrl(c)) { - *tp++ = '\\'; - *tp++ = '^'; - *tp++ = '@' + c; - } else { - sprintf(tp, "\\%03o", CharOf(c)); - tp += strlen(tp); - } - } - *tp++ = '"'; - *tp++ = '\0'; - return (vbuf); -} -NCURSES_EXPORT(const char *) -_nc_visbuf(const char *buf) -{ - return _nc_visbuf2(0, buf); -} - -#ifdef TRACE NCURSES_EXPORT(void) _tracef(const char *fmt,...) { @@ -208,6 +149,14 @@ _nc_retrace_ptr(char *code) return code; } +/* Trace 'SCREEN *' return-values */ +NCURSES_EXPORT(SCREEN *) +_nc_retrace_sp(SCREEN * code) +{ + T((T_RETURN("%p"), code)); + return code; +} + /* Trace 'WINDOW *' return-values */ NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) diff --git a/contrib/ncurses/ncurses/trace/lib_traceatr.c b/contrib/ncurses/ncurses/trace/lib_traceatr.c index 3584b6e..714e508 100644 --- a/contrib/ncurses/ncurses/trace/lib_traceatr.c +++ b/contrib/ncurses/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * + * Author: Thomas Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ @@ -38,11 +39,15 @@ #include <curses.priv.h> #include <term.h> /* acs_chars */ -MODULE_ID("$Id: lib_traceatr.c,v 1.32 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.41 2002/02/10 01:26:56 tom Exp $") #define COLOR_OF(c) (c < 0 || c > 7 ? "default" : colors[c].name) #ifdef TRACE + +static const char l_brace[] = {L_BRACE, 0}; +static const char r_brace[] = {R_BRACE, 0}; + NCURSES_EXPORT(char *) _traceattr2(int bufnum, attr_t newmode) { @@ -87,7 +92,7 @@ _traceattr2(int bufnum, attr_t newmode) unsigned save_nc_tracing = _nc_tracing; _nc_tracing = 0; - strcpy(tmp++, "{"); + strcpy(tmp++, l_brace); for (n = 0; n < SIZEOF(names); n++) { if ((newmode & names[n].val) != 0) { @@ -112,14 +117,14 @@ _traceattr2(int bufnum, attr_t newmode) } } } - if (AttrOf(newmode) == A_NORMAL) { + if (ChAttrOf(newmode) == A_NORMAL) { if (buf[1] != '\0') strcat(tmp, "|"); strcat(tmp, "A_NORMAL"); } _nc_tracing = save_nc_tracing; - return (strcat(buf, "}")); + return (strcat(buf, r_brace)); } NCURSES_EXPORT(char *) @@ -136,15 +141,14 @@ _nc_retrace_attr_t(attr_t code) return code; } -NCURSES_EXPORT(char *) -_tracechtype2(int bufnum, chtype ch) +const char * +_nc_altcharset_name(attr_t attr, chtype ch) { - char *buf = _nc_trace_buf(bufnum, BUFSIZ); - char *found = 0; + const char *result = 0; - strcpy(buf, "{"); - if (ch & A_ALTCHARSET) { + if (attr & A_ALTCHARSET) { char *cp; + char *found = 0; static const struct { unsigned int val; const char *name; @@ -189,32 +193,41 @@ _tracechtype2(int bufnum, chtype ch) *sp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (TextOf(cp[1]) == TextOf(ch)) { + if (ChCharOf(cp[1]) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = TextOf(*found); + ch = ChCharOf(*found); for (sp = names; sp->val; sp++) if (sp->val == ch) { - (void) strcat(buf, sp->name); - ch &= ~A_ALTCHARSET; + result = sp->name; break; } } } + return result; +} - if (found == 0) - (void) strcat(buf, _tracechar(TextOf(ch))); +NCURSES_EXPORT(char *) +_tracechtype2(int bufnum, chtype ch) +{ + char *buf = _nc_trace_buf(bufnum, BUFSIZ); + const char *found; - if (AttrOf(ch) != A_NORMAL) + strcpy(buf, l_brace); + if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) { + (void) strcat(buf, found); + } else + (void) strcat(buf, _tracechar(ChCharOf(ch))); + + if (ChAttrOf(ch) != A_NORMAL) (void) sprintf(buf + strlen(buf), " | %s", - _traceattr2(bufnum + 20, AttrOf(ch))); + _traceattr2(bufnum + 20, ChAttrOf(ch))); - strcat(buf, "}"); - return (buf); + return (strcat(buf, r_brace)); } NCURSES_EXPORT(char *) @@ -231,9 +244,55 @@ _nc_retrace_chtype (attr_t code) return code; } -#else -extern NCURSES_EXPORT(void) _nc_lib_traceatr (void); -NCURSES_EXPORT(void) _nc_lib_traceatr (void) +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(char *) +_tracecchar_t2 (int bufnum, const cchar_t *ch) { + char *buf = _nc_trace_buf(bufnum, BUFSIZ); + attr_t attr = AttrOfD(ch); + const char *found; + + strcpy(buf, l_brace); + if ((found = _nc_altcharset_name(attr, CharOfD(ch))) != 0) { + (void) strcat(buf, found); + attr &= ~A_ALTCHARSET; + } else if (!isnac(CHDEREF(ch))) { + PUTC_DATA; + int n; + + memset (&PUT_st, '\0', sizeof (PUT_st)); + PUTC_i = 0; + (void) strcat(buf, "{ "); + do { + PUTC_ch = PUTC_i < CCHARW_MAX ? ch->chars[PUTC_i] : L'\0'; + PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + if (PUTC_ch == L'\0') + --PUTC_n; + if (PUTC_n <= 0) + break; + for (n = 0; n < PUTC_n; n++) { + if (n) + (void) strcat(buf, ", "); + (void) strcat(buf, _tracechar(UChar(PUTC_buf[n]))); + } + ++PUTC_i; + } while (PUTC_ch != L'\0'); + (void) strcat(buf, " }"); + } + if (attr != A_NORMAL) + (void) sprintf(buf + strlen(buf), " | %s", + _traceattr2(bufnum + 20, attr)); + + return (strcat(buf, r_brace)); } + +NCURSES_EXPORT(char *) +_tracecchar_t (const cchar_t *ch) +{ + return _tracecchar_t2(0, ch); +} +#endif + +#else +empty_module(_nc_lib_traceatr) #endif /* TRACE */ diff --git a/contrib/ncurses/ncurses/trace/lib_tracebits.c b/contrib/ncurses/ncurses/trace/lib_tracebits.c index 21a3b92..a2153d4 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracebits.c +++ b/contrib/ncurses/ncurses/trace/lib_tracebits.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +34,7 @@ #include <curses.priv.h> #include <term.h> /* cur_term */ -MODULE_ID("$Id: lib_tracebits.c,v 1.10 2001/03/24 21:58:23 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.11 2001/10/20 22:44:32 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -238,10 +238,5 @@ _nc_tracebits(void) return (buf); } #else -NCURSES_EXPORT(char *) -_nc_tracebits(void) -{ - static char tmp[] = ""; - return tmp; -} +empty_module(_nc_tracebits) #endif /* TRACE */ diff --git a/contrib/ncurses/ncurses/trace/lib_tracechr.c b/contrib/ncurses/ncurses/trace/lib_tracechr.c index a019969..5b7c90c 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracechr.c +++ b/contrib/ncurses/ncurses/trace/lib_tracechr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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 * @@ -36,22 +36,20 @@ */ #include <curses.priv.h> -MODULE_ID("$Id: lib_tracechr.c,v 1.4 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: lib_tracechr.c,v 1.8 2002/02/10 01:26:04 tom Exp $") #ifdef TRACE NCURSES_EXPORT(char *) -_tracechar(const unsigned char ch) +_tracechar(int ch) { - static char crep[20]; - (void) sprintf(crep, "'%s' = 0x%02x", unctrl(ch), (unsigned) ch); + static char crep[40]; + (void) sprintf(crep, "'%.30s' = %#03o", + (ch > KEY_MIN) + ? keyname(ch) + : unctrl(ch), + (unsigned) ch); return (crep); } #else -extern -NCURSES_EXPORT(void) -_nc_lib_tracechr(void); -NCURSES_EXPORT(void) -_nc_lib_tracechr(void) -{ -} +empty_module(_nc_lib_tracechr) #endif diff --git a/contrib/ncurses/ncurses/trace/lib_tracedmp.c b/contrib/ncurses/ncurses/trace/lib_tracedmp.c index 22304ce..8f87536 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracedmp.c +++ b/contrib/ncurses/ncurses/trace/lib_tracedmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * + * Author: Thomas E. Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ @@ -36,20 +37,24 @@ */ #include <curses.priv.h> +#include <ctype.h> -MODULE_ID("$Id: lib_tracedmp.c,v 1.16 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.22 2001/11/03 15:45:35 tom Exp $") #ifdef TRACE NCURSES_EXPORT(void) _tracedump(const char *name, WINDOW *win) { + static char *buf = 0; + static size_t used = 0; + int i, j, n, width; /* compute narrowest possible display width */ - for (width = i = 0; i <= win->_maxy; i++) { + for (width = i = 0; i <= win->_maxy; ++i) { n = 0; - for (j = 0; j <= win->_maxx; j++) - if (win->_line[i].text[j] != ' ') + for (j = 0; j <= win->_maxx; ++j) + if (CharOf(win->_line[i].text[j]) != L(' ')) n = j; if (n > width) @@ -57,73 +62,83 @@ _tracedump(const char *name, WINDOW *win) } if (width < win->_maxx) ++width; + if (++width + 1 > (int) used) { + used = 2 * (width + 1); + buf = _nc_doalloc(buf, used); + } - for (n = 0; n <= win->_maxy; n++) { - char buf[BUFSIZ], *ep; + for (n = 0; n <= win->_maxy; ++n) { + char *ep = buf; bool haveattrs, havecolors; - /* dump A_CHARTEXT part */ - (void) sprintf(buf, "%s[%2d] %3d%3d ='", - name, n, - win->_line[n].firstchar, - win->_line[n].lastchar); - ep = buf + strlen(buf); - for (j = 0; j <= width; j++) { - ep[j] = TextOf(win->_line[n].text[j]); - if (ep[j] == 0) - ep[j] = '.'; + /* + * Dump A_CHARTEXT part. It is more important to make the grid line up + * in the trace file than to represent control- and wide-characters, so + * we map those to '.' and '?' respectively. + */ + for (j = 0; j < width; ++j) { + chtype test = CharOf(win->_line[n].text[j]); + ep[j] = (UChar(test) == test +#if USE_WIDEC_SUPPORT + && (win->_line[n].text[j].chars[1] == 0) +#endif + ) + ? (iscntrl(UChar(test)) + ? '.' + : UChar(test)) + : '?'; } - ep[j] = '\''; - ep[j + 1] = '\0'; - _tracef("%s", buf); + ep[j] = '\0'; + _tracef("%s[%2d] %3d%3d ='%s'", + name, n, + win->_line[n].firstchar, + win->_line[n].lastchar, + ep); /* dump A_COLOR part, will screw up if there are more than 96 */ havecolors = FALSE; - for (j = 0; j <= width; j++) - if (win->_line[n].text[j] & A_COLOR) { + for (j = 0; j < width; ++j) + if (AttrOf(win->_line[n].text[j]) & A_COLOR) { havecolors = TRUE; break; } if (havecolors) { - (void) sprintf(buf, "%*s[%2d]%*s='", (int) strlen(name), - "colors", n, 8, " "); - ep = buf + strlen(buf); - for (j = 0; j <= width; j++) - ep[j] = CharOf(win->_line[n].text[j] >> 8) + ' '; - ep[j] = '\''; - ep[j + 1] = '\0'; - _tracef("%s", buf); + ep = buf; + for (j = 0; j < width; ++j) + ep[j] = UChar(CharOf(win->_line[n].text[j]) >> + NCURSES_ATTR_SHIFT) + ' '; + ep[j] = '\0'; + _tracef("%*s[%2d]%*s='%s'", (int) strlen(name), + "colors", n, 8, " ", buf); } - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; ++i) { const char *hex = " 123456789ABCDEF"; - chtype mask = (0xf << ((i + 4) * 4)); + attr_t mask = (0xf << ((i + 4) * 4)); haveattrs = FALSE; - for (j = 0; j <= width; j++) - if (win->_line[n].text[j] & mask) { + for (j = 0; j < width; ++j) + if (AttrOf(win->_line[n].text[j]) & mask) { haveattrs = TRUE; break; } if (haveattrs) { - (void) sprintf(buf, "%*s%d[%2d]%*s='", (int) strlen(name) - - 1, "attrs", i, n, 8, " "); - ep = buf + strlen(buf); - for (j = 0; j <= width; j++) - ep[j] = hex[(win->_line[n].text[j] & mask) >> ((i + 4) * 4)]; - ep[j] = '\''; - ep[j + 1] = '\0'; - _tracef("%s", buf); + ep = buf; + for (j = 0; j < width; ++j) + ep[j] = hex[(AttrOf(win->_line[n].text[j]) & mask) >> + ((i + 4) * 4)]; + ep[j] = '\0'; + _tracef("%*s%d[%2d]%*s='%s'", (int) strlen(name) - + 1, "attrs", i, n, 8, " ", buf); } } } +#if NO_LEAKS + free(buf); + used = 0; +#endif } + #else -extern -NCURSES_EXPORT(void) -_nc_lib_tracedmp(void); -NCURSES_EXPORT(void) -_nc_lib_tracedmp(void) -{ -} +empty_module(_nc_lib_tracedmp) #endif /* TRACE */ diff --git a/contrib/ncurses/ncurses/trace/lib_tracemse.c b/contrib/ncurses/ncurses/trace/lib_tracemse.c index 38dd57e..f4a100b 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracemse.c +++ b/contrib/ncurses/ncurses/trace/lib_tracemse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001,2002 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 * @@ -37,7 +37,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_tracemse.c,v 1.8 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.10 2002/01/12 22:32:25 tom Exp $") #ifdef TRACE @@ -49,50 +49,44 @@ _tracemouse(MEVENT const *ep) (void) sprintf(buf, "id %2d at (%2d, %2d, %2d) state %4lx = {", 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") - SHOW(BUTTON1_PRESSED, "press-1") - SHOW(BUTTON1_CLICKED, "click-1") - SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1") - SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1") - SHOW(BUTTON1_RESERVED_EVENT, "reserved-1") - SHOW(BUTTON2_RELEASED, "release-2") - SHOW(BUTTON2_PRESSED, "press-2") - SHOW(BUTTON2_CLICKED, "click-2") - SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2") - SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2") - SHOW(BUTTON2_RESERVED_EVENT, "reserved-2") - SHOW(BUTTON3_RELEASED, "release-3") - SHOW(BUTTON3_PRESSED, "press-3") - SHOW(BUTTON3_CLICKED, "click-3") - SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3") - SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3") - SHOW(BUTTON3_RESERVED_EVENT, "reserved-3") - SHOW(BUTTON4_RELEASED, "release-4") - SHOW(BUTTON4_PRESSED, "press-4") - SHOW(BUTTON4_CLICKED, "click-4") - SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4") - SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4") - SHOW(BUTTON4_RESERVED_EVENT, "reserved-4") - SHOW(BUTTON_CTRL, "ctrl") - SHOW(BUTTON_SHIFT, "shift") - SHOW(BUTTON_ALT, "alt") - SHOW(ALL_MOUSE_EVENTS, "all-events") - SHOW(REPORT_MOUSE_POSITION, "position") +#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(buf, s), ", ") + SHOW(BUTTON1_RELEASED, "release-1"); + SHOW(BUTTON1_PRESSED, "press-1"); + SHOW(BUTTON1_CLICKED, "click-1"); + SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1"); + SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1"); + SHOW(BUTTON1_RESERVED_EVENT, "reserved-1"); + SHOW(BUTTON2_RELEASED, "release-2"); + SHOW(BUTTON2_PRESSED, "press-2"); + SHOW(BUTTON2_CLICKED, "click-2"); + SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2"); + SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2"); + SHOW(BUTTON2_RESERVED_EVENT, "reserved-2"); + SHOW(BUTTON3_RELEASED, "release-3"); + SHOW(BUTTON3_PRESSED, "press-3"); + SHOW(BUTTON3_CLICKED, "click-3"); + SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3"); + SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3"); + SHOW(BUTTON3_RESERVED_EVENT, "reserved-3"); + SHOW(BUTTON4_RELEASED, "release-4"); + SHOW(BUTTON4_PRESSED, "press-4"); + SHOW(BUTTON4_CLICKED, "click-4"); + SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4"); + SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4"); + SHOW(BUTTON4_RESERVED_EVENT, "reserved-4"); + SHOW(BUTTON_CTRL, "ctrl"); + SHOW(BUTTON_SHIFT, "shift"); + SHOW(BUTTON_ALT, "alt"); + SHOW(ALL_MOUSE_EVENTS, "all-events"); + SHOW(REPORT_MOUSE_POSITION, "position"); #undef SHOW - if (buf[strlen(buf) - 1] == ' ') + if (buf[strlen(buf) - 1] == ' ') buf[strlen(buf) - 2] = '\0'; (void) strcat(buf, "}"); return (buf); } #else /* !TRACE */ -/* don't make empty module */ -NCURSES_EXPORT(void) -_nc_lib_tracemouse(void); -NCURSES_EXPORT(void) -_nc_lib_tracemouse(void) -{ -} +empty_module(_nc_lib_tracemouse) #endif diff --git a/contrib/ncurses/ncurses/trace/trace_tries.c b/contrib/ncurses/ncurses/trace/trace_tries.c index fdf3a09..d703322 100644 --- a/contrib/ncurses/ncurses/trace/trace_tries.c +++ b/contrib/ncurses/ncurses/trace/trace_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000,2001 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 * @@ -35,7 +35,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: trace_tries.c,v 1.8 2000/12/10 03:03:51 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.10 2001/10/20 22:42:51 tom Exp $") #ifdef TRACE static unsigned char *buffer; @@ -72,8 +72,5 @@ _nc_trace_tries(struct tries *tree) } #else -NCURSES_EXPORT(void) -_nc_trace_tries(struct tries *tree GCC_UNUSED) -{ -} +empty_module(_nc_trace_tries) #endif diff --git a/contrib/ncurses/ncurses/trace/varargs.c b/contrib/ncurses/ncurses/trace/varargs.c new file mode 100644 index 0000000..7a1a742 --- /dev/null +++ b/contrib/ncurses/ncurses/trace/varargs.c @@ -0,0 +1,171 @@ +/**************************************************************************** + * Copyright (c) 2001 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 2001 * + ****************************************************************************/ + +#include <curses.priv.h> + +#include <ctype.h> + +MODULE_ID("$Id: varargs.c,v 1.1 2001/10/20 20:37:48 tom Exp $") + +#ifdef TRACE + +typedef enum { + atUnknown = 0, atInteger, atFloat, atPoint, atString +} ARGTYPE; + +#define VA_INT(type) ival = va_arg(ap, type) +#define VA_FLT(type) fval = va_arg(ap, type) +#define VA_PTR(type) pval = (void *)va_arg(ap, type) +#define VA_STR(type) sval = va_arg(ap, type) + +/* + * Returns a string that represents the parameter list of a printf-style call. + */ +NCURSES_EXPORT(char *) +_nc_varargs(const char *fmt, va_list ap) +{ + static char *result_buf; + static size_t result_len; + + char buffer[BUFSIZ]; + + if (fmt == 0 || *fmt == '\0') + return ""; + if (result_len == 0) + result_buf = typeMalloc(char, result_len = BUFSIZ); + if (result_buf == 0) + return ""; + *result_buf = '\0'; + + while (*fmt != '\0') { + if (*fmt == '%') { + char *pval = 0; /* avoid const-cast */ + const char *sval = ""; + double fval = 0.0; + int done = FALSE; + int ival = 0; + int type = 0; + ARGTYPE used = atUnknown; + + while (*++fmt != '\0' && !done) { + + if (*fmt == '*') { + VA_INT(int); + used = atInteger; + break; + } else if (isalpha(UChar(*fmt))) { + done = TRUE; + switch (*fmt) { + case 'Z': /* FALLTHRU */ + case 'h': /* FALLTHRU */ + case 'l': /* FALLTHRU */ + done = FALSE; + type = *fmt; + break; + case 'i': /* FALLTHRU */ + case 'd': /* FALLTHRU */ + case 'u': /* FALLTHRU */ + case 'x': /* FALLTHRU */ + case 'X': /* FALLTHRU */ + if (type == 'l') + VA_INT(long); + else if (type == 'Z') + VA_INT(size_t); + else + VA_INT(int); + used = atInteger; + break; + case 'f': /* FALLTHRU */ + case 'e': /* FALLTHRU */ + case 'E': /* FALLTHRU */ + case 'g': /* FALLTHRU */ + case 'G': /* FALLTHRU */ + VA_FLT(double); + used = atFloat; + break; + case 'c': + VA_INT(int); + used = atInteger; + break; + case 's': + VA_STR(const char *); + used = atString; + break; + case 'p': + VA_PTR(void *); + used = atPoint; + break; + case 'n': + VA_PTR(int *); + used = atPoint; + break; + default: + break; + } + } else if (*fmt == '%') { + done = TRUE; + } + if (used != atUnknown) { + const char *param = buffer; + switch (used) { + case atInteger: + sprintf(buffer, "%d", ival); + break; + case atFloat: + sprintf(buffer, "%f", fval); + break; + case atPoint: + sprintf(buffer, "%p", pval); + break; + case atString: + param = _nc_visbuf2(1, sval); + break; + default: + strcpy(buffer, "?"); + break; + } + result_len += strlen(param) + 2; + result_buf = typeRealloc(char, result_len, result_buf); + sprintf(result_buf + strlen(result_buf), ",%s", param); + used = atUnknown; + } + } + } else { + fmt++; + } + } + + return (result_buf); +} +#else +empty_module(_nc_varargs) +#endif diff --git a/contrib/ncurses/ncurses/trace/visbuf.c b/contrib/ncurses/ncurses/trace/visbuf.c new file mode 100644 index 0000000..5f2460f --- /dev/null +++ b/contrib/ncurses/ncurses/trace/visbuf.c @@ -0,0 +1,232 @@ +/**************************************************************************** + * Copyright (c) 2001 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 1996-2001 * + * and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * + * and: Eric S. Raymond <esr@snark.thyrsus.com> * + ****************************************************************************/ + +/* + * visbuf.c - Tracing/Debugging support routines + */ + +#include <curses.priv.h> + +#include <tic.h> +#include <ctype.h> + +MODULE_ID("$Id: visbuf.c,v 1.3 2001/11/10 23:47:51 tom Exp $") + +static char * +_nc_vischar(char *tp, unsigned c) +{ + if (c == '"' || c == '\\') { + *tp++ = '\\'; + *tp++ = c; + } else if (is7bits(c) && (isgraph(c) || c == ' ')) { + *tp++ = c; + } else if (c == '\n') { + *tp++ = '\\'; + *tp++ = 'n'; + } else if (c == '\r') { + *tp++ = '\\'; + *tp++ = 'r'; + } else if (c == '\b') { + *tp++ = '\\'; + *tp++ = 'b'; + } else if (c == '\033') { + *tp++ = '\\'; + *tp++ = 'e'; + } else if (is7bits(c) && iscntrl(UChar(c))) { + *tp++ = '\\'; + *tp++ = '^'; + *tp++ = '@' + c; + } else { + sprintf(tp, "\\%03lo", ChCharOf(c)); + tp += strlen(tp); + } + return tp; +} + +NCURSES_EXPORT(const char *) +_nc_visbuf2(int bufnum, const char *buf) +{ + char *vbuf; + char *tp; + int c; + + if (buf == 0) + return ("(null)"); + if (buf == CANCELLED_STRING) + return ("(cancelled)"); + +#ifdef TRACE + tp = vbuf = _nc_trace_buf(bufnum, (strlen(buf) * 4) + 5); +#else + { + static char *mybuf[2]; + mybuf[bufnum] = _nc_doalloc(mybuf[bufnum], (strlen(buf) * 4) + 5); + tp = vbuf = mybuf[bufnum]; + } +#endif + *tp++ = D_QUOTE; + while ((c = *buf++) != '\0') { + tp = _nc_vischar(tp, UChar(c)); + } + *tp++ = D_QUOTE; + *tp++ = '\0'; + return (vbuf); +} + +NCURSES_EXPORT(const char *) +_nc_visbuf(const char *buf) +{ + return _nc_visbuf2(0, buf); +} + +#if USE_WIDEC_SUPPORT +#ifdef TRACE +NCURSES_EXPORT(const char *) +_nc_viswbuf2(int bufnum, const wchar_t * buf) +{ + char *vbuf; + char *tp; + int c; + + if (buf == 0) + return ("(null)"); + +#ifdef TRACE + tp = vbuf = _nc_trace_buf(bufnum, (wcslen(buf) * 4) + 5); +#else + { + static char *mybuf[2]; + mybuf[bufnum] = _nc_doalloc(mybuf[bufnum], (wcslen(buf) * 4) + 5); + tp = vbuf = mybuf[bufnum]; + } +#endif + *tp++ = D_QUOTE; + while ((c = *buf++) != '\0') { + tp = _nc_vischar(tp, ChCharOf(c)); + } + *tp++ = D_QUOTE; + *tp++ = '\0'; + return (vbuf); +} + +NCURSES_EXPORT(const char *) +_nc_viswbuf(const wchar_t * buf) +{ + return _nc_viswbuf2(0, buf); +} + +NCURSES_EXPORT(const char *) +_nc_viscbuf2(int bufnum, const cchar_t * buf, int len) +{ + size_t have = BUFSIZ; + char *result = _nc_trace_buf(bufnum, have); + char *tp = result; + int n; + bool same = TRUE; + attr_t attr = A_NORMAL; + const char *found; + + if (len < 0) + len = _nc_wchstrlen(buf); + + for (n = 1; n < len; n++) { + if (AttrOf(buf[n]) != AttrOf(buf[0])) { + same = FALSE; + break; + } + } + + /* + * If the rendition is the same for the whole string, display it as a + * quoted string, followed by the rendition. Otherwise, use the more + * detailed trace function that displays each character separately. + */ + if (same) { + *tp++ = D_QUOTE; + while (len-- > 0) { + if ((found = _nc_altcharset_name(attr, CharOfD(buf))) != 0) { + (void) strcpy(tp, found); + tp += strlen(tp); + attr &= ~A_ALTCHARSET; + } else if (!isnac(CHDEREF(buf))) { + PUTC_DATA; + + memset(&PUT_st, '\0', sizeof(PUT_st)); + PUTC_i = 0; + do { + PUTC_ch = PUTC_i < CCHARW_MAX ? buf->chars[PUTC_i] : L'\0'; + PUTC_n = wcrtomb(PUTC_buf, buf->chars[PUTC_i], &PUT_st); + if (PUTC_ch == L'\0') + --PUTC_n; + if (PUTC_n <= 0) + break; + for (n = 0; n < PUTC_n; n++) { + tp = _nc_vischar(tp, UChar(PUTC_buf[n])); + } + ++PUTC_i; + } while (PUTC_ch != L'\0'); + } + buf++; + } + *tp++ = D_QUOTE; + *tp++ = '\0'; + if (attr != A_NORMAL) + (void) sprintf(tp, " | %s", + _traceattr2(bufnum + 20, attr)); + } else { + *tp++ = L_BRACE; + while (len-- > 0) { + char *temp = _tracecchar_t2(bufnum + 20, buf++); + size_t used = (tp - result); + size_t want = strlen(temp) + 5 + used; + if (want > have) { + result = _nc_trace_buf(bufnum, have = want); + tp = result + used; + } + (void) strcpy(tp, temp); + tp += strlen(tp); + } + *tp++ = R_BRACE; + *tp++ = '\0'; + } + return result; +} + +NCURSES_EXPORT(const char *) +_nc_viscbuf(const cchar_t * buf, int len) +{ + return _nc_viscbuf2(0, buf, len); +} +#endif /* TRACE */ +#endif /* USE_WIDEC_SUPPORT */ diff --git a/contrib/ncurses/ncurses/tty/hashmap.c b/contrib/ncurses/ncurses/tty/hashmap.c index 6d3d61d..1c30526 100644 --- a/contrib/ncurses/ncurses/tty/hashmap.c +++ b/contrib/ncurses/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -70,7 +70,7 @@ AUTHOR #include <curses.priv.h> #include <term.h> /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.36 2000/12/10 03:04:30 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.45 2001/12/19 01:06:49 tom Exp $") #ifdef HASHDEBUG @@ -97,47 +97,56 @@ static chtype oldtext[MAXLINES][TEXTWIDTH], newtext[MAXLINES][TEXTWIDTH]; #endif /* !HASHDEBUG */ -#define oldhash (SP->oldhash) -#define newhash (SP->newhash) +#define oldhash (SP->oldhash) +#define newhash (SP->newhash) +#define hashtab (SP->hashtab) +#define lines_alloc (SP->hashtab_len) + +#if USE_WIDEC_SUPPORT +#define HASH_VAL(ch) (ch.chars[0]) +#else +#define HASH_VAL(ch) (ch) +#endif static inline unsigned long -hash(chtype * text) +hash(NCURSES_CH_T * text) { int i; - chtype ch; + NCURSES_CH_T ch; unsigned long result = 0; for (i = TEXTWIDTH; i > 0; i--) { ch = *text++; - result += (result << 5) + ch; + result += (result << 5) + HASH_VAL(ch); } return result; } /* approximate update cost */ static int -update_cost(chtype * from, chtype * to) +update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) { int cost = 0; int i; for (i = TEXTWIDTH; i > 0; i--) - if (*from++ != *to++) + if (!(CharEq(*from++, *to++))) cost++; return cost; } + static int -update_cost_from_blank(chtype * to) +update_cost_from_blank(NCURSES_CH_T * to) { int cost = 0; int i; - chtype blank = BLANK; + NCURSES_CH_T blank = NewChar2(BLANK_TEXT, BLANK_ATTR); if (back_color_erase) - blank |= (stdscr->_bkgd & A_COLOR); + AddAttr(blank, (AttrOf(stdscr->_nc_bkgd) & A_COLOR)); for (i = TEXTWIDTH; i > 0; i--) - if (blank != *to++) + if (!(CharEq(blank, *to++))) cost++; return cost; @@ -171,15 +180,6 @@ cost_effective(const int from, const int to, const bool blank) + update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE; } -typedef struct { - unsigned long hashval; - int oldcount, newcount; - int oldindex, newindex; -} sym; - -static sym *hashtab = 0; -static int lines_alloc = 0; - static void grow_hunks(void) { @@ -267,14 +267,14 @@ grow_hunks(void) NCURSES_EXPORT(void) _nc_hash_map(void) { - sym *sp; + HASHMAP *sp; register int i; int start, shift, size; if (screen_lines > lines_alloc) { if (hashtab) free(hashtab); - hashtab = typeMalloc(sym, (screen_lines + 1) * 2); + hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2); if (!hashtab) { if (oldhash) { FreeAndNull(oldhash); @@ -387,11 +387,6 @@ _nc_hash_map(void) /* After clearing invalid hunks, try grow the rest. */ grow_hunks(); - -#if NO_LEAKS - FreeAndNull(hashtab); - lines_alloc = 0; -#endif } NCURSES_EXPORT(void) @@ -404,7 +399,7 @@ _nc_make_oldhash(int i) NCURSES_EXPORT(void) _nc_scroll_oldhash(int n, int top, int bot) { - int size; + size_t size; int i; if (!oldhash) diff --git a/contrib/ncurses/ncurses/tty/lib_mvcur.c b/contrib/ncurses/ncurses/tty/lib_mvcur.c index cb7a5ce..89b503f 100644 --- a/contrib/ncurses/ncurses/tty/lib_mvcur.c +++ b/contrib/ncurses/ncurses/tty/lib_mvcur.c @@ -152,7 +152,7 @@ #include <term.h> #include <ctype.h> -MODULE_ID("$Id: lib_mvcur.c,v 1.78 2001/04/14 22:26:14 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.85 2001/06/03 01:48:29 skimo Exp $") #define CURRENT_ROW SP->_cursrow /* phys cursor row */ #define CURRENT_COLUMN SP->_curscol /* phys cursor column */ @@ -207,8 +207,7 @@ trace_normalized_cost(const char *capname, const char *cap, int affcnt) #endif NCURSES_EXPORT(int) -_nc_msec_cost -(const char *const cap, int affcnt) +_nc_msec_cost(const char *const cap, int affcnt) /* compute the cost of a given operation */ { if (cap == 0) @@ -223,11 +222,11 @@ _nc_msec_cost float number = 0.0; for (cp += 2; *cp != '>'; cp++) { - if (isdigit(CharOf(*cp))) + if (isdigit(UChar(*cp))) number = number * 10 + (*cp - '0'); else if (*cp == '*') number *= affcnt; - else if (*cp == '.' && (*++cp != '>') && isdigit(CharOf(*cp))) + else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) number += (*cp - '0') / 10.0; } @@ -499,7 +498,9 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int vcost = SP->_cud_cost; } - if (cursor_down && (n * SP->_cud1_cost < vcost)) { + if (cursor_down + && (*cursor_down != '\n' || SP->_nl) + && (n * SP->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, SP->_cud1_cost, n, cursor_down); } @@ -584,7 +585,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int && n < (int) check.s_size && vcost == 0 && str[0] == '\0' - && isdigit(TextOf(WANT_CHAR(to_y, from_x)))) + && isdigit(CharOf(WANT_CHAR(to_y, from_x)))) ovw = FALSE; #endif /* @@ -599,11 +600,10 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) { - chtype ch = WANT_CHAR(to_y, from_x + i); - if ((ch & A_ATTRIBUTES) != CURRENT_ATTR + NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i); + if (AttrOf(ch) != CURRENT_ATTR #if USE_WIDEC_SUPPORT - || (TextOf(ch) >= 0x80 - && SP->_outch == _nc_utf8_outch) + || !Charable(ch) #endif ) { ovw = FALSE; @@ -615,7 +615,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) - *check.s_tail++ = WANT_CHAR(to_y, from_x + i); + *check.s_tail++ = CharOf(WANT_CHAR(to_y, from_x + i)); *check.s_tail = '\0'; check.s_size -= n; lhcost += n * SP->_char_padding; @@ -837,14 +837,17 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) } NCURSES_EXPORT(int) -mvcur -(int yold, int xold, int ynew, int xnew) +mvcur(int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { - TR(TRACE_MOVE, ("mvcur(%d,%d,%d,%d) called", yold, xold, ynew, xnew)); + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"), + yold, xold, ynew, xnew)); + + if (SP == 0) + returnCode(ERR); if (yold == ynew && xold == xnew) - return (OK); + returnCode(OK); /* * Most work here is rounding for terminal boundaries getting the @@ -859,26 +862,35 @@ mvcur if (xold >= screen_columns) { int l; - l = (xold + 1) / screen_columns; - yold += l; - if (yold >= screen_lines) - l -= (yold - screen_lines - 1); + if (SP->_nl) { + l = (xold + 1) / screen_columns; + yold += l; + if (yold >= screen_lines) + l -= (yold - screen_lines - 1); - while (l > 0) { - if (newline) { - TPUTS_TRACE("newline"); - tputs(newline, 0, _nc_outch); - } else - putchar('\n'); - l--; - if (xold > 0) { - if (carriage_return) { - TPUTS_TRACE("carriage_return"); - tputs(carriage_return, 0, _nc_outch); + while (l > 0) { + if (newline) { + TPUTS_TRACE("newline"); + tputs(newline, 0, _nc_outch); } else - putchar('\r'); - xold = 0; + putchar('\n'); + l--; + if (xold > 0) { + if (carriage_return) { + TPUTS_TRACE("carriage_return"); + tputs(carriage_return, 0, _nc_outch); + } else + putchar('\r'); + xold = 0; + } } + } else { + /* + * If caller set nonl(), we cannot really use newlines to position + * to the next row. + */ + xold = -1; + yold = -1; } } @@ -888,11 +900,12 @@ mvcur ynew = screen_lines - 1; /* destination location is on screen now */ - return (onscreen_mvcur(yold, xold, ynew, xnew, TRUE)); + returnCode(onscreen_mvcur(yold, xold, ynew, xnew, TRUE)); } #if defined(TRACE) || defined(NCURSES_TEST) -NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; +NCURSES_EXPORT_VAR(int) +_nc_optimize_enable = OPTIMIZE_ALL; #endif #if defined(MAIN) || defined(NCURSES_TEST) @@ -912,8 +925,7 @@ _nc_progname = "mvcur"; /* these override lib_tputs.c */ NCURSES_EXPORT(int) -tputs -(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) +tputs(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) /* stub tputs() that dumps sequences in a visible form */ { if (profiling) @@ -938,8 +950,7 @@ _nc_outch(int ch) NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ -NCURSES_EXPORT_VAR(int) -_nc_nulls_sent = 0; /* used by 'tack' program */ +NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0; /* used by 'tack' program */ NCURSES_EXPORT(int) delay_output(int ms GCC_UNUSED) diff --git a/contrib/ncurses/ncurses/tty/lib_tstp.c b/contrib/ncurses/ncurses/tty/lib_tstp.c index ba146a0..c850e41 100644 --- a/contrib/ncurses/ncurses/tty/lib_tstp.c +++ b/contrib/ncurses/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * + * and: Thomas Dickey 1995-2001 * ****************************************************************************/ /* @@ -37,17 +38,15 @@ ** The routine _nc_signal_handler(). ** */ - #include <curses.priv.h> -#include <signal.h> #include <SigAction.h> #if SVR4_ACTION && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.24 2000/12/10 03:04:30 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.30 2002/05/18 19:55:38 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -55,6 +54,41 @@ MODULE_ID("$Id: lib_tstp.c,v 1.24 2000/12/10 03:04:30 tom Exp $") #define USE_SIGTSTP 0 #endif +#ifdef TRACE +static const char * +signal_name(int sig) +{ + switch (sig) { + case SIGALRM: + return "SIGALRM"; +#ifdef SIGCONT + case SIGCONT: + return "SIGCONT"; +#endif + case SIGINT: + return "SIGINT"; + case SIGQUIT: + return "SIGQUIT"; + case SIGTERM: + return "SIGTERM"; +#ifdef SIGTSTP + case SIGTSTP: + return "SIGTSTP"; +#endif +#ifdef SIGTTOU + case SIGTTOU: + return "SIGTTOU"; +#endif +#ifdef SIGWINCH + case SIGWINCH: + return "SIGWINCH"; +#endif + default: + return "unknown signal"; + } +} +#endif + /* * Note: This code is fragile! Its problem is that different OSs * handle restart of system calls interrupted by signals differently. @@ -215,7 +249,7 @@ cleanup(int sig) sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_IGN; - if (sigaction(sig, &act, (sigaction_t *) 0) == 0) + if (sigaction(sig, &act, NULL) == 0) #else if (signal(sig, SIG_IGN) != SIG_ERR) #endif @@ -255,43 +289,57 @@ sigwinch(int sig GCC_UNUSED) * If the given signal is still in its default state, set it to the given * handler. */ -#if HAVE_SIGACTION || HAVE_SIGVEC static int -CatchIfDefault(int sig, sigaction_t * act) +CatchIfDefault(int sig, RETSIGTYPE (*handler) (int)) { + int result; +#if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t old_act; + sigaction_t new_act; + + memset(&new_act, 0, sizeof(new_act)); + sigemptyset(&new_act.sa_mask); +#ifdef SA_RESTART +#ifdef SIGWINCH + if (sig != SIGWINCH) +#endif + new_act.sa_flags |= SA_RESTART; +#endif /* SA_RESTART */ + new_act.sa_handler = handler; - if (sigaction(sig, (sigaction_t *) 0, &old_act) == 0 + if (sigaction(sig, NULL, &old_act) == 0 && (old_act.sa_handler == SIG_DFL + || old_act.sa_handler == handler #if USE_SIGWINCH || (sig == SIGWINCH && old_act.sa_handler == SIG_IGN) #endif )) { - (void) sigaction(sig, act, (sigaction_t *) 0); - return TRUE; + (void) sigaction(sig, &new_act, NULL); + result = TRUE; + } else { + result = FALSE; } - return FALSE; -} -#else -static int -CatchIfDefault(int sig, RETSIGTYPE(*handler) (int)) -{ - void (*ohandler) (int); +#else /* !HAVE_SIGACTION */ + RETSIGTYPE (*ohandler) (int); ohandler = signal(sig, SIG_IGN); if (ohandler == SIG_DFL + || ohandler == handler #if USE_SIGWINCH || (sig == SIGWINCH && ohandler == SIG_IGN) #endif ) { signal(sig, handler); - return TRUE; + result = TRUE; } else { signal(sig, ohandler); - return FALSE; + result = FALSE; } -} #endif + T(("CatchIfDefault - will %scatch %s", + result ? "" : "not ", signal_name(sig))); + return result; +} /* * This is invoked once at the beginning (e.g., from 'initscr()'), to @@ -307,60 +355,45 @@ CatchIfDefault(int sig, RETSIGTYPE(*handler) (int)) NCURSES_EXPORT(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_SIGWINCH - act.sa_handler = sigwinch; - CatchIfDefault(SIGWINCH, &act); -#endif + static bool initialized = FALSE; + T((T_CALLED("_nc_signal_handler(%d)"), enable)); +#if USE_SIGTSTP /* Xenix 2.x doesn't have SIGTSTP, for example */ + { + static bool ignore_tstp = FALSE; + + if (!ignore_tstp) { + static sigaction_t act, oact; + + if (!enable) { + act.sa_handler = SIG_IGN; + sigaction(SIGTSTP, &act, &oact); + } else if (act.sa_handler != SIG_DFL) { + sigaction(SIGTSTP, &oact, NULL); + } else if (sigaction(SIGTSTP, NULL, &oact) == 0 + && (oact.sa_handler == SIG_DFL)) { + sigemptyset(&act.sa_mask); #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 = tstp; - if (!CatchIfDefault(SIGTSTP, &act)) - ignore = TRUE; + act.sa_handler = tstp; + (void) sigaction(SIGTSTP, &act, NULL); + } else { + ignore_tstp = TRUE; + } } } -#else /* !USE_SIGTSTP */ - if (enable) { -#if HAVE_SIGACTION || HAVE_SIGVEC - static sigaction_t act; - sigemptyset(&act.sa_mask); -#if USE_SIGWINCH - act.sa_handler = sigwinch; - CatchIfDefault(SIGWINCH, &act); -#endif -#ifdef SA_RESTART - act.sa_flags |= SA_RESTART; -#endif /* SA_RESTART */ - act.sa_handler = cleanup; - CatchIfDefault(SIGINT, &act); - CatchIfDefault(SIGTERM, &act); - -#else /* !(HAVE_SIGACTION || HAVE_SIGVEC) */ +#endif /* !USE_SIGTSTP */ - CatchIfDefault(SIGINT, cleanup); - CatchIfDefault(SIGTERM, cleanup); + if (!initialized) { + if (enable) { + CatchIfDefault(SIGINT, cleanup); + CatchIfDefault(SIGTERM, cleanup); #if USE_SIGWINCH - CatchIfDefault(SIGWINCH, sigwinch); + CatchIfDefault(SIGWINCH, sigwinch); #endif -#endif /* !(HAVE_SIGACTION || HAVE_SIGVEC) */ + initialized = TRUE; + } } -#endif /* !USE_SIGTSTP */ + returnVoid; } diff --git a/contrib/ncurses/ncurses/tty/lib_twait.c b/contrib/ncurses/ncurses/tty/lib_twait.c index 2dfcb10..9829a7e 100644 --- a/contrib/ncurses/ncurses/tty/lib_twait.c +++ b/contrib/ncurses/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,12 +40,14 @@ ** comments, none of the original code remains - T.Dickey). */ +#include <curses.priv.h> + #ifdef __BEOS__ +#undef false +#undef true #include <OS.h> #endif -#include <curses.priv.h> - #if USE_FUNC_POLL # if HAVE_SYS_TIME_H # include <sys/time.h> @@ -59,7 +61,7 @@ # endif #endif -MODULE_ID("$Id: lib_twait.c,v 1.41 2000/12/10 03:04:30 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.44 2002/04/21 21:06:29 tom Exp $") static long _nc_gettime(bool first) @@ -85,7 +87,7 @@ _nc_gettime(bool first) } res = (t1 - t0) * 1000; #endif - T(("%s time: %ld msec", first ? "get" : "elapsed", res)); + TR(TRACE_IEVENT, ("%s time: %ld msec", first ? "get" : "elapsed", res)); return res; } @@ -103,8 +105,7 @@ _nc_gettime(bool first) * descriptors. */ NCURSES_EXPORT(int) -_nc_timed_wait -(int mode, int milliseconds, int *timeleft) +_nc_timed_wait(int mode, int milliseconds, int *timeleft) { int fd; int count; @@ -120,7 +121,10 @@ _nc_timed_wait long starttime, returntime; - T(("start twait: %d milliseconds, mode: %d", milliseconds, mode)); + if (milliseconds < 0) + milliseconds = 0; + TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d", + milliseconds, mode)); #if PRECISE_GETTIME retry: @@ -228,8 +232,8 @@ _nc_timed_wait if (timeleft) *timeleft = milliseconds; - T(("end twait: returned %d (%d), remaining time %d msec", - result, errno, milliseconds)); + TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec", + result, errno, milliseconds)); /* * Both 'poll()' and 'select()' return the number of file descriptors diff --git a/contrib/ncurses/ncurses/tty/lib_vidattr.c b/contrib/ncurses/ncurses/tty/lib_vidattr.c index 464973d..00611f4 100644 --- a/contrib/ncurses/ncurses/tty/lib_vidattr.c +++ b/contrib/ncurses/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -64,7 +64,7 @@ #include <curses.priv.h> #include <term.h> -MODULE_ID("$Id: lib_vidattr.c,v 1.36 2000/12/10 03:05:48 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.39 2001/08/26 00:40:46 Philippe.Blain Exp $") #define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) @@ -88,13 +88,12 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.36 2000/12/10 03:05:48 tom Exp $") NCURSES_EXPORT(int) vidputs -(attr_t newmode, int (*outc) (int)) +(chtype newmode, int (*outc) (int)) { static attr_t previous_attr = A_NORMAL; attr_t turn_on, turn_off; int pair; bool reverse = FALSE; - bool used_ncv = FALSE; bool can_color = (SP == 0 || SP->_coloron); #if NCURSES_EXT_FUNCS bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); @@ -182,7 +181,7 @@ vidputs } SetColorsIf((pair != 0) || fix_pair0, previous_attr); - } else if (set_attributes && !used_ncv) { + } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); tputs(tparm(set_attributes, @@ -230,12 +229,24 @@ vidputs TurnOn(A_PROTECT, enter_protected_mode); TurnOn(A_INVIS, enter_secure_mode); TurnOn(A_UNDERLINE, enter_underline_mode); +#ifdef enter_horizontal_hl_mode TurnOn(A_HORIZONTAL, enter_horizontal_hl_mode); +#endif +#ifdef enter_left_hl_mode TurnOn(A_LEFT, enter_left_hl_mode); +#endif +#ifdef enter_low_hl_mode TurnOn(A_LOW, enter_low_hl_mode); +#endif +#ifdef enter_right_hl_mode TurnOn(A_RIGHT, enter_right_hl_mode); +#endif +#ifdef enter_top_hl_mode TurnOn(A_TOP, enter_top_hl_mode); +#endif +#ifdef enter_vertical_hl_mode TurnOn(A_VERTICAL, enter_vertical_hl_mode); +#endif /* *INDENT-ON* */ } @@ -252,7 +263,7 @@ vidputs } NCURSES_EXPORT(int) -vidattr(attr_t newmode) +vidattr(chtype newmode) { T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); diff --git a/contrib/ncurses/ncurses/tty/tty_update.c b/contrib/ncurses/ncurses/tty/tty_update.c index d292ad3..e06de1b 100644 --- a/contrib/ncurses/ncurses/tty/tty_update.c +++ b/contrib/ncurses/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001,2002 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,12 +41,14 @@ * *-----------------------------------------------------------------*/ +#include <curses.priv.h> + #ifdef __BEOS__ +#undef false +#undef true #include <OS.h> #endif -#include <curses.priv.h> - #if defined(TRACE) && HAVE_SYS_TIMES_H && HAVE_TIMES #define USE_TRACE_TIMES 1 #else @@ -70,7 +72,7 @@ #include <term.h> -MODULE_ID("$Id: tty_update.c,v 1.151 2001/02/03 23:41:55 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.174 2002/04/21 21:04:16 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -92,12 +94,12 @@ MODULE_ID("$Id: tty_update.c,v 1.151 2001/02/03 23:41:55 tom Exp $") */ /* #define POSITION_DEBUG */ -static inline chtype ClrBlank(WINDOW *win); +static inline NCURSES_CH_T ClrBlank(WINDOW *win); static int ClrBottom(int total); -static void ClearScreen(chtype blank); +static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); -static void InsStr(chtype * line, int count); +static void InsStr(NCURSES_CH_T * line, int count); static void TransformLine(int const lineno); #ifdef POSITION_DEBUG @@ -163,7 +165,7 @@ position_check(int expected_y, int expected_x, char *legend) static inline void GoTo(int const row, int const col) { - chtype oldattr = SP->_current_attr; + attr_t oldattr = SP->_current_attr; TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", row, col, SP->_cursrow, SP->_curscol)); @@ -189,22 +191,30 @@ GoTo(int const row, int const col) } static inline void -PutAttrChar(chtype ch) +PutAttrChar(CARG_CH_T ch) { - int data; + PUTC_DATA; + NCURSES_CH_T tilde; - if (tilde_glitch && (TextOf(ch) == '~')) - ch = ('`' | AttrOf(ch)); + if (tilde_glitch && (CharOfD(ch) == L('~'))) { + SetChar(tilde, L('`'), AttrOfD(ch)); + ch = CHREF(tilde); + } TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)", - _tracechtype(ch), + _tracech_t(ch), SP->_cursrow, SP->_curscol)); - UpdateAttrs(ch); - data = TextOf(ch); + UpdateAttrs(AttrOfD(ch)); +#if !USE_WIDEC_SUPPORT + /* FIXME - we do this special case for signal handling, should see how to + * make it work for wide characters. + */ if (SP->_outch != 0) { - SP->_outch(data); - } else { - putc(data, SP->_ofp); /* macro's fastest... */ + SP->_outch(ch); + } else +#endif + { + PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ #ifdef TRACE _nc_outchars++; #endif /* TRACE */ @@ -276,7 +286,7 @@ check_pending(void) /* put char at lower right corner */ static void -PutCharLR(chtype const ch) +PutCharLR(const ARG_CH_T ch) { if (!auto_right_margin) { /* we can put the char directly */ @@ -333,7 +343,7 @@ wrap_cursor(void) } static inline void -PutChar(chtype const ch) +PutChar(const ARG_CH_T ch) /* insert character, handling automargin stuff */ { if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1) @@ -354,19 +364,27 @@ PutChar(chtype const ch) * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. */ static inline bool -can_clear_with(chtype ch) +can_clear_with(ARG_CH_T ch) { if (!back_color_erase && SP->_coloron) { - if (ch & A_COLOR) - return FALSE; #if NCURSES_EXT_FUNCS if (!SP->_default_color) return FALSE; if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK) return FALSE; + if (AttrOfD(ch) & A_COLOR) { + short fg, bg; + pair_content(PAIR_NUMBER(AttrOfD(ch)), &fg, &bg); + if (fg != C_MASK || bg != C_MASK) + return FALSE; + } +#else + if (AttrOfD(ch) & A_COLOR) + return FALSE; #endif } - return ((ch & ~(NONBLANK_ATTR | A_COLOR)) == BLANK); + return (ISBLANK(CHDEREF(ch)) && + (AttrOfD(ch) & ~(NONBLANK_ATTR | A_COLOR)) == BLANK_ATTR); } /* @@ -382,28 +400,28 @@ can_clear_with(chtype ch) * This code is optimized using ech and rep. */ static int -EmitRange(const chtype * ntext, int num) +EmitRange(const NCURSES_CH_T * ntext, int num) { int i; if (erase_chars || repeat_char) { while (num > 0) { int runcount; - chtype ntext0; + NCURSES_CH_T ntext0; - while (num > 1 && ntext[0] != ntext[1]) { - PutChar(ntext[0]); + while (num > 1 && !CharEq(ntext[0], ntext[1])) { + PutChar(CHREF(ntext[0])); ntext++; num--; } ntext0 = ntext[0]; if (num == 1) { - PutChar(ntext0); + PutChar(CHREF(ntext0)); return 0; } runcount = 2; - while (runcount < num && ntext[runcount] == ntext0) + while (runcount < num && CharEq(ntext[runcount], ntext0)) runcount++; /* @@ -416,8 +434,8 @@ EmitRange(const chtype * ntext, int num) */ if (erase_chars && runcount > SP->_ech_cost + SP->_cup_ch_cost - && can_clear_with(ntext0)) { - UpdateAttrs(ntext0); + && can_clear_with(CHREF(ntext0))) { + UpdateAttrs(AttrOf(ntext0)); putp(tparm(erase_chars, runcount)); /* @@ -437,15 +455,15 @@ EmitRange(const chtype * ntext, int num) if (wrap_possible) rep_count--; - UpdateAttrs(ntext0); - putp(tparm(repeat_char, TextOf(ntext0), rep_count)); + UpdateAttrs(AttrOf(ntext0)); + putp(tparm(repeat_char, CharOf(ntext0), rep_count)); SP->_curscol += rep_count; if (wrap_possible) - PutChar(ntext0); + PutChar(CHREF(ntext0)); } else { for (i = 0; i < runcount; i++) - PutChar(ntext[i]); + PutChar(CHREF(ntext[i])); } ntext += runcount; num -= runcount; @@ -454,7 +472,7 @@ EmitRange(const chtype * ntext, int num) } for (i = 0; i < num; i++) - PutChar(ntext[i]); + PutChar(CHREF(ntext[i])); return 0; } @@ -468,8 +486,8 @@ EmitRange(const chtype * ntext, int num) */ static int PutRange( - const chtype * otext, - const chtype * ntext, + const NCURSES_CH_T * otext, + const NCURSES_CH_T * ntext, int row, int first, int last) { @@ -481,7 +499,9 @@ PutRange( if (otext != ntext && (last - first + 1) > SP->_inline_cost) { for (j = first, run = 0; j <= last; j++) { - if (otext[j] == ntext[j]) { + if (!run && isnac(otext[j])) + continue; + if (CharEq(otext[j], ntext[j])) { run++; } else { if (run > SP->_inline_cost) { @@ -580,7 +600,7 @@ doupdate(void) for (i = 0; i < screen_lines; i++) { for (j = 0; j < screen_columns; j++) { bool failed = FALSE; - chtype turnon = AttrOf(newscr->_line[i].text[j]) & ~rattr; + attr_t turnon = AttrOf(newscr->_line[i].text[j]) & ~rattr; /* is an attribute turned on here? */ if (turnon == 0) { @@ -597,16 +617,16 @@ doupdate(void) * ensure there's enough room to set the attribute before * the first non-blank in the run. */ -#define SAFE(a) (!((a) & (chtype)~NONBLANK_ATTR)) - if (TextOf(newscr->_line[i].text[j]) == ' ' && SAFE(turnon)) { - newscr->_line[i].text[j] &= ~turnon; +#define SAFE(a) (!((a) & (attr_t)~NONBLANK_ATTR)) + if (ISBLANK(newscr->_line[i].text[j]) && SAFE(turnon)) { + RemAttr(newscr->_line[i].text[j], turnon); continue; } /* check that there's enough room at start of span */ for (k = 1; k <= magic_cookie_glitch; k++) { if (j - k < 0 - || TextOf(newscr->_line[i].text[j - k]) != ' ' + || !ISBLANK(newscr->_line[i].text[j - k]) || !SAFE(AttrOf(newscr->_line[i].text[j - k]))) failed = TRUE; } @@ -633,7 +653,7 @@ doupdate(void) foundit:; if (end_onscreen) { - chtype *lastline = newscr->_line[m].text; + NCURSES_CH_T *lastline = newscr->_line[m].text; /* * If there are safely-attributed blanks at the @@ -642,14 +662,14 @@ doupdate(void) * of span. */ while (n >= 0 - && TextOf(lastline[n]) == ' ' + && ISBLANK(lastline[n]) && SAFE(AttrOf(lastline[n]))) - lastline[n--] &= ~turnon; + RemAttr(lastline[n--], turnon); /* check that there's enough room at end of span */ for (k = 1; k <= magic_cookie_glitch; k++) if (n + k >= screen_columns - || TextOf(lastline[n + k]) != ' ' + || !ISBLANK(lastline[n + k]) || !SAFE(AttrOf(lastline[n + k]))) failed = TRUE; } @@ -667,7 +687,7 @@ doupdate(void) for (; q < screen_columns; q++) { if (AttrOf(newscr->_line[p].text[q]) == rattr) goto foundend; - newscr->_line[p].text[q] &= ~turnon; + RemAttr(newscr->_line[p].text[q], turnon); } q = 0; } @@ -682,7 +702,7 @@ doupdate(void) * for cookies before the first nonblank character */ for (k = 1; k <= magic_cookie_glitch; k++) - newscr->_line[i].text[j - k] |= turnon; + AddAttr(newscr->_line[i].text[j - k], turnon); } rattr = AttrOf(newscr->_line[i].text[j]); @@ -782,8 +802,8 @@ doupdate(void) 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)); + (long) (after.tms_stime - before.tms_stime), + (long) (after.tms_utime - before.tms_utime))); #endif /* USE_TRACE_TIMES */ _nc_signal_handler(TRUE); @@ -802,14 +822,14 @@ doupdate(void) * in the wbkgd() call. Assume 'stdscr' for this case. */ #define BCE_ATTRS (A_NORMAL|A_COLOR) -#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_bkgd) +#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd) -static inline chtype +static inline NCURSES_CH_T ClrBlank(WINDOW *win) { - chtype blank = BLANK; + NCURSES_CH_T blank = NewChar(BLANK_TEXT); if (back_color_erase) - blank |= (BCE_BKGD(win) & BCE_ATTRS); + AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS)); return blank; } @@ -824,7 +844,7 @@ static void ClrUpdate(void) { int i; - chtype blank = ClrBlank(stdscr); + NCURSES_CH_T blank = ClrBlank(stdscr); int nonempty = min(screen_lines, newscr->_maxy + 1); TR(TRACE_UPDATE, ("ClrUpdate() called")); @@ -846,7 +866,7 @@ ClrUpdate(void) */ static void -ClrToEOL(chtype blank, bool needclear) +ClrToEOL(NCURSES_CH_T blank, bool needclear) { int j; @@ -854,9 +874,9 @@ ClrToEOL(chtype blank, bool needclear) && SP->_cursrow >= 0) { for (j = SP->_curscol; j < screen_columns; j++) { if (j >= 0) { - chtype *cp = &(curscr->_line[SP->_cursrow].text[j]); + NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]); - if (*cp != blank) { + if (!CharEq(*cp, blank)) { *cp = blank; needclear = TRUE; } @@ -867,12 +887,12 @@ ClrToEOL(chtype blank, bool needclear) } if (needclear) { - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eol"); if (SP->_el_cost > (screen_columns - SP->_curscol)) { int count = (screen_columns - SP->_curscol); while (count-- > 0) - PutChar(blank); + PutChar(CHREF(blank)); } else { putp(clr_eol); } @@ -886,14 +906,14 @@ ClrToEOL(chtype blank, bool needclear) */ static void -ClrToEOS(chtype blank) +ClrToEOS(NCURSES_CH_T blank) { int row, col; row = SP->_cursrow; col = SP->_curscol; - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eos"); tputs(clr_eos, screen_lines - row, _nc_outch); @@ -920,20 +940,20 @@ ClrBottom(int total) int col; int top = total; int last = min(screen_columns, newscr->_maxx + 1); - chtype blank = ClrBlank(stdscr); + NCURSES_CH_T blank = ClrBlank(stdscr); bool ok; - if (clr_eos && can_clear_with(blank)) { + if (clr_eos && can_clear_with(CHREF(blank))) { for (row = total - 1; row >= 0; row--) { for (col = 0, ok = TRUE; ok && col < last; col++) { - ok = (newscr->_line[row].text[col] == blank); + ok = (CharEq(newscr->_line[row].text[col], blank)); } if (!ok) break; for (col = 0; ok && col < last; col++) { - ok = (curscr->_line[row].text[col] == blank); + ok = (CharEq(curscr->_line[row].text[col], blank)); } if (!ok) top = row; @@ -953,6 +973,25 @@ ClrBottom(int total) return total; } +#if USE_XMC_SUPPORT +#if USE_WIDEC_SUPPORT +static inline bool +check_xmc_transition(NCURSES_CH_T * a, NCURSES_CH_T * b) +{ + if (((a->attr ^ b->attr) & ~(a->attr) & SP->_xmc_triggers) != 0) { + return TRUE; + } + return FALSE; +} +#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b)) +#else +#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) +#endif + +#define xmc_new(r,c) newscr->_line[r].text[c] +#define xmc_turn_off(a,b) xmc_turn_on(b,a) +#endif /* USE_XMC_SUPPORT */ + /* ** TransformLine(lineno) ** @@ -975,8 +1014,8 @@ static void TransformLine(int const lineno) { int firstChar, oLastChar, nLastChar; - chtype *newLine = newscr->_line[lineno].text; - chtype *oldLine = curscr->_line[lineno].text; + NCURSES_CH_T *newLine = newscr->_line[lineno].text; + NCURSES_CH_T *oldLine = curscr->_line[lineno].text; int n; bool attrchanged = FALSE; @@ -986,8 +1025,8 @@ TransformLine(int const lineno) if (SP->oldhash && SP->newhash) SP->oldhash[lineno] = SP->newhash[lineno]; -#define ColorOf(n) ((n) & A_COLOR) -#define unColor(n) ((n) & ALL_BUT_COLOR) +#define ColorOf(n) (AttrOf(n) & A_COLOR) +#define unColor(n) (AttrOf(n) & ALL_BUT_COLOR) /* * If we have colors, there is the possibility of having two color pairs * that display as the same colors. For instance, Lynx does this. Check @@ -995,13 +1034,13 @@ TransformLine(int const lineno) * they are equivalent. */ if (SP->_coloron) { - chtype oldColor; - chtype newColor; + attr_t oldColor; + attr_t newColor; int oldPair; int newPair; for (n = 0; n < screen_columns; n++) { - if (newLine[n] != oldLine[n]) { + if (!CharEq(newLine[n], oldLine[n])) { oldColor = ColorOf(oldLine[n]); newColor = ColorOf(newLine[n]); if (oldColor != newColor @@ -1011,8 +1050,8 @@ TransformLine(int const lineno) if (oldPair < COLOR_PAIRS && newPair < COLOR_PAIRS && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) { - oldLine[n] &= ~A_COLOR; - oldLine[n] |= ColorOf(newLine[n]); + RemAttr(oldLine[n], A_COLOR); + AddAttr(oldLine[n], ColorOf(newLine[n])); } } } @@ -1036,10 +1075,6 @@ TransformLine(int const lineno) PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1)); #if USE_XMC_SUPPORT -#define NEW(r,c) newscr->_line[r].text[c] -#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) -#define xmc_turn_off(a,b) xmc_turn_on(b,a) - /* * This is a very simple loop to paint characters which may have the * magic cookie glitch embedded. It doesn't know much about video @@ -1060,40 +1095,39 @@ TransformLine(int const lineno) * If we are writing an attributed blank, where the * previous cell is not attributed. */ - if (TextOf(newLine[n]) == ' ' + if (ISBLANK(newLine[n]) && ((n > 0 && xmc_turn_on(newLine[n - 1], newLine[n])) || (n == 0 && lineno > 0 - && xmc_turn_on(NEW(lineno - 1, screen_columns - 1), + && xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1), newLine[n])))) { n = m; } - PutChar(newLine[n]); + PutChar(CHREF(newLine[n])); /* check for turn-off: * If we are writing an attributed non-blank, where the * next cell is blank, and not attributed. */ - if (TextOf(newLine[n]) != ' ' + if (!ISBLANK(newLine[n]) && ((n + 1 < screen_columns && 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))))) { + && xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) { n = m; } } -#undef NEW #endif } else { - chtype blank; + NCURSES_CH_T blank; /* find the first differing character */ while (firstChar < screen_columns && - newLine[firstChar] == oldLine[firstChar]) + CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; /* if there wasn't one, we're done */ @@ -1101,25 +1135,25 @@ TransformLine(int const lineno) return; /* it may be cheap to clear leading whitespace with clr_bol */ - if (clr_bol && can_clear_with(blank = newLine[0])) { + if (clr_bol && (blank = newLine[0], can_clear_with(CHREF(blank)))) { int oFirstChar, nFirstChar; for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++) - if (oldLine[oFirstChar] != blank) + if (!CharEq(oldLine[oFirstChar], blank)) break; for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++) - if (newLine[nFirstChar] != blank) + if (!CharEq(newLine[nFirstChar], blank)) break; if (nFirstChar > oFirstChar + SP->_el1_cost) { if (nFirstChar >= screen_columns && SP->_el_cost <= SP->_el1_cost) { GoTo(lineno, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eol"); putp(clr_eol); } else { GoTo(lineno, nFirstChar - 1); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_bol"); putp(clr_bol); } @@ -1134,12 +1168,12 @@ TransformLine(int const lineno) blank = newLine[screen_columns - 1]; - if (!can_clear_with(blank)) { + if (!can_clear_with(CHREF(blank))) { /* find the last differing character */ nLastChar = screen_columns - 1; while (nLastChar > firstChar - && newLine[nLastChar] == oldLine[nLastChar]) + && CharEq(newLine[nLastChar], oldLine[nLastChar])) nLastChar--; if (nLastChar >= firstChar) { @@ -1147,29 +1181,29 @@ TransformLine(int const lineno) PutRange(oldLine, newLine, lineno, firstChar, nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (nLastChar - firstChar + 1) * sizeof(chtype)); + (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } return; } /* find last non-blank character on old line */ oLastChar = screen_columns - 1; - while (oLastChar > firstChar && oldLine[oLastChar] == blank) + while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank)) oLastChar--; /* find last non-blank character on new line */ nLastChar = screen_columns - 1; - while (nLastChar > firstChar && newLine[nLastChar] == blank) + while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank)) nLastChar--; if ((nLastChar == firstChar) && (SP->_el_cost < (oLastChar - nLastChar))) { GoTo(lineno, firstChar); - if (newLine[firstChar] != blank) - PutChar(newLine[firstChar]); + if (!CharEq(newLine[firstChar], blank)) + PutChar(CHREF(newLine[firstChar])); ClrToEOL(blank, FALSE); } else if ((nLastChar != oLastChar) - && (newLine[nLastChar] != oldLine[oLastChar] + && (!CharEq(newLine[nLastChar], oldLine[oLastChar]) || !(_nc_idcok && has_ic()))) { GoTo(lineno, firstChar); if ((oLastChar - nLastChar) > SP->_el_cost) { @@ -1185,14 +1219,16 @@ TransformLine(int const lineno) int oLastNonblank = oLastChar; /* find the last characters that really differ */ - while (newLine[nLastChar] == oldLine[oLastChar]) { - if (nLastChar != 0 - && oLastChar != 0) { - nLastChar--; - oLastChar--; - } else { + /* can be -1 if no characters differ */ + while (CharEq(newLine[nLastChar], oldLine[oLastChar])) { + /* don't split a wide char */ + if (isnac(newLine[nLastChar]) && + !CharEq(newLine[nLastChar - 1], oldLine[oLastChar - 1])) + break; + nLastChar--; + oLastChar--; + if (nLastChar == -1 || oLastChar == -1) break; - } } n = min(oLastChar, nLastChar); @@ -1227,7 +1263,7 @@ TransformLine(int const lineno) * setting the video attributes from * the last character on the row. */ - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); DelChar(oLastChar - nLastChar); } } @@ -1238,7 +1274,7 @@ TransformLine(int const lineno) if (screen_columns > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (screen_columns - firstChar) * sizeof(chtype)); + (screen_columns - firstChar) * sizeof(NCURSES_CH_T)); } /* @@ -1249,7 +1285,7 @@ TransformLine(int const lineno) */ static void -ClearScreen(chtype blank) +ClearScreen(NCURSES_CH_T blank) { int i, j; bool fast_clear = (clear_screen || clr_eos || clr_eol); @@ -1268,7 +1304,7 @@ ClearScreen(chtype blank) if (fast_clear) { if (clear_screen) { - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clear_screen"); putp(clear_screen); SP->_cursrow = SP->_curscol = 0; @@ -1277,13 +1313,13 @@ ClearScreen(chtype blank) SP->_cursrow = SP->_curscol = -1; GoTo(0, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eos"); putp(clr_eos); } else if (clr_eol) { SP->_cursrow = SP->_curscol = -1; - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < screen_lines; i++) { GoTo(i, 0); TPUTS_TRACE("clr_eol"); @@ -1292,11 +1328,11 @@ ClearScreen(chtype blank) GoTo(0, 0); } } else { - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < screen_lines; i++) { GoTo(i, 0); for (j = 0; j < screen_columns; j++) - PutChar(blank); + PutChar(CHREF(blank)); } GoTo(0, 0); } @@ -1317,7 +1353,7 @@ ClearScreen(chtype blank) */ static void -InsStr(chtype * line, int count) +InsStr(NCURSES_CH_T * line, int count) { TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count)); @@ -1328,7 +1364,7 @@ InsStr(chtype * line, int count) TPUTS_TRACE("parm_ich"); tputs(tparm(parm_ich, count), count, _nc_outch); while (count) { - PutAttrChar(*line); + PutAttrChar(CHREF(*line)); line++; count--; } @@ -1336,7 +1372,7 @@ InsStr(chtype * line, int count) TPUTS_TRACE("enter_insert_mode"); putp(enter_insert_mode); while (count) { - PutAttrChar(*line); + PutAttrChar(CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); putp(insert_padding); @@ -1350,7 +1386,7 @@ InsStr(chtype * line, int count) while (count) { TPUTS_TRACE("insert_character"); putp(insert_character); - PutAttrChar(*line); + PutAttrChar(CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); putp(insert_padding); @@ -1435,40 +1471,40 @@ _nc_outstr(const char *str) /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */ static int -scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank) +scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) { int i, j; if (n == 1 && scroll_forward && top == miny && bot == maxy) { GoTo(bot, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("scroll_forward"); tputs(scroll_forward, 0, _nc_outch); } else if (n == 1 && delete_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("delete_line"); tputs(delete_line, 0, _nc_outch); } else if (parm_index && top == miny && bot == maxy) { GoTo(bot, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_index"); tputs(tparm(parm_index, n, 0), n, _nc_outch); } else if (parm_delete_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_delete_line"); tputs(tparm(parm_delete_line, n, 0), n, _nc_outch); } else if (scroll_forward && top == miny && bot == maxy) { GoTo(bot, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_forward"); tputs(scroll_forward, 0, _nc_outch); } } else if (delete_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); tputs(delete_line, 0, _nc_outch); @@ -1481,7 +1517,7 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank) for (i = 0; i < n; i++) { GoTo(bot - i, 0); for (j = 0; j < screen_columns; j++) - PutChar(blank); + PutChar(CHREF(blank)); } } #endif @@ -1491,40 +1527,41 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank) /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */ /* n > 0 */ static int -scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank) +scroll_csr_backward(int n, int top, int bot, int miny, int maxy, + NCURSES_CH_T blank) { int i, j; if (n == 1 && scroll_reverse && top == miny && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("scroll_reverse"); tputs(scroll_reverse, 0, _nc_outch); } else if (n == 1 && insert_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("insert_line"); tputs(insert_line, 0, _nc_outch); } else if (parm_rindex && top == miny && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_rindex"); tputs(tparm(parm_rindex, n, 0), n, _nc_outch); } else if (parm_insert_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_insert_line"); tputs(tparm(parm_insert_line, n, 0), n, _nc_outch); } else if (scroll_reverse && top == miny && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_reverse"); tputs(scroll_reverse, 0, _nc_outch); } } else if (insert_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); tputs(insert_line, 0, _nc_outch); @@ -1537,7 +1574,7 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank) for (i = 0; i < n; i++) { GoTo(top + i, 0); for (j = 0; j < screen_columns; j++) - PutChar(blank); + PutChar(CHREF(blank)); } } #endif @@ -1547,7 +1584,7 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank) /* scroll by using delete_line at del and insert_line at ins */ /* n > 0 */ static int -scroll_idl(int n, int del, int ins, chtype blank) +scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) { int i; @@ -1555,7 +1592,7 @@ scroll_idl(int n, int del, int ins, chtype blank) return ERR; GoTo(del, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); if (n == 1 && delete_line) { TPUTS_TRACE("delete_line"); tputs(delete_line, 0, _nc_outch); @@ -1570,7 +1607,7 @@ scroll_idl(int n, int del, int ins, chtype blank) } GoTo(ins, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); if (n == 1 && insert_line) { TPUTS_TRACE("insert_line"); tputs(insert_line, 0, _nc_outch); @@ -1592,7 +1629,7 @@ _nc_scrolln (int n, int top, int bot, int maxy) /* scroll region from top to bot by n lines */ { - chtype blank = ClrBlank(stdscr); + NCURSES_CH_T blank = ClrBlank(stdscr); int i; bool cursor_saved = FALSE; int res; @@ -1647,13 +1684,14 @@ _nc_scrolln */ if (res != ERR && (non_dest_scroll_region || (memory_below && bot == maxy))) { + NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); if (bot == maxy && clr_eos) { GoTo(bot - n, 0); - ClrToEOS(BLANK); + ClrToEOS(blank2); } else { for (i = 0; i < n; i++) { GoTo(bot - i, 0); - ClrToEOL(BLANK, FALSE); + ClrToEOL(blank2, FALSE); } } } @@ -1692,9 +1730,10 @@ _nc_scrolln */ if (res != ERR && (non_dest_scroll_region || (memory_above && top == 0))) { + NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); for (i = 0; i < -n; i++) { GoTo(i + top, 0); - ClrToEOL(BLANK, FALSE); + ClrToEOL(blank2, FALSE); } } } @@ -1750,6 +1789,7 @@ _nc_screen_wrap(void) #if NCURSES_EXT_FUNCS if (SP->_coloron && !SP->_default_color) { + NCURSES_CH_T blank = NewChar(BLANK_TEXT); SP->_default_color = TRUE; _nc_do_color(-1, 0, FALSE, _nc_outch); SP->_default_color = FALSE; @@ -1758,7 +1798,7 @@ _nc_screen_wrap(void) SP->_cursrow = screen_lines - 1; SP->_curscol = 0; - ClrToEOL(BLANK, TRUE); + ClrToEOL(blank, TRUE); } #endif } diff --git a/contrib/ncurses/ncurses/widechar/lib_box_set.c b/contrib/ncurses/ncurses/widechar/lib_box_set.c new file mode 100644 index 0000000..7f69e5aa --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_box_set.c @@ -0,0 +1,113 @@ +/**************************************************************************** + * Copyright (c) 2002 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. * + ****************************************************************************/ + +/**************************************************************************** + * Authors: Sven Verdoolaege and Thomas Dickey 2001,2002 * + ****************************************************************************/ + +/* +** lib_box_set.c +** +** The routine wborder_set(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_box_set.c,v 1.2 2002/03/23 21:35:24 tom Exp $") + +NCURSES_EXPORT(int) +wborder_set(WINDOW *win, + const ARG_CH_T ls, const ARG_CH_T rs, + const ARG_CH_T ts, const ARG_CH_T bs, + const ARG_CH_T tl, const ARG_CH_T tr, + const ARG_CH_T bl, const ARG_CH_T br) +{ + NCURSES_SIZE_T i; + NCURSES_SIZE_T endx, endy; + NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; + + T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), + win, + _tracech_t2(1, ls), + _tracech_t2(2, rs), + _tracech_t2(3, ts), + _tracech_t2(4, bs), + _tracech_t2(5, tl), + _tracech_t2(6, tr), + _tracech_t2(7, bl), + _tracech_t2(8, br))); + + if (!win) + returnCode(ERR); + +#define RENDER_WITH_DEFAULT(ch,def) w ##ch = (ch == 0) ? *def : *ch + + RENDER_WITH_DEFAULT(ls, WACS_VLINE); + RENDER_WITH_DEFAULT(rs, WACS_VLINE); + RENDER_WITH_DEFAULT(ts, WACS_HLINE); + RENDER_WITH_DEFAULT(bs, WACS_HLINE); + RENDER_WITH_DEFAULT(tl, WACS_ULCORNER); + RENDER_WITH_DEFAULT(tr, WACS_URCORNER); + RENDER_WITH_DEFAULT(bl, WACS_LLCORNER); + RENDER_WITH_DEFAULT(br, WACS_LRCORNER); + + T(("using %s, %s, %s, %s, %s, %s, %s, %s", + _tracech_t2(1, CHREF(wls)), + _tracech_t2(2, CHREF(wrs)), + _tracech_t2(3, CHREF(wts)), + _tracech_t2(4, CHREF(wbs)), + _tracech_t2(5, CHREF(wtl)), + _tracech_t2(6, CHREF(wtr)), + _tracech_t2(7, CHREF(wbl)), + _tracech_t2(8, CHREF(wbr)))); + + endx = win->_maxx; + endy = win->_maxy; + + for (i = 0; i <= endx; i++) { + win->_line[0].text[i] = wts; + win->_line[endy].text[i] = wbs; + } + win->_line[endy].firstchar = win->_line[0].firstchar = 0; + win->_line[endy].lastchar = win->_line[0].lastchar = endx; + + for (i = 0; i <= endy; i++) { + win->_line[i].text[0] = wls; + win->_line[i].text[endx] = wrs; + win->_line[i].firstchar = 0; + win->_line[i].lastchar = endx; + } + win->_line[0].text[0] = wtl; + win->_line[0].text[endx] = wtr; + win->_line[endy].text[0] = wbl; + win->_line[endy].text[endx] = wbr; + + _nc_synchook(win); + returnCode(OK); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_cchar.c b/contrib/ncurses/ncurses/widechar/lib_cchar.c new file mode 100644 index 0000000..efbfc69 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_cchar.c @@ -0,0 +1,114 @@ +/**************************************************************************** + * Copyright (c) 2001,2002 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. * + ****************************************************************************/ + +/* +** lib_cchar.c +** +** The routines setcchar() and getcchar(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_cchar.c,v 1.5 2002/04/27 22:35:46 tom Exp $") + +/* + * The SuSv2 description leaves some room for interpretation. We'll assume wch + * is L'\0' terminated, contains at most one character with strictly positive + * width, which must be the first, and contains no characters of negative + * width. + */ +NCURSES_EXPORT(int) +setcchar(cchar_t * wcval, const wchar_t * wch, const attr_t attrs, + short color_pair, const void *opts) +{ + int i; + int len; + int code = OK; + + TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%ld,%d,%p)"), + wcval, _nc_viswbuf(wch), attrs, color_pair, opts)); + + if (opts != NULL || (len = wcslen(wch)) > CCHARW_MAX + || (len > 0 && wcwidth(wch[0]) < 0)) { + code = ERR; + } else { + + for (i = 1; i < len; ++i) { + if (wcwidth(wch[i]) != 0) { + code = ERR; + break; + } + } + + if (code != ERR) { + memset(wcval, 0, sizeof(*wcval)); + + if (len != 0) { + SetAttr(*wcval, attrs | color_pair); + memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); + TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, + _tracecchar_t(wcval))); + } + } + } + + TR(TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} + +NCURSES_EXPORT(int) +getcchar(const cchar_t * wcval, wchar_t * wch, attr_t * attrs, + short *color_pair, void *opts) +{ + wchar_t *wp; + int len; + int code = ERR; + + TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), + wcval, wch, attrs, color_pair, opts)); + + if (opts == NULL) { + len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? wp - wcval->chars + : CCHARW_MAX; + + if (wch == NULL) { + code = len; + } else if (len >= 0) { + *attrs = AttrOf(*wcval) & A_ATTRIBUTES; + *color_pair = AttrOf(*wcval) & A_COLOR; + wmemcpy(wch, wcval->chars, (unsigned) len); + wch[len] = L'\0'; + code = OK; + } + } + + TR(TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_erasewchar.c b/contrib/ncurses/ncurses/widechar/lib_erasewchar.c new file mode 100644 index 0000000..7d64553 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_erasewchar.c @@ -0,0 +1,77 @@ +/**************************************************************************** + * Copyright (c) 2002 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 2002 * + ****************************************************************************/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") + +/* + * erasewchar() + * + * Return erase character as given in cur_term->Ottyb. + * + */ + +NCURSES_EXPORT(int) +erasewchar(wchar_t * wch) +{ + int value; + int result = ERR; + + T((T_CALLED("erasewchar()"))); + if ((value = erasechar()) != ERR) { + *wch = value; + result = OK; + } + returnCode(result); +} + +/* + * killwchar() + * + * Return kill character as given in cur_term->Ottyb. + * + */ + +NCURSES_EXPORT(int) +killwchar(wchar_t * wch) +{ + int value; + int result = ERR; + + T((T_CALLED("killwchar()"))); + if ((value = killchar()) != ERR) { + *wch = value; + result = OK; + } + returnCode(result); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_get_wch.c b/contrib/ncurses/ncurses/widechar/lib_get_wch.c new file mode 100644 index 0000000..21c40a5 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_get_wch.c @@ -0,0 +1,99 @@ +/**************************************************************************** + * Copyright (c) 2002 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 2002 * + ****************************************************************************/ + +/* +** lib_get_wch.c +** +** The routine get_wch(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_get_wch.c,v 1.3 2002/03/17 16:14:45 tom Exp $") + +NCURSES_EXPORT(int) +wget_wch(WINDOW *win, wint_t * result) +{ + int code; + char buffer[(MB_CUR_MAX * 9) + 1]; /* allow some redundant shifts */ + int status; + mbstate_t state; + size_t count = 0; + unsigned long value; + wchar_t wch; + + T((T_CALLED("wget_wch(%p)"), win)); + /* + * We can get a stream of single-byte characters and KEY_xxx codes from + * _nc_wgetch(), while we want to return a wide character or KEY_xxx code. + */ + for (;;) { + T(("reading %d of %d", count + 1, sizeof(buffer))); + code = _nc_wgetch(win, &value, TRUE); + if (code == ERR) { + break; + } else if (code == KEY_CODE_YES) { + /* + * If we were processing an incomplete multibyte character, return + * an error since we have a KEY_xxx code which interrupts it. For + * some cases, we could improve this by writing a new version of + * lib_getch.c(!), but it is not clear whether the improvement + * would be worth the effort. + */ + if (count != 0) { + ungetch(value); + code = ERR; + } + break; + } else if (count + 1 >= sizeof(buffer)) { + ungetch(value); + code = ERR; + break; + } else { + buffer[count++] = UChar(value); + memset(&state, 0, sizeof(state)); + status = mbrlen(buffer, count, &state); + if (status >= 0) { + memset(&state, 0, sizeof(state)); + if ((int) mbrtowc(&wch, buffer, count, &state) != status) { + code = ERR; /* the two calls should match */ + } + value = wch; + break; + } + } + } + *result = value; + T(("result %#o", value)); + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_get_wstr.c b/contrib/ncurses/ncurses/widechar/lib_get_wstr.c new file mode 100644 index 0000000..426381c --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_get_wstr.c @@ -0,0 +1,205 @@ +/**************************************************************************** + * Copyright (c) 2002 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 2002 * + ****************************************************************************/ + +/* +** lib_get_wstr.c +** +** The routine wgetn_wstr(). +** +*/ + +#include <curses.priv.h> +#include <term.h> + +MODULE_ID("$Id: lib_get_wstr.c,v 1.3 2002/05/11 22:29:43 tom Exp $") + +/* + * This wipes out the last character, no matter whether it was a tab, control + * or other character, and handles reverse wraparound. + */ +static wchar_t * +WipeOut(WINDOW *win, int y, int x, wchar_t * first, wchar_t * last, bool echoed) +{ + if (last > first) { + *--last = '\0'; + if (echoed) { + int y1 = win->_cury; + int x1 = win->_curx; + + wmove(win, y, x); + waddwstr(win, first); + getyx(win, y, x); + while (win->_cury < y1 + || (win->_cury == y1 && win->_curx < x1)) + waddch(win, (chtype) ' '); + + wmove(win, y, x); + } + } + return last; +} + +NCURSES_EXPORT(int) +wgetn_wstr(WINDOW *win, wint_t * str, int maxlen) +{ + TTY buf; + bool oldnl, oldecho, oldraw, oldcbreak; + wint_t erasec; + wint_t killc; + wchar_t *oldstr; + wchar_t *tmpstr; + wint_t ch; + int y, x, code; + + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); + + if (!win) + returnCode(ERR); + + _nc_get_tty_mode(&buf); + + oldnl = SP->_nl; + oldecho = SP->_echo; + oldraw = SP->_raw; + oldcbreak = SP->_cbreak; + nl(); + noecho(); + noraw(); + cbreak(); + + erasec = erasechar(); + killc = killchar(); + + assert(sizeof(wchar_t) == sizeof(wint_t)); + oldstr = (wchar_t *) str; + tmpstr = (wchar_t *) str; + + getyx(win, y, x); + + if (is_wintouched(win) || (win->_flags & _HASMOVED)) + wrefresh(win); + + while ((code = wget_wch(win, &ch)) != ERR) { + if (code == KEY_CODE_YES) { + /* + * Some terminals (the Wyse-50 is the most common) generate a \n + * from the down-arrow key. With this logic, it's the user's + * choice whether to set kcud=\n for wget_wch(); terminating + * *getn_wstr() with \n should work either way. + */ + if (ch == '\n' + || ch == '\r' + || ch == KEY_DOWN + || ch == KEY_ENTER) { + if (oldecho == TRUE + && win->_cury == win->_maxy + && win->_scroll) + wechochar(win, (chtype) '\n'); + break; + } + if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) { + if (tmpstr > oldstr) { + tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho); + } + } else if (ch == killc) { + while (tmpstr > oldstr) { + tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho); + } + } else { + beep(); + } + } else if (maxlen >= 0 && tmpstr - oldstr >= maxlen) { + beep(); + } else { + *tmpstr++ = ch; + if (oldecho == TRUE) { + int oldy = win->_cury; + cchar_t tmp; + + setcchar(&tmp, tmpstr - 1, A_NORMAL, 0, NULL); + if (wadd_wch(win, &tmp) == ERR) { + /* + * We can't really use the lower-right corner for input, + * since it'll mess up bookkeeping for erases. + */ + win->_flags &= ~_WRAPPED; + waddch(win, (chtype) ' '); + tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho); + continue; + } else if (win->_flags & _WRAPPED) { + /* + * If the last waddch forced a wrap & scroll, adjust our + * reference point for erasures. + */ + if (win->_scroll + && oldy == win->_maxy + && win->_cury == win->_maxy) { + if (--y <= 0) { + y = 0; + } + } + win->_flags &= ~_WRAPPED; + } + wrefresh(win); + } + } + } + + win->_curx = 0; + win->_flags &= ~_WRAPPED; + if (win->_cury < win->_maxy) + win->_cury++; + wrefresh(win); + + /* Restore with a single I/O call, to fix minor asymmetry between + * raw/noraw, etc. + */ + SP->_nl = oldnl; + SP->_echo = oldecho; + SP->_raw = oldraw; + SP->_cbreak = oldcbreak; + + _nc_set_tty_mode(&buf); + + *tmpstr = 0; + if (code == ERR) { + if (tmpstr == oldstr) { + *tmpstr++ = (wchar_t)WEOF; + *tmpstr = 0; + } + returnCode(ERR); + } + + T(("wgetn_wstr returns %s", _nc_viswbuf(oldstr))); + + returnCode(OK); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_hline_set.c b/contrib/ncurses/ncurses/widechar/lib_hline_set.c new file mode 100644 index 0000000..43175de --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_hline_set.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_hline_set.c +** +** The routine whline_set(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") + +NCURSES_EXPORT(int) +whline_set(WINDOW *win, const cchar_t * ch, int n) +{ + int code = ERR; + NCURSES_SIZE_T start; + NCURSES_SIZE_T end; + + T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + + if (win) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T wch; + + start = win->_curx; + end = start + n - 1; + if (end > win->_maxx) + end = win->_maxx; + + CHANGED_RANGE(line, start, end); + + if (ch == 0) + wch = *WACS_HLINE; + else + wch = *ch; + wch = _nc_render(win, wch); + + while (end >= start) { + line->text[end] = wch; + end--; + } + + _nc_synchook(win); + code = OK; + } + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_in_wch.c b/contrib/ncurses/ncurses/widechar/lib_in_wch.c new file mode 100644 index 0000000..562fa82 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_in_wch.c @@ -0,0 +1,60 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_in_wch.c +** +** The routine win_wch(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_in_wch.c,v 1.1 2002/03/10 20:22:00 tom Exp $") + +NCURSES_EXPORT(int) +win_wch(WINDOW *win, NCURSES_CONST cchar_t * wcval) +{ + int row, col; + int code = OK; + + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + if (win != 0 + && wcval != 0) { + getyx(win, row, col); + + *wcval = win->_line[row].text[col]; + } else { + code = ERR; + } + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c b/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c new file mode 100644 index 0000000..42268ec --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c @@ -0,0 +1,62 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_in_wchnstr.c +** +** The routine win_wchnstr(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.1 2002/04/13 19:33:57 tom Exp $") + +NCURSES_EXPORT(int) +win_wchnstr(WINDOW *win, NCURSES_CONST cchar_t * wchstr, int n) +{ + int code = OK; + + TR(TRACE_CCALLS, (T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); + if (win != 0 + && wchstr != 0) { + + if (n < 0) { + n = getmaxx(win) + 1 - getcurx(win); + } + while (n-- > 0) + win_wch(win, wchstr++); + } else { + code = ERR; + } + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_ins_nwstr.c b/contrib/ncurses/ncurses/widechar/lib_ins_nwstr.c new file mode 100644 index 0000000..8302b8b --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_ins_nwstr.c @@ -0,0 +1,84 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_ins_nwstr.c +** +** The routine wins_nwstr(). +** +*/ + +#include <curses.priv.h> +#include <ctype.h> + +MODULE_ID("$Id: lib_ins_nwstr.c,v 1.2 2002/03/10 22:43:12 tom Exp $") + +NCURSES_EXPORT(int) +wins_nwstr(WINDOW *win, const wchar_t * wstr, int n) +{ + int code = ERR; + NCURSES_SIZE_T oy; + NCURSES_SIZE_T ox; + const wchar_t *cp; + + T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbuf(wstr), n)); + + if (win != 0 + && wstr != 0 + && wcwidth(*wstr) > 0) { + code = OK; + if (n < 1) + n = wcslen(wstr); + oy = win->_cury; + ox = win->_curx; + for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { + NCURSES_CH_T wch; + SetChar2(wch, *cp); + if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') { + _nc_waddch_nosync(win, wch); + } else if (is7bits(*cp) && iscntrl(*cp)) { + winsch(win, ' ' + (chtype) (*cp)); + winsch(win, (chtype) '^'); + win->_curx += 2; + } else if (wins_wch(win, &wch) == ERR + || win->_curx > win->_maxx) { + break; + } + } + + win->_curx = ox; + win->_cury = oy; + _nc_synchook(win); + code = OK; + } + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_ins_wch.c b/contrib/ncurses/ncurses/widechar/lib_ins_wch.c new file mode 100644 index 0000000..0821ee5 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_ins_wch.c @@ -0,0 +1,65 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_ins_wch.c +** +** The routine wins_wch(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_ins_wch.c,v 1.1 2002/03/10 22:25:06 tom Exp $") + +NCURSES_EXPORT(int) +wins_wch(WINDOW *win, const cchar_t * wch) +{ + int code = ERR; + + T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); + + if (win) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - 1; + + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; + + *temp1 = _nc_render(win, *wch); + code = OK; + } + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_inwstr.c b/contrib/ncurses/ncurses/widechar/lib_inwstr.c new file mode 100644 index 0000000..c3c46fa --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_inwstr.c @@ -0,0 +1,96 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_inwstr.c +** +** The routines winnwstr() and winwstr(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_inwstr.c,v 1.1 2002/03/10 00:25:27 tom Exp $") + +NCURSES_EXPORT(int) +winnwstr(WINDOW *win, wchar_t * wstr, int n) +{ + int row, col, inx; + int count = 0; + int last = 0; + cchar_t *text; + wchar_t wch; + + TR(TRACE_CCALLS, (T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); + if (wstr != 0) { + if (win) { + getyx(win, row, col); + + text = win->_line[row].text; + while (count < n && count != ERR) { + for (inx = 0; (inx < CCHARW_MAX) + && ((wch = text[col].chars[inx]) != 0); + ++inx) { + if (count + 1 >= n) { + if ((count = last) == 0) { + count = ERR; /* error if we t store nothing */ + } + break; + } + wstr[count++] = wch; + } + last = count; + if (++col > win->_maxx) { + break; + } + } + } + if (count > 0) + wstr[count] = '\0'; + } + returnCode(count); +} + +/* + * X/Open says winwstr() returns OK if not ERR. If that is not a blunder, it + * must have a null termination on the string (see above). Unlike winnstr(), + * it does not define what happens for a negative count with winnwstr(). + */ +NCURSES_EXPORT(int) +winwstr(WINDOW *win, wchar_t * wstr) +{ + int result = OK; + TR(TRACE_CCALLS, (T_CALLED("winwstr(%p,%p)"), win, wstr)); + if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) + result = ERR; + returnCode(result); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_unget_wch.c b/contrib/ncurses/ncurses/widechar/lib_unget_wch.c new file mode 100644 index 0000000..b4b3433 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_unget_wch.c @@ -0,0 +1,76 @@ +/**************************************************************************** + * Copyright (c) 2002 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 2002 * + ****************************************************************************/ + +/* +** lib_unget_wch.c +** +** The routine unget_wch(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_unget_wch.c,v 1.2 2002/03/17 00:01:38 tom Exp $") + +NCURSES_EXPORT(int) +unget_wch(const wchar_t wch) +{ + int result = OK; + mbstate_t state; + size_t length; + int n; + + T((T_CALLED("unget_wch(%d)"), wch)); + + memset(&state, 0, sizeof(state)); + length = wcrtomb(0, wch, &state); + + if (length != (size_t) (-1) + && length != 0) { + char *string = malloc(length); + + memset(&state, 0, sizeof(state)); + wcrtomb(string, wch, &state); + + for (n = (int) (length - 1); n >= 0; --n) { + if (ungetch(string[n]) != OK) { + result = ERR; + break; + } + } + free(string); + } else { + result = ERR; + } + + returnCode(result); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_vid_attr.c b/contrib/ncurses/ncurses/widechar/lib_vid_attr.c new file mode 100644 index 0000000..06e7880 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_vid_attr.c @@ -0,0 +1,94 @@ +/**************************************************************************** + * Copyright (c) 2002 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 2002 * + ****************************************************************************/ + +#include <curses.priv.h> +#include <term.h> + +MODULE_ID("$Id: lib_vid_attr.c,v 1.1 2002/05/11 20:55:26 tom Exp $") + +#define set_color(mode, pair) mode &= ~A_COLOR; mode |= COLOR_PAIR(pair) + +NCURSES_EXPORT(int) +vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) +{ + T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); + set_color(newmode, pair); + returnCode(vidputs(newmode, outc)); +} + +#undef vid_attr +NCURSES_EXPORT(int) +vid_attr(attr_t newmode, short pair, void *opts GCC_UNUSED) +{ + T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); + set_color(newmode, pair); + returnCode(vidputs(newmode, _nc_outch)); +} + +NCURSES_EXPORT(attr_t) +term_attrs(void) +{ + attr_t attrs = WA_NORMAL; + + T((T_CALLED("term_attrs()"))); + if (enter_alt_charset_mode) + attrs |= WA_ALTCHARSET; + + if (enter_blink_mode) + attrs |= WA_BLINK; + + if (enter_bold_mode) + attrs |= WA_BOLD; + + if (enter_dim_mode) + attrs |= WA_DIM; + + if (enter_reverse_mode) + attrs |= WA_REVERSE; + + if (enter_standout_mode) + attrs |= WA_STANDOUT; + + if (enter_protected_mode) + attrs |= WA_PROTECT; + + if (enter_secure_mode) + attrs |= WA_INVIS; + + if (enter_underline_mode) + attrs |= WA_UNDERLINE; + + if (SP->_coloron) + attrs |= A_COLOR; + + returnAttr(attrs); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_vline_set.c b/contrib/ncurses/ncurses/widechar/lib_vline_set.c new file mode 100644 index 0000000..af42df1 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_vline_set.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +/* +** lib_vline_set.c +** +** The routine wvline_set(). +** +*/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") + +NCURSES_EXPORT(int) +wvline_set(WINDOW *win, const cchar_t * ch, int n) +{ + int code = ERR; + NCURSES_SIZE_T row, col; + NCURSES_SIZE_T end; + + T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + + if (win) { + NCURSES_CH_T wch; + row = win->_cury; + col = win->_curx; + end = row + n - 1; + if (end > win->_maxy) + end = win->_maxy; + + if (ch == 0) + wch = *WACS_VLINE; + else + wch = *ch; + wch = _nc_render(win, wch); + + while (end >= row) { + struct ldat *line = &(win->_line[end]); + line->text[col] = wch; + CHANGED_CELL(line, col); + end--; + } + + _nc_synchook(win); + code = OK; + } + returnCode(code); +} diff --git a/contrib/ncurses/ncurses/widechar/lib_wacs.c b/contrib/ncurses/ncurses/widechar/lib_wacs.c new file mode 100644 index 0000000..05fa329 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_wacs.c @@ -0,0 +1,120 @@ +/**************************************************************************** + * Copyright (c) 2002 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 Dickey 2002 * + ****************************************************************************/ + +#include <curses.priv.h> +#include <term.h> + +MODULE_ID("$Id: lib_wacs.c,v 1.2 2002/02/17 00:02:15 tom Exp $") + +NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; + +static int +_nc_unicode_locale(void) +{ + char *s; + if (((s = getenv("LC_ALL")) != 0 && *s != '\0') + || ((s = getenv("LC_ALL")) != 0 && *s != '\0') + || ((s = getenv("LC_ALL")) != 0 && *s != '\0')) { + if (strstr(s, ".UTF-8") != 0) + return 1; + } + return 0; +} + +NCURSES_EXPORT(void) +_nc_init_wacs(void) +{ + /* *INDENT-OFF* */ + static const struct { + int map; + int value[2]; + } table[] = { + /* VT100 symbols */ + { 'l', { '+', 0x250c }}, /* upper left corner */ + { 'm', { '+', 0x2514 }}, /* lower left corner */ + { 'k', { '+', 0x2510 }}, /* upper right corner */ + { 'j', { '+', 0x2518 }}, /* lower right corner */ + { 't', { '+', 0x251c }}, /* tee pointing left */ + { 'u', { '+', 0x2524 }}, /* tee pointing right */ + { 'v', { '+', 0x2534 }}, /* tee pointing up */ + { 'w', { '+', 0x252c }}, /* tee pointing down */ + { 'q', { '-', 0x2500 }}, /* horizontal line */ + { 'x', { '|', 0x2502 }}, /* vertical line */ + { 'n', { '+', 0x253c }}, /* large plus or crossover */ + { 'o', { '~', 0x23ba }}, /* scan line 1 */ + { 's', { '_', 0x23bd }}, /* scan line 9 */ + { '\'', { '+', 0x25c6 }}, /* diamond */ + { 'a', { ':', 0x2592 }}, /* checker board (stipple) */ + { 'f', { '\'', 0x00b0 }}, /* degree symbol */ + { 'g', { '#', 0x00b1 }}, /* plus/minus */ + { '~', { 'o', 0x00b7 }}, /* bullet */ + /* Teletype 5410v1 symbols */ + { ',', { '<', 0x2190 }}, /* arrow pointing left */ + { '+', { '>', 0x2192 }}, /* arrow pointing right */ + { '.', { 'v', 0x2193 }}, /* arrow pointing down */ + { '-', { '^', 0x2191 }}, /* arrow pointing up */ + { 'h', { '#', 0x2592 }}, /* board of squares */ + { 'i', { '#', 0x2603 }}, /* lantern symbol */ + { '0', { '#', 0x25ae }}, /* solid square block */ + /* these defaults were invented for ncurses */ + { 'p', { '-', 0x23bb }}, /* scan line 3 */ + { 'r', { '-', 0x23bc }}, /* scan line 7 */ + { 'y', { '<', 0x2264 }}, /* less-than-or-equal-to */ + { 'z', { '>', 0x2265 }}, /* greater-than-or-equal-to */ + { '{', { '*', 0x03c0 }}, /* greek pi */ + { '|', { '!', 0x2260 }}, /* not-equal */ + { '}', { 'f', 0x00a3 }}, /* pound-sterling symbol */ + }; + /* *INDENT-ON* */ + + unsigned n, m; + int active = _nc_unicode_locale(); + + T(("initializing WIDE-ACS map (Unicode is%s active)", + active ? "" : " not")); + + if (active) { + enter_alt_charset_mode = ""; + exit_alt_charset_mode = ""; + acs_chars = ""; + ena_acs = ""; + } + _nc_wacs = typeCalloc(cchar_t, ACS_LEN); + for (n = 0; n < SIZEOF(table); ++n) { + m = table[n].map; + SetChar(_nc_wacs[m], table[n].value[active], A_NORMAL); + T(("#%d, SetChar(%c, %#04x) = %s", + n, m, + table[n].value[active], + _tracecchar_t(&_nc_wacs[m]))); + } +} diff --git a/contrib/ncurses/ncurses/widechar/lib_wunctrl.c b/contrib/ncurses/ncurses/widechar/lib_wunctrl.c new file mode 100644 index 0000000..f4887d1 --- /dev/null +++ b/contrib/ncurses/ncurses/widechar/lib_wunctrl.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * Copyright (c) 2001 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. * + ****************************************************************************/ + +/* +** lib_wunctrl.c +** +** The routine wunctrl(). +** +*/ + +#include <curses.priv.h> + +#if USE_WIDEC_SUPPORT + +MODULE_ID("$Id: lib_wunctrl.c,v 1.6 2001/09/22 19:18:02 tom Exp $") + +NCURSES_EXPORT(wchar_t *) +wunctrl(cchar_t * wc) +{ + static wchar_t str[5], *sp; + + if (Charable(*wc)) { + const char *p; + for (p = unctrl(wctob(CharOf(*wc))), sp = str; *p;) + *sp++ = btowc(*p++); + return str; + } else + return wc->chars; +} + +#endif diff --git a/contrib/ncurses/panel/Makefile.in b/contrib/ncurses/panel/Makefile.in index 6780007..c359252 100644 --- a/contrib/ncurses/panel/Makefile.in +++ b/contrib/ncurses/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.36 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.41 2002/01/20 00:41:18 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 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"), # @@ -50,6 +50,7 @@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ @@ -58,6 +59,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -70,7 +72,7 @@ CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ \ +CPPFLAGS = @CPPFLAGS@ -I@top_srcdir@/ncurses \ -DHAVE_CONFIG_H CCFLAGS = $(CPPFLAGS) $(CFLAGS) @@ -86,7 +88,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ @@ -98,6 +100,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -114,8 +118,9 @@ install :: $(AUTO_SRC) $(LIBRARIES) sources: $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # make a copy to simplify include-paths while still keeping panel's include # file in this directory. @@ -134,7 +139,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/contrib/ncurses/panel/panel.priv.h b/contrib/ncurses/panel/panel.priv.h index d029b12..7097d84 100644 --- a/contrib/ncurses/panel/panel.priv.h +++ b/contrib/ncurses/panel/panel.priv.h @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.18 2001/03/24 21:38:45 tom Exp $ */ +/* $Id: panel.priv.h,v 1.19 2001/06/02 23:31:05 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 @@ -47,6 +47,7 @@ # include <dbmalloc.h> /* Conor Cahill's library */ #endif +#include "curses.priv.h" #include "panel.h" #include <nc_panel.h> @@ -101,15 +102,6 @@ #define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) #define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) -/* borrowed from curses.priv.h */ -#define CHANGED_RANGE(line,start,end) \ - if (line->firstchar == _NOCHANGE \ - || line->firstchar > (start)) \ - line->firstchar = start; \ - if (line->lastchar == _NOCHANGE \ - || line->lastchar < (end)) \ - line->lastchar = end - /*+------------------------------------------------------------------------- IS_LINKED(pan) - check to see if panel is in the stack --------------------------------------------------------------------------*/ diff --git a/contrib/ncurses/progs/MKtermsort.sh b/contrib/ncurses/progs/MKtermsort.sh index 5486fd7..c3495c4 100755 --- a/contrib/ncurses/progs/MKtermsort.sh +++ b/contrib/ncurses/progs/MKtermsort.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: MKtermsort.sh,v 1.6 2000/01/25 11:35:36 tom Exp $ +# $Id: MKtermsort.sh,v 1.7 2001/05/26 23:37:57 tom Exp $ # # MKtermsort.sh -- generate indirection vectors for the various sort methods # @@ -15,6 +15,11 @@ export LC_ALL AWK=${1-awk} DATA=${2-../include/Caps} +data=data$$ +trap 'rm -f $data' 1 2 5 15 +sed -e 's/[ ]\+/ /g' < $DATA >$data +DATA=$data + echo "/*"; echo " * termsort.c --- sort order arrays for use by infocmp."; echo " *"; @@ -104,24 +109,26 @@ echo ""; echo "static const bool bool_from_termcap[] = {"; $AWK <$DATA ' -$3 == "bool" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} -$3 == "bool" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} +$3 == "bool" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} +$3 == "bool" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} ' echo "};"; echo ""; echo "static const bool num_from_termcap[] = {"; $AWK <$DATA ' -$3 == "num" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} -$3 == "num" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} +$3 == "num" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} +$3 == "num" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} ' echo "};"; echo ""; echo "static const bool str_from_termcap[] = {"; $AWK <$DATA ' -$3 == "str" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} -$3 == "str" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} +$3 == "str" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} +$3 == "str" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} ' echo "};"; echo ""; + +rm -f $data diff --git a/contrib/ncurses/progs/Makefile.in b/contrib/ncurses/progs/Makefile.in index f0d772a..43b85c4 100644 --- a/contrib/ncurses/progs/Makefile.in +++ b/contrib/ncurses/progs/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.52 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.56 2001/12/08 18:48:01 tom Exp $ ############################################################################## # Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # # # @@ -107,7 +107,10 @@ AUTO_SRC = \ termsort.c \ transform.h -PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x +# tic and toe rely on direct access to the terminfo database +GET_PROGS = infocmp$x clear$x tput$x tset$x +PUT_PROGS = @MAKE_TERMINFO@ tic$x toe$x +PROGS = $(PUT_PROGS) $(GET_PROGS) TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x @@ -147,35 +150,35 @@ transform.h : 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) +@MAKE_TERMINFO@ $(LIBTOOL) $(INSTALL_PROGRAM) tic$x $(DESTDIR)$(bindir)/$(actual_tic) +@MAKE_TERMINFO@ $(LIBTOOL) $(INSTALL_PROGRAM) toe$x $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ @echo "linking $(actual_infotocap) to $(actual_tic)" +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) +@MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap)) +@MAKE_TERMINFO@ @echo "linking $(actual_captoinfo) to $(actual_tic)" +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo) +@MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) $(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: - -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic) - -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic) +@MAKE_TERMINFO@ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo) +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@$(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 $@ + sh $(srcdir)/../mkinstalldirs $@ # # Utilities normally built by make all start here @@ -222,7 +225,7 @@ tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@ termsort.c: $(srcdir)/MKtermsort.sh - sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@ + sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@" >$@ # # Utility productions start here @@ -235,7 +238,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace -rm -f $(TESTPROGS) clean :: mostlyclean @@ -257,10 +260,10 @@ $(DEPS_CURSES) : cd ../ncurses; $(MAKE) $(CF_MFLAGS) lint: +@MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c $(srcdir)/dump_entry.c $(LINT_LIBS) +@MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS) - $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c $(srcdir)/dump_entry.c $(LINT_LIBS) - $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS) diff --git a/contrib/ncurses/progs/dump_entry.c b/contrib/ncurses/progs/dump_entry.c index 4320c09..5245a47 100644 --- a/contrib/ncurses/progs/dump_entry.c +++ b/contrib/ncurses/progs/dump_entry.c @@ -38,7 +38,7 @@ #include "termsort.c" /* this C file is generated */ #include <parametrized.h> /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.55 2001/03/10 19:45:51 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.56 2001/08/12 00:21:22 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -56,7 +56,6 @@ static int sortmode; /* sort mode to use */ static int width = 60; /* max line width for listings */ static int column; /* current column, limited by 'width' */ static int oldcol; /* last value of column before wrap */ -static int tracelevel; /* level of debug output */ static bool pretty; /* true if we format if-then-else strings */ static DYNBUF outbuf; @@ -172,7 +171,6 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval, { width = twidth; pretty = formatted; - tracelevel = traceval; /* versions */ if (version == 0) diff --git a/contrib/ncurses/progs/infocmp.c b/contrib/ncurses/progs/infocmp.c index 5d1a111..69f00ae 100644 --- a/contrib/ncurses/progs/infocmp.c +++ b/contrib/ncurses/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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,7 +41,7 @@ #include <term_entry.h> #include <dump_entry.h> -MODULE_ID("$Id: infocmp.c,v 1.60 2001/02/24 22:03:12 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.63 2001/09/22 19:57:40 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -937,30 +937,75 @@ usage(void) } static char * -name_initializer(const char *type) +any_initializer(const char *fmt, const char *type) { static char *initializer; char *s; if (initializer == 0) - initializer = (char *) malloc(strlen(entries->tterm.term_names) + 20); + initializer = (char *) malloc(strlen(entries->tterm.term_names) + + strlen(type) + strlen(fmt)); - (void) sprintf(initializer, "%s_data_%s", type, entries->tterm.term_names); + (void) strcpy(initializer, entries->tterm.term_names); for (s = initializer; *s != 0 && *s != '|'; s++) { - if (!isalnum(CharOf(*s))) + if (!isalnum(UChar(*s))) *s = '_'; } *s = 0; + (void) sprintf(s, fmt, type); return initializer; } +static char * +name_initializer(const char *type) +{ + return any_initializer("_%s_data", type); +} + +static char * +string_variable(const char *type) +{ + return any_initializer("_s_%s", type); +} + /* dump C initializers for the terminal type */ static void dump_initializers(TERMTYPE * term) { int n; - const char *str = 0; int size; + const char *str = 0; + + printf("\nstatic char %s[] = \"%s\";\n\n", + name_initializer("alias"), entries->tterm.term_names); + + for_each_string(n, term) { + char buf[MAX_STRING], *sp, *tp; + + if (VALID_STRING(term->Strings[n])) { + tp = buf; + *tp++ = '"'; + for (sp = term->Strings[n]; + *sp != 0 && (tp - buf) < MAX_STRING - 6; + sp++) { + if (isascii(UChar(*sp)) + && isprint(UChar(*sp)) + && *sp != '\\' + && *sp != '"') + *tp++ = *sp; + else { + (void) sprintf(tp, "\\%03o", UChar(*sp)); + tp += 4; + } + } + *tp++ = '"'; + *tp = '\0'; + size += (strlen(term->Strings[n]) + 1); + (void) printf("static char %-20s[] = %s;\n", + string_variable(ExtStrname(term, n, strnames)), buf); + } + } + printf("\n"); (void) printf("static char %s[] = %s\n", name_initializer("bool"), L_CURL); @@ -1015,52 +1060,47 @@ dump_initializers(TERMTYPE * term) (void) printf("static char * %s[] = %s\n", name_initializer("string"), L_CURL); for_each_string(n, term) { - char buf[MAX_STRING], *sp, *tp; if (term->Strings[n] == ABSENT_STRING) str = "ABSENT_STRING"; else if (term->Strings[n] == CANCELLED_STRING) str = "CANCELLED_STRING"; else { - tp = buf; - *tp++ = '"'; - for (sp = term->Strings[n]; - *sp != 0 && (tp - buf) < MAX_STRING - 6; - sp++) { - if (isascii(CharOf(*sp)) - && isprint(CharOf(*sp)) - && *sp != '\\' - && *sp != '"') - *tp++ = *sp; - else { - (void) sprintf(tp, "\\%03o", CharOf(*sp)); - tp += 4; - } - } - *tp++ = '"'; - *tp = '\0'; - size += (strlen(term->Strings[n]) + 1); - str = buf; + str = string_variable(ExtStrname(term, n, strnames)); } -#if NCURSES_XNAMES - if (n == STRCOUNT) { - (void) printf("%s;\n", R_CURL); - - (void) printf("static char * %s[] = %s\n", - name_initializer("string_ext"), L_CURL); - } -#endif (void) printf("\t/* %3d: %-8s */\t%s,\n", n, ExtStrname(term, n, strnames), str); } (void) printf("%s;\n", R_CURL); + +#if NCURSES_XNAMES + if ((NUM_BOOLEANS(term) != BOOLCOUNT) + || (NUM_NUMBERS(term) != NUMCOUNT) + || (NUM_STRINGS(term) != STRCOUNT)) { + (void) printf("static char * %s[] = %s\n", + name_initializer("string_ext"), L_CURL); + for (n = BOOLCOUNT; n < NUM_BOOLEANS(term); ++n) { + (void) printf("\t/* %3d: bool */\t\"%s\",\n", + n, ExtBoolname(term, n, boolnames)); + } + for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) { + (void) printf("\t/* %3d: num */\t\"%s\",\n", + n, ExtNumname(term, n, numnames)); + } + for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) { + (void) printf("\t/* %3d: str */\t\"%s\",\n", + n, ExtStrname(term, n, strnames)); + } + (void) printf("%s;\n", R_CURL); + } +#endif } /* dump C initializers for the terminal type */ static void dump_termtype(TERMTYPE * term) { - (void) printf("\t%s\n\t\t\"%s\",\n", L_CURL, term->term_names); + (void) printf("\t%s\n\t\t%s,\n", L_CURL, name_initializer("alias")); (void) printf("\t\t(char *)0,\t/* pointer to string table */\n"); (void) printf("\t\t%s,\n", name_initializer("bool")); @@ -1072,7 +1112,9 @@ 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) + ((NUM_BOOLEANS(term) != BOOLCOUNT) + || (NUM_NUMBERS(term) != NUMCOUNT) + || (NUM_STRINGS(term) != STRCOUNT)) ? name_initializer("string_ext") : "(char **)0"); diff --git a/contrib/ncurses/progs/progs.priv.h b/contrib/ncurses/progs/progs.priv.h index 1826275..9d13b3c 100644 --- a/contrib/ncurses/progs/progs.priv.h +++ b/contrib/ncurses/progs/progs.priv.h @@ -30,7 +30,7 @@ * Author: Thomas E. Dickey <dickey@clark.net> 1997,1998 * ****************************************************************************/ /* - * $Id: progs.priv.h,v 1.26 2000/11/05 00:22:05 tom Exp $ + * $Id: progs.priv.h,v 1.27 2001/06/18 18:43:52 tom Exp $ * * progs.priv.h * @@ -165,12 +165,12 @@ extern int optind; #if !HAVE_ISASCII # undef isascii # if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127) -# define isascii(c) (CharOf(c) <= 127) +# define isascii(c) (UChar(c) <= 127) # else # define isascii(c) 1 /* not really ascii anyway */ # endif #endif -#define CharOf(c) ((unsigned char)(c)) +#define UChar(c) ((unsigned char)(c)) #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) diff --git a/contrib/ncurses/progs/tic.c b/contrib/ncurses/progs/tic.c index c74afc3..28292e6 100644 --- a/contrib/ncurses/progs/tic.c +++ b/contrib/ncurses/progs/tic.c @@ -44,7 +44,7 @@ #include <term_entry.h> #include <transform.h> -MODULE_ID("$Id: tic.c,v 1.90 2001/04/15 00:21:31 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.92 2001/06/18 18:44:01 tom Exp $") const char *_nc_progname = "tic"; @@ -293,12 +293,12 @@ put_translate(int c) static char * stripped(char *src) { - while (isspace(CharOf(*src))) + while (isspace(UChar(*src))) src++; if (*src != '\0') { char *dst = strcpy(malloc(strlen(src) + 1), src); size_t len = strlen(dst); - while (--len != 0 && isspace(CharOf(dst[len]))) + while (--len != 0 && isspace(UChar(dst[len]))) dst[len] = '\0'; return dst; } @@ -445,7 +445,7 @@ main(int argc, char *argv[]) log_fp = stderr; - _nc_progname = _nc_basename(argv[0]); + _nc_progname = _nc_rootname(argv[0]); if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) { outform = F_TERMINFO; diff --git a/contrib/ncurses/progs/toe.c b/contrib/ncurses/progs/toe.c index b7afb67..7a75785 100644 --- a/contrib/ncurses/progs/toe.c +++ b/contrib/ncurses/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 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 * @@ -43,14 +43,14 @@ #include <dump_entry.h> #include <term_entry.h> -MODULE_ID("$Id: toe.c,v 1.24 2000/09/09 19:52:35 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.26 2001/06/16 11:00:41 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) const char *_nc_progname; static int typelist(int eargc, char *eargv[], bool, - void (*)(const char *, TERMTYPE *)); + void (*)(const char *, TERMTYPE *)); static void deschook(const char *, TERMTYPE *); #if NO_LEAKS @@ -65,13 +65,27 @@ ExitProgram(int code) GCC_NORETURN; } #endif +static bool +is_a_file(char *path) +{ + struct stat sb; + return (stat(path, &sb) == 0 + && (sb.st_mode & S_IFMT) == S_IFREG); +} + +static bool +is_a_directory(char *path) +{ + struct stat sb; + return (stat(path, &sb) == 0 + && (sb.st_mode & S_IFMT) == S_IFDIR); +} + static char * get_directory(char *path) { if (path != 0) { - struct stat sb; - if (stat(path, &sb) != 0 - || (sb.st_mode & S_IFMT) != S_IFDIR + if (!is_a_directory(path) || access(path, R_OK | X_OK) != 0) path = 0; } @@ -87,7 +101,7 @@ main(int argc, char *argv[]) int i, c; int code; - _nc_progname = _nc_basename(argv[0]); + _nc_progname = _nc_rootname(argv[0]); while ((c = getopt(argc, argv, "huv:UV")) != EOF) switch (c) { @@ -153,12 +167,12 @@ main(int argc, char *argv[]) for (i = 0; i < rp->nuses; i++) if (_nc_name_match(qp->tterm.term_names, - rp->uses[i].name, "|")) { + rp->uses[i].name, "|")) { if (matchcount++ == 0) (void) printf("%s:", - _nc_first_name(qp->tterm.term_names)); + _nc_first_name(qp->tterm.term_names)); (void) printf(" %s", - _nc_first_name(rp->tterm.term_names)); + _nc_first_name(rp->tterm.term_names)); } } if (matchcount) @@ -214,8 +228,8 @@ deschook(const char *cn, TERMTYPE * tp) static int typelist(int eargc, char *eargv[], - bool verbosity, - void (*hook) (const char *, TERMTYPE * tp)) + bool verbosity, + void (*hook) (const char *, TERMTYPE * tp)) /* apply a function to each entry in given terminfo directories */ { int i; @@ -227,8 +241,8 @@ typelist(int eargc, char *eargv[], if ((termdir = opendir(eargv[i])) == 0) { (void) fflush(stdout); (void) fprintf(stderr, - "%s: can't open terminfo directory %s\n", - _nc_progname, eargv[i]); + "%s: can't open terminfo directory %s\n", + _nc_progname, eargv[i]); return (EXIT_FAILURE); } else if (verbosity) (void) printf("#\n#%s:\n#\n", eargv[i]); @@ -245,7 +259,9 @@ typelist(int eargc, char *eargv[], continue; (void) sprintf(buf, "%s/%s/", eargv[i], name_1); - chdir(buf); + if (chdir(buf) != 0) + continue; + entrydir = opendir("."); while ((entry = readdir(entrydir)) != 0) { char name_2[PATH_MAX]; @@ -255,15 +271,15 @@ typelist(int eargc, char *eargv[], len = NAMLEN(entry); strncpy(name_2, entry->d_name, len)[len] = '\0'; - if (isDotname(name_2)) + if (isDotname(name_2) || !is_a_file(name_2)) continue; status = _nc_read_file_entry(name_2, <erm); if (status <= 0) { (void) fflush(stdout); (void) fprintf(stderr, - "toe: couldn't open terminfo file %s.\n", - name_2); + "toe: couldn't open terminfo file %s.\n", + name_2); return (EXIT_FAILURE); } diff --git a/contrib/ncurses/progs/tput.c b/contrib/ncurses/progs/tput.c index 7aab909..3b65d15 100644 --- a/contrib/ncurses/progs/tput.c +++ b/contrib/ncurses/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -45,7 +45,7 @@ #endif #include <transform.h> -MODULE_ID("$Id: tput.c,v 1.26 2001/03/24 21:59:48 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.30 2001/07/22 00:16:33 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -132,7 +132,9 @@ tput(int argc, char *argv[]) int status; FILE *f; - check_aliases(name = argv[0]); + if ((name = argv[0]) == 0) + name = ""; + check_aliases(name); if (is_reset || is_init) { if (init_prog != 0) { system(init_prog); @@ -153,15 +155,21 @@ tput(int argc, char *argv[]) } FLUSH; +#ifdef set_lr_margin 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) { + } else +#endif +#ifdef set_left_margin_parm + if (set_left_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) { + } else +#endif + if (clear_margins != 0 + && set_left_margin != 0 + && set_right_margin != 0) { PUTS(clear_margins); if (carriage_return != 0) { PUTS(carriage_return); @@ -321,7 +329,7 @@ main(int argc, char **argv) char buf[BUFSIZ]; int errors = 0; - check_aliases(prg_name = _nc_basename(argv[0])); + check_aliases(prg_name = _nc_rootname(argv[0])); term = getenv("TERM"); @@ -376,14 +384,18 @@ main(int argc, char **argv) /* crack the argument list into a dope vector */ for (cp = buf; *cp; cp++) { - if (isspace(CharOf(*cp))) + if (isspace(UChar(*cp))) { *cp = '\0'; - else if (cp == buf || cp[-1] == 0) + } else if (cp == buf || cp[-1] == 0) { argvec[argnum++] = cp; + if (argnum >= (int) SIZEOF(argvec) - 1) + break; + } } argvec[argnum] = 0; - if (tput(argnum, argvec) != 0) + if (argnum != 0 + && tput(argnum, argvec) != 0) errors++; } diff --git a/contrib/ncurses/progs/tset.c b/contrib/ncurses/progs/tset.c index f6e02db..0276c4b 100644 --- a/contrib/ncurses/progs/tset.c +++ b/contrib/ncurses/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 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 * @@ -95,15 +95,15 @@ char *ttyname(int fd); #if NEED_PTEM_H /* they neglected to define struct winsize in termios.h -- it's only in termio.h */ -#include <sys/stream.h> -#include <sys/ptem.h> +#include <sys/stream.h> +#include <sys/ptem.h> #endif #include <curses.h> /* for bool typedef */ #include <dump_entry.h> #include <transform.h> -MODULE_ID("$Id: tset.c,v 0.49 2001/02/24 23:29:33 tom Exp $") +MODULE_ID("$Id: tset.c,v 0.52 2001/09/29 21:13:56 tom Exp $") extern char **environ; @@ -112,15 +112,16 @@ extern char **environ; const char *_nc_progname = "tset"; -static TTY mode, oldmode; +static TTY mode, oldmode, original; +static bool can_restore = FALSE; static bool isreset = FALSE; /* invoked as reset */ static int terasechar = -1; /* new erase character */ static int intrchar = -1; /* new interrupt character */ static int tkillchar = -1; /* new kill character */ static int tlines, tcolumns; /* window size */ -#define LOWERCASE(c) ((isalpha(CharOf(c)) && isupper(CharOf(c))) ? tolower(CharOf(c)) : (c)) +#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) static int CaselessCmp(const char *a, const char *b) @@ -135,6 +136,17 @@ CaselessCmp(const char *a, const char *b) } static void +exit_error(void) +{ + if (can_restore) + SET_TTY(STDERR_FILENO, &original); + (void) fprintf(stderr, "\n"); + fflush(stderr); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + +static void err(const char *fmt,...) { va_list ap; @@ -142,8 +154,7 @@ err(const char *fmt,...) (void) fprintf(stderr, "tset: "); (void) vfprintf(stderr, fmt, ap); va_end(ap); - (void) fprintf(stderr, "\n"); - exit(EXIT_FAILURE); + exit_error(); /* NOTREACHED */ } @@ -152,25 +163,24 @@ failed(const char *msg) { char temp[BUFSIZ]; perror(strncat(strcpy(temp, "tset: "), msg, sizeof(temp) - 10)); - exit(EXIT_FAILURE); + exit_error(); /* NOTREACHED */ } static void cat(char *file) { - register int fd, nr; + FILE *fp; + size_t nr; char buf[BUFSIZ]; - if ((fd = open(file, O_RDONLY, 0)) < 0) + if ((fp = fopen(file, "r")) == 0) failed(file); - while ((nr = read(fd, buf, sizeof(buf))) > 0) - if (write(STDERR_FILENO, buf, (size_t) nr) == -1) - failed("write to stderr"); - if (nr != 0) - failed(file); - (void) close(fd); + while ((nr = fread(buf, sizeof(char), sizeof(buf), fp)) != 0) + if (fwrite(buf, sizeof(char), nr, stderr) != nr) + failed("write to stderr"); + fclose(fp); } static int @@ -189,7 +199,8 @@ askuser(const char *dflt) /* We can get recalled; if so, don't continue uselessly. */ if (feof(stdin) || ferror(stdin)) { (void) fprintf(stderr, "\n"); - exit(EXIT_FAILURE); + exit_error(); + /* NOTREACHED */ } for (;;) { if (dflt) @@ -200,8 +211,8 @@ askuser(const char *dflt) if (fgets(answer, sizeof(answer), stdin) == 0) { if (dflt == 0) { - (void) fprintf(stderr, "\n"); - exit(EXIT_FAILURE); + exit_error(); + /* NOTREACHED */ } return (dflt); } @@ -534,7 +545,7 @@ get_termcap_entry(char *userarg) while (fgets(buffer, sizeof(buffer) - 1, fp) != 0) { for (s = buffer, t = d = 0; *s; s++) { - if (isspace(CharOf(*s))) + if (isspace(UChar(*s))) *s = '\0'; else if (t == 0) t = s; @@ -757,11 +768,7 @@ reset_mode(void) ); #endif -#ifdef TERMIOS - tcsetattr(STDERR_FILENO, TCSADRAIN, &mode); -#else - stty(STDERR_FILENO, &mode); -#endif + SET_TTY(STDERR_FILENO, &mode); } /* @@ -891,7 +898,7 @@ set_init(void) #ifdef TAB3 if (oldmode.c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) { oldmode.c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET); - tcsetattr(STDERR_FILENO, TCSADRAIN, &oldmode); + SET_TTY(STDERR_FILENO, &oldmode); } #endif settle = set_tabs(); @@ -1034,8 +1041,9 @@ static void usage(const char *pname) { (void) fprintf(stderr, - "usage: %s [-IQVrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\n", pname); - exit(EXIT_FAILURE); + "usage: %s [-IQVrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]", pname); + exit_error(); + /* NOTREACHED */ } static char @@ -1058,14 +1066,15 @@ main(int argc, char **argv) if (GET_TTY(STDERR_FILENO, &mode) < 0) failed("standard error"); - oldmode = mode; + can_restore = TRUE; + original = oldmode = mode; #ifdef TERMIOS ospeed = cfgetospeed(&mode); #else ospeed = mode.sg_ospeed; #endif - p = _nc_basename(*argv); + p = _nc_rootname(*argv); if (!strcmp(p, PROG_RESET)) { isreset = TRUE; reset_mode(); @@ -1154,11 +1163,7 @@ main(int argc, char **argv) /* Set the modes if they've changed. */ if (memcmp(&mode, &oldmode, sizeof(mode))) { -#ifdef TERMIOS - tcsetattr(STDERR_FILENO, TCSADRAIN, &mode); -#else - stty(STDERR_FILENO, &mode); -#endif + SET_TTY(STDERR_FILENO, &mode); } } diff --git a/contrib/ncurses/tack/Makefile.in b/contrib/ncurses/tack/Makefile.in index be0e90d..732da7f 100644 --- a/contrib/ncurses/tack/Makefile.in +++ b/contrib/ncurses/tack/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.25 2001/03/24 19:49:06 tom Exp $ +# $Id: Makefile.in,v 1.27 2001/12/08 18:48:01 tom Exp $ # Makefile for tack # # The variable 'srcdir' refers to the source-distribution, and can be set with @@ -101,7 +101,7 @@ uninstall.tack: $(DESTDIR)$(bindir) \ $(DESTDIR)$(mandir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # # Rules for building tack @@ -139,7 +139,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f tags TAGS *.i do.tic *~ + -rm -f core tags TAGS *~ *.bak *.i *.atac trace clean :: mostlyclean -rm -f $(PROGS) diff --git a/contrib/ncurses/tack/ansi.c b/contrib/ncurses/tack/ansi.c index 4e81f223..807bc53 100644 --- a/contrib/ncurses/tack/ansi.c +++ b/contrib/ncurses/tack/ansi.c @@ -21,7 +21,7 @@ #include <tack.h> -MODULE_ID("$Id: ansi.c,v 1.8 2001/03/24 22:00:27 tom Exp $") +MODULE_ID("$Id: ansi.c,v 1.9 2001/06/18 18:44:17 tom Exp $") /* * Standalone tests for ANSI terminals. Three entry points: @@ -180,7 +180,7 @@ valid_mode(int expected) read_ansi(); ape = 0; - ch = CharOf(pack_buf[0]); + ch = UChar(pack_buf[0]); ansi_value[0] = 0; if (ch != A_CSI && ch != A_DCS) return FALSE; @@ -255,7 +255,7 @@ read_reports(void) vcr = TRUE; break; } - j = CharOf(pack_buf[0]); + j = UChar(pack_buf[0]); if (j != A_CSI && j != A_DCS) { put_crlf(); t = "*** The above request gives illegal response ***"; @@ -323,7 +323,7 @@ request_cfss(void) putchp(' '); for (j = 0; ansi_buf[j]; j++) { if (ansi_buf[j] == 'r') { - for (k = j++; (ch = CharOf(ansi_buf[k])) != 0; k++) + for (k = j++; (ch = UChar(ansi_buf[k])) != 0; k++) if (ch == A_ESC) { break; } else if (ch == A_ST) { diff --git a/contrib/ncurses/tack/charset.c b/contrib/ncurses/tack/charset.c index a5cac94..991401f 100644 --- a/contrib/ncurses/tack/charset.c +++ b/contrib/ncurses/tack/charset.c @@ -21,7 +21,7 @@ #include <tack.h> -MODULE_ID("$Id: charset.c,v 1.6 2000/11/05 00:22:00 tom Exp $") +MODULE_ID("$Id: charset.c,v 1.8 2001/06/18 18:44:26 tom Exp $") /* Menu definitions for alternate character set and SGR tests. @@ -285,10 +285,12 @@ charset_sgr( } put_crlf(); +#ifdef max_attributes if (max_attributes >= 0) { sprintf(temp, "(ma) Maximum attributes %d ", max_attributes); ptext(temp); } +#endif generic_done_message(t, state, ch); } @@ -433,12 +435,12 @@ test_acs( break; } if (glyph[j].name[0] == '\0') { - if (isgraph(CharOf(acs_chars[i]))) { + if (isgraph(UChar(acs_chars[i]))) { sprintf(temp, " %c", acs_chars[i]); } else { sprintf(temp, " 0x%02x", - CharOf(acs_chars[i])); + UChar(acs_chars[i])); } strcpy(&temp[5], " *** has no mapping ***"); putln(temp); diff --git a/contrib/ncurses/tack/edit.c b/contrib/ncurses/tack/edit.c index f6574fb..2d1a780 100644 --- a/contrib/ncurses/tack/edit.c +++ b/contrib/ncurses/tack/edit.c @@ -23,7 +23,7 @@ #include <time.h> #include <tic.h> -MODULE_ID("$Id: edit.c,v 1.7 2001/02/24 22:10:40 tom Exp $") +MODULE_ID("$Id: edit.c,v 1.8 2001/06/18 18:44:32 tom Exp $") /* * Terminfo edit features @@ -876,7 +876,7 @@ change_one_entry( putln(buf); ptextln("Enter new pad. 0 for no pad. CR for no change."); read_string(buf, 32); - if (buf[0] == '\0' || (buf[1] == '\0' && isalpha(CharOf(buf[0])))) { + if (buf[0] == '\0' || (buf[1] == '\0' && isalpha(UChar(buf[0])))) { *chp = buf[0]; return; } diff --git a/contrib/ncurses/tack/init.c b/contrib/ncurses/tack/init.c index 4255452..8a2e44f 100644 --- a/contrib/ncurses/tack/init.c +++ b/contrib/ncurses/tack/init.c @@ -22,7 +22,7 @@ #include <tack.h> -MODULE_ID("$Id: init.c,v 1.2 2000/05/13 19:58:48 Daniel.Weaver Exp $") +MODULE_ID("$Id: init.c,v 1.3 2001/06/16 17:54:19 tom Exp $") #if NCURSES_VERSION_MAJOR >= 5 || NCURSES_VERSION_PATCH >= 981219 #define _nc_get_curterm(p) _nc_get_tty_mode(p) @@ -163,8 +163,12 @@ display_basic(void) } else { report_cap(" (home)", cursor_home); } +#ifdef user9 report_cap("ENQ (u9)", user9); +#endif +#ifdef user8 report_cap("ACK (u8)", user8); +#endif sprintf(temp, "\nTerminal size: %d x %d. Baud rate: %ld. Frame size: %d.%d", columns, lines, tty_baud_rate, tty_frame_size >> 1, (tty_frame_size & 1) * 5); putln(temp); diff --git a/contrib/ncurses/tack/output.c b/contrib/ncurses/tack/output.c index e1e4b4f..5825bea 100644 --- a/contrib/ncurses/tack/output.c +++ b/contrib/ncurses/tack/output.c @@ -23,7 +23,7 @@ #include <tack.h> #include <time.h> -MODULE_ID("$Id: output.c,v 1.6 2000/11/05 00:21:58 tom Exp $") +MODULE_ID("$Id: output.c,v 1.7 2001/06/18 18:44:40 tom Exp $") /* globals */ long char_sent; /* number of characters sent */ @@ -122,7 +122,7 @@ tc_putch(int c) } if (log_fp) { /* terminal output logging */ - c = CharOf(c); + c = UChar(c); if (c < 32) { fprintf(log_fp, "<%s>", c0[c]); log_count += 5; @@ -561,7 +561,7 @@ hex_expand_to(char *s, int l) char *t; for (t = buf; *s; s++) { - sprintf(t, "%02X ", CharOf(*s)); + sprintf(t, "%02X ", UChar(*s)); t += 3; if (t - buf > (int) sizeof(buf) - 4) { break; @@ -584,13 +584,13 @@ expand_command(const char *c) char *s; s = buf; - for (i = FALSE; (ch = CharOf(*c)) != 0; c++) { + for (i = FALSE; (ch = UChar(*c)) != 0; c++) { if (i) { *s++ = ' '; } i = TRUE; if (ch < 32) { - j = CharOf(c[1]); + j = UChar(c[1]); if (ch == '\033' && j >= '@' && j <= '_') { ch = j - '@'; c++; @@ -599,7 +599,7 @@ expand_command(const char *c) for (j = 0; (*s = c0[ch][j++]); s++); } else { *s++ = ch; - j = CharOf(c[1]); + j = UChar(c[1]); if (ch >= '0' && ch <= '9' && j >= '0' && j <= '9') { i = FALSE; diff --git a/contrib/ncurses/tack/sync.c b/contrib/ncurses/tack/sync.c index 3323b93..6eb91b2 100644 --- a/contrib/ncurses/tack/sync.c +++ b/contrib/ncurses/tack/sync.c @@ -22,7 +22,7 @@ #include <tack.h> #include <time.h> -MODULE_ID("$Id: sync.c,v 1.2 2000/03/04 20:28:16 tom Exp $") +MODULE_ID("$Id: sync.c,v 1.3 2001/06/16 17:55:48 tom Exp $") /* terminal-synchronization and performance tests */ @@ -143,7 +143,11 @@ probe_enq_ok(void) fflush(stdout); can_test("u8 u9", FLAG_TESTED); +#ifdef user9 tty_ENQ = user9 ? user9 : "\005"; +#else + tty_ENQ = "\005"; +#endif tc_putp(tty_ENQ); event_start(TIME_SYNC); /* start the timer */ read_key(tty_ACK, TTY_ACK_SIZE - 1); @@ -159,16 +163,22 @@ probe_enq_ok(void) putln(expand(tty_ENQ)); ptext("ACK received: "); putln(expand(tty_ACK)); +#ifdef user8 len = user8 ? strlen(user8) : 0; +#else + len = 0; +#endif sprintf(temp, "Length of ACK %d. Expected length of ACK %d.", (int) strlen(tty_ACK), len); ptextln(temp); +#ifdef user8 if (len) { temp[0] = user8[len - 1]; temp[1] = '\0'; ptext("Terminating character found in (u8): "); putln(expand(temp)); } +#endif return; } @@ -180,6 +190,7 @@ probe_enq_ok(void) return; } tc = tty_ACK[len - 1]; +#ifdef user8 if (user8) { ulen = strlen(user8); if (tc == user8[ulen - 1]) { @@ -189,6 +200,7 @@ probe_enq_ok(void) return; } } +#endif /* fixed length acknowledge string */ ACK_length = len; ACK_terminator = -2; diff --git a/contrib/ncurses/tack/sysdep.c b/contrib/ncurses/tack/sysdep.c index 2537657..d8b4802 100644 --- a/contrib/ncurses/tack/sysdep.c +++ b/contrib/ncurses/tack/sysdep.c @@ -24,16 +24,19 @@ * global has no effect. */ -#if defined(__BEOS__) -#include <OS.h> -#endif +#include <signal.h> /* include before curses.h to work around glibc bug */ #include <tack.h> -#include <signal.h> #include <term.h> #include <errno.h> +#if defined(__BEOS__) +#undef false +#undef true +#include <OS.h> +#endif + #if HAVE_SELECT #if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT #include <sys/time.h> @@ -43,7 +46,7 @@ #endif #endif -MODULE_ID("$Id: sysdep.c,v 1.9 2000/09/02 19:17:39 tom Exp $") +MODULE_ID("$Id: sysdep.c,v 1.11 2002/04/21 19:40:43 tom Exp $") #if DECL_ERRNO extern int errno; diff --git a/contrib/ncurses/tack/tack.c b/contrib/ncurses/tack/tack.c index 8ada023..f6e37d4 100644 --- a/contrib/ncurses/tack/tack.c +++ b/contrib/ncurses/tack/tack.c @@ -21,7 +21,7 @@ #include <tack.h> -MODULE_ID("$Id: tack.c,v 1.1 1998/01/10 01:34:45 tom Exp $") +MODULE_ID("$Id: tack.c,v 1.2 2001/10/28 01:05:35 tom Exp $") /* This program is designed to test terminfo, not curses. Therefore @@ -126,7 +126,7 @@ struct test_menu edit_menu = { extern struct test_list mode_test_list[]; struct test_menu mode_menu = { - 0, 'n', 0, "Mode test menu", + 0, 'n', 0, "Test modes and glitches:", "mode", "n) run standard tests", 0, mode_test_list, 0, 0, 0 }; @@ -135,7 +135,7 @@ extern struct test_list acs_test_list[]; static struct test_menu acs_menu = { 0, 'n', 0, - "Alternate character set and graphics rendition test menu", + "Test alternate character set and graphics rendition:", "acs", "n) run standard tests", 0, acs_test_list, 0, 0, 0 }; @@ -144,7 +144,7 @@ extern struct test_list color_test_list[]; struct test_menu color_menu = { 0, 'n', 0, - "Color test menu", + "Test color:", "color", "n) run standard tests", 0, color_test_list, 0, 0, 0 }; @@ -153,7 +153,7 @@ extern struct test_list crum_test_list[]; static struct test_menu crum_menu = { 0, 'n', 0, - "Cursor movement test menu", + "Test cursor movement:", "move", "n) run standard tests", 0, crum_test_list, 0, 0, 0 }; @@ -162,7 +162,7 @@ extern struct test_list funkey_test_list[]; static struct test_menu funkey_menu = { 0, 'n', 0, - "Function key test menu", + "Test function keys:", "fkey", "n) run standard tests", sync_test, funkey_test_list, 0, 0, 0 }; @@ -171,7 +171,7 @@ extern struct test_list printer_test_list[]; static struct test_menu printer_menu = { 0, 'n', 0, - "Printer test menu", + "Test printer:", "printer", "n) run standard tests", 0, printer_test_list, 0, 0, 0 }; @@ -181,7 +181,7 @@ extern struct test_list pad_test_list[]; static struct test_menu pad_menu = { 0, 'n', 0, - "Pad test menu", + "Test padding and string capabilities:", "pad", "n) run standard tests", sync_test, pad_test_list, 0, 0, 0 }; @@ -190,11 +190,11 @@ static struct test_list normal_test_list[] = { {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, {MENU_NEXT, 0, 0, 0, "x) test modes and glitches", 0, &mode_menu}, - {MENU_NEXT, 0, 0, 0, "a) test alternate character sets", 0, &acs_menu}, + {MENU_NEXT, 0, 0, 0, "a) test alternate character set and graphic rendition", 0, &acs_menu}, {MENU_NEXT, 0, 0, 0, "c) test color", 0, &color_menu}, {MENU_NEXT, 0, 0, 0, "m) test cursor movement", 0, &crum_menu}, {MENU_NEXT, 0, 0, 0, "f) test function keys", 0, &funkey_menu}, - {MENU_NEXT, 0, 0, 0, "p) test string capabilities", 0, &pad_menu}, + {MENU_NEXT, 0, 0, 0, "p) test padding and string capabilities", 0, &pad_menu}, {0, 0, 0, 0, "P) test printer", 0, &printer_menu}, {MENU_MENU, 0, 0, 0, "/) test a specific capability", 0, 0}, {0, 0, 0, 0, "t) auto generate pad delays", pad_gen, &pad_menu}, diff --git a/contrib/ncurses/tack/tack.h b/contrib/ncurses/tack/tack.h index 3a81b4d..daca1e1 100644 --- a/contrib/ncurses/tack/tack.h +++ b/contrib/ncurses/tack/tack.h @@ -19,7 +19,7 @@ ** Boston, MA 02111-1307, USA. */ -/* $Id: tack.h,v 1.8 2001/03/24 21:53:35 tom Exp $ */ +/* $Id: tack.h,v 1.9 2001/06/18 18:44:49 tom Exp $ */ #ifndef NCURSES_TACK_H_incl #define NCURSES_TACK_H_incl 1 @@ -60,7 +60,7 @@ extern char *_nc_strstr(const char *, const char *); #define strstr(h,n) _nc_strstr(h,n) #endif -#define CharOf(c) ((unsigned char)(c)) +#define UChar(c) ((unsigned char)(c)) extern FILE *log_fp; extern FILE *debug_fp; diff --git a/contrib/ncurses/test/Makefile.in b/contrib/ncurses/test/Makefile.in index b99957b..833b57f 100644 --- a/contrib/ncurses/test/Makefile.in +++ b/contrib/ncurses/test/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.61 2001/03/24 19:53:31 tom Exp $ +# $Id: Makefile.in,v 1.63 2002/02/03 00:54:10 china Exp $ ############################################################################## # Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # # # @@ -69,7 +69,7 @@ LOCAL_LIBS = @TEST_DEPS@ MATH_LIB = @MATH_LIB@ LD = @LD@ -LINK = @LINK_TESTS@ $(LIBTOOL) $(CC) +LINK = @LINK_TESTS@ $(LIBTOOL) $(CC) $(CFLAGS) LDFLAGS = @LD_MODEL@ @TEST_ARGS@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@ @@ -201,7 +201,7 @@ uninstall.libs: uninstall.test: mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -rf *.o screendump *.lis $(TESTS) .libs diff --git a/contrib/ncurses/test/blue.c b/contrib/ncurses/test/blue.c index 4f73351..5daba2e 100644 --- a/contrib/ncurses/test/blue.c +++ b/contrib/ncurses/test/blue.c @@ -13,16 +13,12 @@ * results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is * just as good. * - * $Id: blue.c,v 1.18 1999/01/17 00:11:56 tom Exp $ + * $Id: blue.c,v 1.23 2002/04/06 23:05:16 tom Exp $ */ -#include <test.priv.h> - -#include <string.h> -#include <signal.h> #include <time.h> -#include <term.h> +#include <test.priv.h> #define NOCARD (-1) @@ -55,7 +51,7 @@ static int deck[PACK_SIZE]; static int grid[GRID_LENGTH]; /* card layout grid */ static int freeptr[4]; /* free card space pointers */ -static int deal_number=0; +static int deal_number = 0; static chtype ranks[SUIT_LENGTH][2] = { @@ -106,75 +102,75 @@ static chtype glyphs[] = static chtype *suits = letters; /* this may change to glyphs below */ -static RETSIGTYPE die(int onsig) +static RETSIGTYPE +die(int onsig) { (void) signal(onsig, SIG_IGN); endwin(); - exit(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } -static void init_vars(void) +static void +init_vars(void) { int i; deck_size = PACK_SIZE; - for (i=0; i < PACK_SIZE; i++) - deck[i]=i; + for (i = 0; i < PACK_SIZE; i++) + deck[i] = i; for (i = 0; i < 4; i++) - freeptr[i]=i * GRID_WIDTH; + freeptr[i] = i * GRID_WIDTH; } -static void shuffle(int size) +static void +shuffle(int size) { - int i,j,numswaps,swapnum,temp; + int i, j, numswaps, swapnum, temp; - numswaps=size*10; /* an arbitrary figure */ + numswaps = size * 10; /* an arbitrary figure */ - for (swapnum=0;swapnum<numswaps;swapnum++) - { - i=rand() % size; - j=rand() % size; - temp=deck[i]; - deck[i]=deck[j]; - deck[j]=temp; + for (swapnum = 0; swapnum < numswaps; swapnum++) { + i = rand() % size; + j = rand() % size; + temp = deck[i]; + deck[i] = deck[j]; + deck[j] = temp; } } -static void deal_cards(void) +static void +deal_cards(void) { - int ptr, card=0, value, csuit, crank, suit, aces[4]; - - for (suit=HEARTS;suit<=CLUBS;suit++) - { - ptr=freeptr[suit]; - grid[ptr++]=NOCARD; /* 1st card space is blank */ - while ((ptr % GRID_WIDTH) != 0) - { - value=deck[card++]; - crank=value % SUIT_LENGTH; - csuit=value / SUIT_LENGTH; - if (crank==ACE) - aces[csuit]=ptr; - grid[ptr++]=value; + int ptr, card = 0, value, csuit, crank, suit, aces[4]; + + for (suit = HEARTS; suit <= CLUBS; suit++) { + ptr = freeptr[suit]; + grid[ptr++] = NOCARD; /* 1st card space is blank */ + while ((ptr % GRID_WIDTH) != 0) { + value = deck[card++]; + crank = value % SUIT_LENGTH; + csuit = value / SUIT_LENGTH; + if (crank == ACE) + aces[csuit] = ptr; + grid[ptr++] = value; } } - if (deal_number==1) /* shift the aces down to the 1st column */ - for (suit=HEARTS;suit<=CLUBS;suit++) - { + if (deal_number == 1) /* shift the aces down to the 1st column */ + for (suit = HEARTS; suit <= CLUBS; suit++) { grid[suit * GRID_WIDTH] = suit * SUIT_LENGTH; - grid[aces[suit]]=NOCARD; - freeptr[suit]=aces[suit]; + grid[aces[suit]] = NOCARD; + freeptr[suit] = aces[suit]; } } -static void printcard(int value) +static void +printcard(int value) { (void) addch(' '); if (value == NOCARD) (void) addstr(" "); - else - { + else { addch(ranks[value % SUIT_LENGTH][0] | COLOR_PAIR(BLUE_ON_WHITE)); addch(ranks[value % SUIT_LENGTH][1] | COLOR_PAIR(BLUE_ON_WHITE)); addch(suits[value / SUIT_LENGTH]); @@ -182,151 +178,144 @@ static void printcard(int value) (void) addch(' '); } -static void display_cards(int deal) +static void +display_cards(int deal) { int row, card; clear(); - (void)printw( - "Blue Moon 2.1 - by Tim Lister & Eric Raymond - Deal %d.\n", - deal); - for(row=HEARTS;row<=CLUBS;row++) - { + (void) printw( + "Blue Moon 2.1 - by Tim Lister & Eric Raymond - Deal %d.\n", + deal); + for (row = HEARTS; row <= CLUBS; row++) { move(BASEROW + row + row + 2, 1); - for(card=0;card<GRID_WIDTH;card++) + for (card = 0; card < GRID_WIDTH; card++) printcard(grid[row * GRID_WIDTH + card]); } - move(PROMPTROW + 2, 0); refresh(); + move(PROMPTROW + 2, 0); + refresh(); #define P(x) (void)printw("%s\n", x) -P(" This 52-card solitaire starts with the entire deck shuffled and dealt"); -P("out in four rows. The aces are then moved to the left end of the layout,"); -P("making 4 initial free spaces. You may move to a space only the card that"); -P("matches the left neighbor in suit, and is one greater in rank. Kings are"); -P("high, so no cards may be placed to their right (they create dead spaces)."); -P(" When no moves can be made, cards still out of sequence are reshuffled"); -P("and dealt face up after the ends of the partial sequences, leaving a card"); -P("space after each sequence, so that each row looks like a partial sequence"); -P("followed by a space, followed by enough cards to make a row of 14. "); -P(" A moment's reflection will show that this game cannot take more than 13"); -P("deals. A good score is 1-3 deals, 4-7 is average, 8 or more is poor. "); + P(" This 52-card solitaire starts with the entire deck shuffled and dealt"); + P("out in four rows. The aces are then moved to the left end of the layout,"); + P("making 4 initial free spaces. You may move to a space only the card that"); + P("matches the left neighbor in suit, and is one greater in rank. Kings are"); + P("high, so no cards may be placed to their right (they create dead spaces)."); + P(" When no moves can be made, cards still out of sequence are reshuffled"); + P("and dealt face up after the ends of the partial sequences, leaving a card"); + P("space after each sequence, so that each row looks like a partial sequence"); + P("followed by a space, followed by enough cards to make a row of 14. "); + P(" A moment's reflection will show that this game cannot take more than 13"); + P("deals. A good score is 1-3 deals, 4-7 is average, 8 or more is poor. "); #undef P refresh(); } -static int find(int card) +static int +find(int card) { int i; - if ((card<0) || (card>=PACK_SIZE)) - return(NOCARD); - for(i = 0; i < GRID_LENGTH; i++) + if ((card < 0) || (card >= PACK_SIZE)) + return (NOCARD); + for (i = 0; i < GRID_LENGTH; i++) if (grid[i] == card) return i; - return(NOCARD); + return (NOCARD); } -static void movecard(int src, int dst) +static void +movecard(int src, int dst) { - grid[dst]=grid[src]; - grid[src]=NOCARD; + grid[dst] = grid[src]; + grid[src] = NOCARD; - move( BASEROW + (dst / GRID_WIDTH)*2+2, (dst % GRID_WIDTH)*5 + 1); + move(BASEROW + (dst / GRID_WIDTH) * 2 + 2, (dst % GRID_WIDTH) * 5 + 1); printcard(grid[dst]); - move( BASEROW + (src / GRID_WIDTH)*2+2, (src % GRID_WIDTH)*5 + 1); + move(BASEROW + (src / GRID_WIDTH) * 2 + 2, (src % GRID_WIDTH) * 5 + 1); printcard(grid[src]); refresh(); } -static void play_game(void) +static void +play_game(void) { - int dead=0, i, j; + int dead = 0, i, j; char c; int selection[4], card; - while (dead<4) - { - dead=0; - for (i=0;i<4;i++) - { - card=grid[freeptr[i]-1]; + while (dead < 4) { + dead = 0; + for (i = 0; i < 4; i++) { + card = grid[freeptr[i] - 1]; - if ( ((card % SUIT_LENGTH)==KING) + if (((card % SUIT_LENGTH) == KING) || - (card==NOCARD) ) - selection[i]=NOCARD; + (card == NOCARD)) + selection[i] = NOCARD; else - selection[i]=find(card+1); + selection[i] = find(card + 1); - if (selection[i]==NOCARD) + if (selection[i] == NOCARD) dead++; }; - if (dead < 4) - { - char live[NSUITS+1], *lp = live; - - for (i=0;i<4;i++) - { - if (selection[i] != NOCARD) - { - move(BASEROW + (selection[i] / GRID_WIDTH)*2+3, - (selection[i] % GRID_WIDTH)*5); - (void)printw(" %c ", *lp++ = 'a' + i); + if (dead < 4) { + char live[NSUITS + 1], *lp = live; + + for (i = 0; i < 4; i++) { + if (selection[i] != NOCARD) { + move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3, + (selection[i] % GRID_WIDTH) * 5); + (void) printw(" %c ", *lp++ = 'a' + i); } }; *lp = '\0'; - if (strlen(live) == 1) - { - move(PROMPTROW,0); - (void)printw( - "Making forced moves... "); + if (strlen(live) == 1) { + move(PROMPTROW, 0); + (void) printw( + "Making forced moves... "); refresh(); (void) sleep(1); c = live[0]; - } - else - { - char buf[BUFSIZ]; + } else { + char buf[BUFSIZ]; - (void)sprintf(buf, - "Type [%s] to move, r to redraw, q or INTR to quit: ", - live); + (void) sprintf(buf, + "Type [%s] to move, r to redraw, q or INTR to quit: ", + live); do { - move(PROMPTROW,0); + move(PROMPTROW, 0); (void) addstr(buf); - move(PROMPTROW, (int)strlen(buf)); + move(PROMPTROW, (int) strlen(buf)); clrtoeol(); (void) addch(' '); } while - (((c = getch())<'a' || c>'d') && (c!='r') && (c!='q')); + (((c = getch()) < 'a' || c > 'd') && (c != 'r') && (c != 'q')); } for (j = 0; j < 4; j++) - if (selection[j]!=NOCARD) - { - move(BASEROW + (selection[j] / GRID_WIDTH)*2+3, - (selection[j] % GRID_WIDTH)*5); - (void)printw(" "); + if (selection[j] != NOCARD) { + move(BASEROW + (selection[j] / GRID_WIDTH) * 2 + 3, + (selection[j] % GRID_WIDTH) * 5); + (void) printw(" "); } if (c == 'r') display_cards(deal_number); else if (c == 'q') die(SIGINT); - else - { - i = c-'a'; + else { + i = c - 'a'; if (selection[i] == NOCARD) beep(); - else - { + else { movecard(selection[i], freeptr[i]); - freeptr[i]=selection[i]; + freeptr[i] = selection[i]; } } } @@ -334,54 +323,54 @@ static void play_game(void) move(PROMPTROW, 0); standout(); - (void)printw("Finished deal %d - type any character to continue...", deal_number); + (void) printw("Finished deal %d - type any character to continue...", deal_number); standend(); (void) getch(); } -static int collect_discards(void) +static int +collect_discards(void) { - int row, col, cardno=0, finish, gridno; - - for (row=HEARTS;row<=CLUBS;row++) - { - finish=0; - for (col=1;col<GRID_WIDTH;col++) - { - gridno=row * GRID_WIDTH + col; - - if ((grid[gridno]!=(grid[gridno-1]+1))&&(finish==0)) - { - finish=1; - freeptr[row]=gridno; + int row, col, cardno = 0, finish, gridno; + + for (row = HEARTS; row <= CLUBS; row++) { + finish = 0; + for (col = 1; col < GRID_WIDTH; col++) { + gridno = row * GRID_WIDTH + col; + + if ((grid[gridno] != (grid[gridno - 1] + 1)) && (finish == 0)) { + finish = 1; + freeptr[row] = gridno; }; - if ((finish!=0)&&(grid[gridno]!=NOCARD)) - deck[cardno++]=grid[gridno]; + if ((finish != 0) && (grid[gridno] != NOCARD)) + deck[cardno++] = grid[gridno]; } } return cardno; } -static void game_finished(int deal) +static void +game_finished(int deal) { clear(); - (void)printw("You finished the game in %d deals. This is ",deal); + (void) printw("You finished the game in %d deals. This is ", deal); standout(); - if (deal<2) - (void)addstr("excellent"); - else if (deal<4) - (void)addstr("good"); - else if (deal<8) - (void)addstr("average"); + if (deal < 2) + (void) addstr("excellent"); + else if (deal < 4) + (void) addstr("good"); + else if (deal < 8) + (void) addstr("average"); else - (void)addstr("poor"); + (void) addstr("poor"); standend(); (void) addstr(". "); refresh(); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { (void) signal(SIGINT, die); initscr(); @@ -390,20 +379,20 @@ int main(int argc, char *argv[]) * We use COLOR_GREEN because COLOR_BLACK is wired to the wrong thing. */ start_color(); - init_pair(RED_ON_WHITE, COLOR_RED, COLOR_WHITE); - init_pair(BLUE_ON_WHITE, COLOR_BLUE, COLOR_WHITE); - init_pair(BLACK_ON_WHITE, COLOR_BLACK, COLOR_WHITE); + init_pair(RED_ON_WHITE, COLOR_RED, COLOR_WHITE); + init_pair(BLUE_ON_WHITE, COLOR_BLUE, COLOR_WHITE); + init_pair(BLACK_ON_WHITE, COLOR_BLACK, COLOR_WHITE); #ifndef COLOR_PAIR - letters[0] = OR_COLORS('h', RED_ON_WHITE); /* hearts */ + letters[0] = OR_COLORS('h', RED_ON_WHITE); /* hearts */ letters[1] = OR_COLORS('s', BLACK_ON_WHITE); /* spades */ - letters[2] = OR_COLORS('d', RED_ON_WHITE); /* diamonds */ + letters[2] = OR_COLORS('d', RED_ON_WHITE); /* diamonds */ letters[3] = OR_COLORS('c', BLACK_ON_WHITE); /* clubs */ #if defined(__i386__) && defined(A_ALTCHARSET) - glyphs[0] = PC_COLORS('\003', RED_ON_WHITE); /* hearts */ - glyphs[1] = PC_COLORS('\006', BLACK_ON_WHITE); /* spades */ - glyphs[2] = PC_COLORS('\004', RED_ON_WHITE); /* diamonds */ - glyphs[3] = PC_COLORS('\005', BLACK_ON_WHITE); /* clubs */ + glyphs[0] = PC_COLORS('\003', RED_ON_WHITE); /* hearts */ + glyphs[1] = PC_COLORS('\006', BLACK_ON_WHITE); /* spades */ + glyphs[2] = PC_COLORS('\004', RED_ON_WHITE); /* diamonds */ + glyphs[3] = PC_COLORS('\005', BLACK_ON_WHITE); /* clubs */ #endif #endif @@ -415,13 +404,13 @@ int main(int argc, char *argv[]) cbreak(); if (argc == 2) - srand((unsigned)atoi(argv[1])); + srand((unsigned) atoi(argv[1])); else - srand((unsigned)time((time_t *)0)); + srand((unsigned) time((time_t *) 0)); init_vars(); - do{ + do { deal_number++; shuffle(deck_size); deal_cards(); @@ -429,12 +418,12 @@ int main(int argc, char *argv[]) play_game(); } while - ((deck_size=collect_discards()) != 0); + ((deck_size = collect_discards()) != 0); game_finished(deal_number); die(SIGINT); - /*NOTREACHED*/ + /*NOTREACHED */ } /* blue.c ends here */ diff --git a/contrib/ncurses/test/bs.c b/contrib/ncurses/test/bs.c index 3a22c1d..2d3a7fb 100644 --- a/contrib/ncurses/test/bs.c +++ b/contrib/ncurses/test/bs.c @@ -7,30 +7,19 @@ * v2.0 featuring strict ANSI/POSIX conformance, November 1993. * v2.1 with ncurses mouse support, September 1995 * - * $Id: bs.c,v 1.29 2001/04/14 22:36:05 Erik.Sigra Exp $ + * $Id: bs.c,v 1.35 2002/04/06 23:10:12 tom Exp $ */ -#include <test.priv.h> - -#include <signal.h> #include <ctype.h> -#include <string.h> #include <assert.h> #include <time.h> +#include <test.priv.h> + #ifndef SIGIOT #define SIGIOT SIGABRT #endif -#ifndef A_UNDERLINE /* BSD curses */ -#define beep() write(1,"\007",1); -#define cbreak crmode -#define saveterm savetty -#define resetterm resetty -#define nocbreak nocrmode -#define strchr index -#endif /* !A_UNDERLINE */ - static int getcoord(int); /* @@ -57,7 +46,7 @@ static int getcoord(int); /* display symbols */ #define SHOWHIT '*' #define SHOWSPLASH ' ' -#define IS_SHIP(c) (isupper(CharOf(c)) ? TRUE : FALSE) +#define IS_SHIP(c) (isupper(UChar(c)) ? TRUE : FALSE) /* how to position us on player board */ #define PYBASE 3 @@ -122,8 +111,8 @@ typedef struct { int hits; /* how many times has this ship been hit? */ char symbol; /* symbol for game purposes */ int length; /* length of ship */ - char x, y; /* coordinates of ship start point */ - unsigned char dir; /* direction of `bow' */ + int x, y; /* coordinates of ship start point */ + int dir; /* direction of `bow' */ bool placed; /* has it been placed on the board? */ } ship_t; @@ -160,18 +149,17 @@ static int salvo, blitz, closepack; #define PR (void)addstr -static RETSIGTYPE -uninitgame(int sig) GCC_NORETURN; +static RETSIGTYPE uninitgame(int sig) GCC_NORETURN; - static RETSIGTYPE uninitgame(int sig GCC_UNUSED) +static RETSIGTYPE uninitgame(int sig GCC_UNUSED) /* end the game, either normally or due to signal */ { clear(); (void) refresh(); - (void) resetterm(); + (void) reset_shell_mode(); (void) echo(); (void) endwin(); - exit(EXIT_FAILURE); + ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS); } static void @@ -217,10 +205,8 @@ intro(void) (void) strcpy(name, dftname); (void) initscr(); -#ifdef KEY_MIN keypad(stdscr, TRUE); -#endif /* KEY_MIN */ - (void) saveterm(); + (void) def_prog_mode(); (void) nonl(); (void) cbreak(); (void) noecho(); @@ -549,65 +535,49 @@ getcoord(int atcpu) switch (c = getch()) { case 'k': case '8': -#ifdef KEY_MIN case KEY_UP: -#endif /* KEY_MIN */ ny = cury + BDEPTH - 1; nx = curx; break; case 'j': case '2': -#ifdef KEY_MIN case KEY_DOWN: -#endif /* KEY_MIN */ ny = cury + 1; nx = curx; break; case 'h': case '4': -#ifdef KEY_MIN case KEY_LEFT: -#endif /* KEY_MIN */ ny = cury; nx = curx + BWIDTH - 1; break; case 'l': case '6': -#ifdef KEY_MIN case KEY_RIGHT: -#endif /* KEY_MIN */ ny = cury; nx = curx + 1; break; case 'y': case '7': -#ifdef KEY_MIN case KEY_A1: -#endif /* KEY_MIN */ ny = cury + BDEPTH - 1; nx = curx + BWIDTH - 1; break; case 'b': case '1': -#ifdef KEY_MIN case KEY_C1: -#endif /* KEY_MIN */ ny = cury + 1; nx = curx + BWIDTH - 1; break; case 'u': case '9': -#ifdef KEY_MIN case KEY_A3: -#endif /* KEY_MIN */ ny = cury + BDEPTH - 1; nx = curx + 1; break; case 'n': case '3': -#ifdef KEY_MIN case KEY_C3: -#endif /* KEY_MIN */ ny = cury + 1; nx = curx + 1; break; @@ -943,7 +913,7 @@ randomfire(int *px, int *py) --srchstep; } else { error("No moves possible?? Help!"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); /*NOTREACHED */ } } @@ -1159,7 +1129,7 @@ do_options(int c, char *op[]) (void) fprintf(stderr, "\t-s : play a salvo game\n"); (void) fprintf(stderr, "\t-b : play a blitz game\n"); (void) fprintf(stderr, "\t-c : ships may be adjacent\n"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); break; case '-': switch (op[i][1]) { @@ -1168,7 +1138,7 @@ do_options(int c, char *op[]) if (salvo == 1) { (void) fprintf(stderr, "Bad Arg: -b and -s are mutually exclusive\n"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } break; case 's': @@ -1176,7 +1146,7 @@ do_options(int c, char *op[]) if (blitz == 1) { (void) fprintf(stderr, "Bad Arg: -s and -b are mutually exclusive\n"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } break; case 'c': @@ -1186,7 +1156,7 @@ do_options(int c, char *op[]) (void) fprintf(stderr, "Bad arg: type \"%s ?\" for usage message\n", op[0]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } } } diff --git a/contrib/ncurses/test/cardfile.c b/contrib/ncurses/test/cardfile.c index a705d9d..8edbd1e 100644 --- a/contrib/ncurses/test/cardfile.c +++ b/contrib/ncurses/test/cardfile.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2001,2002 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,17 +29,18 @@ /* * Author: Thomas E. Dickey <dickey@clark.net> 1999 * - * $Id: cardfile.c,v 1.6 2000/11/04 23:14:28 tom Exp $ + * $Id: cardfile.c,v 1.11 2002/04/06 23:12:50 tom Exp $ * * File format: text beginning in column 1 is a title; other text forms the content. */ #include <test.priv.h> +#if HAVE_FORM_H && HAVE_PANEL_H && HAVE_LIBFORM && HAVE_LIBPANEL + #include <form.h> #include <panel.h> -#include <string.h> #include <ctype.h> #define VISIBLE_CARDS 10 @@ -75,7 +76,7 @@ strdup(char *s) static const char * skip(const char *buffer) { - while (isspace(CharOf(*buffer))) + while (isspace(UChar(*buffer))) buffer++; return buffer; } @@ -84,7 +85,7 @@ static void trim(char *buffer) { unsigned n = strlen(buffer); - while (n-- && isspace(CharOf(buffer[n]))) + while (n-- && isspace(UChar(buffer[n]))) buffer[n] = 0; } @@ -166,7 +167,7 @@ read_data(char *fname) if ((fp = fopen(fname, "r")) != 0) { while (fgets(buffer, sizeof(buffer), fp)) { trim(buffer); - if (isspace(CharOf(*buffer))) { + if (isspace(UChar(*buffer))) { if (card == 0) card = add_title(""); add_content(card, buffer); @@ -378,6 +379,11 @@ cardfile(char *fname) case MAX_FORM_COMMAND + 4: write_data(fname); break; +#ifdef KEY_RESIZE + case KEY_RESIZE: + flash(); + break; +#endif default: beep(); break; @@ -416,5 +422,13 @@ main(int argc, char *argv[]) endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } +#else +int +main(void) +{ + printf("This program requires the curses form and panel libraries\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/contrib/ncurses/test/configure b/contrib/ncurses/test/configure index de1cf77..8d44c2b 100755 --- a/contrib/ncurses/test/configure +++ b/contrib/ncurses/test/configure @@ -184,6 +184,7 @@ EOF cat <<EOF --enable and --with options recognized: --with-5lib use SunOS sysv-libraries + --with-ncursesw use wide ncurses-libraries (installed) --with-ncurses use ncurses-libraries (installed) EOF exit 0 ;; @@ -528,7 +529,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:532: checking for $ac_word" >&5 +echo "configure:533: 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 @@ -558,7 +559,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:562: checking for $ac_word" >&5 +echo "configure:563: 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 @@ -609,7 +610,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:613: checking for $ac_word" >&5 +echo "configure:614: 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 @@ -641,7 +642,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:646: 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. @@ -652,12 +653,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 656 "configure" +#line 657 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:662: \"$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 @@ -683,12 +684,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:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:688: 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:692: checking whether we are using GNU C" >&5 +echo "configure:693: 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 @@ -697,7 +698,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$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:702: \"$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 @@ -716,7 +717,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:720: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:721: 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 @@ -784,16 +785,239 @@ fi + +# Check whether --with-ncursesw or --without-ncursesw was given. +if test "${with_ncursesw+set}" = set; then + withval="$with_ncursesw" + + cat >> confdefs.h <<\EOF +#define _GNU_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF + + echo $ac_n "checking for initscr""... $ac_c" 1>&6 +echo "configure:803: 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 <<EOF +#line 808 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char initscr(); below. */ +#include <assert.h> +/* 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 initscr(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_initscr) || defined (__stub___initscr) +choke me +#else +initscr(); +#endif + +; return 0; } +EOF +if { (eval echo configure:831: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_initscr=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 +echo "configure:850: 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 +else + ac_save_LIBS="$LIBS" +LIBS="-lgpm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 858 "configure" +#include "confdefs.h" +/* 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 Gpm_Open(); + +int main() { +Gpm_Open() +; return 0; } +EOF +if { (eval echo configure:869: \"$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 + 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 + ac_tr_lib=HAVE_LIB`echo gpm | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF + + LIBS="-lgpm $LIBS" + +else + echo "$ac_t""no" 1>&6 +fi + + LIB_NAME=ncursesw + echo $ac_n "checking for putwc""... $ac_c" 1>&6 +echo "configure:898: checking for putwc" >&5 +if eval "test \"`echo '$''{'ac_cv_func_putwc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 903 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char putwc(); below. */ +#include <assert.h> +/* 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 putwc(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_putwc) || defined (__stub___putwc) +choke me +#else +putwc(); +#endif + +; return 0; } +EOF +if { (eval echo configure:926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_putwc=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_putwc=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'putwc`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + +echo $ac_n "checking for putwc in libutf8""... $ac_c" 1>&6 +echo "configure:945: checking for putwc in libutf8" >&5 +if eval "test \"`echo '$''{'cf_cv_libutf8'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +cat > conftest.$ac_ext <<EOF +#line 953 "configure" +#include "confdefs.h" + +#include <libutf8.h> +int main() { +putwc(0,0); +; return 0; } +EOF +if { (eval echo configure:961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_libutf8=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_libutf8=no +fi +rm -f conftest* + LIBS="$cf_save_LIBS" + +fi + +echo "$ac_t""$cf_cv_libutf8" 1>&6 + +if test "$cf_cv_libutf8" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_LIBUTF8_H 1 +EOF + + LIBS="-lutf8 $LIBS" +fi + +fi + + for p in $HOME /usr/local /usr + do + if test -f $p/include/ncursesw/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include/ncursesw" + test $p != /usr && CPPFLAGS="$CPPFLAGS -I$p/include" + test $p != /usr && LIBS="-L$p/lib $LIBS" + break + elif test $p != /usr + then + if test -f $p/include/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include" + LIBS="-L$p/lib $LIBS" + break + fi + fi + done + +fi + +fi + + + # Check whether --with-ncurses or --without-ncurses was given. if test "${with_ncurses+set}" = set; then withval="$with_ncurses" echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:792: checking for initscr" >&5 +echo "configure:1016: 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 <<EOF -#line 797 "configure" +#line 1021 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr(); below. */ @@ -816,7 +1040,7 @@ initscr(); ; return 0; } EOF -if { (eval echo configure:820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1044: \"$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 @@ -835,7 +1059,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:839: checking for Gpm_Open in -lgpm" >&5 +echo "configure:1063: 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 @@ -843,7 +1067,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <<EOF -#line 847 "configure" +#line 1071 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -854,7 +1078,7 @@ int main() { Gpm_Open() ; return 0; } EOF -if { (eval echo configure:858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1082: \"$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 @@ -909,12 +1133,12 @@ fi echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:913: checking for initscr" >&5 +echo "configure:1137: 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 <<EOF -#line 918 "configure" +#line 1142 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr(); below. */ @@ -937,7 +1161,7 @@ initscr(); ; return 0; } EOF -if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1165: \"$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 @@ -956,7 +1180,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -l$LIB_NAME""... $ac_c" 1>&6 -echo "configure:960: checking for initscr in -l$LIB_NAME" >&5 +echo "configure:1184: 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 @@ -964,7 +1188,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$LIB_NAME $LIBS" cat > conftest.$ac_ext <<EOF -#line 968 "configure" +#line 1192 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -975,7 +1199,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1203: \"$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 @@ -1005,7 +1229,7 @@ fi fi echo $ac_n "checking for form_driver in -lform""... $ac_c" 1>&6 -echo "configure:1009: checking for form_driver in -lform" >&5 +echo "configure:1233: 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 @@ -1013,7 +1237,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lform $LIBS" cat > conftest.$ac_ext <<EOF -#line 1017 "configure" +#line 1241 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1024,7 +1248,7 @@ int main() { form_driver() ; return 0; } EOF -if { (eval echo configure:1028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1252: \"$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 @@ -1052,7 +1276,7 @@ else fi echo $ac_n "checking for menu_driver in -lmenu""... $ac_c" 1>&6 -echo "configure:1056: checking for menu_driver in -lmenu" >&5 +echo "configure:1280: 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 @@ -1060,7 +1284,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmenu $LIBS" cat > conftest.$ac_ext <<EOF -#line 1064 "configure" +#line 1288 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1071,7 +1295,7 @@ int main() { menu_driver() ; return 0; } EOF -if { (eval echo configure:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1299: \"$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 @@ -1099,7 +1323,7 @@ else fi echo $ac_n "checking for new_panel in -lpanel""... $ac_c" 1>&6 -echo "configure:1103: checking for new_panel in -lpanel" >&5 +echo "configure:1327: 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 @@ -1107,7 +1331,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpanel $LIBS" cat > conftest.$ac_ext <<EOF -#line 1111 "configure" +#line 1335 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1118,7 +1342,7 @@ int main() { new_panel() ; return 0; } EOF -if { (eval echo configure:1122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1346: \"$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 @@ -1147,12 +1371,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1151: checking return type of signal handlers" >&5 +echo "configure:1375: 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 <<EOF -#line 1156 "configure" +#line 1380 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -1169,7 +1393,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1189,7 +1413,7 @@ EOF echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1193: checking how to run the C preprocessor" >&5 +echo "configure:1417: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1204,13 +1428,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1208 "configure" +#line 1432 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1438: \"$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 : @@ -1221,13 +1445,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1225 "configure" +#line 1449 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1455: \"$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 : @@ -1238,13 +1462,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1242 "configure" +#line 1466 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1472: \"$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 : @@ -1269,12 +1493,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1273: checking for ANSI C header files" >&5 +echo "configure:1497: 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 <<EOF -#line 1278 "configure" +#line 1502 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1282,7 +1506,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1510: \"$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* @@ -1299,7 +1523,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 -#line 1303 "configure" +#line 1527 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1317,7 +1541,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 -#line 1321 "configure" +#line 1545 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1338,7 +1562,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1342 "configure" +#line 1566 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1349,7 +1573,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1373,12 +1597,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1377: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1601: 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 <<EOF -#line 1382 "configure" +#line 1606 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -1387,7 +1611,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1410,8 +1634,10 @@ fi for ac_hdr in \ form.h \ getopt.h \ +locale.h \ menu.h \ nc_alloc.h \ +nomacros.h \ panel.h \ sys/ioctl.h \ sys/select.h \ @@ -1422,17 +1648,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:1426: checking for $ac_hdr" >&5 +echo "configure:1652: 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 -#line 1431 "configure" +#line 1657 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1662: \"$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* @@ -1460,8 +1686,10 @@ done for ac_func in \ +getnstr \ gettimeofday \ napms \ +resize_term \ resizeterm \ strdup \ use_default_colors \ @@ -1470,12 +1698,12 @@ wresize \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1474: checking for $ac_func" >&5 +echo "configure:1702: 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 <<EOF -#line 1479 "configure" +#line 1707 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1498,7 +1726,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1730: \"$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 @@ -1524,7 +1752,7 @@ done echo $ac_n "checking for function curses_version""... $ac_c" 1>&6 -echo "configure:1528: checking for function curses_version" >&5 +echo "configure:1756: 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 @@ -1533,7 +1761,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_curses_version=unknown else cat > conftest.$ac_ext <<EOF -#line 1537 "configure" +#line 1765 "configure" #include "confdefs.h" #include <curses.h> @@ -1545,7 +1773,7 @@ int main() } EOF -if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1777: \"$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 @@ -1568,20 +1796,194 @@ test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF EOF -echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6 -echo "configure:1573: checking if sys/time.h conflicts with sys/select.h" >&5 +echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6 +echo "configure:1801: checking for alternate character set array" >&5 +if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cf_cv_curses_acs_map=unknown +for name in acs_map _acs_map __acs_map _nc_acs_map +do +cat > conftest.$ac_ext <<EOF +#line 1810 "configure" +#include "confdefs.h" + +#include <curses.h> + +int main() { + +$name['k'] = ACS_PLUS + +; return 0; } +EOF +if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_curses_acs_map=$name; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$cf_cv_curses_acs_map" 1>&6 + +test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF +#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map +EOF + + +echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6 +echo "configure:1841: checking for wide alternate character set array" >&5 +if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cf_cv_curses_wacs_map=unknown +for name in wacs_map _wacs_map __wacs_map _nc_wacs +do +cat > conftest.$ac_ext <<EOF +#line 1850 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <curses.h> + +int main() { + +$name['k'] = *WACS_PLUS + +; return 0; } +EOF +if { (eval echo configure:1864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_curses_wacs_map=$name; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6 + +test "$cf_cv_curses_wacs_map" != unknown && cat >> confdefs.h <<EOF +#define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map +EOF + + + + + +echo $ac_n "checking for type attr_t in curses.h""... $ac_c" 1>&6 +echo "configure:1887: checking for type attr_t in curses.h" >&5 +cat > conftest.$ac_ext <<EOF +#line 1889 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <curses.h> +int main() { + +attr_t foo + +; return 0; } +EOF +if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_result=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_result=no +fi +rm -f conftest* +echo "$ac_t""$cf_result" 1>&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >> confdefs.h <<EOF +#define $cf_result 1 +EOF + +else + cat >> confdefs.h <<EOF +#define attr_t long +EOF + +fi + + +echo $ac_n "checking for type mbstate_t in curses.h""... $ac_c" 1>&6 +echo "configure:1930: checking for type mbstate_t in curses.h" >&5 +cat > conftest.$ac_ext <<EOF +#line 1932 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <curses.h> +int main() { + +mbstate_t foo + +; return 0; } +EOF +if { (eval echo configure:1945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_result=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_result=no +fi +rm -f conftest* +echo "$ac_t""$cf_result" 1>&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >> confdefs.h <<EOF +#define $cf_result 1 +EOF + +else + cat >> confdefs.h <<EOF +#define mbstate_t long +EOF + +fi + + + +echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6 +echo "configure:1974: 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 <<EOF -#line 1579 "configure" +#line 1980 "configure" #include "confdefs.h" -#if HAVE_SYS_TIME_H +#include <sys/types.h> +#ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif -#if HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif @@ -1589,7 +1991,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sys_time_select=yes else @@ -1603,11 +2005,12 @@ 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 + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure diff --git a/contrib/ncurses/test/configure.in b/contrib/ncurses/test/configure.in index d61d477..28a75b6 100644 --- a/contrib/ncurses/test/configure.in +++ b/contrib/ncurses/test/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2000,2002 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,2000 +dnl Author: Thomas E. Dickey 1996, etc. dnl -dnl $Id: configure.in,v 1.31 2000/10/15 18:46:17 tom Exp $ +dnl $Id: configure.in,v 1.35 2002/04/06 22:02:50 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) @@ -77,6 +77,57 @@ AC_ARG_WITH(5lib, [LIBS="-L/usr/5lib $LIBS" CPPFLAGS="$CPPFLAGS -I/usr/5include"]) +dnl --------------------------------------------------------------------------- +dnl Check for libutf8 +AC_DEFUN([CF_LIBUTF8], +[ +AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[ + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +AC_TRY_LINK([ +#include <libutf8.h>],[putwc(0,0);], + [cf_cv_libutf8=yes], + [cf_cv_libutf8=no]) + LIBS="$cf_save_LIBS" +]) + +if test "$cf_cv_libutf8" = yes ; then + AC_DEFINE(HAVE_LIBUTF8_H) + LIBS="-lutf8 $LIBS" +fi +])dnl + +dnl --------------------------------------------------------------------------- +dnl NcursesW, installed in conventional location +AC_ARG_WITH(ncursesw, + [ --with-ncursesw use wide ncurses-libraries (installed)], + [ + AC_DEFINE(_GNU_SOURCE) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED) + AC_CHECK_FUNC(initscr,,[ + AC_CHECK_LIB(gpm,Gpm_Open) + LIB_NAME=ncursesw + AC_CHECK_FUNC(putwc,,[CF_LIBUTF8]) + for p in $HOME /usr/local /usr + do + if test -f $p/include/ncursesw/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include/ncursesw" + test $p != /usr && CPPFLAGS="$CPPFLAGS -I$p/include" + test $p != /usr && LIBS="-L$p/lib $LIBS" + break + elif test $p != /usr + then + if test -f $p/include/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include" + LIBS="-L$p/lib $LIBS" + break + fi + fi + done + ],[test -d /usr/ccs/lib && LIBS="-L/usr/ccs/lib $LIBS"])]) + dnl Ncurses, installed in conventional location AC_ARG_WITH(ncurses, [ --with-ncurses use ncurses-libraries (installed)], @@ -121,8 +172,10 @@ AC_HEADER_TIME AC_CHECK_HEADERS( \ form.h \ getopt.h \ +locale.h \ menu.h \ nc_alloc.h \ +nomacros.h \ panel.h \ sys/ioctl.h \ sys/select.h \ @@ -132,8 +185,10 @@ unistd.h \ ) AC_CHECK_FUNCS( \ +getnstr \ gettimeofday \ napms \ +resize_term \ resizeterm \ strdup \ use_default_colors \ @@ -141,6 +196,7 @@ vsscanf \ wresize \ ) +dnl --------------------------------------------------------------------------- dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS. dnl It's a character string "SVR4", not documented. AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[ @@ -159,21 +215,93 @@ rm -f core]) test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION) dnl --------------------------------------------------------------------------- +dnl Check for likely values of acs_map[]: +AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[ +cf_cv_curses_acs_map=unknown +for name in acs_map _acs_map __acs_map _nc_acs_map +do +AC_TRY_LINK([ +#include <curses.h> +],[ +$name['k'] = ACS_PLUS +],[cf_cv_curses_acs_map=$name; break]) +done +]) + +test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map) + +dnl --------------------------------------------------------------------------- +dnl Check for likely values of wacs_map[]: +AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[ +cf_cv_curses_wacs_map=unknown +for name in wacs_map _wacs_map __wacs_map _nc_wacs +do +AC_TRY_LINK([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <curses.h> +],[ +$name['k'] = *WACS_PLUS +],[cf_cv_curses_wacs_map=$name; break]) +done +]) + +test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map) + +dnl --------------------------------------------------------------------------- +dnl Make an uppercase version of a variable +dnl $1=uppercase($2) +AC_DEFUN([CF_UPPER], +[ +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +])dnl + +dnl --------------------------------------------------------------------------- +dnl Check if curses.h defines the given type +AC_DEFUN([CF_CURSES_TYPE], +[ +AC_MSG_CHECKING(for type $1 in curses.h) +AC_TRY_COMPILE([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <curses.h>],[ +$1 foo +],cf_result=yes,cf_result=no) +AC_MSG_RESULT($cf_result) +if test $cf_result = yes ; then + CF_UPPER(cf_result,have_type_$1) + AC_DEFINE_UNQUOTED($cf_result) +else + AC_DEFINE_UNQUOTED($1,$2) +fi +])dnl + +CF_CURSES_TYPE(attr_t,long) +CF_CURSES_TYPE(mbstate_t,long) + +dnl --------------------------------------------------------------------------- +dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on +dnl older SCO configurations. dnl [CF_SYS_TIME_SELECT] -AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h) + +AC_MSG_CHECKING(if sys/time.h works with sys/select.h) AC_CACHE_VAL(cf_cv_sys_time_select,[ AC_TRY_COMPILE([ -#if HAVE_SYS_TIME_H +#include <sys/types.h> +#ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif -#if HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #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 --------------------------------------------------------------------------- AC_OUTPUT(Makefile,[ diff --git a/contrib/ncurses/test/ditto.c b/contrib/ncurses/test/ditto.c index 8ceafe5..c2c6b26 100644 --- a/contrib/ncurses/test/ditto.c +++ b/contrib/ncurses/test/ditto.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2001 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,7 +29,7 @@ /* * Author: Thomas E. Dickey <dickey@clark.net> 1998 * - * $Id: ditto.c,v 1.3 1998/08/15 23:39:34 tom Exp $ + * $Id: ditto.c,v 1.4 2001/09/15 21:53:37 tom Exp $ * * The program illustrates how to set up multiple screens from a single * program. Invoke the program by specifying another terminal on the same @@ -41,108 +41,108 @@ #include <errno.h> typedef struct { - FILE *input; - FILE *output; - SCREEN *screen; + FILE *input; + FILE *output; + SCREEN *screen; } DITTO; static void failed(const char *s) { - perror(s); - exit(EXIT_FAILURE); + perror(s); + ExitProgram(EXIT_FAILURE); } static void usage(void) { - fprintf(stderr, "usage: ditto [terminal1 ...]\n"); - exit(EXIT_FAILURE); + fprintf(stderr, "usage: ditto [terminal1 ...]\n"); + ExitProgram(EXIT_FAILURE); } static FILE * open_tty(char *path) { - FILE *fp; - struct stat sb; + FILE *fp; + struct stat sb; - if (stat(path, &sb) < 0) - failed(path); - if ((sb.st_mode & S_IFMT) != S_IFCHR) { - errno = ENOTTY; - failed(path); - } - fp = fopen(path, "a+"); - if (fp == 0) - failed(path); - printf("opened %s\n", path); - return fp; + if (stat(path, &sb) < 0) + failed(path); + if ((sb.st_mode & S_IFMT) != S_IFCHR) { + errno = ENOTTY; + failed(path); + } + fp = fopen(path, "a+"); + if (fp == 0) + failed(path); + printf("opened %s\n", path); + return fp; } int main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { - int j; - int active_tty = 0; - DITTO *data; + int j; + int active_tty = 0; + DITTO *data; - if (argc <= 1) - usage(); + if (argc <= 1) + usage(); - if ((data = (DITTO *)calloc(argc, sizeof(DITTO))) == 0) - failed("calloc data"); + if ((data = (DITTO *) calloc(argc, sizeof(DITTO))) == 0) + failed("calloc data"); - data[0].input = stdin; - data[0].output = stdout; - for (j = 1; j < argc; j++) { - data[j].input = - data[j].output = open_tty(argv[j]); - } + data[0].input = stdin; + data[0].output = stdout; + for (j = 1; j < argc; j++) { + data[j].input = + data[j].output = open_tty(argv[j]); + } - /* - * If we got this far, we have open connection(s) to the terminal(s). - * Set up the screens. - */ - for (j = 0; j < argc; j++) { - active_tty++; - data[j].screen = newterm( - (char *)0, /* assume $TERM is the same */ - data[j].output, - data[j].input); - if (data[j].screen == 0) - failed("newterm"); - cbreak(); - noecho(); - scrollok(stdscr, TRUE); - } + /* + * If we got this far, we have open connection(s) to the terminal(s). + * Set up the screens. + */ + for (j = 0; j < argc; j++) { + active_tty++; + data[j].screen = newterm( + (char *) 0, /* assume $TERM is the same */ + data[j].output, + data[j].input); + if (data[j].screen == 0) + failed("newterm"); + cbreak(); + noecho(); + scrollok(stdscr, TRUE); + } - /* - * Loop, reading characters from any of the inputs and writing to all - * of the screens. - */ - for(;;) { - int ch; - set_term(data[0].screen); - ch = getch(); - if (ch == ERR) - continue; - if (ch == 4) - break; - for (j = 0; j < argc; j++) { - set_term(data[j].screen); - addch(ch); - refresh(); - } + /* + * Loop, reading characters from any of the inputs and writing to all + * of the screens. + */ + for (;;) { + int ch; + set_term(data[0].screen); + ch = getch(); + if (ch == ERR) + continue; + if (ch == 4) + break; + for (j = 0; j < argc; j++) { + set_term(data[j].screen); + addch(ch); + refresh(); } + } - /* - * Cleanup and exit - */ - for (j = argc-1; j >= 0; j--) { - set_term(data[j].screen); - endwin(); - } - return EXIT_SUCCESS; + /* + * Cleanup and exit + */ + for (j = argc - 1; j >= 0; j--) { + set_term(data[j].screen); + endwin(); + } + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/dots.c b/contrib/ncurses/test/dots.c index a5ddcaa..2e0190f 100644 --- a/contrib/ncurses/test/dots.c +++ b/contrib/ncurses/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2001,2002 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,16 +29,13 @@ /* * Author: Thomas E. Dickey <dickey@clark.net> 1999 * - * $Id: dots.c,v 1.4 2000/02/13 01:05:13 tom Exp $ + * $Id: dots.c,v 1.8 2002/04/06 21:33:42 tom Exp $ * * A simple demo of the terminfo interface. */ -#include <test.priv.h> - -#include <term.h> /* for tparm() */ - #include <time.h> -#include <signal.h> + +#include <test.priv.h> #define valid(s) ((s != 0) && s != (char *)-1) @@ -81,7 +78,7 @@ onsig(int n GCC_UNUSED) { interrupted = TRUE; cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float @@ -93,8 +90,8 @@ ranf(void) int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { int x, y, z, j, p; float r; @@ -123,19 +120,19 @@ main( y = (int) (r * ranf()) + 2; p = (ranf() > 0.9) ? '*' : ' '; - tputs(tparm(cursor_address, y, x), 1, outc); + tputs(tparm3(cursor_address, y, x), 1, outc); if (max_colors > 0) { - z = (int)(ranf() * max_colors); + z = (int) (ranf() * max_colors); if (ranf() > 0.01) { - tputs(tparm(set_a_foreground, z), 1, outc); + tputs(tparm2(set_a_foreground, z), 1, outc); } else { - tputs(tparm(set_a_background, z), 1, outc); + tputs(tparm2(set_a_background, z), 1, outc); } } else if (valid(exit_attribute_mode) - && valid(enter_reverse_mode)) { + && valid(enter_reverse_mode)) { if (ranf() <= 0.01) outs((ranf() > 0.6) ? enter_reverse_mode : - exit_attribute_mode); + exit_attribute_mode); } outc(p); fflush(stdout); diff --git a/contrib/ncurses/test/filter.c b/contrib/ncurses/test/filter.c index 6ccaffd..c3ea3c1 100644 --- a/contrib/ncurses/test/filter.c +++ b/contrib/ncurses/test/filter.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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,7 +29,7 @@ /* * Author: Thomas E. Dickey <dickey@clark.net> 1998 * - * $Id: filter.c,v 1.5 2001/02/24 22:11:58 tom Exp $ + * $Id: filter.c,v 1.7 2002/03/23 23:02:15 tom Exp $ */ #include <test.priv.h> @@ -45,11 +45,6 @@ * and refresh(), but that does not work any better. */ -#ifndef NCURSES_VERSION -#define attr_t long -#define getnstr(s,n) getstr(s) -#endif - static int new_command(char *buffer, int length, attr_t underline) { @@ -104,5 +99,5 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) printw("done"); refresh(); endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/firework.c b/contrib/ncurses/test/firework.c index 66c1227..3d84c43 100644 --- a/contrib/ncurses/test/firework.c +++ b/contrib/ncurses/test/firework.c @@ -1,11 +1,10 @@ /* - * $Id: firework.c,v 1.17 2000/09/02 18:41:12 tom Exp $ + * $Id: firework.c,v 1.20 2002/03/23 21:41:42 tom Exp $ */ -#include <test.priv.h> - -#include <signal.h> #include <time.h> +#include <test.priv.h> + static int my_bg = COLOR_BLACK; static void @@ -19,7 +18,7 @@ static RETSIGTYPE onsig(int n GCC_UNUSED) { cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -35,7 +34,7 @@ showit(void) #endif if (ch == 'q') { cleanup(); - exit(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } else if (ch == 's') { nodelay(stdscr, FALSE); } else if (ch == ' ') { @@ -114,8 +113,8 @@ explode(int row, int col) int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { int j; int start, end, row, diff, flag = 0, direction; @@ -154,7 +153,7 @@ main( attrset(A_NORMAL); for (row = 0; row < diff; row++) { mvprintw(LINES - row, start + (row * direction), - (direction < 0) ? "\\" : "/"); + (direction < 0) ? "\\" : "/"); if (flag++) { showit(); erase(); diff --git a/contrib/ncurses/test/firstlast.c b/contrib/ncurses/test/firstlast.c index f9515dc..6a79a33 100644 --- a/contrib/ncurses/test/firstlast.c +++ b/contrib/ncurses/test/firstlast.c @@ -2,88 +2,89 @@ * This test was written by Alexander V. Lukyanov to demonstrate difference * between ncurses 4.1 and SVR4 curses * - * $Id: firstlast.c,v 1.2 1997/10/18 21:34:53 tom Exp $ + * $Id: firstlast.c,v 1.3 2001/09/15 21:46:34 tom Exp $ */ #include <test.priv.h> -static void fill(WINDOW *w,const char *str) +static void +fill(WINDOW *w, const char *str) { - const char *s; - for(;;) { - for(s=str; *s; s++) { - if(waddch(w,*s)==ERR) - { - wmove(w,0,0); - return; - } - } + const char *s; + for (;;) { + for (s = str; *s; s++) { + if (waddch(w, *s) == ERR) { + wmove(w, 0, 0); + return; + } } + } } -int main( +int +main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { - WINDOW *large,*small; - initscr(); - noecho(); - - large = newwin(20,60,2,10); - small = newwin(10,30,7,25); - - /* test 1 - addch */ - fill(large,"LargeWindow"); - - refresh(); - wrefresh(large); - wrefresh(small); - - mvwaddstr(small,5,5," Test <place to change> String "); - wrefresh(small); - getch(); - - touchwin(large); - wrefresh(large); - - mvwaddstr(small,5,5," Test <***************> String "); - wrefresh(small); - - /* DIFFERENCE! */ - getch(); - - /* test 2: erase */ - erase(); - refresh(); - getch(); - - /* test 3: clrtoeol */ - werase(small); - wrefresh(small); - touchwin(large); - wrefresh(large); - wmove(small,5,0); - waddstr(small," clrtoeol>"); - wclrtoeol(small); - wrefresh(small); - - /* DIFFERENCE! */; - getch(); - - /* test 4: clrtobot */ - werase(small); - wrefresh(small); - touchwin(large); - wrefresh(large); - wmove(small,5,3); - waddstr(small," clrtobot>"); - wclrtobot(small); - wrefresh(small); - - /* DIFFERENCE! */ - getch(); - - endwin(); - - return EXIT_SUCCESS; + WINDOW *large, *small; + initscr(); + noecho(); + + large = newwin(20, 60, 2, 10); + small = newwin(10, 30, 7, 25); + + /* test 1 - addch */ + fill(large, "LargeWindow"); + + refresh(); + wrefresh(large); + wrefresh(small); + + mvwaddstr(small, 5, 5, " Test <place to change> String "); + wrefresh(small); + getch(); + + touchwin(large); + wrefresh(large); + + mvwaddstr(small, 5, 5, " Test <***************> String "); + wrefresh(small); + + /* DIFFERENCE! */ + getch(); + + /* test 2: erase */ + erase(); + refresh(); + getch(); + + /* test 3: clrtoeol */ + werase(small); + wrefresh(small); + touchwin(large); + wrefresh(large); + wmove(small, 5, 0); + waddstr(small, " clrtoeol>"); + wclrtoeol(small); + wrefresh(small); + + /* DIFFERENCE! */ ; + getch(); + + /* test 4: clrtobot */ + werase(small); + wrefresh(small); + touchwin(large); + wrefresh(large); + wmove(small, 5, 3); + waddstr(small, " clrtobot>"); + wclrtobot(small); + wrefresh(small); + + /* DIFFERENCE! */ + getch(); + + endwin(); + + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/gdc.c b/contrib/ncurses/test/gdc.c index c215874..8b37b1e44 100644 --- a/contrib/ncurses/test/gdc.c +++ b/contrib/ncurses/test/gdc.c @@ -6,14 +6,12 @@ * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling * - * $Id: gdc.c,v 1.16 2001/02/24 23:27:22 tom Exp $ + * $Id: gdc.c,v 1.21 2002/03/23 22:17:24 tom Exp $ */ -#include <test.priv.h> - #include <time.h> -#include <signal.h> -#include <string.h> + +#include <test.priv.h> #define YBASE 10 #define XBASE 10 @@ -38,7 +36,7 @@ sighndl(int signo) sigtermed = signo; if (redirected) { endwin(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } } @@ -120,7 +118,7 @@ usage(void) unsigned j; for (j = 0; j < SIZEOF(msg); j++) fprintf(stderr, "%s\n", msg[j]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } int @@ -163,7 +161,7 @@ main(int argc, char *argv[]) if (name == 0 || newterm(name, ofp, ifp) == 0) { fprintf(stderr, "cannot open terminal\n"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } } else { @@ -304,7 +302,7 @@ main(int argc, char *argv[]) standend(); endwin(); fprintf(stderr, "gdc terminated by signal %d\n", sigtermed); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } /* FALLTHRU */ default: @@ -313,5 +311,5 @@ main(int argc, char *argv[]) } while (--count); standend(); endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/hanoi.c b/contrib/ncurses/test/hanoi.c index 0b032f8..ef09514 100644 --- a/contrib/ncurses/test/hanoi.c +++ b/contrib/ncurses/test/hanoi.c @@ -14,17 +14,15 @@ * * Date: 05.Nov.90 * - * $Id: hanoi.c,v 1.19 2000/09/02 18:51:16 tom Exp $ + * $Id: hanoi.c,v 1.23 2002/03/24 00:40:01 tom Exp $ */ #include <test.priv.h> -#include <string.h> - #define NPEGS 3 /* This is not configurable !! */ #define MINTILES 3 #define MAXTILES 9 -#define DEFAULTTILES 7 +#define DEFAULTTILES 7 #define TOPLINE 6 #define BASELINE 16 #define STATUSLINE (LINES-3) @@ -70,7 +68,7 @@ int main(int argc, char **argv) { int NTiles, FromCol, ToCol; - unsigned char AutoFlag = 0; + bool AutoFlag = 0; switch (argc) { case 1: @@ -80,24 +78,24 @@ main(int argc, char **argv) NTiles = atoi(argv[1]); if (NTiles > MAXTILES || NTiles < MINTILES) { fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 3: if (strcmp(argv[2], "a")) { Usage(); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } NTiles = atoi(argv[1]); if (NTiles > MAXTILES || NTiles < MINTILES) { fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } AutoFlag = TRUE; break; default: Usage(); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } #ifdef TRACE trace(TRACE_MAXIMUM); @@ -118,7 +116,7 @@ main(int argc, char **argv) if (LINES < 24) { endwin(); fprintf(stderr, "Min screen length 24 lines\n"); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } if (AutoFlag) { curs_set(0); @@ -154,7 +152,7 @@ main(int argc, char **argv) } } endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } static int @@ -295,7 +293,7 @@ Solved(int NumTiles) } static void -Usage() +Usage(void) { fprintf(stderr, "Usage: hanoi [<No Of Tiles>] [a]\n"); fprintf(stderr, diff --git a/contrib/ncurses/test/hashtest.c b/contrib/ncurses/test/hashtest.c index 682368d..9ddb07c 100644 --- a/contrib/ncurses/test/hashtest.c +++ b/contrib/ncurses/test/hashtest.c @@ -3,7 +3,7 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.17 2001/03/10 19:47:22 tom Exp $ + * $Id: hashtest.c,v 1.21 2002/03/23 22:17:24 tom Exp $ */ #ifdef TRACE @@ -14,11 +14,9 @@ #define USE_TRACE 0 #endif -#include <test.priv.h> - -#include <string.h> #include <ctype.h> -#include <signal.h> + +#include <test.priv.h> #define LO_CHAR ' ' #define HI_CHAR '~' @@ -43,7 +41,7 @@ static RETSIGTYPE finish(int sig GCC_UNUSED) { cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -154,7 +152,7 @@ usage(void) for (n = 0; n < SIZEOF(tbl); n++) fprintf(stderr, "%s\n", tbl[n]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } int @@ -223,6 +221,6 @@ main(int argc, char *argv[]) } cleanup(); /* we're done */ - return (EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } /* hashtest.c ends here */ diff --git a/contrib/ncurses/test/keynames.c b/contrib/ncurses/test/keynames.c index 88cadd2..c2056ec 100644 --- a/contrib/ncurses/test/keynames.c +++ b/contrib/ncurses/test/keynames.c @@ -1,14 +1,15 @@ /* - * $Id: keynames.c,v 1.2 1998/06/06 22:45:13 tom Exp $ + * $Id: keynames.c,v 1.3 2001/09/15 21:46:34 tom Exp $ */ #include <test.priv.h> -int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - int n; - for (n = -1; n < 512; n++) { - printf("%d(%5o):%s\n", n, n, keyname(n)); - } - return EXIT_SUCCESS; + int n; + for (n = -1; n < 512; n++) { + printf("%d(%5o):%s\n", n, n, keyname(n)); + } + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/knight.c b/contrib/ncurses/test/knight.c index b922371..469d25e 100644 --- a/contrib/ncurses/test/knight.c +++ b/contrib/ncurses/test/knight.c @@ -6,14 +6,12 @@ * Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.20 2000/10/29 00:51:51 tom Exp $ + * $Id: knight.c,v 1.24 2002/03/23 22:17:24 tom Exp $ */ -#include <test.priv.h> - #include <ctype.h> -#include <signal.h> -#include <string.h> + +#include <test.priv.h> /* board size */ #define BDEPTH 8 @@ -696,7 +694,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) play(); endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } /* knight.c ends here */ diff --git a/contrib/ncurses/test/lrtest.c b/contrib/ncurses/test/lrtest.c index f2fc9d2..a3b856a 100644 --- a/contrib/ncurses/test/lrtest.c +++ b/contrib/ncurses/test/lrtest.c @@ -7,11 +7,10 @@ * This can't be part of the ncurses test-program, because ncurses rips off the * bottom line to do labels. * - * $Id: lrtest.c,v 0.15 2000/12/31 02:09:42 tom Exp $ + * $Id: lrtest.c,v 0.17 2002/04/06 20:45:22 tom Exp $ */ #include <test.priv.h> -#include <term.h> typedef struct { int y, x, mode, dir, inc; @@ -139,7 +138,7 @@ main( curs_set(1); endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } /* lrtest.c ends here */ diff --git a/contrib/ncurses/test/ncurses.c b/contrib/ncurses/test/ncurses.c index 8bbf023..0782d40 100644 --- a/contrib/ncurses/test/ncurses.c +++ b/contrib/ncurses/test/ncurses.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 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 * @@ -38,18 +38,17 @@ DESCRIPTION AUTHOR Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993 + Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.143 2001/05/12 23:49:04 tom Exp $ +$Id: ncurses.c,v 1.170 2002/04/21 21:08:07 tom Exp $ ***************************************************************************/ -#include <test.priv.h> - #include <stdio.h> #include <ctype.h> -#include <string.h> #include <assert.h> -#include <signal.h> + +#include <test.priv.h> #if HAVE_LOCALE_H #include <locale.h> @@ -64,7 +63,7 @@ $Id: ncurses.c,v 1.143 2001/05/12 23:49:04 tom Exp $ #endif #endif -#if HAVE_PANEL_H +#if HAVE_PANEL_H && HAVE_LIBPANEL #define USE_LIBPANEL 1 #include <panel.h> #else @@ -92,34 +91,54 @@ static int save_trace = TRACE_ORDINARY | TRACE_CALLS; extern int _nc_tracing; #endif -#if !defined(HAVE_NAPMS) -#define HAVE_NAPMS 1 -#endif - #else #define mmask_t chtype /* not specified in XSI */ -#define attr_t chtype /* not specified in XSI */ -#define ACS_S3 (acs_map['p']) /* scan line 3 */ -#define ACS_S7 (acs_map['r']) /* scan line 7 */ -#define ACS_LEQUAL (acs_map['y']) /* less/equal */ -#define ACS_GEQUAL (acs_map['z']) /* greater/equal */ -#define ACS_PI (acs_map['{']) /* Pi */ -#define ACS_NEQUAL (acs_map['|']) /* not equal */ -#define ACS_STERLING (acs_map['}']) /* UK pound sign */ + +#ifdef CURSES_ACS_ARRAY +#define ACS_S3 (CURSES_ACS_ARRAY['p']) /* scan line 3 */ +#define ACS_S7 (CURSES_ACS_ARRAY['r']) /* scan line 7 */ +#define ACS_LEQUAL (CURSES_ACS_ARRAY['y']) /* less/equal */ +#define ACS_GEQUAL (CURSES_ACS_ARRAY['z']) /* greater/equal */ +#define ACS_PI (CURSES_ACS_ARRAY['{']) /* Pi */ +#define ACS_NEQUAL (CURSES_ACS_ARRAY['|']) /* not equal */ +#define ACS_STERLING (CURSES_ACS_ARRAY['}']) /* UK pound sign */ +#else +#define ACS_S3 (A_ALTCHARSET + 'p') /* scan line 3 */ +#define ACS_S7 (A_ALTCHARSET + 'r') /* scan line 7 */ +#define ACS_LEQUAL (A_ALTCHARSET + 'y') /* less/equal */ +#define ACS_GEQUAL (A_ALTCHARSET + 'z') /* greater/equal */ +#define ACS_PI (A_ALTCHARSET + '{') /* Pi */ +#define ACS_NEQUAL (A_ALTCHARSET + '|') /* not equal */ +#define ACS_STERLING (A_ALTCHARSET + '}') /* UK pound sign */ +#endif + +#ifdef CURSES_WACS_ARRAY +#define WACS_S3 (&(CURSES_WACS_ARRAY['p'])) /* scan line 3 */ +#define WACS_S7 (&(CURSES_WACS_ARRAY['r'])) /* scan line 7 */ +#define WACS_LEQUAL (&(CURSES_WACS_ARRAY['y'])) /* less/equal */ +#define WACS_GEQUAL (&(CURSES_WACS_ARRAY['z'])) /* greater/equal */ +#define WACS_PI (&(CURSES_WACS_ARRAY['{'])) /* Pi */ +#define WACS_NEQUAL (&(CURSES_WACS_ARRAY['|'])) /* not equal */ +#define WACS_STERLING (&(CURSES_WACS_ARRAY['}'])) /* UK pound sign */ +#endif #endif #define P(string) printw("%s\n", string) -#ifndef CTRL -#define CTRL(x) ((x) & 0x1f) +#ifdef CTRL +#undef CTRL #endif +#define CTRL(x) ((x) & 0x1f) #define QUIT CTRL('Q') #define ESCAPE CTRL('[') #define BLANK ' ' /* this is the background character */ +#undef max_colors static int max_colors; /* the actual number of colors we'll use */ + +#undef max_pairs static int max_pairs; /* ...and the number of color pairs */ /* The behavior of mvhline, mvvline for negative/zero length is unspecified, @@ -166,6 +185,33 @@ wGetchar(WINDOW *win) } #define Getchar() wGetchar(stdscr) +#if USE_WIDEC_SUPPORT +static int +wGet_wchar(WINDOW *win, wint_t * result) +{ + int c; +#ifdef TRACE + while ((c = wget_wch(win, result)) == CTRL('T')) { + if (_nc_tracing) { + save_trace = _nc_tracing; + _tracef("TOGGLE-TRACING OFF"); + _nc_tracing = 0; + } else { + _nc_tracing = save_trace; + } + trace(_nc_tracing); + if (_nc_tracing) + _tracef("TOGGLE-TRACING ON"); + } +#else + c = wget_wch(win, result); +#endif + return c; +} +#define Get_wchar(result) wGet_wchar(stdscr, result) + +#endif + static void Pause(void) { @@ -249,106 +295,380 @@ mouse_decode(MEVENT const *ep) ****************************************************************************/ static void -getch_test(void) -/* test the keypad feature */ +setup_getch(WINDOW *win, bool flags[]) +{ + keypad(win, flags['k']); /* should be redundant, but for testing */ + meta(win, flags['m']); /* force this to a known state */ + if (flags['e']) + echo(); + else + noecho(); +} + +static void +wgetch_help(WINDOW *win, bool flags[]) +{ + static const char *help[] = + { + "e -- toggle echo mode" + ,"g -- triggers a getstr test" + ,"k -- toggle keypad/literal mode" + ,"m -- toggle meta (7-bit/8-bit) mode" + ,"q -- quit (x also exits)" + ,"s -- shell out\n" + ,"w -- create a new window" +#ifdef SIGTSTP + ,"z -- suspend this process" +#endif + }; + int y, x; + unsigned chk = ((SIZEOF(help) + 1) / 2); + unsigned n; + + getyx(win, y, x); + move(0, 0); + printw("Type any key to see its %s value. Also:\n", + flags['k'] ? "keypad" : "literal"); + for (n = 0; n < SIZEOF(help); ++n) { + int row = 1 + (n % chk); + int col = (n >= chk) ? COLS / 2 : 0; + int flg = ((strstr(help[n], "toggle") != 0) + && (flags[UChar(*help[n])] != FALSE)); + if (flg) + standout(); + mvprintw(row, col, "%s", help[n]); + if (col == 0) + clrtoeol(); + if (flg) + standend(); + } + wrefresh(stdscr); + wmove(win, y, x); +} + +static void +wgetch_wrap(WINDOW *win, int first_y) +{ + int last_y = getmaxy(win) - 1; + int y = getcury(win) + 1; + + if (y >= last_y) + y = first_y; + wmove(win, y, 0); + wclrtoeol(win); +} + +static void +wgetch_test(WINDOW *win, int delay) { char buf[BUFSIZ]; + int first_y, first_x; + int last_y = getmaxy(win) - 1; int c; - int incount = 0, firsttime = 0; - bool blocking = TRUE; - int y; - - refresh(); + int incount = 0; + bool flags[256]; + bool blocking = (delay < 0); + int y, x; -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif + memset(flags, FALSE, sizeof(flags)); + flags['k'] = (win == stdscr); - (void) printw("Delay in 10ths of a second (<CR> for blocking input)? "); - echo(); - getstr(buf); - noecho(); - nonl(); + setup_getch(win, flags); + wtimeout(win, delay); + getyx(win, first_y, first_x); - if (isdigit(CharOf(buf[0]))) { - timeout(atoi(buf) * 100); - blocking = FALSE; - } + wgetch_help(win, flags); + wsetscrreg(win, first_y, last_y); + scrollok(win, TRUE); - c = '?'; - raw(); for (;;) { - if (firsttime++) { - printw("Key pressed: %04o ", c); + while ((c = wGetchar(win)) == ERR) { + incount++; + if (blocking) { + (void) wprintw(win, "%05d: input error", incount); + break; + } else { + (void) wprintw(win, "%05d: input timed out", incount); + } + wgetch_wrap(win, first_y); + } + if (c == ERR && blocking) { + wprintw(win, "ERR"); + wgetch_wrap(win, first_y); + } else if (c == 'x' || c == 'q') { + break; + } else if (c == 'e') { + flags['e'] = !flags['e']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'g') { + waddstr(win, "getstr test: "); + echo(); + wgetnstr(win, buf, sizeof(buf) - 1); + noecho(); + wprintw(win, "I saw %d characters:\n\t`%s'.", (int) strlen(buf), buf); + wclrtoeol(win); + wgetch_wrap(win, first_y); + } else if (c == 'k') { + flags['k'] = !flags['k']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'm') { + flags['m'] = !flags['m']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 's') { + ShellOut(TRUE); + } else if (c == 'w') { + int high = last_y - first_y + 1; + int wide = getmaxx(win) - first_x; + int old_y, old_x; + int new_y = first_y + getbegy(win); + int new_x = first_x + getbegx(win); + + getyx(win, old_y, old_x); + if (high > 2 && wide > 2) { + WINDOW *wb = newwin(high, wide, new_y, new_x); + WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); + + box(wb, 0, 0); + wrefresh(wb); + wmove(wi, 0, 0); + wgetch_test(wi, delay); + delwin(wi); + delwin(wb); + + wgetch_help(win, flags); + wmove(win, old_y, old_x); + touchwin(win); + wrefresh(win); + } +#ifdef SIGTSTP + } else if (c == 'z') { + kill(getpid(), SIGTSTP); +#endif + } else { + wprintw(win, "Key pressed: %04o ", c); #ifdef NCURSES_MOUSE_VERSION if (c == KEY_MOUSE) { MEVENT event; getmouse(&event); - printw("KEY_MOUSE, %s\n", mouse_decode(&event)); + wprintw(win, "KEY_MOUSE, %s", mouse_decode(&event)); + getyx(win, y, x); + move(event.y, event.x); + addch('*'); + wmove(win, y, x); } else #endif /* NCURSES_MOUSE_VERSION */ if (c >= KEY_MIN) { - (void) addstr(keyname(c)); - addch('\n'); + (void) waddstr(win, keyname(c)); } else if (c > 0x80) { int c2 = (c & 0x7f); if (isprint(c2)) - (void) printw("M-%c", c2); + (void) wprintw(win, "M-%c", c2); else - (void) printw("M-%s", unctrl(c2)); - addstr(" (high-half character)\n"); + (void) wprintw(win, "M-%s", unctrl(c2)); + waddstr(win, " (high-half character)"); } else { if (isprint(c)) - (void) printw("%c (ASCII printable character)\n", c); + (void) wprintw(win, "%c (ASCII printable character)", c); else - (void) printw("%s (ASCII control character)\n", unctrl(c)); + (void) wprintw(win, "%s (ASCII control character)", + unctrl(c)); } - y = getcury(stdscr); - if (y >= LINES - 1) - move(0, 0); - clrtoeol(); + wgetch_wrap(win, first_y); } + } - if (c == 'g') { - addstr("getstr test: "); - echo(); - getstr(buf); - noecho(); - printw("I saw `%s'.\n", buf); - } - if (c == 's') { - ShellOut(TRUE); - } - if (c == 'x' || c == 'q' || (c == ERR && blocking)) - break; - if (c == '?') { - addstr("Type any key to see its keypad value. Also:\n"); - addstr("g -- triggers a getstr test\n"); - addstr("s -- shell out\n"); - addstr("q -- quit\n"); - addstr("? -- repeats this help message\n"); - } + wtimeout(win, -1); +} - while ((c = Getchar()) == ERR) - if (!blocking) - (void) printw("%05d: input timed out\n", incount++); - else { - (void) printw("%05d: input error\n", incount++); - break; - } +static int +begin_getch_test(void) +{ + char buf[BUFSIZ]; + int delay; + + refresh(); + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + + (void) printw("Delay in 10ths of a second (<CR> for blocking input)? "); + echo(); + getnstr(buf, sizeof(buf) - 1); + noecho(); + nonl(); + + if (isdigit(UChar(buf[0]))) { + delay = atoi(buf) * 100; + } else { + delay = -1; } + raw(); + move(5, 0); + return delay; +} +static void +finish_getch_test(void) +{ #ifdef NCURSES_MOUSE_VERSION mousemask(0, (mmask_t *) 0); #endif - timeout(-1); erase(); noraw(); nl(); endwin(); } +static void +getch_test(void) +{ + int delay = begin_getch_test(); + wgetch_test(stdscr, delay); + finish_getch_test(); +} + +#if USE_WIDEC_SUPPORT +static void +wget_wch_test(WINDOW *win, int delay) +{ + char buf[BUFSIZ]; + int first_y, first_x; + int last_y = getmaxy(win) - 1; + wint_t c; + int incount = 0; + bool flags[256]; + bool blocking = (delay < 0); + int y, x, code; + + memset(flags, FALSE, sizeof(flags)); + flags['k'] = (win == stdscr); + + setup_getch(win, flags); + wtimeout(win, delay); + getyx(win, first_y, first_x); + + wgetch_help(win, flags); + wsetscrreg(win, first_y, last_y); + scrollok(win, TRUE); + + for (;;) { + while ((code = wGet_wchar(win, &c)) == ERR) { + incount++; + if (blocking) { + (void) wprintw(win, "%05d: input error", incount); + break; + } else { + (void) wprintw(win, "%05d: input timed out", incount); + } + wgetch_wrap(win, first_y); + } + if (code == ERR && blocking) { + wprintw(win, "ERR"); + wgetch_wrap(win, first_y); + } else if (c == 'x' || c == 'q') { + break; + } else if (c == 'e') { + flags['e'] = !flags['e']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'g') { + waddstr(win, "getstr test: "); + echo(); + wgetnstr(win, buf, sizeof(buf) - 1); + noecho(); + wprintw(win, "I saw %d characters:\n\t`%s'.", strlen(buf), buf); + wclrtoeol(win); + wgetch_wrap(win, first_y); + } else if (c == 'k') { + flags['k'] = !flags['k']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'm') { + flags['m'] = !flags['m']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 's') { + ShellOut(TRUE); + } else if (c == 'w') { + int high = last_y - first_y + 1; + int wide = getmaxx(win) - first_x; + int old_y, old_x; + int new_y = first_y + getbegy(win); + int new_x = first_x + getbegx(win); + + getyx(win, old_y, old_x); + if (high > 2 && wide > 2) { + WINDOW *wb = newwin(high, wide, new_y, new_x); + WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); + + box_set(wb, 0, 0); + wrefresh(wb); + wmove(wi, 0, 0); + wget_wch_test(wi, delay); + delwin(wi); + delwin(wb); + + wgetch_help(win, flags); + wmove(win, old_y, old_x); + touchwin(win); + wrefresh(win); + } +#ifdef SIGTSTP + } else if (c == 'z') { + kill(getpid(), SIGTSTP); +#endif + } else { + wprintw(win, "Key pressed: %04o ", c); +#ifdef NCURSES_MOUSE_VERSION + if (c == KEY_MOUSE) { + MEVENT event; + + getmouse(&event); + wprintw(win, "KEY_MOUSE, %s", mouse_decode(&event)); + getyx(win, y, x); + move(event.y, event.x); + addch('*'); + wmove(win, y, x); + } else +#endif /* NCURSES_MOUSE_VERSION */ + if (code == KEY_CODE_YES) { + (void) waddstr(win, key_name(c)); + } else { + if (c < 256 && iscntrl(c)) { + (void) wprintw(win, "%s (control character)", unctrl(c)); + } else { + wchar_t c2 = c; + waddnwstr(win, &c2, 1); + (void) wprintw(win, " = %#x (printable character)", c); + } + } + wgetch_wrap(win, first_y); + } + } + + wtimeout(win, -1); +} + +static void +get_wch_test(void) +{ + int delay = begin_getch_test(); + wget_wch_test(stdscr, delay); + finish_getch_test(); +} +#endif + +/**************************************************************************** + * + * Character attributes test + * + ****************************************************************************/ + static int show_attr(int row, int skip, chtype attr, const char *name) { @@ -379,8 +699,10 @@ show_attr(int row, int skip, chtype attr, const char *name) const char *s = string; while (*s) { int ch = *s++; - if ((ch = acs_map[ch]) == 0) +#ifdef CURSES_ACS_ARRAY + if ((ch = CURSES_ACS_ARRAY[ch]) == 0) ch = ' '; +#endif addch(ch); } } else { @@ -394,7 +716,7 @@ show_attr(int row, int skip, chtype attr, const char *name) if (!(termattrs() & attr)) { printw(" (N/A)"); } else if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) { - static const attr_t table[] = + static const chtype table[] = { A_STANDOUT, A_UNDERLINE, @@ -550,7 +872,7 @@ attr_test(void) * ****************************************************************************/ -static NCURSES_CONST char *color_names[] = +static NCURSES_CONST char *the_color_names[] = { "black", "red", @@ -576,7 +898,7 @@ show_color_name(int y, int x, int color) if (max_colors > 8) mvprintw(y, x, "%02d ", color); else - mvaddstr(y, x, color_names[color]); + mvaddstr(y, x, the_color_names[color]); } static void @@ -671,8 +993,8 @@ 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 < (int) SIZEOF(the_color_names) + ? the_color_names[i] : "")); attrset(COLOR_PAIR(i)); addstr(" "); attrset(A_NORMAL); @@ -949,6 +1271,27 @@ show_upper_chars(int first) } } +static void +show_box_chars(void) +{ + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the ACS Line-Drawing Set"); + attroff(A_BOLD); + refresh(); + box(stdscr, 0, 0); + /* *INDENT-OFF* */ + mvhline(LINES / 2, 0, ACS_HLINE, COLS); + mvvline(0, COLS / 2, ACS_VLINE, LINES); + mvaddch(0, COLS / 2, ACS_TTEE); + mvaddch(LINES / 2, COLS / 2, ACS_PLUS); + mvaddch(LINES - 1, COLS / 2, ACS_BTEE); + mvaddch(LINES / 2, 0, ACS_LTEE); + mvaddch(LINES / 2, COLS - 1, ACS_RTEE); + /* *INDENT-ON* */ + +} + static int show_1_acs(int n, const char *name, chtype code) { @@ -975,37 +1318,43 @@ show_acs_chars(void) refresh(); n = show_1_acs(0, BOTH(ACS_ULCORNER)); - n = show_1_acs(n, BOTH(ACS_LLCORNER)); n = show_1_acs(n, BOTH(ACS_URCORNER)); + n = show_1_acs(n, BOTH(ACS_LLCORNER)); n = show_1_acs(n, BOTH(ACS_LRCORNER)); - n = show_1_acs(n, BOTH(ACS_RTEE)); + n = show_1_acs(n, BOTH(ACS_LTEE)); - n = show_1_acs(n, BOTH(ACS_BTEE)); + n = show_1_acs(n, BOTH(ACS_RTEE)); n = show_1_acs(n, BOTH(ACS_TTEE)); + n = show_1_acs(n, BOTH(ACS_BTEE)); + n = show_1_acs(n, BOTH(ACS_HLINE)); n = show_1_acs(n, BOTH(ACS_VLINE)); - n = show_1_acs(n, BOTH(ACS_PLUS)); - n = show_1_acs(n, BOTH(ACS_S1)); - n = show_1_acs(n, BOTH(ACS_S9)); - n = show_1_acs(n, BOTH(ACS_DIAMOND)); - n = show_1_acs(n, BOTH(ACS_CKBOARD)); - n = show_1_acs(n, BOTH(ACS_DEGREE)); - n = show_1_acs(n, BOTH(ACS_PLMINUS)); - n = show_1_acs(n, BOTH(ACS_BULLET)); + n = show_1_acs(n, BOTH(ACS_LARROW)); n = show_1_acs(n, BOTH(ACS_RARROW)); - n = show_1_acs(n, BOTH(ACS_DARROW)); n = show_1_acs(n, BOTH(ACS_UARROW)); + n = show_1_acs(n, BOTH(ACS_DARROW)); + + n = show_1_acs(n, BOTH(ACS_BLOCK)); n = show_1_acs(n, BOTH(ACS_BOARD)); n = show_1_acs(n, BOTH(ACS_LANTERN)); - n = show_1_acs(n, BOTH(ACS_BLOCK)); - n = show_1_acs(n, BOTH(ACS_S3)); - n = show_1_acs(n, BOTH(ACS_S7)); - n = show_1_acs(n, BOTH(ACS_LEQUAL)); + n = show_1_acs(n, BOTH(ACS_BULLET)); + n = show_1_acs(n, BOTH(ACS_CKBOARD)); + n = show_1_acs(n, BOTH(ACS_DEGREE)); + n = show_1_acs(n, BOTH(ACS_DIAMOND)); + n = show_1_acs(n, BOTH(ACS_PLMINUS)); + n = show_1_acs(n, BOTH(ACS_PLUS)); + n = show_1_acs(n, BOTH(ACS_GEQUAL)); - n = show_1_acs(n, BOTH(ACS_PI)); n = show_1_acs(n, BOTH(ACS_NEQUAL)); + n = show_1_acs(n, BOTH(ACS_LEQUAL)); + n = show_1_acs(n, BOTH(ACS_STERLING)); + n = show_1_acs(n, BOTH(ACS_PI)); + n = show_1_acs(n, BOTH(ACS_S1)); + n = show_1_acs(n, BOTH(ACS_S3)); + n = show_1_acs(n, BOTH(ACS_S7)); + n = show_1_acs(n, BOTH(ACS_S9)); } static void @@ -1018,6 +1367,9 @@ acs_display(void) case 'a': show_acs_chars(); break; + case 'b': + show_box_chars(); + break; case '0': case '1': case '2': @@ -1028,7 +1380,216 @@ acs_display(void) mvprintw(LINES - 3, 0, "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, b=box, 0=C1, 1,2,3=GR characters, q=quit"); + refresh(); + } while ((c = Getchar()) != 'x' && c != 'q'); + + Pause(); + erase(); + endwin(); +} + +#if USE_WIDEC_SUPPORT +static void +show_upper_widechars(int first) +{ + cchar_t temp; + wchar_t code; + int last = first + 31; + + erase(); + attron(A_BOLD); + mvprintw(0, 20, "Display of Character Codes %d to %d", first, last); + attroff(A_BOLD); + refresh(); + + for (code = first; code <= last; code++) { + int row = 4 + ((code - first) % 16); + int col = ((code - first) / 16) * COLS / 2; + attr_t attrs = A_NORMAL; + char tmp[80]; + sprintf(tmp, "%3d (0x%x)", code, code); + mvprintw(row, col, "%*s: ", COLS / 4, tmp); + setcchar(&temp, &code, attrs, 0, 0); + echo_wchar(&temp); + } +} + +static int +show_1_wacs(int n, const char *name, const cchar_t * code) +{ + const int height = 16; + int row = 4 + (n % height); + int col = (n / height) * COLS / 2; + mvprintw(row, col, "%*s : ", COLS / 4, name); + add_wchnstr(code, 1); + return n + 1; +} + +static void +show_wacs_chars(void) +/* display the wide-ACS character set */ +{ + int n; + +/*#define BOTH2(name) #name, &(name) */ +#define BOTH2(name) #name, name + + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + + n = show_1_wacs(0, BOTH2(WACS_ULCORNER)); + n = show_1_wacs(n, BOTH2(WACS_URCORNER)); + n = show_1_wacs(n, BOTH2(WACS_LLCORNER)); + n = show_1_wacs(n, BOTH2(WACS_LRCORNER)); + + n = show_1_wacs(n, BOTH2(WACS_LTEE)); + n = show_1_wacs(n, BOTH2(WACS_RTEE)); + n = show_1_wacs(n, BOTH2(WACS_TTEE)); + n = show_1_wacs(n, BOTH2(WACS_BTEE)); + + n = show_1_wacs(n, BOTH2(WACS_HLINE)); + n = show_1_wacs(n, BOTH2(WACS_VLINE)); + + n = show_1_wacs(n, BOTH2(WACS_LARROW)); + n = show_1_wacs(n, BOTH2(WACS_RARROW)); + n = show_1_wacs(n, BOTH2(WACS_UARROW)); + n = show_1_wacs(n, BOTH2(WACS_DARROW)); + + n = show_1_wacs(n, BOTH2(WACS_BLOCK)); + n = show_1_wacs(n, BOTH2(WACS_BOARD)); + n = show_1_wacs(n, BOTH2(WACS_LANTERN)); + n = show_1_wacs(n, BOTH2(WACS_BULLET)); + n = show_1_wacs(n, BOTH2(WACS_CKBOARD)); + n = show_1_wacs(n, BOTH2(WACS_DEGREE)); + n = show_1_wacs(n, BOTH2(WACS_DIAMOND)); + n = show_1_wacs(n, BOTH2(WACS_PLMINUS)); + n = show_1_wacs(n, BOTH2(WACS_PLUS)); + +#ifdef CURSES_WACS_ARRAY + n = show_1_wacs(n, BOTH2(WACS_GEQUAL)); + n = show_1_wacs(n, BOTH2(WACS_NEQUAL)); + n = show_1_wacs(n, BOTH2(WACS_LEQUAL)); + + n = show_1_wacs(n, BOTH2(WACS_STERLING)); + n = show_1_wacs(n, BOTH2(WACS_PI)); + n = show_1_wacs(n, BOTH2(WACS_S1)); + n = show_1_wacs(n, BOTH2(WACS_S3)); + n = show_1_wacs(n, BOTH2(WACS_S7)); + n = show_1_wacs(n, BOTH2(WACS_S9)); +#endif +} + +static void +show_wbox_chars(void) +{ + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the Wide-ACS Line-Drawing Set"); + attroff(A_BOLD); + refresh(); + box_set(stdscr, 0, 0); + /* *INDENT-OFF* */ + mvhline_set(LINES / 2, 0, WACS_HLINE, COLS); + mvvline_set(0, COLS / 2, WACS_VLINE, LINES); + mvadd_wch(0, COLS / 2, WACS_TTEE); + mvadd_wch(LINES / 2, COLS / 2, WACS_PLUS); + mvadd_wch(LINES - 1, COLS / 2, WACS_BTEE); + mvadd_wch(LINES / 2, 0, WACS_LTEE); + mvadd_wch(LINES / 2, COLS - 1, WACS_RTEE); + /* *INDENT-ON* */ + +} + +static int +show_2_wacs(int n, const char *name, char *code) +{ + const int height = 16; + int row = 4 + (n % height); + int col = (n / height) * COLS / 2; + mvprintw(row, col, "%*s : ", COLS / 4, name); + addstr(code); + return n + 1; +} + +static void +show_utf8_chars(void) +/* display the wide-ACS character set */ +{ + int n; + + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + /* *INDENT-OFF* */ + n = show_2_wacs(0, "WACS_ULCORNER", "\342\224\214"); + n = show_2_wacs(n, "WACS_URCORNER", "\342\224\220"); + n = show_2_wacs(n, "WACS_LLCORNER", "\342\224\224"); + n = show_2_wacs(n, "WACS_LRCORNER", "\342\224\230"); + + n = show_2_wacs(n, "WACS_LTEE", "\342\224\234"); + n = show_2_wacs(n, "WACS_RTEE", "\342\224\244"); + n = show_2_wacs(n, "WACS_TTEE", "\342\224\254"); + n = show_2_wacs(n, "WACS_BTEE", "\342\224\264"); + + n = show_2_wacs(n, "WACS_HLINE", "\342\224\200"); + n = show_2_wacs(n, "WACS_VLINE", "\342\224\202"); + + n = show_2_wacs(n, "WACS_LARROW", "\342\206\220"); + n = show_2_wacs(n, "WACS_RARROW", "\342\206\222"); + n = show_2_wacs(n, "WACS_UARROW", "\342\206\221"); + n = show_2_wacs(n, "WACS_DARROW", "\342\206\223"); + + n = show_2_wacs(n, "WACS_STERLING", "\302\243"); + + n = show_2_wacs(n, "WACS_BLOCK", "\342\226\256"); + n = show_2_wacs(n, "WACS_BOARD", "\342\226\222"); + n = show_2_wacs(n, "WACS_LANTERN", "\342\230\203"); + n = show_2_wacs(n, "WACS_BULLET", "\302\267"); + n = show_2_wacs(n, "WACS_CKBOARD", "\342\226\222"); + n = show_2_wacs(n, "WACS_DEGREE", "\302\260"); + n = show_2_wacs(n, "WACS_DIAMOND", "\342\227\206"); + n = show_2_wacs(n, "WACS_GEQUAL", "\342\211\245"); + n = show_2_wacs(n, "WACS_NEQUAL", "\342\211\240"); + n = show_2_wacs(n, "WACS_LEQUAL", "\342\211\244"); + n = show_2_wacs(n, "WACS_PLMINUS", "\302\261"); + n = show_2_wacs(n, "WACS_PLUS", "\342\224\274"); + n = show_2_wacs(n, "WACS_PI", "\317\200"); + n = show_2_wacs(n, "WACS_S1", "\342\216\272"); + n = show_2_wacs(n, "WACS_S3", "\342\216\273"); + n = show_2_wacs(n, "WACS_S7", "\342\216\274"); + n = show_2_wacs(n, "WACS_S9", "\342\216\275"); + /* *INDENT-OFF* */ +} + +static void +wide_acs_display(void) +{ + int c = 'a'; + + do { + switch (c) { + case 'a': + show_wacs_chars(); + break; + case 'b': + show_wbox_chars(); + break; + case 'u': + show_utf8_chars(); + break; + default: + if (isdigit(c)) + show_upper_widechars((c - '0') * 32 + 128); + break; + } + mvprintw(LINES - 2, 0, + "Select: a WACS, b box, u UTF-8, 0-9 non-ASCII characters, q=quit"); refresh(); } while ((c = Getchar()) != 'x' && c != 'q'); @@ -1037,6 +1598,8 @@ acs_display(void) endwin(); } +#endif + /* * Graphic-rendition test (adapted from vttest) */ @@ -1138,21 +1701,30 @@ FRAME WINDOW *wind; }; +#ifdef NCURSES_VERSION +#define keypad_active(win) (win)->_use_keypad +#define scroll_active(win) (win)->_scroll +#else +#define keypad_active(win) FALSE +#define scroll_active(win) FALSE +#endif + /* We need to know if these flags are actually set, so don't look in FRAME. - * These names are known to work with SVr4 curses as well as ncurses. + * These names are known to work with SVr4 curses as well as ncurses. The + * _use_keypad name does not work with Solaris 8. */ static bool HaveKeypad(FRAME * curp) { WINDOW *win = (curp ? curp->wind : stdscr); - return win->_use_keypad; + return keypad_active(win); } static bool HaveScroll(FRAME * curp) { WINDOW *win = (curp ? curp->wind : stdscr); - return win->_scroll; + return scroll_active(win); } static void @@ -1628,7 +2200,7 @@ acs_and_scroll(void) wrefresh(usescr); } while ((c = wGetchar(usescr)) != QUIT - && !((c == ESCAPE) && (usescr->_use_keypad)) + && !((c == ESCAPE) && (keypad_active(usescr))) && (c != ERR)); breakout: @@ -3260,6 +3832,12 @@ do_single_test(const char c) getch_test(); break; +#if USE_WIDEC_SUPPORT + case 'A': + get_wch_test(); + break; +#endif + case 'b': attr_test(); break; @@ -3288,6 +3866,12 @@ do_single_test(const char c) acs_display(); break; +#if USE_WIDEC_SUPPORT + case 'F': + wide_acs_display(); + break; +#endif + #if USE_LIBPANEL case 'o': demo_panels(); @@ -3367,7 +3951,7 @@ usage(void) size_t n; for (n = 0; n < SIZEOF(tbl); n++) fprintf(stderr, "%s\n", tbl[n]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -3390,23 +3974,23 @@ announce_sig(int sig) #endif static int -rip_footer(WINDOW *win, int columns) +rip_footer(WINDOW *win, int cols) { wbkgd(win, A_REVERSE); werase(win); wmove(win, 0, 0); - wprintw(win, "footer: %d columns", columns); + wprintw(win, "footer: %d columns", cols); wnoutrefresh(win); return OK; } static int -rip_header(WINDOW *win, int columns) +rip_header(WINDOW *win, int cols) { wbkgd(win, A_REVERSE); werase(win); wmove(win, 0, 0); - wprintw(win, "header: %d columns", columns); + wprintw(win, "header: %d columns", cols); wnoutrefresh(win); return OK; } @@ -3505,12 +4089,14 @@ main(int argc, char *argv[]) start_color(); #ifdef NCURSES_VERSION_PATCH max_colors = COLORS > 16 ? 16 : COLORS; +#if HAVE_USE_DEFAULT_COLORS if (default_colors) use_default_colors(); #if NCURSES_VERSION_PATCH >= 20000708 else if (assumed_colors) assume_default_colors(default_fg, default_bg); #endif +#endif #else /* normal SVr4 curses */ max_colors = COLORS > 8 ? 8 : COLORS; #endif @@ -3541,11 +4127,17 @@ main(int argc, char *argv[]) do { (void) puts("This is the ncurses main menu"); (void) puts("a = keyboard and mouse input test"); +#if USE_WIDEC_SUPPORT + (void) puts("A = wide-character keyboard and mouse input test"); +#endif (void) puts("b = character attribute test"); (void) puts("c = color test pattern"); (void) puts("d = edit RGB color values"); (void) puts("e = exercise soft keys"); (void) puts("f = display ACS characters"); +#if USE_WIDEC_SUPPORT + (void) puts("F = display Wide-ACS characters"); +#endif (void) puts("g = display windows and scrolling"); (void) puts("i = test of flushinp()"); (void) puts("k = display character attributes"); @@ -3581,7 +4173,7 @@ main(int argc, char *argv[]) if (command == 0) command = 'q'; break; - } else if (command == 0 && !isspace(CharOf(ch))) { + } else if (command == 0 && !isspace(UChar(ch))) { command = ch; } else if (ch == '\n' || ch == '\r') { if (command != 0) diff --git a/contrib/ncurses/test/newdemo.c b/contrib/ncurses/test/newdemo.c index c0042e2..f10a2d6 100644 --- a/contrib/ncurses/test/newdemo.c +++ b/contrib/ncurses/test/newdemo.c @@ -2,14 +2,12 @@ * newdemo.c - A demo program using PDCurses. The program illustrate * the use of colours for text output. * - * $Id: newdemo.c,v 1.18 2001/03/10 22:27:17 tom Exp $ + * $Id: newdemo.c,v 1.23 2002/03/23 22:17:24 tom Exp $ */ -#include <test.priv.h> - -#include <signal.h> #include <time.h> -#include <string.h> + +#include <test.priv.h> #define delay_output(x) napms(x) @@ -55,7 +53,7 @@ static RETSIGTYPE trap(int sig GCC_UNUSED) { endwin(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } /* @@ -236,7 +234,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); if (win == NULL) { endwin(); - return 1; + ExitProgram(EXIT_FAILURE); } while (1) { @@ -354,5 +352,5 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) break; } endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/railroad.c b/contrib/ncurses/test/railroad.c index 6d5cd25..fd773c8 100644 --- a/contrib/ncurses/test/railroad.c +++ b/contrib/ncurses/test/railroad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000 Free Software Foundation, Inc. * + * Copyright (c) 2000-2001,2002 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,15 +29,13 @@ /* * Author: Thomas E. Dickey <dickey@clark.net> 2000 * - * $Id: railroad.c,v 1.5 2001/03/24 22:01:42 tom Exp $ + * $Id: railroad.c,v 1.10 2002/04/06 20:45:22 tom Exp $ * * A simple demo of the termcap interface. */ #include <test.priv.h> -#include <termcap.h> #include <ctype.h> -#include <signal.h> static char *wipeit; static char *moveit; @@ -119,36 +117,38 @@ ShowSign(char *string) while (*string != 0) { ch = *string; - 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(' '); + if (ch != ' ') { + 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); } - tputs(tgoto(moveit, first, height - 1), 1, outc); - PutChar(ch); - } - } else { - 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++; + 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(); } - if (moveit != 0) - Backup(); StandOut(1); PutChar(ch); StandOut(0); @@ -173,7 +173,7 @@ onsig(int n GCC_UNUSED) { interrupted = TRUE; cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -238,5 +238,5 @@ main(int argc, char *argv[]) {world, 0}; railroad(hello); } - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/rain.c b/contrib/ncurses/test/rain.c index a7771b0..46fa80a5 100644 --- a/contrib/ncurses/test/rain.c +++ b/contrib/ncurses/test/rain.c @@ -1,22 +1,22 @@ /* - * $Id: rain.c,v 1.15 2000/09/02 18:41:22 tom Exp $ + * $Id: rain.c,v 1.19 2002/04/06 20:45:22 tom Exp $ */ #include <test.priv.h> -#include <term.h> /* for tparm() */ - -#include <signal.h> - /* rain 11/3/1980 EPS/CITHEP */ static float ranf(void); static void onsig(int sig); -static int next_j(int j) +static int +next_j(int j) { - if (j==0) j=4; else --j; + if (j == 0) + j = 4; + else + --j; if (has_colors()) { - int z = (int)(3*ranf()); + int z = (int) (3 * ranf()); chtype color = COLOR_PAIR(z); if (z) color |= A_BOLD; @@ -28,15 +28,16 @@ static int next_j(int j) int main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { -int x, y, j; -static int xpos[5], ypos[5]; -float r; -float c; + int x, y, j; + static int xpos[5], ypos[5]; + float r; + float c; - for (j=SIGHUP;j<=SIGTERM;j++) - if (signal(j,SIG_IGN)!=SIG_IGN) signal(j,onsig); + for (j = SIGHUP; j <= SIGTERM; j++) + if (signal(j, SIG_IGN) != SIG_IGN) + signal(j, onsig); initscr(); if (has_colors()) { @@ -44,7 +45,7 @@ float c; start_color(); #if HAVE_USE_DEFAULT_COLORS if (use_default_colors() == OK) - bg = -1; + bg = -1; #endif init_pair(1, COLOR_BLUE, bg); init_pair(2, COLOR_CYAN, bg); @@ -54,18 +55,18 @@ float c; curs_set(0); timeout(0); - r = (float)(LINES - 4); - c = (float)(COLS - 4); - for (j=5;--j>=0;) { - xpos[j]=(int)(c* ranf())+2; - ypos[j]=(int)(r* ranf())+2; + r = (float) (LINES - 4); + c = (float) (COLS - 4); + for (j = 5; --j >= 0;) { + xpos[j] = (int) (c * ranf()) + 2; + ypos[j] = (int) (r * ranf()) + 2; } - for (j=0;;) { - x=(int)(c*ranf())+2; - y=(int)(r*ranf())+2; + for (j = 0;;) { + x = (int) (c * ranf()) + 2; + y = (int) (r * ranf()) + 2; - mvaddch(y,x, '.'); + mvaddch(y, x, '.'); mvaddch(ypos[j], xpos[j], 'o'); @@ -73,33 +74,33 @@ float c; mvaddch(ypos[j], xpos[j], 'O'); j = next_j(j); - mvaddch( ypos[j]-1, xpos[j], '-'); - mvaddstr(ypos[j], xpos[j]-1, "|.|"); - mvaddch( ypos[j]+1, xpos[j], '-'); + mvaddch(ypos[j] - 1, xpos[j], '-'); + mvaddstr(ypos[j], xpos[j] - 1, "|.|"); + mvaddch(ypos[j] + 1, xpos[j], '-'); j = next_j(j); - mvaddch( ypos[j]-2, xpos[j], '-'); - mvaddstr(ypos[j]-1, xpos[j]-1, "/ \\"); - mvaddstr(ypos[j], xpos[j]-2, "| O |"); - mvaddstr(ypos[j]+1, xpos[j]-1, "\\ /"); - mvaddch( ypos[j]+2, xpos[j], '-'); + mvaddch(ypos[j] - 2, xpos[j], '-'); + mvaddstr(ypos[j] - 1, xpos[j] - 1, "/ \\"); + mvaddstr(ypos[j], xpos[j] - 2, "| O |"); + mvaddstr(ypos[j] + 1, xpos[j] - 1, "\\ /"); + mvaddch(ypos[j] + 2, xpos[j], '-'); j = next_j(j); - mvaddch( ypos[j]-2, xpos[j], ' '); - mvaddstr(ypos[j]-1, xpos[j]-1, " "); - mvaddstr(ypos[j], xpos[j]-2, " "); - mvaddstr(ypos[j]+1, xpos[j]-1, " "); - mvaddch( ypos[j]+2, xpos[j], ' '); - - xpos[j] = x; ypos[j] = y; - - switch(getch()) - { - case('q'): - case('Q'): + mvaddch(ypos[j] - 2, xpos[j], ' '); + mvaddstr(ypos[j] - 1, xpos[j] - 1, " "); + mvaddstr(ypos[j], xpos[j] - 2, " "); + mvaddstr(ypos[j] + 1, xpos[j] - 1, " "); + mvaddch(ypos[j] + 2, xpos[j], ' '); + + xpos[j] = x; + ypos[j] = y; + + switch (getch()) { + case ('q'): + case ('Q'): curs_set(1); endwin(); - return(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); case 's': nodelay(stdscr, FALSE); break; @@ -107,9 +108,9 @@ float c; nodelay(stdscr, TRUE); break; #ifdef KEY_RESIZE - case(KEY_RESIZE): - r = (float)(LINES - 4); - c = (float)(COLS - 4); + case (KEY_RESIZE): + r = (float) (LINES - 4); + c = (float) (COLS - 4); break; #endif } @@ -122,7 +123,7 @@ onsig(int n GCC_UNUSED) { curs_set(1); endwin(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float diff --git a/contrib/ncurses/test/tclock.c b/contrib/ncurses/test/tclock.c index 319b0d4..6661b83 100644 --- a/contrib/ncurses/test/tclock.c +++ b/contrib/ncurses/test/tclock.c @@ -1,7 +1,17 @@ #include "test.priv.h" #include <math.h> -#include <time.h> + +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif /* tclock - analog/digital clock for curses. @@ -103,9 +113,7 @@ dline(int pair, int from_x, int from_y, int x2, int y2, char ch) } int -main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { int i, cx, cy; double cr, mradius, hradius, mangle, hangle; @@ -119,6 +127,10 @@ main( struct tm *t; char szChar[10]; int my_bg = COLOR_BLACK; +#if HAVE_GETTIMEOFDAY + struct timeval current; + double fraction = 0.0; +#endif initscr(); noecho(); @@ -172,7 +184,7 @@ main( if (hours > 12.0) hours -= 12.0; - mangle = ((t->tm_min) * (2 * PI) / 60.0); + mangle = ((t->tm_min + (t->tm_sec / 60.0)) * (2 * PI) / 60.0); mdx = A2X(mangle, mradius); mdy = A2Y(mangle, mradius); @@ -180,7 +192,11 @@ main( hdx = A2X(hangle, hradius); hdy = A2Y(hangle, hradius); - sangle = ((t->tm_sec) * (2.0 * PI) / 60.0); +#if HAVE_GETTIMEOFDAY + gettimeofday(¤t, 0); + fraction = (current.tv_usec / 1.0e6); +#endif + sangle = ((t->tm_sec + fraction) * (2.0 * PI) / 60.0); sdx = A2X(sangle, sradius); sdy = A2Y(sangle, sradius); @@ -193,7 +209,7 @@ main( if (has_colors()) attrset(COLOR_PAIR(1)); - plot(cx + sdx, cy - sdy, 'O'); + dline(1, cx, cy, cx + sdx, cy - sdy, 'O'); if (has_colors()) attrset(COLOR_PAIR(0)); @@ -218,13 +234,13 @@ main( break; } - plot(cx + sdx, cy - sdy, ' '); dline(0, cx, cy, cx + hdx, cy - hdy, ' '); dline(0, cx, cy, cx + mdx, cy - mdy, ' '); + dline(0, cx, cy, cx + sdx, cy - sdy, ' '); } curs_set(1); endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/test.priv.h b/contrib/ncurses/test/test.priv.h index f5ecf02..05973d9 100644 --- a/contrib/ncurses/test/test.priv.h +++ b/contrib/ncurses/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey <dickey@clark.net> 1996 * ****************************************************************************/ -/* $Id: test.priv.h,v 1.20 2000/11/04 22:56:50 tom Exp $ */ +/* $Id: test.priv.h,v 1.34 2002/04/06 23:32:15 tom Exp $ */ #if HAVE_CONFIG_H #include <ncurses_cfg.h> @@ -40,14 +40,50 @@ #define HAVE_WRESIZE 0 #endif -#ifndef HAVE_NC_ALLOC_H -#define HAVE_NC_ALLOC_H 0 +#ifndef HAVE_CURSES_VERSION +#define HAVE_CURSES_VERSION 0 +#endif + +#ifndef HAVE_FORM_H +#define HAVE_FORM_H 0 +#endif + +#ifndef HAVE_LIBFORM +#define HAVE_LIBFORM 0 +#endif + +#ifndef HAVE_LIBMENU +#define HAVE_LIBMENU 0 +#endif + +#ifndef HAVE_LIBPANEL +#define HAVE_LIBPANEL 0 #endif #ifndef HAVE_LOCALE_H #define HAVE_LOCALE_H 0 #endif +#ifndef HAVE_MENU_H +#define HAVE_MENU_H 0 +#endif + +#ifndef HAVE_NAPMS +#define HAVE_NAPMS 1 +#endif + +#ifndef HAVE_NC_ALLOC_H +#define HAVE_NC_ALLOC_H 0 +#endif + +#ifndef HAVE_PANEL_H +#define HAVE_PANEL_H 0 +#endif + +#ifndef HAVE_WRESIZE +#define HAVE_WRESIZE 0 +#endif + #ifndef NCURSES_NOMACROS #define NCURSES_NOMACROS 0 #endif @@ -64,7 +100,10 @@ #include <unistd.h> #endif +#include <signal.h> /* include before curses.h to work around glibc bug */ + #include <curses.h> +#include <term.h> #if NCURSES_NOMACROS #include <nomacros.h> @@ -87,19 +126,74 @@ extern int optind; #define GCC_UNUSED /* nothing */ #endif -#define CharOf(c) ((unsigned char)(c)) +#ifndef HAVE_GETNSTR +#define getnstr(s,n) getstr(s) +#endif + +#ifndef USE_WIDEC_SUPPORT +#if defined(_XOPEN_SOURCE_EXTENDED) && defined(WACS_ULCORNER) +#define USE_WIDEC_SUPPORT 1 +#else +#define USE_WIDEC_SUPPORT 0 +#endif +#endif + +#ifndef HAVE_TYPE_ATTR_T +#if !USE_WIDEC_SUPPORT +#define attr_t long +#endif +#endif + +#ifndef NCURSES_CH_T +#if !USE_WIDEC_SUPPORT +#define NCURSES_CH_T chtype +#else +#define NCURSES_CH_T cchar_t +#endif +#endif + +#ifndef CCHARW_MAX +#define CCHARW_MAX 5 +#endif + +#ifndef KEY_MIN +#define KEY_MIN 256 /* not defined in Solaris 8 */ +#endif + +#ifndef getcurx +#define getcurx(win) ((win)?(win)->_curx:ERR) +#define getcury(win) ((win)?(win)->_cury:ERR) +#endif + +#ifndef getbegx +#define getbegx(win) ((win)?(win)->_begx:ERR) +#define getbegy(win) ((win)?(win)->_begy:ERR) +#endif + +#ifndef getmaxx +#define getmaxx(win) ((win)?((win)->_maxx + 1):ERR) +#define getmaxy(win) ((win)?((win)->_maxy + 1):ERR) +#endif + +/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list + * (which is incompatible with legacy usage, doesn't solve any problems). + */ +#define tparm3(a,b,c) tparm(a,b,c,0,0,0,0,0,0,0) +#define tparm2(a,b) tparm(a,b,0,0,0,0,0,0,0,0) + +#define UChar(c) ((unsigned char)(c)) #define SIZEOF(table) (sizeof(table)/sizeof(table[0])) #if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H #include <nc_alloc.h> #else -#define typeMalloc(type,n) (type *) malloc(n * sizeof(type)) -#define typeRealloc(type,n,p) (type *) realloc(p, n * sizeof(type)) +#define typeMalloc(type,n) (type *) malloc((n) * sizeof(type)) +#define typeRealloc(type,n,p) (type *) realloc(p, (n) * sizeof(type)) #endif #ifndef ExitProgram -#define ExitProgram(code) return code +#define ExitProgram(code) exit(code) #endif #ifndef EXIT_SUCCESS diff --git a/contrib/ncurses/test/testaddch.c b/contrib/ncurses/test/testaddch.c index 444da0a..311eb81 100644 --- a/contrib/ncurses/test/testaddch.c +++ b/contrib/ncurses/test/testaddch.c @@ -2,59 +2,58 @@ * This is an example written by Alexander V. Lukyanov <lav@yars.free.net>, * to demonstrate an inconsistency between ncurses and SVr4 curses. * - * $Id: testaddch.c,v 1.3 1997/10/18 21:35:15 tom Exp $ + * $Id: testaddch.c,v 1.4 2001/09/15 21:46:34 tom Exp $ */ #include <test.priv.h> -static void attr_addstr(const char *s, chtype a) +static void +attr_addstr(const char *s, chtype a) { - while(*s) - addch(((unsigned char)(*s++))|a); + while (*s) + addch(((unsigned char) (*s++)) | a); } int main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { - unsigned i; - chtype back,set,attr; - - initscr(); - start_color(); - init_pair(1,COLOR_WHITE,COLOR_BLUE); - init_pair(2,COLOR_WHITE,COLOR_RED); - init_pair(3,COLOR_BLACK,COLOR_MAGENTA); - init_pair(4,COLOR_BLACK,COLOR_GREEN); - init_pair(5,COLOR_BLACK,COLOR_CYAN); - init_pair(6,COLOR_BLACK,COLOR_YELLOW); - init_pair(7,COLOR_BLACK,COLOR_WHITE); - - for(i=0; i<8; i++) - { - back = (i&1) ? A_BOLD|'B' : ' '; - set = (i&2) ? A_REVERSE : 0; - attr = (i&4) ? COLOR_PAIR(4) : 0; - - bkgdset(back); - attrset(set); - - attr_addstr("Test string with spaces -> <-\n",attr); - } - addch('\n'); - for(i=0; i<8; i++) - { - back = (i&1) ? A_BOLD|'B'|COLOR_PAIR(1) : ' '; - set = (i&2) ? A_REVERSE|COLOR_PAIR(2) : 0; - attr = (i&4) ? COLOR_PAIR(4) : 0; - - bkgdset(back); - attrset(set); - - attr_addstr("Test string with spaces -> <-\n",attr); - } - - getch(); - endwin(); - return EXIT_SUCCESS; + unsigned i; + chtype back, set, attr; + + initscr(); + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + init_pair(2, COLOR_WHITE, COLOR_RED); + init_pair(3, COLOR_BLACK, COLOR_MAGENTA); + init_pair(4, COLOR_BLACK, COLOR_GREEN); + init_pair(5, COLOR_BLACK, COLOR_CYAN); + init_pair(6, COLOR_BLACK, COLOR_YELLOW); + init_pair(7, COLOR_BLACK, COLOR_WHITE); + + for (i = 0; i < 8; i++) { + back = (i & 1) ? A_BOLD | 'B' : ' '; + set = (i & 2) ? A_REVERSE : 0; + attr = (i & 4) ? COLOR_PAIR(4) : 0; + + bkgdset(back); + attrset(set); + + attr_addstr("Test string with spaces -> <-\n", attr); + } + addch('\n'); + for (i = 0; i < 8; i++) { + back = (i & 1) ? A_BOLD | 'B' | COLOR_PAIR(1) : ' '; + set = (i & 2) ? A_REVERSE | COLOR_PAIR(2) : 0; + attr = (i & 4) ? COLOR_PAIR(4) : 0; + + bkgdset(back); + attrset(set); + + attr_addstr("Test string with spaces -> <-\n", attr); + } + + getch(); + endwin(); + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/testcurs.c b/contrib/ncurses/test/testcurs.c index efcd39fa..b08c766 100644 --- a/contrib/ncurses/test/testcurs.c +++ b/contrib/ncurses/test/testcurs.c @@ -7,7 +7,7 @@ * wrs(5/28/93) -- modified to be consistent (perform identically) with either * PDCurses or under Unix System V, R4 * - * $Id: testcurs.c,v 1.24 2001/02/24 22:13:23 tom Exp $ + * $Id: testcurs.c,v 1.28 2002/02/03 00:29:22 tom Exp $ */ #include <test.priv.h> @@ -36,7 +36,7 @@ typedef struct commands COMMAND; const COMMAND command[] = { - {"Intro Test", introTest}, + {"General Test", introTest}, {"Pad Test", padTest}, #if defined(PDCURSES) && !defined(XCURSES) {"Resize Test", resizeTest}, @@ -51,22 +51,25 @@ int width, height; int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { WINDOW *win; - int key, old_option = (-1), new_option = 0; + int key; + int old_option = (-1); + int new_option = 0; bool quit = FALSE; + unsigned n; #ifdef PDCDEBUG PDC_debug("testcurs started\n"); #endif if (!initTest(&win)) - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); erase(); display_menu(old_option, new_option); - while (1) { + for (;;) { #ifdef A_COLOR if (has_colors()) { init_pair(1, COLOR_WHITE, COLOR_BLUE); @@ -82,6 +85,17 @@ main( keypad(stdscr, TRUE); raw(); key = getch(); + if (key < KEY_MIN && key > 0 && isalpha(key)) { + if (islower(key)) + key = toupper(key); + for (n = 0; n < MAX_OPTIONS; ++n) { + if (key == command[n].text[0]) { + display_menu(old_option, new_option = n); + key = ' '; + break; + } + } + } switch (key) { case 10: case 13: @@ -106,6 +120,9 @@ main( quit = TRUE; break; default: + beep(); + break; + case ' ': break; } if (quit == TRUE) @@ -118,7 +135,7 @@ main( #ifdef XCURSES XCursesExit(); #endif - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } static void @@ -186,7 +203,7 @@ introTest(WINDOW *win) wrefresh(win); cbreak(); mvwaddstr(win, 1, 1, - "You should have rectangle in the middle of the screen"); + "You should have rectangle in the middle of the screen"); mvwaddstr(win, 2, 1, "You should have heard a beep"); Continue(win); return; @@ -249,6 +266,8 @@ scrollTest(WINDOW *win) static void inputTest(WINDOW *win) { + int answered; + int repeat; int w, h, bx, by, sw, sh, i, c, num; char buffer[80]; WINDOW *subWin; @@ -317,7 +336,7 @@ inputTest(WINDOW *win) #if defined(PDCURSES) mouse_set(ALL_MOUSE_EVENTS); #endif - while (1) { + for (;;) { wmove(win, 3, 5); c = wgetch(win); wclrtobot(win); @@ -365,20 +384,38 @@ inputTest(WINDOW *win) mouse_set(0L); #endif refresh(); - wclear(win); - mvwaddstr(win, 3, 2, "The window should have moved"); - mvwaddstr(win, 4, 2, - "This text should have appeared without you pressing a key"); - mvwaddstr(win, 6, 2, "Enter a number then a string separated by space"); - mvwin(win, 2, 1); - wrefresh(win); - echo(); - noraw(); - num = 0; - *buffer = 0; - mvwscanw(win, 7, 6, "%d %s", &num, buffer); - mvwprintw(win, 8, 6, "String: %s Number: %d", buffer, num); - Continue(win); + + repeat = 0; + do { + static char *fmt[] = { + "%d %10s", + "%d %[a-zA-Z]s", + "%d %[][a-zA-Z]s", + "%d %[^0-9]" + }; + char *format = fmt[repeat % SIZEOF(fmt)]; + + wclear(win); + mvwaddstr(win, 3, 2, "The window should have moved"); + mvwaddstr(win, 4, 2, + "This text should have appeared without you pressing a key"); + mvwprintw(win, 6, 2, + "Scanning with format \"%s\"", format); + mvwin(win, 2 + 2 * (repeat % 4), 1 + 2 * (repeat % 4)); + erase(); + refresh(); + wrefresh(win); + echo(); + noraw(); + num = 0; + *buffer = 0; + answered = mvwscanw(win, 7, 6, format, &num, buffer); + mvwprintw(win, 8, 6, + "String: %s Number: %d (%d values read)", + buffer, num, answered); + Continue(win); + ++repeat; + } while (answered > 0); } static void @@ -392,7 +429,7 @@ outputTest(WINDOW *win) nl(); wclear(win); mvwaddstr(win, 1, 1, - "You should now have a screen in the upper left corner, and this text should have wrapped"); + "You should now have a screen in the upper left corner, and this text should have wrapped"); mvwin(win, 2, 1); waddstr(win, "\nThis text should be down\n"); waddstr(win, "and broken into two here ^"); @@ -409,7 +446,7 @@ outputTest(WINDOW *win) if (LINES < 24 || COLS < 75) { mvwaddstr(win, 5, 1, - "Some tests have been skipped as they require a"); + "Some tests have been skipped as they require a"); mvwaddstr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS"); Continue(win); } else { @@ -429,7 +466,7 @@ outputTest(WINDOW *win) #endif wclear(win1); mvwaddstr(win1, 5, 1, - "This text should appear; using overlay option"); + "This text should appear; using overlay option"); copywin(win, win1, 0, 0, 0, 0, 9, 49, TRUE); #if defined(PDCURSES) && !defined(XCURSES) @@ -444,7 +481,7 @@ outputTest(WINDOW *win) wclear(win1); wattron(win1, A_BLINK); mvwaddstr(win1, 4, 1, - "This blinking text should appear in only the second window"); + "This blinking text should appear in only the second window"); wattroff(win1, A_BLINK); mvwin(win1, by, bx); overlay(win, win1); @@ -490,7 +527,7 @@ outputTest(WINDOW *win) wclear(win); wmove(win, 2, 2); wprintw(win, "This is a formatted string in a window: %d %s\n", 42, - "is it"); + "is it"); mvwaddstr(win, 10, 1, "Enter a string: "); wrefresh(win); noraw(); @@ -514,7 +551,7 @@ outputTest(WINDOW *win) wclear(win); curs_set(0); mvwaddstr(win, 1, 1, - "The cursor should have disappeared (invisible)"); + "The cursor should have disappeared (invisible)"); Continue(win); } @@ -608,7 +645,7 @@ padTest(WINDOW *dummy GCC_UNUSED) mvwaddstr(pad, 5, 2, "This is a new pad"); wattrset(pad, A_NORMAL); mvwaddstr(pad, 8, 0, - "The end of this line should be truncated here:except now"); + "The end of this line should be truncated here:except now"); mvwaddstr(pad, 11, 1, "This line should not appear.It will now"); wmove(pad, 10, 1); wclrtoeol(pad); @@ -652,6 +689,6 @@ display_menu(int old_option, int new_option) mvaddstr(5 + new_option, 25, command[new_option].text); attrset(A_NORMAL); mvaddstr(13, 3, - "Use Up and Down Arrows to select - Enter to run - Q to quit"); + "Use Up and Down Arrows to select - Enter to run - Q to quit"); refresh(); } diff --git a/contrib/ncurses/test/testscanw.c b/contrib/ncurses/test/testscanw.c index c9a1623..a1c25b9 100644 --- a/contrib/ncurses/test/testscanw.c +++ b/contrib/ncurses/test/testscanw.c @@ -2,7 +2,7 @@ * Date: 1997/03/17 * From: bayern@morpheus.cis.yale.edu * - * $Id: testscanw.c,v 1.6 2000/11/04 23:32:56 tom Exp $ + * $Id: testscanw.c,v 1.8 2001/09/15 21:41:45 tom Exp $ */ #include <test.priv.h> #include <ctype.h> @@ -22,7 +22,7 @@ main(int argc, char *argv[]) trace(TRACE_UPDATE | TRACE_CALLS); #endif while (argc > 1) { - if (isdigit(CharOf(*argv[1]))) + if (isdigit(UChar(*argv[1]))) move(atoi(argv[1]), 0); else if (!strcmp(argv[1], "-k")) keypad(stdscr, TRUE); @@ -35,5 +35,5 @@ main(int argc, char *argv[]) scanw("%20ld", response); /* yes, it's a pointer */ } endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/test/view.c b/contrib/ncurses/test/view.c index ee60f27..83139d4 100644 --- a/contrib/ncurses/test/view.c +++ b/contrib/ncurses/test/view.c @@ -23,15 +23,14 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.35 2001/01/14 01:39:24 tom Exp $ + * $Id: view.c,v 1.52 2002/04/27 22:37:39 tom Exp $ */ -#include <test.priv.h> - -#include <string.h> #include <ctype.h> -#include <signal.h> #include <time.h> +#include <locale.h> + +#include <test.priv.h> #if HAVE_TERMIOS_H # include <termios.h> @@ -45,6 +44,8 @@ # endif #endif +#define my_pair 1 + /* This is needed to compile 'struct winsize' */ #if NEED_PTEM_H #include <sys/stream.h> @@ -52,7 +53,7 @@ #endif static RETSIGTYPE finish(int sig) GCC_NORETURN; -static void show_all(void); +static void show_all(const char *tag); #if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZETERM #define CAN_RESIZE 1 @@ -65,13 +66,13 @@ static RETSIGTYPE adjust(int sig); static int interrupted; #endif -static int waiting; -static int shift; -static int utf8_mode = FALSE; +static bool waiting = FALSE; +static int shift = 0; +static bool try_color = FALSE; static char *fname; -static chtype **lines; -static chtype **lptr; +static NCURSES_CH_T **my_lines; +static NCURSES_CH_T **lptr; static void usage(void) @@ -81,28 +82,37 @@ usage(void) "Usage: view [options] file" ,"" ,"Options:" + ," -c use color if terminal supports it" + ," -i ignore INT, QUIT, TERM signals" ," -n NUM specify maximum number of lines (default 1000)" #if defined(KEY_RESIZE) - ," -r use experimental KEY_RESIZE rather than our own handler" + ," -r use old-style sigwinch handler rather than KEY_RESIZE" #endif #ifdef TRACE ," -t trace screen updates" ," -T NUM specify trace mask" #endif - ," -u translate UTF-8 data" }; size_t n; for (n = 0; n < SIZEOF(msg); n++) fprintf(stderr, "%s\n", msg[n]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static int -ch_len(chtype * src) +ch_len(NCURSES_CH_T * src) { int result = 0; +#if USE_WIDEC_SUPPORT +#endif + +#if USE_WIDEC_SUPPORT + while (getcchar(src++, NULL, NULL, NULL, NULL) > 0) + result++; +#else while (*src++) result++; +#endif return result; } @@ -110,78 +120,56 @@ ch_len(chtype * src) * Allocate a string into an array of chtype's. If UTF-8 mode is * active, translate the string accordingly. */ -static chtype * +static NCURSES_CH_T * ch_dup(char *src) { unsigned len = strlen(src); - chtype *dst = typeMalloc(chtype, len + 1); + NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1); unsigned j, k; - unsigned utf_count = 0; - unsigned utf_char = 0; - -#define UCS_REPL 0xfffd +#if USE_WIDEC_SUPPORT + wchar_t wstr[CCHARW_MAX + 1]; + wchar_t wch; + int l = 0; + mbstate_t state; + size_t rc; + int width; +#endif +#if USE_WIDEC_SUPPORT + memset(&state, 0, sizeof(state)); +#endif for (j = k = 0; j < len; j++) { - if (utf8_mode) { - unsigned c = CharOf(src[j]); - /* Combine UTF-8 into Unicode */ - if (c < 0x80) { - /* We received an ASCII character */ - if (utf_count > 0) - dst[k++] = UCS_REPL; /* prev. sequence incomplete */ - dst[k++] = c; - utf_count = 0; - } else if (c < 0xc0) { - /* We received a continuation byte */ - if (utf_count < 1) { - dst[k++] = UCS_REPL; /* ... unexpectedly */ - } else { - if (!utf_char && !((c & 0x7f) >> (7 - utf_count))) { - utf_char = UCS_REPL; - } - /* characters outside UCS-2 become UCS_REPL */ - if (utf_char > 0x03ff) { - /* value would be >0xffff */ - utf_char = UCS_REPL; - } else { - utf_char <<= 6; - utf_char |= (c & 0x3f); - } - utf_count--; - if (utf_count == 0) - dst[k++] = utf_char; - } - } else { - /* We received a sequence start byte */ - if (utf_count > 0) - dst[k++] = UCS_REPL; /* prev. sequence incomplete */ - if (c < 0xe0) { - utf_count = 1; - utf_char = (c & 0x1f); - if (!(c & 0x1e)) - utf_char = UCS_REPL; /* overlong sequence */ - } else if (c < 0xf0) { - utf_count = 2; - utf_char = (c & 0x0f); - } else if (c < 0xf8) { - utf_count = 3; - utf_char = (c & 0x07); - } else if (c < 0xfc) { - utf_count = 4; - utf_char = (c & 0x03); - } else if (c < 0xfe) { - utf_count = 5; - utf_char = (c & 0x01); - } else { - dst[k++] = UCS_REPL; - utf_count = 0; - } - } - } else { - dst[k++] = src[j]; +#if USE_WIDEC_SUPPORT + rc = mbrtowc(&wch, src + j, len - j, &state); + if (rc == (size_t) -1 || rc == (size_t) -2) + break; + j += rc - 1; + if ((width = wcwidth(wch)) < 0) + break; + if ((width > 0 && l > 0) || l == CCHARW_MAX) { + wstr[l] = L'\0'; + l = 0; + if (setcchar(dst + k, wstr, 0, 0, NULL) != OK) + break; + ++k; } + if (width == 0 && l == 0) + wstr[l++] = L' '; + wstr[l++] = wch; +#else + dst[k++] = src[j]; +#endif + } +#if USE_WIDEC_SUPPORT + if (l > 0) { + wstr[l] = L'\0'; + if (setcchar(dst + k, wstr, 0, 0, NULL) == OK) + ++k; } + setcchar(dst + k, L"", 0, 0, NULL); +#else dst[k] = 0; +#endif return dst; } @@ -193,24 +181,43 @@ main(int argc, char *argv[]) char buf[BUFSIZ]; int i; int my_delay = 0; - chtype **olptr; + NCURSES_CH_T **olptr; int length = 0; int value = 0; bool done = FALSE; bool got_number = FALSE; #if CAN_RESIZE - bool use_resize = TRUE; + bool nonposix_resize = FALSE; +#endif + const char *my_label = "Input"; + + setlocale(LC_ALL, ""); + +#ifndef NCURSES_VERSION + /* + * We know ncurses will catch SIGINT if we don't establish our own handler. + * Other versions of curses may/may not catch it. + */ + (void) signal(SIGINT, finish); /* arrange interrupts to terminate */ #endif - while ((i = getopt(argc, argv, "n:rtT:u")) != EOF) { + while ((i = getopt(argc, argv, "cin:rtT:")) != EOF) { switch (i) { + case 'c': + try_color = TRUE; + break; + case 'i': + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGTERM, SIG_IGN); + break; case 'n': if ((MAXLINES = atoi(optarg)) < 1) usage(); break; #if CAN_RESIZE case 'r': - use_resize = FALSE; + nonposix_resize = TRUE; break; #endif #ifdef TRACE @@ -221,9 +228,6 @@ main(int argc, char *argv[]) trace(TRACE_CALLS); break; #endif - case 'u': - utf8_mode = TRUE; - break; default: usage(); } @@ -231,23 +235,21 @@ main(int argc, char *argv[]) if (optind + 1 != argc) usage(); - if ((lines = typeMalloc(chtype *, MAXLINES + 2)) == 0) + if ((my_lines = typeMalloc(NCURSES_CH_T *, MAXLINES + 2)) == 0) usage(); fname = argv[optind]; if ((fp = fopen(fname, "r")) == 0) { perror(fname); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } - - (void) signal(SIGINT, finish); /* arrange interrupts to terminate */ #if CAN_RESIZE - if (use_resize) + if (nonposix_resize) (void) signal(SIGWINCH, adjust); /* arrange interrupts to resize */ #endif /* slurp the file */ - for (lptr = &lines[0]; (lptr - lines) < MAXLINES; lptr++) { + for (lptr = &my_lines[0]; (lptr - my_lines) < MAXLINES; lptr++) { char temp[BUFSIZ], *s, *d; int col; @@ -263,19 +265,24 @@ main(int argc, char *argv[]) col = (col | 7) + 1; while ((d - temp) != col) *d++ = ' '; - } else if (isprint(CharOf(*d)) || utf8_mode) { + } else +#if USE_WIDEC_SUPPORT + col++, d++; +#else + if (isprint(UChar(*d))) { col++; d++; } else { - sprintf(d, "\\%03o", CharOf(*s)); + sprintf(d, "\\%03o", UChar(*s)); d += strlen(d); col = (d - temp); } +#endif } *lptr = ch_dup(temp); } (void) fclose(fp); - length = lptr - lines; + length = lptr - my_lines; (void) initscr(); /* initialize the curses library */ keypad(stdscr, TRUE); /* enable keyboard mapping */ @@ -285,18 +292,30 @@ main(int argc, char *argv[]) nodelay(stdscr, TRUE); idlok(stdscr, TRUE); /* allow use of insert/delete line */ - lptr = lines; + if (try_color) { + if (has_colors()) { + start_color(); + init_pair(my_pair, COLOR_WHITE, COLOR_BLUE); + bkgd(COLOR_PAIR(my_pair)); + } else { + try_color = FALSE; + } + } + + lptr = my_lines; while (!done) { int n, c; if (!got_number) - show_all(); + show_all(my_label); n = 0; for (;;) { #if CAN_RESIZE - if (interrupted) + if (interrupted) { adjust(0); + my_label = "interrupt"; + } #endif waiting = TRUE; c = getch(); @@ -318,12 +337,14 @@ main(int argc, char *argv[]) n = 1; } + if (c != ERR) + my_label = keyname(c); switch (c) { case KEY_DOWN: case 'n': olptr = lptr; for (i = 0; i < n; i++) - if ((lptr - lines) < (length - LINES + 1)) + if ((lptr - my_lines) < (length - LINES + 1)) lptr++; else break; @@ -334,7 +355,7 @@ main(int argc, char *argv[]) case 'p': olptr = lptr; for (i = 0; i < n; i++) - if (lptr > lines) + if (lptr > my_lines) lptr--; else break; @@ -343,28 +364,29 @@ main(int argc, char *argv[]) case 'h': case KEY_HOME: - lptr = lines; + lptr = my_lines; break; case 'e': case KEY_END: if (length > LINES) - lptr = lines + length - LINES + 1; + lptr = my_lines + length - LINES + 1; else - lptr = lines; + lptr = my_lines; break; case 'r': case KEY_RIGHT: - shift++; + shift += n; break; case 'l': case KEY_LEFT: - if (shift) - shift--; - else + shift -= n; + if (shift < 0) { + shift = 0; beep(); + } break; case 'q': @@ -408,14 +430,20 @@ static RETSIGTYPE finish(int sig) { endwin(); - exit(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS); + ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS); } #if CAN_RESIZE /* * This uses functions that are "unsafe", but it seems to work on SunOS and - * Linux. The 'wrefresh(curscr)' is needed to force the refresh to start from - * the top of the screen -- some xterms mangle the bitmap while resizing. + * Linux. Usually: the "unsafe" refers to the functions that POSIX lists + * which may be called from a signal handler. Those do not include buffered + * I/O, which is used for instance in wrefresh(). To be really portable, you + * should use the KEY_RESIZE return (which relies on ncurses' sigwinch + * handler). + * + * The 'wrefresh(curscr)' is needed to force the refresh to start from the top + * of the screen -- some xterms mangle the bitmap while resizing. */ static RETSIGTYPE adjust(int sig) @@ -424,9 +452,9 @@ adjust(int sig) struct winsize size; if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) { - resizeterm(size.ws_row, size.ws_col); + resize_term(size.ws_row, size.ws_col); wrefresh(curscr); /* Linux needs this */ - show_all(); + show_all(sig ? "SIGWINCH" : "interrupt"); } interrupted = FALSE; } else { @@ -437,15 +465,15 @@ adjust(int sig) #endif /* CAN_RESIZE */ static void -show_all(void) +show_all(const char *tag) { int i; char temp[BUFSIZ]; - chtype *s; + NCURSES_CH_T *s; time_t this_time; #if CAN_RESIZE - sprintf(temp, "(%3dx%3d) col %d ", LINES, COLS, shift); + sprintf(temp, "%s (%3dx%3d) col %d ", tag, LINES, COLS, shift); i = strlen(temp); sprintf(temp + i, "view %.*s", (int) (sizeof(temp) - 7 - i), fname); #else @@ -465,12 +493,18 @@ show_all(void) scrollok(stdscr, FALSE); /* prevent screen from moving */ for (i = 1; i < LINES; i++) { move(i, 0); - printw("%3ld:", (long) (lptr + i - lines)); + printw("%3ld:", (long) (lptr + i - my_lines)); clrtoeol(); if ((s = lptr[i - 1]) != 0) { int len = ch_len(s); if (len > shift) +#if USE_WIDEC_SUPPORT + add_wchstr(s + shift); +#else addchstr(s + shift); +#endif + if (try_color) + wchgat(stdscr, -1, A_NORMAL, my_pair, NULL); } } setscrreg(1, LINES - 1); diff --git a/contrib/ncurses/test/worm.c b/contrib/ncurses/test/worm.c index 02d9e1f..d493d08 100644 --- a/contrib/ncurses/test/worm.c +++ b/contrib/ncurses/test/worm.c @@ -34,13 +34,11 @@ 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.32 2000/12/31 01:54:07 tom Exp $ + $Id: worm.c,v 1.36 2002/03/23 21:46:54 tom Exp $ */ #include <test.priv.h> -#include <signal.h> - static chtype flavor[] = { 'O', '*', '#', '$', '%', '0', '@', @@ -165,7 +163,7 @@ static RETSIGTYPE onsig(int sig GCC_UNUSED) { cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float @@ -201,7 +199,7 @@ main(int argc, char *argv[]) goto usage; if ((length = atoi(argv[x])) < 2 || length > 1024) { fprintf(stderr, "%s: Invalid length\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 'n': @@ -209,7 +207,7 @@ main(int argc, char *argv[]) goto usage; if ((number = atoi(argv[x])) < 1 || number > 40) { fprintf(stderr, "%s: Invalid number of worms\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 't': @@ -230,8 +228,8 @@ main(int argc, char *argv[]) default: usage: fprintf(stderr, - "usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv); - return EXIT_FAILURE; + "usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv); + ExitProgram(EXIT_FAILURE); } } @@ -286,14 +284,14 @@ main(int argc, char *argv[]) w->orientation = w->head = 0; if (!(ip = typeMalloc(short, (length + 1)))) { fprintf(stderr, "%s: out of memory\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } w->xpos = ip; for (x = length; --x >= 0;) *ip++ = -1; if (!(ip = typeMalloc(short, (length + 1)))) { fprintf(stderr, "%s: out of memory\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } w->ypos = ip; for (y = length; --y >= 0;) @@ -365,7 +363,7 @@ main(int argc, char *argv[]) */ if (ch == 'q') { cleanup(); - return (EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } else if (ch == 's') { nodelay(stdscr, FALSE); } else if (ch == ' ') { @@ -400,14 +398,14 @@ main(int argc, char *argv[]) } } op = &(x == 0 ? (y == 0 ? upleft : (y == bottom ? lowleft : - left)) : - (x == last ? (y == 0 ? upright : (y == bottom ? lowright : - right)) : + left)) : + (x == last ? (y == 0 ? upright : (y == bottom ? lowright : + right)) : (y == 0 ? upper : (y == bottom ? lower : normal))))[w->orientation]; switch (op->nopts) { case 0: cleanup(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); case 1: w->orientation = op->opts[0]; break; diff --git a/contrib/ncurses/test/xmas.c b/contrib/ncurses/test/xmas.c index d99b821..f7edde7 100644 --- a/contrib/ncurses/test/xmas.c +++ b/contrib/ncurses/test/xmas.c @@ -92,12 +92,10 @@ /******************************************************************************/ /* - * $Id: xmas.c,v 1.15 2000/09/02 18:45:53 tom Exp $ + * $Id: xmas.c,v 1.18 2002/03/23 21:46:58 tom Exp $ */ #include <test.priv.h> -#include <signal.h> - #define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)" static int my_bg = COLOR_BLACK; @@ -149,11 +147,10 @@ static int strng5(void); static int reindeer(void); static int blinkit(void); -static RETSIGTYPE -done(int sig) GCC_NORETURN; +static RETSIGTYPE done(int sig) GCC_NORETURN; - static void - set_color(WINDOW *win, chtype color) +static void +set_color(WINDOW *win, chtype color) { if (has_colors()) { static bool *pairs; @@ -1156,5 +1153,5 @@ done(int sig GCC_UNUSED) refresh(); endwin(); curs_set(1); - exit(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } |