From: Jan Lentfer Date: Thu, 17 Dec 2009 14:03:46 +0000 (+0100) Subject: vendor/NCURSES: Import v5.7 sources X-Git-Tag: v2.7.1~286^2 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/1d102085bcfa7255149c7b56cdb63da5983038dd vendor/NCURSES: Import v5.7 sources --- diff --git a/contrib/ncurses/ANNOUNCE b/contrib/ncurses/ANNOUNCE index 513234e33c..e09e73177a 100644 --- a/contrib/ncurses/ANNOUNCE +++ b/contrib/ncurses/ANNOUNCE @@ -1,5 +1,4 @@ - - Announcing ncurses 5.4 + Announcing ncurses 5.7 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -8,9 +7,8 @@ enhancements over BSD curses. In mid-June 1995, the maintainer of 4.4BSD curses declared that he - considered 4.4BSD curses obsolete, and is encouraging the keepers of - Unix releases such as BSD/OS, freeBSD and netBSD to switch over to - ncurses. + considered 4.4BSD curses obsolete, and encouraged the keepers of Unix + releases such as BSD/OS, FreeBSD and NetBSD to switch over to ncurses. The ncurses code was developed under GNU/Linux. It has been in use for some time with OpenBSD as the system curses library, and on FreeBSD @@ -28,233 +26,218 @@ Release Notes - This release is designed to be upward compatible from ncurses 5.0 and - 5.3; very few applications will require recompilation, depending on - the platform. These are the highlights from the change-log since - ncurses 5.3 release. + This release is designed to be upward compatible from ncurses 5.0 + through 5.6; very few applications will require recompilation, + depending on the platform. These are the highlights from the + change-log since ncurses 5.6 release. Interface changes: - * add the remaining functions for X/Open curses wide-character - support. - + pecho_wchar() - + slk_wset() - These are only available if the library is configured using the - --enable-widec option. - * write getyx() and related 2-return macros in terms of getcury(), - getcurx(), etc. - * simplify ifdef for bool declaration in curses.h - * modify ifdef's in curses.h that disabled use of __attribute__() - for g++, since recent versions implement the cases which ncurses - uses. - * add key_defined() function, to tell which keycode a string is - bound to. + * generate linkable stubs for some macros: + getattrs New features and improvements: * library - + implement logic in lib_mouse.c to handle position reports - which are generated when XFree86 xterm is initialized with - private modes 1002 or 1003. These are returned to the - application as the REPORT_MOUSE_POSITION mask, which was not - implemented. - + modify soft-key initialization to use A_REVERSE if A_STANDOUT - would not be shown when colors are used, i.e., if ncv#1 is - set in the terminfo as is done in "screen". - + add configure option for FreeBSD sysmouse, --with-sysmouse, - and implement library support for that. + + new flavor of the ncurses library provides rudimentary + support for POSIX threads. Several functions are reentrant, + but most require either a window-level or screen-level mutex. + (This is API-compatible, but not ABI-compatible with the + normal library). + + add NCURSES_OPAQUE symbol to curses.h, will use to make + structs opaque in selected configurations. + + add NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS symbols to + curses.h to make it simpler to tell if the extended functions + and/or colors are declared. + + add wresize() to C++ binding + + eliminate fixed-buffer vsprintf() calls in C++ binding. + + add several functions to C++ binding which wrap C functions + that pass a WINDOW* parameter. + + adapt mouse-handling code from menu library in form-library + + improve tracing for form library, showing created forms, + fields, etc. + + make $NCURSES_NO_PADDING feature work for termcap interface . + + add check to trace-file open, if the given name is a + directory, add ".log" to the name and try again. + + several new manpages: curs_legacy.3x, curs_memleaks.3x, + curs_opaque.3x and curs_threads.3x * programs: - + tack: - o allow it to run from fallback terminfo data. - o reset colors after each color test, correct a place - where exit_standout_mode was used instead of - exit_attribute_mode. - o improve bce test by making it set colors other than - black on white. - + tic: - o handle a case where an entry has no description, and - capabilities begin on the same line as the entry name. - o allow a terminfo entry with a leading 2-character name. - o improved warnings when suppressing items to fit in - termcap's 1023-byte limit. - o add check for multiple "tc=" clauses in a termcap. - o correct logic for resolving "use=" clauses allow infocmp - and tic to show cancelled capabilities. - o check for incomplete line-drawing character mapping. - o check for missing/empty/illegal terminfo name. - + tput: - o modify tput to use the same parameter analysis as - tparm() does, to provide for user-defined strings, e.g., - for xterm title, a corresponding capability might be - title=\E]2;%p1%s^G, - + tset: - o use the system's default values for CKILL and other - default control characters. - o correct interchanged defaults for kill and interrupt - characters, which caused it to report unnecessarily. + + modified three test-programs to demonstrate the threading + support in this version: ditto, rain, worm. + + several new test-programs: demo_panels, dots_mvcur, + inch_wide, inchs, key_name, key_names, savescreen, + savescreen.sh test_arrays, test_get_wstr, test_getstr, + test_instr, test_inwstr and test_opaque. + + add adacurses-config to the Ada95 install. + + modify tic -f option to format spaces as \s to prevent them + from being lost when that is read back in unformatted + strings. + + The tack program is now distributed separately from ncurses. + * terminal database + + added entries: + o Eterm-256color, Eterm-88color and rxvt-88color + o aterm + o konsole-256color + o mrxvt + o screen.mlterm + o screen.rxvt + o teraterm4.59 is now the primary primary teraterm entry, + renamed original to teraterm2.3 + o 9term terminal + o Newbury Data entries + + updated/improved entries: + o gnome to version 2.22.3 + o h19, z100 + o konsole to version 1.6.6 + o mlterm, mlterm+pcfkeys + o xterm, and building-blocks for function-keys to [3]xterm + patch #230. Major bug fixes: - * prevent recursion in wgetch() via wgetnstr() if the connection - cannot be switched between cooked/raw modes because it is not a - TTY. - * correct a case in _nc_remove_string(), used by define_key(), to - avoid infinite loop if the given string happens to be a substring - of other strings which are assigned to keys. - * modify logic of acsc to use the original character if no mapping - is defined, rather than a null. - * several improvements for handling multi-cell display of wide - characters. - + modify setcchar() to allow converting control characters to - complex characters. - + correct handling of multibyte characters in waddch_literal() - which force wrapping because they are started too late on the - line. - + modify setcchar() to allow for wchar_t input strings that - have more than one spacing character. - * other fixes for wide-character support: - + rewrote lib_acs.c to allow PutAttrChar() to decide how to - render alternate-characters, i.e., to work with Linux console - and UTF-8 locale. - + implement a workaround so that line-drawing works with - screen's crippled UTF-8 support (tested with 3.9.13). This - only works with the wide-character support (--enable-widec); - the normal library will simply suppress line-drawing when - running in a UTF-8 locale in screen. - + corrections to lib_get_wstr.c: - o null-terminate buffer passed to setcchar(), which - occasionally failed. - o map special characters such as erase- and - kill-characters into key-codes so those will work as - expected even if they are not mentioned in the terminfo. - * modify setupterm() to check if the terminfo and terminal-modes - have already been read. This ensures that it does not reinvoke - def_prog_mode() when an application calls more than one function, - such as tgetent() and initscr(). - * fix form_driver() cases for REQ_CLR_EOF, REQ_CLR_EOL, - REQ_DEL_CHAR, REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure - the cursor was at the editing position before making - modifications. - * correct keybound(), which reported definitions in the wrong table, - i.e., the list of definitions which are disabled by keyok(). - * fixes related to safe_sprintf.c: - + correct an allocation size in safe_sprintf.c for the "*" - format code. - + correct safe_sprintf.c to not return a null pointer if the - format happens to be an empty string. - + make return value from _nc_printf_string() consistent. - Before, depending on whether --enable-safe-sprintf was used, - it might not be cached for reallocating. - * other low-level improvements to the optimization code include: - + if the output is a socket or other non-tty device, use 1 - millisecond for the cost in mvcur; previously it was 9 - milliseconds because the baudrate was not known. - + modify lib_getch.c to avoid recursion via wgetnstr() when the - input is not a tty and consequently mode-changes do not work. - + fix several places in tack/pad.c which tested and used the - parameter- and parameterless strings inconsistently. - + change several tputs() calls in scrolling code to use putp(), - to enable padding which may be needed for some terminals. - + improve mvcur() by checking if it is safe to move when video - attributes are set (msgr), and if not, reset/restore - attributes within that function rather than doing it - separately in the GoTo() function in tty_update.c. - + use tputs() rather than putp() in a few cases in tty_update.c - since the corresponding delays are proportional to the number - of lines affected: repeat_char, clr_eos, - change_scroll_region. - * correct line/column reference in adjust_window(), needed to make - special windows such as curscr track properly when resizing. - * fix a potential recursion between napms() and _nc_timed_wait() - * rewrote lib_insch.c, combining it with lib_insstr.c so both handle - tab and other control characters consistently. - * do not try to open gpm mouse driver if standard output is not a - tty; the gpm library does not make this check. + * add logic to tic for cancelling strings in user-defined + capabilities (this is needed for current konsole terminfo entry). + * modify mk-1st.awk so the generated makefile rules for linking or + installing shared libraries do not first remove the library, in + case it is in use, e.g., libncurses.so by /bin/sh. + * correct check for notimeout() in wgetch(). + * fix a sign-extension bug in infocmp's repair_acsc() function. + * change winnstr() to stop at the end of the line. + * make Ada95 demo_panels() example work. + * fix for adding a non-spacing character at the beginning of a line. + * fill in extended-color pair to make colors work for + wide-characters using extended-colors. + * improve refresh of window on top of multi-column characters, + taking into account split characters on left/right window + boundaries. + * modify win_wchnstr() to ensure that only a base cell is returned + for each multi-column character. + * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by + using unctrl() to display illegal bytes rather than trying to + append further bytes to make up a valid sequence. + * restore curs_set() state after endwin()/refresh() + * modify keyname() to use "^X" form only if meta() has been called, + or if keyname() is called without initializing curses, e.g., via + initscr() or newterm(). + * modify unctrl() to check codes in 128-255 range versus isprint(). + If they are not printable, and locale was set, use a "M-" or "~" + sequence. + * improve resizeterm() by moving ripped-off lines, and repainting + the soft-keys. + * modify form library to accept control characters such as newline + in set_field_buffer(), which is compatible with Solaris. + * use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., + to make those work properly with the --enable-ext-mouse + configuration + * correct some functions in Ada95 binding which were using return + value from C where none was returned. + * reviewed/fixed issues reported by Coverity and Klocwork tools. Portability: * configure script: + new options: - --with-abi-version option. - addresses platforms where packagers have diverged - from ncurses ABI numbering. - - --with-manpage-format=catonly - addresses behavior of BSDI, allow install of - man+cat files on NetBSD, whose behavior has - diverged by requiring both to be present. - - --with-manpage-aliases - extends "--with-manpage-aliases" to provide the - option of generating ".so" files rather than - symbolic links for manpage aliases. - - --with-rel-version - workaround to force libtool on Darwin generate the - "same" library names as with the "--with-shared" - option. The Darwin ld program does not work well - with a zero as the minor-version value. - - --with-trace - simplifies defining TRACE to incorporate trace() in - libraries. - - + fixes/improvements for cross-compiling: - o allow BUILD_CC and related configure script variables to - be overridden from the environment. - o use AC_CHECK_TOOL to get proper values for AR and LD for - cross compiling. - o use $cross_compiling variable in configure script rather - than comparing $host_alias and $target alias, since - "host" is traditionally misused in autoconf to refer to - the target platform. - o modify run_tic.in to avoid using wrong shared libraries - when cross-compiling. - + fixes for Mac OS X: - o fix a redefinition of $RANLIB in the configure script - when libtool is used. - o modify MKlib_gen.sh to avoid passing "#" tokens through - the C preprocessor. This works around Mac OS X's - preprocessor, which insists on adding a blank on each - side of the token. - + workarounds for broken tools: - o add configure check for wchar_t and wint_t types, rather - than rely on preprocessor definitions. Also work around - for gcc fixinclude bug which creates a shadow copy of - curses.h if it sees these symbols apparently typedef'd. - o modify configure script to omit -Winline for gcc 3.3, - since that feature is broken. - o several script fixes to work around the ironically named - POSIXLY_CORRECT feature of GNU sed 4.0. - o modify configure script to avoid using "head -1", which - does not work if POSIXLY_CORRECT (sic) is set. - o update configure script to reflect fix for - AC_PROG_GCC_TRADITIONAL, which is broken in autoconf - 2.5x for Mac OS X 10.2.3. - o repair check for missing C++ compiler, which is broken - in autoconf 2.5x by hardcoding it to g++. - + corrected ifdef's relating to configure check for wchar_t, - etc. - + remove configure script check to allow -Wconversion for older - versions of gcc - + modify configure script to accommodate libtool 1.5, as well - as add an parameter to the "--with-libtool" option which can - specify the pathname of libtool. - + change several sed scripts to avoid using "\+" since it is - not a BRE (basic regular expression). One instance caused - terminfo.5 to be misformatted on FreeBSD. - + use '%' as sed substitute delimiter in run_tic script to - avoid problems with pathname delimiters such as ':' and '@'. - + add -D_XOPEN_SOURCE=500 if needed when configuring with - "--enable-widec", to get mbstate_t declaration on HPUX 11.11. + --disable-big-strings + control whether static string tables are generated + as single large strings (to improve startup + performance), or as array of individual strings. + + --disable-relink + control whether shared libraries are relinked + (during install) when rpath is enabled. + + --disable-tic-depends + make explicit whether tic library depends on + ncurses/ncursesw library. + + --enable-mixed-case + override the configure script's check if the + filesystem supports mixed-case filenames. This + allows one to control how the terminal database + maps to the filesystem. For filesystems that do not + support mixed-case, the library uses generate + 2-character (hexadecimal) codes for the lower-level + of the filesystem terminfo database + + --enable-reentrant + builds a different flavor of the ncurses library + (ncursest) which improves reentrant use of the + library by reducing global and static variables + (see the "--with-pthread" option for the threaded + support). + + --enable-weak-symbols + use weak-symbols for linking to the POSIX thread + library, and use the same soname for the ncurses + shared library as the normal library (caveat: the + ABI is for the threaded library, which makes global + data accessed via functions). + + --with-pthread + build with the POSIX thread library (tested with + AIX, Linux, FreeBSD, OpenBSD, HPUX, IRIX64, + Solaris, Tru64). + + --with-ticlib + build/install the tic-support functions in a + separate library + + + improved options: + + --enable-ext-colors + requires the wide-character configuration. + + --with-chtype + ignore option value "unsigned" is always added to + the type in curses.h; do the same for + --with-mmask-t. + + --with-dmalloc + build-fix for redefinition of strndup. + + --with-hashed-db + accepts a parameter which is the install-prefix of + a given Berkeley Database. + + --with-hashed-db + the $LIBS environment variable overrides the search + for the db library. + + --without-hashed-db + assumed when "--disable-database" is used. + + * other configure/build issues: + + build-fixes for LynxOS + + modify shared-library rules to allow FreeBSD 3.x to use + rpath. + + build-fix for FreeBSD "contemporary" TTY interface. + + build-fixes for AIX with libtool. + + build-fixes for Darwin and libtool. + + modify BeOS-specific ifdef's to build on Haiku. + + corrected gcc options for building shared libraries on + Solaris and IRIX64. + + change shared-library configuration for OpenBSD, make rpath + work. + + build-fixes for using libutf8, e.g., on OpenBSD 3.7 + + add "-e" option in ncurses/Makefile.in when generating + source-files to force earlier exit if the build environment + fails unexpectedly. + + add support for shared libraries for QNX. + + change delimiter in MKlib_gen.sh from '%' to '@', to avoid + substitution by IBM xlc to '#' as part of its extensions to + digraphs. * library: - + adjust include-options in CF_ETIP_DEFINES to avoid missing - ncurses_dll.h, fixing special definitions that may be needed - for etip.h. - + modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use - a ".so" suffix. - + improve ifdef's to guard against redefinition of wchar_t and - wint_t in curses.h. - + remove an #undef for KEY_EVENT from curses.tail used in the - experimental NCURSES_WGETCH_EVENTS feature. The #undef - confuses Debian dpkg's build script. + + rewrite wrapper for wcrtomb(), making it work on Solaris. + This is used in the form library to determine the length of + the buffer needed by field_buffer. + + add/use configure script macro CF_SIG_ATOMIC_T, use the + corresponding type for data manipulated by signal handlers. + + set locale in misc/ncurses-config.in since it uses a range + + disable GPM mouse support when $TERM does not happen to + contain "linux", since Gpm_Open() no longer limits its + assertion to terminals that it might handle, e.g., within + "screen" in xterm. + + reset mouse file-descriptor when unloading GPM library. + * test programs: + + update test programs to build/work with various UNIX curses + for comparisons. Features of Ncurses @@ -281,17 +264,15 @@ The ncurses package also has many useful extensions over SVr4: * The API is 8-bit clean and base-level conformant with the X/OPEN curses specification, XSI curses (that is, it implements all BASE - level features, but not all EXTENDED features). Most - EXTENDED-level features not directly concerned with wide-character - support are implemented, including many function calls not - supported under SVr4 curses (but portability of all calls is - documented so you can use the SVr4 subset only). + level features, and most EXTENDED features). It includes many + function calls not supported under SVr4 curses (but portability of + all calls is documented so you can use the SVr4 subset only). * Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner of the screen if your terminal has an insert-character capability. * Ada95 and C++ bindings. - * Support for mouse event reporting with X Window xterm and OS/2 - console windows. + * Support for mouse event reporting with X Window xterm and FreeBSD + and OS/2 console windows. * Extended mouse support via Alessandro Rubini's gpm package. * The function wresize() allows you to resize windows, preserving their data. @@ -302,7 +283,9 @@ the use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by defining more than one control sequence to map to a given key code. - * Support for 16-color terminals, such as aixterm and XFree86 xterm. + * Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors option. + * Support for 16-color terminals, such as aixterm and modern xterm. * Better cursor-movement optimization. The package now features a cursor-local-movement computation more efficient than either BSD's or System V's. @@ -373,55 +356,51 @@ cdk Curses Development Kit - [3]http://invisible-island.net/cdk/ - [4]http://www.vexus.ca/products/CDK/ + [4]http://invisible-island.net/cdk/ + [5]http://www.vexus.ca/products/CDK/ ded directory-editor - [5]http://invisible-island.net/ded/ + [6]http://invisible-island.net/ded/ dialog the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [6]http://invisible-island.net/dialog/ + [7]http://invisible-island.net/dialog/ lynx the character-screen WWW browser - [7]http://lynx.isc.org/release/ + [8]http://lynx.isc.org/release/ Midnight Commander file manager - [8]http://www.ibiblio.org/mc/ + [9]http://www.ibiblio.org/mc/ mutt mail utility - [9]http://www.mutt.org/ + [10]http://www.mutt.org/ ncftp file-transfer utility - [10]http://www.ncftp.com/ + [11]http://www.ncftp.com/ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [11]http://www.bostic.com/vi/ + [12]http://www.bostic.com/vi/ pinfo Lynx-like info browser. - [12]http://dione.ids.pl/~pborys/software/pinfo/ + [13]https://alioth.debian.org/projects/pinfo/ tin - newsreader, supporting color, MIME [13]http://www.tin.org/ - - vh-1.6 - Volks-Hypertext browser for the Jargon File - [14]http://www.debian.org/Packages/unstable/text/vh.html + newsreader, supporting color, MIME [14]http://www.tin.org/ as well as some that use ncurses for the terminfo support alone: minicom terminal emulator - [15]http://www.netsonic.fi/~walker/minicom.html + [15]http://alioth.debian.org/projects/minicom/ vile vi-like-emacs @@ -461,9 +440,10 @@ Future Plans Other Related Resources The distribution provides a newer version of the terminfo-format - terminal description file maintained by [20]Eric Raymond . Unlike the - older version, the termcap and terminfo data are provided in the same - file. + terminal description file once maintained by [20]Eric Raymond . Unlike + the older version, the termcap and terminfo data are provided in the + same file, and provides several user-definable extensions beyond the + X/Open specification. You can find lots of information on terminal-related topics not covered in the terminfo file at [21]Richard Shuford's archive . @@ -472,19 +452,19 @@ References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/cdk/ - 4. http://www.vexus.ca/products/CDK/ - 5. http://invisible-island.net/ded/ - 6. http://invisible-island.net/dialog/ - 7. http://lynx.isc.org/release/ - 8. http://www.ibiblio.org/mc/ - 9. http://www.mutt.org/ - 10. http://www.ncftp.com/ - 11. http://www.bostic.com/vi/ - 12. http://dione.ids.pl/~pborys/software/pinfo/ - 13. http://www.tin.org/ - 14. http://www.debian.org/Packages/unstable/text/vh.html - 15. http://www.netsonic.fi/~walker/minicom.html + 3. http://invisible-island.net/xterm/xterm.log.html#xterm_230 + 4. http://invisible-island.net/cdk/ + 5. http://www.vexus.ca/products/CDK/ + 6. http://invisible-island.net/ded/ + 7. http://invisible-island.net/dialog/ + 8. http://lynx.isc.org/release/ + 9. http://www.ibiblio.org/mc/ + 10. http://www.mutt.org/ + 11. http://www.ncftp.com/ + 12. http://www.bostic.com/vi/ + 13. https://alioth.debian.org/projects/pinfo/ + 14. http://www.tin.org/ + 15. http://alioth.debian.org/projects/minicom/ 16. http://invisible-island.net/vile/ 17. mailto:dickey@invisible-island.net 18. mailto:bug-ncurses@gnu.org diff --git a/contrib/ncurses/AUTHORS b/contrib/ncurses/AUTHORS new file mode 100644 index 0000000000..57904c4045 --- /dev/null +++ b/contrib/ncurses/AUTHORS @@ -0,0 +1,38 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 2006 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: AUTHORS,v 1.2 2006/10/28 21:44:52 tom Exp $ +------------------------------------------------------------------------------- +These are the principal authors/contributors of ncurses since 1.9.9e, +in decreasing order of their contribution: + +TD Thomas E. Dickey +JPF Juergen Pfeifer +ESR Eric S Raymond +AVL Alexander V Lukyanov +PB Philippe Blain +SV Sven Verdoolaege diff --git a/contrib/ncurses/INSTALL b/contrib/ncurses/INSTALL index 8743d4941c..ab7dcd8299 100644 --- a/contrib/ncurses/INSTALL +++ b/contrib/ncurses/INSTALL @@ -1,4 +1,31 @@ --- $Id: INSTALL,v 1.71 2004/02/07 21:06:05 tom Exp $ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-2006,2008 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: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -19,12 +46,6 @@ below. If you are converting from BSD curses and do not have root access, be sure to read the BSD CONVERSION NOTES section below. -If you are using a version of XFree86 xterm older than 3.1.2F, see the section -on RECENT XTERM VERSIONS below. - -If you are trying to build GNU Emacs using ncurses for terminal support, -read the USING NCURSES WITH EMACS section below. - If you are trying to build applications using gpm with ncurses, read the USING NCURSES WITH GPM section below. @@ -45,7 +66,7 @@ do anything else. REQUIREMENTS: ------------ -You will need the following in order to build and install ncurses under UNIX: +You will need the following to build and install ncurses under UNIX: * ANSI C compiler (gcc, for instance) * sh (bash will do) @@ -64,9 +85,10 @@ INSTALLATION PROCEDURE: with it. The --prefix option to configure changes the root directory for installing - ncurses. The default is in subdirectories of /usr/local. Use - --prefix=/usr to replace your default curses distribution. This is the - default for Linux and BSD/OS users. + ncurses. The default is normally in subdirectories of /usr/local, except + for systems where ncurses is normally installed as a system library, e.g., + Linux, the various BSD systems and Cygwin. Use --prefix=/usr to replace + your default curses distribution. The package gets installed beneath the --prefix directory as follows: @@ -77,9 +99,20 @@ INSTALLATION PROCEDURE: In $(prefix)/include: C header files Under $(prefix)/man: the manual pages - Note however that the configure script attempts to locate previous - installation of ncurses, and will set the default prefix according to where - it finds the ncurses headers. + Note that the configure script attempts to locate previous installation of + ncurses, and will set the default prefix according to where it finds the + ncurses headers. + + Do not use commands such as + + make install prefix=XXX + + to change the prefix after configuration, since the prefix value is used + for some absolute pathnames such as TERMINFO. Instead do this + + make install DESTDIR=XXX + + See also the discussion of --with-install-prefix. 2. Type `./configure' in the top-level directory of the distribution to configure ncurses for your operating system and create the Makefiles. @@ -116,6 +149,9 @@ INSTALLATION PROCEDURE: recent implementation of libiconv. We have built this configuration on Linux using libiconv, sometimes requiring libutf8. + If you configure using the --with-pthread option, a "t" is appended to + the library names (e.g., libncursest.a, libncursestw.a). + If you do not specify any models, the normal and debug libraries will be configured. Typing `configure' with no arguments is equivalent to: @@ -271,6 +307,11 @@ SUMMARY OF CONFIGURE OPTIONS: return deceptive results, so you may have to override the configure script. Or you may be building tic for a smaller machine. + --disable-big-strings + Disable compile-time optimization of predefined tables which puts + all of their strings into a very long string, to reduce relocation + overhead. + --disable-database Use only built-in data. The ncurses libraries normally read terminfo and termcap data from disk. You can configure ncurses to have a @@ -294,14 +335,36 @@ SUMMARY OF CONFIGURE OPTIONS: more likely writable than the system terminfo database. Use this option to disable the feature altogether. + --disable-largefile + Disable compiler flags needed to use large-file interfaces. + --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. + Any implementation of curses must not free the memory associated with + a screen, since (even after calling endwin()), it must be available + for use in the next call to refresh(). There are also chunks of + memory held for performance reasons. That makes it hard to analyze + curses applications for memory leaks. To work around this, build + a debugging version of the ncurses library which frees those chunks + which it can, and provides the _nc_free_and_exit() function to free + the remainder on exit. The ncurses utility and test programs use this + feature, e.g., via the ExitProgram() macro. + + --disable-lp64 + The header files will ignore use of the _LP64 symbol to make chtype + and mmask_t types 32 bits (they may be long on 64-bit hosts, for + compatibility with older releases). + + NOTE: this is potentially an ABI change, depending on existing + packages. The default for this option is "disabled" for ncurses + ABI 5, and "enabled" for ABI 6. + --disable-macros For testing, use functions rather than macros. The program will run - more slowly, but it is simpler to debug. This makes a header file - "nomacros.h". See also the --enable-expanded option. + more slowly, but it is simpler to debug. This defines NCURSES_NOMACROS + at build time. See also the --enable-expanded option. --disable-overwrite If you are installing ncurses on a system which contains another @@ -313,6 +376,13 @@ SUMMARY OF CONFIGURE OPTIONS: rather than the include directory. This makes it simpler to avoid compile-time conflicts with other versions of curses.h + --disable-relink + If --enable-rpath is given, the generated makefiles normally will + rebuild the libraries during install. Use this option to simply + copy whatever the linked produced. + + This option is ignored if --enable-rpath is not given. + --disable-root-environ Compile with environment restriction, so certain environment variables are not available when running as root, or via a setuid/setgid @@ -323,6 +393,23 @@ SUMMARY OF CONFIGURE OPTIONS: Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. + --disable-tic-depends + When building shared libraries, normally the tic library is linked to + depend upon the ncurses library (and in turn, on the term-library if + the --with-termlib option was given). The tic- and term-libraries + ABI does not depend on the --enable-widec option. Some packagers have + used this to reduce the number of library files which are packaged + by using only one copy of those libraries. To make this work properly, + the tic library must be built without an explicit dependency on the + ncurses (or ncursesw) library. Use this configure option to do that. + For example + configure --with-ticlib --with-shared --disable-tic-depends + + --disable-tparm-varargs + Portable programs should call tparm() using the fixed-length parameter + list documented in X/Open. ncurses provides varargs support for this + function. Use --disable-tparm-varargs to disable this support. + --enable-assertions For testing, compile-in assertion code. This is used only for a few places where ncurses cannot easily recover by returning an error code. @@ -379,16 +466,41 @@ SUMMARY OF CONFIGURE OPTIONS: For testing, generate functions for certain macros to make them visible as such to the debugger. See also the --disable-macros option. + --enable-ext-colors + Extend the cchar_t structure to allow more than 16 colors to be + encoded. This applies only to the wide-character (--enable-widec) + configuration. + + NOTE: using this option will make libraries which are not binary- + compatible with libncursesw 5.4. None of the interfaces change, but + applications which have an array of cchar_t's must be recompiled. + + --enable-ext-mouse + Modify the encoding of mouse state to make room for a 5th mouse button. + That allows one to use ncurses with a wheel mouse with xterm or + similar X terminal emulators. + + NOTE: using this option will make libraries which are not binary- + compatible with libncursesw 5.4. None of the interfaces change, but + applications which have mouse mask mmask_t's must be recompiled. + --enable-getcap Use the 4.4BSD getcap code if available, or a bundled version of it to fetch termcap entries. Entries read in this way cannot use (make cross-references to) the terminfo tree, but it is faster than reading /etc/termcap. + If configured for one of the *BSD systems, this automatically uses + the hashed database system produced using cap_mkdb or similar tools. + In that case, there is no advantage in using the --enable-getcap-cache + option. + + See also the --with-hashed-db option. + --enable-getcap-cache Cache translated termcaps under the directory $HOME/.terminfo - NOTE: this sounds good - it makes ncurses run faster the second time. + NOTE: this sounds good - it makes ncurses run faster the second time. But look where the data comes from - an /etc/termcap containing lots of entries that are not up to date. If you configure with this option and forget to install the terminfo database before running an ncurses @@ -401,16 +513,38 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. + --enable-mixed-case + Controls whether the filesystem on which the terminfo database resides + supports mixed-case filenames (normal for UNIX, but not on other + systems). If you do not specify this option, the configure script + checks the current filesystem. + --enable-no-padding Compile-in support for the $NCURSES_NO_PADDING environment variable, which allows you to suppress the effect of non-mandatory padding in terminfo entries. This is the default, unless you have disabled the extended functions. + --enable-reentrant + Compile experimental configuration which improves reentrant use of the + library by reducing global and static variables. This option is also + set if --with-pthread is used. + --enable-rpath - Use rpath option when generating shared libraries, and with some - restrictions when linking the corresponding programs. This applies - mainly to systems using the GNU linker (read the manpage). + Use rpath option when generating shared libraries, and (with some + restrictions) when linking the corresponding programs. This originally + (in 1997) applied mainly to systems using the GNU linker (read the + manpage). + + More recently it is useful for systems that require special treatment + shared libraries in "unusual" locations. The "system" libraries reside + in directories which are on the loader's default search-path. While + you may be able to use workarounds such as the $LD_LIBRARY_PATH + environment variable, they do not work with setuid applications since + the LD_LIBRARY_PATH variable would be unset in that situation. + + This option does not apply to --with-libtool, since libtool makes + extra assumptions about rpath. --enable-safe-sprintf Compile with experimental safe-sprintf code. You may consider using @@ -424,6 +558,13 @@ SUMMARY OF CONFIGURE OPTIONS: changes. This option is the default, unless you have disabled the extended functions. + --enable-signed-char + The term.h header declares a Booleans[] array typed "char". But it + stores signed values there and "char" is not necessarily signed. + Some packagers choose to alter the type of Booleans[] though this + is not strictly compatible. This option allows one to implement this + alteration without patching the source code. + --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -443,10 +584,20 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-warnings Turn on GCC compiler warnings. There should be only a few. + --enable-weak-symbols + If the --with-pthread option is set, check if the compiler supports + weak-symbols. If it does, then name the thread-capable library without + the "t" (libncurses rather than libncursest), and provide for + dynamically loading the pthreads entrypoints at runtime. This allows + one to reduce the number of library files for ncurses. + + --enable-wgetch-events + Compile with experimental wgetch-events code. See ncurses/README.IZ + --enable-widec - Compile with experimental wide-character code. This makes a different - version of the libraries (e.g., libncursesw.so), which stores - characters as wide-characters, + Compile with wide-character code. This makes a different version of + the libraries (e.g., libncursesw.so), which stores characters as + wide-characters, NOTE: applications compiled with this configuration are not compatible with those built for 8-bit characters. You cannot simply make a @@ -466,11 +617,14 @@ SUMMARY OF CONFIGURE OPTIONS: Normally this is the same as the release version; some ports have special requirements for compatibility. + This option does not affect linking with libtool, which uses the + release major/minor numbers. + --with-ada-compiler=CMD Specify the Ada95 compiler command (default "gnatmake") --with-ada-include=DIR - Tell where to install the Ada includes (default: + Tell where to install the Ada includes (default: PREFIX/lib/ada/adainclude) --with-ada-objects=DIR @@ -493,20 +647,32 @@ SUMMARY OF CONFIGURE OPTIONS: to do this if the target compiler has unusual flags which confuse the host compiler. + You can also set the environment variable $BUILD_CFLAGS rather than + use this option. + --with-build-cppflags=XXX If cross-compiling, specify the host C preprocessor-flags. You might need to do this if the target compiler has unusual flags which confuse the host compiler. + You can also set the environment variable $BUILD_CPPFLAGS rather than + use this option. + --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. + You can also set the environment variable $BUILD_LDFLAGS rather than + use this option. + --with-build-libs=XXX If cross-compiling, the host libraries. You might need to do this if the target environment requires unusual libraries. + You can also set the environment variable $BUILD_LIBS rather than + use this option. + --with-caps=XXX Specify an alternate terminfo capabilities file, which makes the configure script look for "include/Caps.XXX". A few systems, e.g., @@ -516,6 +682,13 @@ SUMMARY OF CONFIGURE OPTIONS: to use a terminfo database which is compatible with the native applications. + --with-chtype=TYPE + Override type of chtype, which stores the video attributes and (if + --enable-widec is not given) a character. Prior to ncurses 5.5, this + was always unsigned long, but with ncurses 5.5, it may be unsigned. + Use this option if you need to preserve compatibility with 64-bit + executables. + --with-database=XXX Specify the terminfo source file to install. Usually you will wish to install ncurses' default (misc/terminfo.src). Certain systems @@ -524,6 +697,7 @@ SUMMARY OF CONFIGURE OPTIONS: --with-dbmalloc For testing, compile and link with Conor Cahill's dbmalloc library. + This also sets the --disable-leaks option. --with-debug Generate debug-libraries (default). These are named by adding "_g" @@ -533,12 +707,9 @@ SUMMARY OF CONFIGURE OPTIONS: Specify the default terminfo database directory. This is normally DATADIR/terminfo, e.g., /usr/share/terminfo. - --with-develop - Enable experimental/development options. This does not count those - that change the interface, such as --enable-widec. - --with-dmalloc For testing, compile and link with Gray Watson's dmalloc library. + This also sets the --disable-leaks option. --with-fallbacks=XXX Specify a list of fallback terminal descriptions which will be @@ -546,12 +717,58 @@ SUMMARY OF CONFIGURE OPTIONS: --with-gpm use Alessandro Rubini's GPM library to provide mouse support on the - Linux console. + Linux console. Prior to ncurses 5.5, this introduced a dependency on + the GPM library. + + Currently ncurses uses the dlsym() function to bind to the library at + runtime, so it is only necessary that the library be present when + ncurses is built, to obtain the filename (or soname) used in the + corresponding dlopen() call. If you give a value for this option, + e.g., + + --with-gpm=$HOME/tmp/test-gpm.so + + that overrides the configure check for the soname. + + See also --without-dlsym + + --with-hashed-db[=XXX] + Use a hashed database for storing terminfo data rather than storing + each compiled entry in a separate binary file within a directory + tree. + + In particular, this uses the Berkeley database 1.8.5 interface, as + provided by that and its successors db 2, 3, and 4. The actual + interface is slightly different in the successor versions of the + Berkeley database. The database should have been configured using + "--enable-compat185". + + If you use this option for configuring ncurses, tic will only be able + to write entries in the hashed database. infocmp can still read + entries from a directory tree as well as reading entries from the + hashed database. To do this, infocmp determines whether the $TERMINFO + variable points to a directory or a file, and reads the directory-tree + or hashed database respectively. + + You cannot have a directory containing both hashed-database and + filesystem-based terminfo entries. + + Use the parameter value to give the install-prefix used for the + datbase, e.g., + --with-hashed-db=/usr/local/BigBase + to find the corresponding include- and lib-directories under the + given directory. + + See also the --enable-getcap option. --with-install-prefix=XXX Allows you to specify an alternate location for installing ncurses after building it. The value you specify is prepended to the "real" - install location. This simplifies making binary packages. + install location. This simplifies making binary packages. The + makefile variable DESTDIR is set by this option. It is also possible + to use + make install DESTDIR=XXX + since the makefiles pass that variable to subordinate makes. NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. @@ -568,6 +785,12 @@ SUMMARY OF CONFIGURE OPTIONS: particular version of libtool, e.g., /usr/bin/libtool-1.2.3 + It is possible to rebuild the configure script to use the automake + macros for libtool, e.g., AC_PROG_LIBTOOL. See the comments in + aclocal.m4 for CF_PROG_LIBTOOL, and ensure that you build configure + using the appropriate patch for autoconf from + http://invisible-island.net/autoconf/ + --with-manpage-aliases Tell the configure script you wish to create entries in the man-directory for aliases to manpages which list them, e.g., the @@ -600,11 +823,25 @@ SUMMARY OF CONFIGURE OPTIONS: by running them through tbl to generate tables understandable by nroff. + --with-mmask-t=TYPE + Override type of mmask_t, which stores the mouse mask. Prior to + ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it + may be unsigned. Use this option if you need to preserve compatibility + with 64-bit executables. + + --with-normal + Generate normal (i.e., static) libraries (default). + + Note: on Linux, the configure script will attempt to use the GPM + library via the dlsym() function call. Use --without-dlsym to disable + this feature, or --without-gpm, depending on whether you wish to use + GPM. + --with-ospeed=TYPE Override type of ospeed variable, which is part of the termcap compatibility interface. In termcap, this is a 'short', which works for a wide range of baudrates because ospeed is not the actual speed - but the encoded value, e.g., B9600 would be a small number such as 13. + but the encoded value, e.g., B9600 would be a small number such as 13. However the encoding scheme originally allowed for values "only" up to 38400bd. A newer set of definitions past 38400bd is not encoded as compactly, and is not guaranteed to fit into a short (see the function @@ -613,13 +850,15 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. - --with-normal - Generate normal (i.e., static) libraries (default). - --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a + --with-pthread + Link with POSIX threads, set --enable-reentrant. The use_window() and + use_screen() functions will use mutex's, allowing rudimentary support + for multithreaded applications. + --with-rcs-ids Compile-in RCS identifiers. Most of the C files have an identifier. @@ -633,11 +872,21 @@ SUMMARY OF CONFIGURE OPTIONS: Generate shared-libraries. The names given depend on the system for which you are building, typically using a ".so" suffix, along with symbolic links that refer to the release version. - + NOTE: Unless you override the configure script by setting the $CFLAGS environment variable, these will not be built with the -g debugging option. + NOTE: For some configurations, e.g., installing a new version of + ncurses shared libraries on a machine which already has ncurses + shared libraries, you may encounter problems with the linker. + For example, it may prevent you from running the build tree's + copy of tic (for installing the terminfo database) because it + loads the system's copy of the ncurses shared libraries. In that + case, using the misc/shlib script may be helpful, since it sets + $LD_LIBRARY_PATH to point to the build tree, e.g., + ./misc/shlib make install + --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. This is normally chosen automatically based on the type of system @@ -657,20 +906,46 @@ SUMMARY OF CONFIGURE OPTIONS: Specify a search-list of terminfo directories which will be compiled into the ncurses library (default: DATADIR/terminfo) - --with-termlib + --with-termlib[=XXX] When building the ncurses library, organize this as two parts: the curses library (libncurses) and the low-level terminfo library (libtinfo). This is done to accommodate applications that use only the latter. The terminfo library is about half the size of the total. + If an option value is given, that overrides the name of the terminfo + library. For instance, if the wide-character version is built, the + terminfo library would be named libtinfow. But the libtinfow interface + is upward compatible from libtinfo, so it would be possible to overlay + libtinfo.so with a "wide" version of libtinfow.so by renaming it with + this option. + --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) + --with-ticlib[=XXX] + When building the ncurses library, build a separate library for + the modules that are used only by the utility programs. Normally + those would be bundled with the termlib or ncurses libraries. + + If an option value is given, that overrides the name of the tic + library. As in termlib, there is no ABI difference between the + "wide" libticw.so and libtic.so + + NOTE: Overriding the name of the tic library may be useful if you are + also using the --with-termlib option to rename libtinfo. If you are + not doing that, renaming the tic library can result in conflicting + library dependencies for tic and other programs built with the tic + library. + --with-trace Configure the trace() function as part of the all models of the ncurses library. Normally it is part of the debug (libncurses_g) library only. + --with-valgrind + For testing, compile with debug option. + This also sets the --disable-leaks option. + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -693,11 +968,23 @@ SUMMARY OF CONFIGURE OPTIONS: Suppress the configure script's check for C++, do not build the C++ binding and related demo. + --without-develop + Disable development options. This does not include those that change + the interface, such as --enable-widec. + + --without-dlsym + Do not use dlsym() to load GPM dynamically. + --without-progs Tell the configure script to suppress the build of ncurses' application programs (e.g., tic). The test applications will still be built if you type "make", though not if you simply do "make install". + --without-xterm-new + Tell the configure script to use "xterm-old" for the entry used in + the terminfo database. This will work with variations such as + X11R5 and X11R6 xterm. + COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: -------------------------------------------- @@ -714,10 +1001,225 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: you may encounter when building a system with different versions of ncurses: + 5.7 (November 2, 2008) + Interface changes: + + + generate linkable stubs for some macros: + getattrs + + + Add new library configuration for tic-library (the non-curses portion + of the ncurses library used for the tic program as well as some + others such as tack. There is no API change, but makefiles would be + changed to use the tic-library built separately. + + tack, distributed separately from ncurses, uses some of the internal + _nc_XXX functions, which are declared in the tic.h header file. + + The reason for providing this separate library is that none of the + functions in it are suitable for threaded applications. + + + Add new library configuration (ncursest, ncurseswt) which provides + rudimentary support for POSIX threads. This introduces opaque + access functions to the WINDOW structure and adds a parameter to + several internal functions. + + + move most internal variables (except tic-library) into data blocks + _nc_globals and _nc_prescreen to simplify analysis. Those were + globally accessible, but since they were not part of the documented + API, there is no ABI change. + + + changed static tables of strings to be indices into long strings, to + improve startup performance. This changes parameter lists for some + of the internal functions. + + Added extensions: + + + add NCURSES_OPAQUE definition in curses.h to control whether internal + details of the WINDOW structure are visible to an application. This + is always defined when the threaded library is built, and is optional + otherwise. New functions for this: is_cleared, is_idcok, is_idlok, + is_immedok, is_keypad, is_leaveok, is_nodelay, is_notimeout, + is_scrollok, is_syncok, wgetparent and wgetscrreg. + + + the threaded library (ncursest) also disallows direct updating of + global curses-level variables, providing functions (via macros) for + obtaining their value. A few of those variables can be modified by + the application, using new functions: set_escdelay, set_tabsize + + + added functions use_window() and use_screen() which wrap a mutex + (if threading is configured) around a call to a user-supplied + function. + + Added internal functions: + _nc_get_alias_table + _nc_get_screensize + _nc_keyname + _nc_screen_of + _nc_set_no_padding + _nc_tracechar + _nc_tracemouse + _nc_unctrl + _nc_ungetch + + These are used for leak-testing, and are stubs for + ABI compatibility when ncurses is not configured for that + using the --disable-leaks configure script option: + + _nc_free_and_exit + _nc_leaks_tinfo + + Removed internal functions: + none + + Modified internal functions: + _nc_fifo_dump + _nc_find_entry + _nc_handle_sigwinch + _nc_init_keytry + _nc_keypad + _nc_locale_breaks_acs + _nc_timed_wait + _nc_update_screensize + + Use new typedef TRIES to replace "struct tries": + + _nc_add_to_try + _nc_expand_try + _nc_remove_key + _nc_remove_string + _nc_trace_tries + + 5.6 (December 17, 2006) + Interface changes: + + + generate linkable stubs for some macros: + + getbegx, getbegy, getcurx, getcury, getmaxx, getmaxy, getparx, + getpary, getpary, + + and (for libncursesw) + + wgetbkgrnd + + Added extensions: + nofilter() + use_legacy_coding() + + Added internal functions: + _nc_first_db + _nc_get_source + _nc_handle_sigwinch + _nc_is_abs_path + _nc_is_dir_path + _nc_is_file_path + _nc_keep_tic_dir + _nc_keep_tic_dir + _nc_last_db + _nc_next_db + _nc_read_termtype + _nc_tic_dir + + Also (if using the hashed database configuration): + + _nc_db_close + _nc_db_first + _nc_db_get + _nc_db_have_data + _nc_db_have_index + _nc_db_next + _nc_db_open + _nc_db_put + + otherwise + + _nc_hashed_db + + Removed internal functions: + none + + Modified internal functions: + _nc_add_to_try + _nc_do_color + _nc_expand_try + _nc_remove_key + _nc_setupscreen + + 5.5 (October 10, 2005) + Interface changes: + + + terminfo installs "xterm-new" as "xterm" entry rather than + "xterm-old" (aka xterm-r6). + + + terminfo data is installed using the tic -x option (few systems + still use ncurses 4.2). + + + modify C++ binding to work with newer C++ compilers by providing + initializers and using modern casts. Old-style header names are + still used in this release to allow compiling with not-so-old + compilers. + + + form and menu libraries now work with wide-character data. + Applications which bypassed the form library and manipulated the + FIELD.buf data directly will not work properly with libformw, since + that no longer points to an array of char. The set_field_buffer() + and field_buffer() functions translate to/from the actual field + data. + + + change SP->_current_attr to a pointer, adjust ifdef's to ensure that + libtinfo.so and libtinfow.so have the same ABI. The reason for this + is that the corresponding data which belongs to the upper-level + ncurses library has a different size in each model. + + + winnstr() now returns multibyte character strings for the + wide-character configuration. + + + assume_default_colors() no longer requires that use_default_colors() + be called first. + + + data_ahead() now works with wide-characters. + + + slk_set() and slk_wset() now accept and store multibyte or + multicolumn characters. + + + start_color() now returns OK if colors have already been started. + start_color() also returns ERR if it cannot allocate memory. + + + pair_content() now returns -1 for consistency with init_pair() if it + corresponds to the default-color. + + + unctrl() now returns null if its parameter does not correspond + to an unsigned char. + + Added extensions: + Experimental mouse version 2 supports wheel mice with buttons + 4 and 5. This requires ABI 6 because it modifies the encoding + of mouse events. + + Experimental extended colors allows encoding of 256 foreground + and background colors, e.g., with the xterm-256color or + xterm-88color terminfo entries. This requires ABI 6 because + it changes the size of cchar_t. + + Added internal functions: + _nc_check_termtype2 + _nc_resolve_uses2 + _nc_retrace_cptr + _nc_retrace_cvoid_ptr + _nc_retrace_void_ptr + _nc_setup_term + + Removed internal functions: + none + + Modified internal functions: + _nc_insert_ch + _nc_save_str + _nc_trans_string + 5.4 (February 8, 2004) Interface changes: - + add the remaining functions for X/Open curses wide-character support. + + add the remaining functions for X/Open curses wide-character support. These are only available if the library is configured using the --enable-widec option. pecho_wchar() @@ -742,6 +1244,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: Added extensions: key_defined() + Added internal functions: _nc_get_locale() _nc_insert_ch() @@ -753,9 +1256,11 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: _nc_tparm_analyze() _nc_trace_bufcat() debug _nc_unicode_locale() + Removed internal functions: _nc_outstr() _nc_sigaction() + Modified internal functions: _nc_remove_string() _nc_retrace_chtype() @@ -778,6 +1283,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: Added extensions: is_term_resized() resize_term() + Added internal functions: _nc_altcharset_name() debug _nc_reset_colors() @@ -788,8 +1294,10 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: _nc_varargs() debug _nc_visbufn() debug _nc_wgetch() + Removed internal functions: _nc_background() + Modified internal functions: _nc_freeall() debug @@ -1063,17 +1571,10 @@ RECENT XTERM VERSIONS: --------------------- The terminfo database file included with this distribution assumes you - are running an XFree86 xterm based on X11R6 (i.e., xterm-r6). The - earlier X11R5 entry (xterm-r5) is provided as well. - - If you are running XFree86 version 3.2 (actually 3.1.2F and up), you - should consider using the xterm-xf86-v32 (or later, the most recent - version is always named "xterm-xfree86") entry, which adds ANSI color - and the VT220 capabilities which have been added in XFree86. If you - are running a mixed network, however, where this terminal description - may be used on an older xterm, you may have problems, since - applications that assume these capabilities will produce incorrect - output on the older xterm (e.g., highlighting is not cleared). + are running a modern xterm based on XFree86 (i.e., xterm-new). The + earlier X11R6 entry (xterm-r6) and X11R5 entry (xterm-r5) is provided + as well. See the --without-xterm-new configure script option if you + are unable to update your system. CONFIGURING FALLBACK ENTRIES: @@ -1082,7 +1583,8 @@ CONFIGURING FALLBACK ENTRIES: In order to support operation of ncurses programs before the terminfo tree is accessible (that is, in single-user mode or at OS installation time) the ncurses library can be compiled to include an array of - pre-fetched fallback entries. + pre-fetched fallback entries. This must be done on a machine which + has ncurses' infocmp and terminfo database installed. These entries are checked by setupterm() only when the conventional fetches from the terminfo tree and the termcap fallback (if configured) @@ -1090,23 +1592,23 @@ CONFIGURING FALLBACK ENTRIES: shadow modifications to the on-disk entry for the same type, when that entry is accessible. - By default, there are no entries on the fallback list. After you - have built the ncurses suite for the first time, you can change - the list (the process needs infocmp(1)). To do so, use the script - MKfallback.sh. A configure script option --with-fallbacks does this - (it accepts a comma-separated list of the names you wish, and does - not require a rebuild). + By default, there are no entries on the fallback list. After you have + built the ncurses suite for the first time, you can change the list + (the process needs infocmp(1)). To do so, use the script + ncurses/tinfo/MKfallback.sh. A configure script option + --with-fallbacks does this (it accepts a comma-separated list of the + names you wish, and does not require a rebuild). If you wanted (say) to have linux, vt100, and xterm fallbacks, you would use the commands cd ncurses; - MKfallback.sh linux vt100 xterm >fallback.c + tinfo/MKfallback.sh linux vt100 xterm >fallback.c Then just rebuild and reinstall the library as you would normally. You can restore the default empty fallback list with - MKfallback.sh >fallback.c + tinfo/MKfallback.sh >fallback.c The overhead for an empty fallback list is one trivial stub function. Any non-empty fallback list is const-ed and therefore lives in sharable @@ -1186,45 +1688,37 @@ USING NCURSES WITH AFS: can't hard-link across them. The --enable-symlinks option copes with this by making tic use symbolic links. -USING NCURSES WITH EMACS: - GNU Emacs has its own termcap support. By default, it uses a mixture - of those functions and code linked from the host system's libraries. - You need to foil this and shut out the GNU termcap library entirely. - - In order to do this, hack the Linux config file (s/linux.h) to contain - a #define TERMINFO and set the symbol LIBS_TERMCAP to "-lncurses". - - We have submitted such a change for the 19.30 release, so it may - already be applied in your sources -- check for the #define TERMINFO. - USING NCURSES WITH GPM: - Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) - which is used on Linux console. Be aware that GPM is commonly + Ncurses 4.1 and up can be configured to use GPM (General Purpose + Mouse) which is used on Linux console. Be aware that GPM is commonly installed as a shared library which contains a wrapper for the curses wgetch() function (libcurses.o). Some integrators have simplified - linking applications by combining all or part of libcurses.so (the BSD - curses) into the libgpm.so file, producing symbol conflicts with - ncurses (specifically the wgetch function). You may be able to work - around this problem by linking as follows: + linking applications by combining all or part of libcurses.so into the + libgpm.so file, producing symbol conflicts with ncurses (specifically + the wgetch function). This was originally the BSD curses, but + generally whatever curses library exists on the system. + + You may be able to work around this problem by linking as follows: cc -o foo foo.o -lncurses -lgpm -lncurses but the linker may not cooperate, producing mysterious errors. - A patched version of gpm is available: + See the FAQ, as well as the discussion under the --with-gpm option: - dickey.his.com:/ncurses/gpm-1.10-970125.tar.gz - - This patch is incorporated in gpm 1.12; however some integrators - are slow to update this library. Current distributions of gpm can - be configured properly using the --without-curses option. + http://invisible-island.net/ncurses/ncurses.faq.html#using_gpm_lib BUILDING NCURSES WITH A CROSS-COMPILER Ncurses can be built with a cross-compiler. Some parts must be built with the host's compiler since they are used for building programs (e.g., ncurses/make_hash and ncurses/make_keys) that generate tables - that are compiled into the ncurses library. You should set the - BUILD_CC environment variable to your host's compiler, and run the - configure script configuring for the cross-compiler. + that are compiled into the ncurses library. The essential thing to do + is set the BUILD_CC environment variable to your host's compiler, and + run the configure script configuring for the cross-compiler. + + The configure options --with-build-cc, etc., are provided to make this + simpler. Since make_hash and make_keys use only ANSI C features, it + is normally not necessary to provide the other options such as + --with-build-libs, but they are provided for completeness. Note that all of the generated source-files which are part of ncurses will be made if you use @@ -1235,6 +1729,12 @@ BUILDING NCURSES WITH A CROSS-COMPILER support for the tools used to generate the sources, e.g., sed, awk and Bourne-shell. + When ncurses has been successfully cross-compiled, you may want to use + "make install" (with a suitable target directory) to construct an + install tree. Note that in this case (as with the --with-fallbacks + option), ncurses uses the development platform's tic to do the + "make install.data" portion. + BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to @@ -1243,3 +1743,5 @@ BUGS: The Hacker's Guide in the doc directory includes some guidelines on how to report bugs in ways that will get them fixed most quickly. + +-- vile:txtmode diff --git a/contrib/ncurses/MANIFEST b/contrib/ncurses/MANIFEST index 3d2297e13c..db3871f2e1 100644 --- a/contrib/ncurses/MANIFEST +++ b/contrib/ncurses/MANIFEST @@ -1,8 +1,10 @@ ./ANNOUNCE +./AUTHORS ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO ./Ada95/gen/Makefile.in +./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c ./Ada95/gen/html.m4 ./Ada95/gen/normal.m4 @@ -19,6 +21,7 @@ ./Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 ./Ada95/gen/terminal_interface-curses-panels.ads.m4 ./Ada95/gen/terminal_interface-curses-trace.ads.m4 +./Ada95/gen/terminal_interface-curses.adb.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 ./Ada95/samples/Makefile.in ./Ada95/samples/README @@ -162,7 +165,6 @@ ./Ada95/src/terminal_interface-curses-text_io.adb ./Ada95/src/terminal_interface-curses-text_io.ads ./Ada95/src/terminal_interface-curses-trace.adb_p -./Ada95/src/terminal_interface-curses.adb ./Ada95/src/terminal_interface.ads ./INSTALL ./MANIFEST @@ -206,6 +208,7 @@ ./dist.mk ./doc/hackguide.doc ./doc/html/Ada95.html +./doc/html/NCURSES-Programming-HOWTO.html ./doc/html/ada/files.htm ./doc/html/ada/files/T.htm ./doc/html/ada/funcs.htm @@ -346,8 +349,10 @@ ./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_legacy.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html +./doc/html/man/curs_opaque.3x.html ./doc/html/man/curs_outopts.3x.html ./doc/html/man/curs_overlay.3x.html ./doc/html/man/curs_pad.3x.html @@ -361,6 +366,7 @@ ./doc/html/man/curs_termattrs.3x.html ./doc/html/man/curs_termcap.3x.html ./doc/html/man/curs_terminfo.3x.html +./doc/html/man/curs_threads.3x.html ./doc/html/man/curs_touch.3x.html ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html @@ -390,11 +396,13 @@ ./doc/html/man/form_requestname.3x.html ./doc/html/man/form_userptr.3x.html ./doc/html/man/form_win.3x.html +./doc/html/man/index.html ./doc/html/man/infocmp.1m.html ./doc/html/man/infotocap.1m.html ./doc/html/man/key_defined.3x.html ./doc/html/man/keybound.3x.html ./doc/html/man/keyok.3x.html +./doc/html/man/legacy_coding.3x.html ./doc/html/man/menu.3x.html ./doc/html/man/menu_attributes.3x.html ./doc/html/man/menu_cursor.3x.html @@ -433,6 +441,7 @@ ./doc/ncurses-intro.doc ./form/Makefile.in ./form/READ.ME +./form/f_trace.c ./form/fld_arg.c ./form/fld_attr.c ./form/fld_current.c @@ -495,9 +504,11 @@ ./include/curses.tail ./include/curses.wide ./include/edit_cfg.sh +./include/hashed_db.h ./include/headers ./include/nc_alloc.h ./include/nc_panel.h +./include/nc_tparm.h ./include/ncurses_cfg.hin ./include/ncurses_defs ./include/ncurses_dll.h @@ -546,8 +557,11 @@ ./man/curs_instr.3x ./man/curs_inwstr.3x ./man/curs_kernel.3x +./man/curs_legacy.3x +./man/curs_memleaks.3x ./man/curs_mouse.3x ./man/curs_move.3x +./man/curs_opaque.3x ./man/curs_outopts.3x ./man/curs_overlay.3x ./man/curs_pad.3x @@ -561,6 +575,7 @@ ./man/curs_termattrs.3x ./man/curs_termcap.3x ./man/curs_terminfo.3x +./man/curs_threads.3x ./man/curs_touch.3x ./man/curs_trace.3x ./man/curs_util.3x @@ -595,6 +610,7 @@ ./man/key_defined.3x ./man/keybound.3x ./man/keyok.3x +./man/legacy_coding.3x ./man/make_sed.sh ./man/man_db.renames ./man/manlinks.sed @@ -663,6 +679,7 @@ ./menu/m_scale.c ./menu/m_spacing.c ./menu/m_sub.c +./menu/m_trace.c ./menu/m_userptr.c ./menu/m_win.c ./menu/menu.h @@ -677,13 +694,17 @@ ./misc/emx.src ./misc/form.def ./misc/form.ref -./misc/indent.pro +./misc/gen_edit.sh +./misc/jpf-indent ./misc/makedef.cmd ./misc/makellib ./misc/menu.def ./misc/menu.ref +./misc/ncu-indent +./misc/ncurses-config.in ./misc/ncurses.def ./misc/ncurses.ref +./misc/ncurses.supp ./misc/panel.def ./misc/panel.ref ./misc/run_tic.in @@ -697,7 +718,8 @@ ./mk-0th.awk ./mk-1st.awk ./mk-2nd.awk -./mkinstalldirs +./mk-hdr.awk +./mkdirs.sh ./ncurses/Makefile.in ./ncurses/README ./ncurses/README.IZ @@ -710,6 +732,7 @@ ./ncurses/base/key_defined.c ./ncurses/base/keybound.c ./ncurses/base/keyok.c +./ncurses/base/legacy_coding.c ./ncurses/base/lib_addch.c ./ncurses/base/lib_addstr.c ./ncurses/base/lib_beep.c @@ -738,6 +761,7 @@ ./ncurses/base/lib_initscr.c ./ncurses/base/lib_insch.c ./ncurses/base/lib_insdel.c +./ncurses/base/lib_insnstr.c ./ncurses/base/lib_instr.c ./ncurses/base/lib_isendwin.c ./ncurses/base/lib_leaveok.c @@ -785,15 +809,19 @@ ./ncurses/base/safe_sprintf.c ./ncurses/base/sigaction.c ./ncurses/base/tries.c +./ncurses/base/use_window.c ./ncurses/base/version.c ./ncurses/base/vsscanf.c ./ncurses/base/wresize.c ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses +./ncurses/llib-lncursest ./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk +./ncurses/tinfo/MKcaptab.sh +./ncurses/tinfo/MKcodes.awk ./ncurses/tinfo/MKfallback.sh ./ncurses/tinfo/MKkeys_list.sh ./ncurses/tinfo/MKnames.awk @@ -808,9 +836,12 @@ ./ncurses/tinfo/comp_hash.c ./ncurses/tinfo/comp_parse.c ./ncurses/tinfo/comp_scan.c +./ncurses/tinfo/db_iterator.c ./ncurses/tinfo/doalloc.c +./ncurses/tinfo/entries.c ./ncurses/tinfo/free_ttype.c ./ncurses/tinfo/getenv_num.c +./ncurses/tinfo/hashed_db.c ./ncurses/tinfo/home_terminfo.c ./ncurses/tinfo/init_keytry.c ./ncurses/tinfo/lib_acs.c @@ -839,6 +870,8 @@ ./ncurses/tinfo/read_termcap.c ./ncurses/tinfo/setbuf.c ./ncurses/tinfo/strings.c +./ncurses/tinfo/trim_sgr0.c +./ncurses/tinfo/use_screen.c ./ncurses/tinfo/write_entry.c ./ncurses/trace/README ./ncurses/trace/lib_trace.c @@ -874,6 +907,7 @@ ./ncurses/widechar/lib_in_wchnstr.c ./ncurses/widechar/lib_ins_wch.c ./ncurses/widechar/lib_inwstr.c +./ncurses/widechar/lib_key_name.c ./ncurses/widechar/lib_pecho_wchar.c ./ncurses/widechar/lib_slk_wset.c ./ncurses/widechar/lib_unget_wch.c @@ -917,29 +951,6 @@ ./progs/toe.c ./progs/tput.c ./progs/tset.c -./tack/COPYING -./tack/HISTORY -./tack/Makefile.in -./tack/README -./tack/ansi.c -./tack/charset.c -./tack/color.c -./tack/control.c -./tack/crum.c -./tack/edit.c -./tack/fun.c -./tack/init.c -./tack/menu.c -./tack/modes.c -./tack/modules -./tack/output.c -./tack/pad.c -./tack/scan.c -./tack/sync.c -./tack/sysdep.c -./tack/tack.1 -./tack/tack.c -./tack/tack.h ./tar-copy.sh ./test/Makefile.in ./test/README @@ -948,45 +959,71 @@ ./test/blue.c ./test/bs.6 ./test/bs.c +./test/bulgarian-utf8.txt ./test/cardfile.c ./test/cardfile.dat +./test/chgat.c ./test/color_set.c ./test/configure ./test/configure.in +./test/demo_altkeys.c ./test/demo_defkey.c ./test/demo_forms.c ./test/demo_keyok.c ./test/demo_menus.c ./test/demo_panels.c +./test/demo_termcap.c ./test/ditto.c ./test/dots.c +./test/dots_mvcur.c +./test/echochar.c ./test/edit_field.c ./test/edit_field.h ./test/filter.c ./test/firework.c ./test/firstlast.c +./test/foldkeys.c ./test/gdc.6 ./test/gdc.c ./test/hanoi.c ./test/hashtest.c +./test/inch_wide.c +./test/inchs.c ./test/ins_wide.c ./test/inserts.c +./test/key_names.c ./test/keynames.c ./test/knight.c +./test/linux-color.dat ./test/listused.sh ./test/lrtest.c +./test/mk-test.awk ./test/modules +./test/movewindow.c ./test/ncurses.c ./test/ncurses_tst.hin ./test/newdemo.c +./test/programs ./test/railroad.c ./test/rain.c +./test/redraw.c +./test/savescreen.c +./test/savescreen.sh ./test/tclock.c ./test/test.priv.h +./test/test_arrays.c +./test/test_get_wstr.c +./test/test_getstr.c +./test/test_instr.c +./test/test_inwstr.c +./test/test_opaque.c ./test/testaddch.c ./test/testcurs.c ./test/testscanw.c ./test/tracemunch ./test/view.c +./test/widechars-utf8.txt ./test/worm.c ./test/xmas.c +./test/xterm-16color.dat +./test/xterm-88color.dat diff --git a/contrib/ncurses/Makefile.in b/contrib/ncurses/Makefile.in deleted file mode 100644 index 7a30d32270..0000000000 --- a/contrib/ncurses/Makefile.in +++ /dev/null @@ -1,93 +0,0 @@ -# $Id: Makefile.in,v 1.22 2001/10/27 18:17:22 tom Exp $ -############################################################################## -# Copyright (c) 1998 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,1997 -# -# Master Makefile for ncurses library. - -SHELL = /bin/sh - -DESTDIR=@DESTDIR@ -CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" - -@SET_MAKE@ - -NCURSES_MAJOR = @NCURSES_MAJOR@ -NCURSES_MINOR = @NCURSES_MINOR@ -NCURSES_PATCH = @NCURSES_PATCH@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -ticdir = @TERMINFO@ -includedir = @includedir@ -libdir = @libdir@ -mandir = @mandir@ - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ - -DIRS_TO_MAKE = @DIRS_TO_MAKE@ - -all :: $(DIRS_TO_MAKE) - -$(DIRS_TO_MAKE) : - mkdir $@ - -preinstall : - @ echo '' - @ echo '** Configuration summary for NCURSES $(NCURSES_MAJOR).$(NCURSES_MINOR) $(NCURSES_PATCH):' - @ echo '' - @ echo ' bin directory: '$(bindir) - @ echo ' lib directory: '$(libdir) - @ echo ' include directory: '$(includedir) - @ echo ' man directory: '$(mandir) -@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir) - @ echo '' - @ test "$(includedir)" = "$(prefix)/include" || \ - echo '** Include-directory is not in a standard location' - @ test ! -f $(includedir)/termcap.h || \ - fgrep NCURSES_VERSION $(includedir)/termcap.h >/dev/null || \ - echo '** Will overwrite non-ncurses termcap.h' - @ test ! -f $(includedir)/curses.h || \ - fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ - echo '** Will overwrite non-ncurses curses.h' - -# Put the common rules here so that we can easily construct the list of -# directories to visit. -all \ -clean \ -distclean \ -mostlyclean \ -realclean \ -depend \ -sources \ -uninstall \ -install :: diff --git a/contrib/ncurses/Makefile.os2 b/contrib/ncurses/Makefile.os2 deleted file mode 100644 index 167ff657e0..0000000000 --- a/contrib/ncurses/Makefile.os2 +++ /dev/null @@ -1,234 +0,0 @@ -################################################################################ -# Wrapper Makefile for ncurses library under OS/2. -################################################################################ -# $Id: Makefile.os2,v 1.10 2000/10/09 23:53:57 Ilya.Zakharevich Exp $ -# -# Author: Juan Jose Garcia Ripoll . -# Webpage: http://www.arrakis.es/~worm/ -################################################################################ -# -# Notes (from I Zakharevich) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~ -# I could build the library with the following sequence of commands: -# -# touch Makefile -# make -f Makefile.os2 config -# make -f Makefile.os2 CC=gcc HOSTCC=gcc CXX=gcc -# -# Ignoring the following errors: -# Invalid configuration `os2'... -# ... ac_maketemp="make": not found -# ... syntax error: `done' unexpected -# No rule to make target `lib/ncurses4.dll' -# -# You may need to run -# -# rm make.defs -# make -f Makefile.os2 make.defs -# -# if the build of misc/panel.def fails. -# -# If you do not have perl, the configuration will fail. Use autoconf to -# generate the EMX-specific configure script (see README.emx), and run the -# configure script to generate the makefiles. Then, run -# -# make -f Makefile.os2 make.dlls -# -# Notes (from J J G Ripoll) -# ~~~~~~~~~~~~~~~~~~~~~~~~~ -# The `make.defs' rule creates the new '.def' files and outputs a diagnostic -# about symbols that disappear from one release to the other, as well as -# checks about the new '.def' consistency. If there were no problems, the -# maintainer is free to replace the `.ref' files with the newer ones using the -# `save.defs' rule. So, the only tough work is ensuring that the symbols that -# disappear are not essential. -# -# I first thought about killing '_nc_*' symbols, but it seems that some of -# them --_nc_panel_hook, _nc_ada*, etc-- are needed outside ncurses.dll. -# However, the whole size of the export table will not be larger than 1k or -# so. -# -# [installation] -# -# The way things are handled in misc/Makefile is not well suited for OS/2, -# where only emx.src is needed. Thus, I've written a few wrapper rules in -# Makefile.os2 that handle installation/deinstallation. -# -# [distribution] -# -# There's also a new rule that configures and builds a sort of binary -# distribution, much like the one I prepared for 1.9.9e. It's `os2dist'. -# -################################################################################ - -all :: config - -# This is for configuring - -# What is a useful value for this? -CONFIG_OPTS = --enable-termcap -WWWGET = lynx -source -MV_F = mv -f -DLL_LN_OPTS = -Zcrtdll -Zdll -Zomf -Zmt - -config: config.cache - -config.cache: configure.cmd configure - -$(MV_F) $@ $@.ref - configure.cmd $(CONFIG_OPTS) - -configure.cmd: configure convert_configure.pl - perl convert_configure.pl configure > $@ - -convert_configure.pl: - $(WWWGET) ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/$@ > $@ - -install :: - echo *** - echo *** Do not use this command. Use install.os2 instead. - echo *** - exit 2 - -install.os2 : install.emxdata install.libs install.progs - -include ./Makefile - -all :: make.dlls - -# -# DLLs and that stuff -# - -LIBRARIES = ncurses form menu panel - -DLL_TAG = $(NCURSES_MAJOR) -LIB_TAG = _s - -DLL_ROOTS = $(addsuffix $(DLL_TAG), $(LIBRARIES)) -DLLS = $(addsuffix .dll, $(addprefix ./lib/, $(DLL_ROOTS))) - -LIB_ROOTS = $(addsuffix $(LIB_TAG), $(LIBRARIES)) -LIBS = $(addsuffix .lib, $(addprefix ./lib/, $(LIB_ROOTS))) - -LIBS_AOUT = $(addsuffix .a, $(addprefix ./lib/, $(LIB_ROOTS))) - -DEFS = $(addsuffix .def, $(addprefix ./misc/, $(LIBRARIES))) - -DLL_SIGNATURE = NCurses-$(NCURSES_MAJOR)-$(NCURSES_MINOR)-$(NCURSES_PATCH) - -./lib/%$(LIB_TAG).lib : ./misc/%.def - emximp -o $@ $< - -./lib/%$(LIB_TAG).a : ./misc/%.def - emximp -o $@ $< - -./lib/%$(DLL_TAG).dll : ./lib/%.a - emxomf -o ./lib/$*$(DLL_TAG).lib $< - if [ "$*" = "ncurses" ]; then \ - gcc $(LDFLAGS) $(DLL_LN_OPTS) ./lib/$*$(DLL_TAG).lib \ - ./misc/$*.def -o $@; \ - else \ - gcc $(LDFLAGS) $(DLL_LN_OPTS) ./lib/$*$(DLL_TAG).lib \ - ./lib/ncurses$(LIB_TAG).lib ./misc/$*.def -o $@; \ - fi - -rm -f ./lib/$*$(DLL_TAG).lib - -make.dlls : $(DEFS) $(LIBS) $(DLLS) $(LIBS_AOUT) - -$(DEFS) : make.defs - -LIBDIR = $(DESTDIR)$(libdir) -$(LIBDIR) : - mkdir -p $@ - -install.libs :: $(LIBS) $(DLLS) $(LIBDIR) - @for i in $(DLL_ROOTS); do \ - echo installing ./lib/$$i.dll as $(LIBDIR)/$$i.dll; \ - $(INSTALL_DATA) ./lib/$$i.dll $(LIBDIR)/$$i.dll; done - @for i in $(LIB_ROOTS); do \ - echo installing ./lib/$$i.lib as $(LIBDIR)/$$i.lib; \ - $(INSTALL_DATA) ./lib/$$i.lib $(LIBDIR)/$$i.lib; done - -uninstall.libs :: - -@for i in $(DLL_ROOTS); do \ - echo uninstalling $(LIBDIR)/$$i.dll; \ - rm -f $(LIBDIR)/$$i.dll; done - -@for i in $(LIB_ROOTS); do \ - echo uninstalling $(LIBDIR)/$$i.lib; \ - rm -f $(LIBDIR)/$$i.lib; done - -make.defs : - for i in $(LIBRARIES); do \ - echo LIBRARY $${i}$(DLL_TAG) INITINSTANCE TERMINSTANCE > ./misc/$$i.def; \ - echo DESCRIPTION \"$(DLL_SIGNATURE), module $$i\" >> ./misc/$$i.def; \ - echo CODE LOADONCALL >> ./misc/$$i.def; \ - echo DATA LOADONCALL NONSHARED MULTIPLE >> ./misc/$$i.def; \ - echo EXPORTS >> ./misc/$$i.def; \ - echo Creating $$i.def; \ - (cmd /C ".\\misc\\makedef.cmd ./lib/$$i.a ./misc/$$i.ref >> ./misc/$$i.def" \ - && cmd /C ".\\misc\\chkdef.cmd ./misc/$$i.def") \ - || exit 1; \ - done - touch make.defs - -save.defs : - for i in $(LIBRARIES); do \ - test -f ./misc/$$i.def && cp ./misc/$$i.def ./misc/$$i.ref; \ - done - -clean \ -os2clean :: - -rm -f $(DLLS) $(LIBS) - -realclean :: - -rm -f $(addprefix ./misc/, $(addsuffix .def, $(LIBRARIES))) - -# -# This is a simplified version of misc/Makefile -# - -TICDIR = $(DESTDIR)$(datadir)/terminfo -TABSETDIR = $(DESTDIR)$(datadir)/tabset - -$(TICDIR) : - mkdir -p $@ - -install \ -install.emxdata :: $(TICDIR) - -@rm -fr $(TICDIR)/* - echo Building terminfo database, please wait... - set TERMINFO=$(TICDIR); ./progs/tic ./misc/emx.src - echo Installing the terminfo cleaner and the sources... - cp ./misc/emx.src ./misc/cleantic.cmd $(TICDIR) - ./misc/cleantic.cmd $(TICDIR) - -uninstall \ -uninstall.emxdata :: - -cd $(TICDIR) && rm -rf * - -cd $(TABSETDIR) && rm -rf * - -# -# This is for preparing binary distributions -# - -OS2NAME=ncurses-$(NCURSES_MAJOR).$(NCURSES_MINOR)-emx - -# -# FIXME: this assumes that we can rerun the configure script, changing only -# the install-prefix. That means we cannot provide "interesting" options -# when building. -# -os2dist : - $(MAKE) -f Makefile.os2 os2clean - ./configure --without-debug --with-install-prefix=`pwd|sed -e 's@^.:@@'`/$(OS2NAME) - $(MAKE) -f Makefile.os2 $(CF_MFLAGS) install.os2 - -rm -f $(OS2NAME).zip - echo NCurses-$(NCURSES_MAJOR).$(NCURSES_MINOR)-$(NCURSES_PATCH) for emx > $(OS2NAME)/FILE_ID.DIZ - echo Binary release. >> $(OS2NAME)/FILE_ID.DIZ - zip -r $(OS2NAME).zip ./$(OS2NAME) - -clean \ -os2clean :: - -rm -rf $(OS2NAME) - -rm -f $(OS2NAME).zip - diff --git a/contrib/ncurses/NEWS b/contrib/ncurses/NEWS index 3f2c2d290c..a64450b302 100644 --- a/contrib/ncurses/NEWS +++ b/contrib/ncurses/NEWS @@ -1,10 +1,2224 @@ --- $Id: NEWS,v 1.797 2004/02/08 21:15:26 tom Exp $ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-2007,2008 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: NEWS,v 1.1320 2008/11/02 00:56:22 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. -Changes through 1.9.9e are recorded by Zeyd M. Ben-Halim. -Changes since 1.9.9e are recorded by Thomas Dickey. +Changes through 1.9.9e are recorded by Zeyd M Ben-Halim. +Changes since 1.9.9e are recorded by Thomas E Dickey. + +Contributors include those who have provided patches (even small ones), as well +as those who provide useful information (bug reports, analyses). Changes with +no cited author are the work of Thomas E Dickey (TD). + +A few contributors are given in this file by their initials. +They each account for one percent or more of the changes since 1.9.9e. +See the AUTHORS file for the corresponding full names. + +Changes through 1.9.9e did not credit all contributions; +it is not possible to add this information. + +20081102 5.7 release for upload to ftp.gnu.org + +20081025 + + add a manpage to discuss memory leaks. + + add support for shared libraries for QNX (other than libtool, which + does not work well on that platform). + + build-fix for QNX C++ binding. + +20081018 + + build-fixes for OS/2 EMX. + + modify form library to accept control characters such as newline + in set_field_buffer(), which is compatible with Solaris (report by + Nit Khair). + + modify configure script to assume --without-hashed-db when + --disable-database is used. + + add "-e" option in ncurses/Makefile.in when generating source-files + to force earlier exit if the build environment fails unexpectedly + (prompted by patch by Adrian Bunk). + + change configure script to use CF_UTF8_LIB, improved variant of + CF_LIBUTF8. + +20081012 + + add teraterm4.59 terminfo entry, use that as primary teraterm entry, rename + original to teraterm2.3 -TD + + update "gnome" terminfo to 2.22.3 -TD + + update "konsole" terminfo to 1.6.6, needs today's fix for tic -TD + + add "aterm" terminfo -TD + + add "linux2.6.26" terminfo -TD + + add logic to tic for cancelling strings in user-defined capabilities, + overlooked til now. + +20081011 + + update html documentation. + + add -m and -s options to test/keynames.c and test/key_names.c to test + the meta() function with keyname() or key_name(), respectively. + + correct return value of key_name() on error; it is null. + + document some unresolved issues for rpath and pthreads in TO-DO. + + fix a missing prototype for ioctl() on OpenBSD in tset.c + + add configure option --disable-tic-depends to make explicit whether + tic library depends on ncurses/ncursesw library, amends change from + 20080823 (prompted by Debian #501421). + +20081004 + + some build-fixes for configure --disable-ext-funcs (incomplete, but + works for C/C++ parts). + + improve configure-check for awks unable to handle large strings, e.g. + AIX 5.1 whose awk silently gives up on large printf's. + +20080927 + + fix build for --with-dmalloc by workaround for redefinition of + strndup between string.h and dmalloc.h + + fix build for --disable-sigwinch + + add environment variable NCURSES_GPM_TERMS to allow override to use + GPM on terminals other than "linux", etc. + + disable GPM mouse support when $TERM does not happen to contain + "linux", since Gpm_Open() no longer limits its assertion to terminals + that it might handle, e.g., within "screen" in xterm. + + reset mouse file-descriptor when unloading GPM library (report by + Miroslav Lichvar). + + fix build for --disable-leaks --enable-widec --with-termlib + > patch by Juergen Pfeifer: + + use improved initialization for soft-label keys in Ada95 sample code. + + discard internal symbol _nc_slk_format (unused since 20080112). + + move call of slk_paint_info() from _nc_slk_initialize() to + slk_intern_refresh(), improving initialization. + +20080925 + + fix bug in mouse code for GPM from 20080920 changes (reported in + Debian #500103, also Miroslav Lichvar). + +20080920 + + fix shared-library rules for cygwin with tic- and tinfo-libraries. + + fix a memory leak when failure to connect to GPM. + + correct check for notimeout() in wgetch() (report on linux.redhat + newsgroup by FurtiveBertie). + + add an example warning-suppression file for valgrind, + misc/ncurses.supp (based on example from Reuben Thomas) + +20080913 + + change shared-library configuration for OpenBSD, make rpath work. + + build-fixes for using libutf8, e.g., on OpenBSD 3.7 + +20080907 + + corrected fix for --enable-weak-symbols (report by Frederic L W + Meunier). + +20080906 + + corrected gcc options for building shared libraries on IRIX64. + + add configure check for awk programs unable to handle big-strings, + use that to improve the default for --enable-big-strings option. + + makefile-fixes for --enable-weak-symbols (report by Frederic L W + Meunier). + + update test/configure script. + + adapt ifdef's from library to make test/view.c build when mbrtowc() + is unavailable, e.g., with HPUX 10.20. + + add configure check for wcsrtombs, mbsrtowcs, which are used in + test/ncurses.c, and use wcstombs, mbstowcs instead if available, + fixing build of ncursew for HPUX 11.00 + +20080830 + + fixes to make Ada95 demo_panels() example work. + + modify Ada95 'rain' test program to accept keyboard commands like the + C-version. + + modify BeOS-specific ifdef's to build on Haiku (patch by Scott + Mccreary). + + add configure-check to see if the std namespace is legal for cerr + and endl, to fix a build issue with Tru64. + + consistently use NCURSES_BOOL in lib_gen.c + + filter #line's from lib_gen.c + + change delimiter in MKlib_gen.sh from '%' to '@', to avoid + substitution by IBM xlc to '#' as part of its extensions to digraphs. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + (caveat - its maintainer removed support for older Linux systems). + +20080823 + + modify configure check for pthread library to work with OSF/1 5.1, + which uses #define's to associate its header and library. + + use pthread_mutexattr_init() for initializing pthread_mutexattr_t, + makes threaded code work on HPUX 11.23 + + fix a bug in demo_menus in freeing menus (cf: 20080804). + + modify configure script for the case where tic library is used (and + possibly renamed) to remove its dependency upon ncurses/ncursew + library (patch by Dr Werner Fink). + + correct manpage for menu_fore() which gave wrong default for + the attribute used to display a selected entry (report by Mike Gran). + + add Eterm-256color, Eterm-88color and rxvt-88color (prompted by + Debian #495815) -TD + +20080816 + + add configure option --enable-weak-symbols to turn on new feature. + + add configure-check for availability of weak symbols. + + modify linkage with pthread library to use weak symbols so that + applications not linked to that library will not use the mutexes, + etc. This relies on gcc, and may be platform-specific (patch by Dr + Werner Fink). + + add note to INSTALL to document limitation of renaming of tic library + using the --with-ticlib configure option (report by Dr Werner Fink). + + document (in manpage) why tputs does not detect I/O errors (prompted + by comments by Samuel Thibault). + + fix remaining warnings from Klocwork report. + +20080804 + + modify _nc_panelhook() data to account for a permanent memory leak. + + fix memory leaks in test/demo_menus + + fix most warnings from Klocwork tool (report by Larry Zhou). + + modify configure script CF_XOPEN_SOURCE macro to add case for + "dragonfly" from xterm #236 changes. + + modify configure script --with-hashed-db to let $LIBS override the + search for the db library (prompted by report by Samson Pierre). + +20080726 + + build-fixes for gcc 4.3.1 (changes to gnat "warnings", and C inlining + thresholds). + +20080713 + + build-fix (reports by Christian Ebert, Funda Wang). + +20080712 + + compiler-warning fixes for Solaris. + +20080705 + + use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., to + make those work properly with the "--enable-ext-mouse" configuration + (cf: 20050205). + + improve documentation of build-cc options in INSTALL. + + work-around a bug in gcc 4.2.4 on AIX, which does not pass the + -static/-dynamic flags properly to linker, causing test/bs to + not link. + +20080628 + + correct some ifdef's needed for the broken-linker configuration. + + make debugging library's $BAUDRATE feature work for termcap + interface. + + make $NCURSES_NO_PADDING feature work for termcap interface (prompted + by comment on FreeBSD mailing list). + + add screen.mlterm terminfo entry -TD + + improve mlterm and mlterm+pcfkeys terminfo entries -TD + +20080621 + + regenerated html documentation. + + expand manpage description of parameters for form_driver() and + menu_driver() (prompted by discussion with Adam Spragg). + + add null-pointer checks for cur_term in baudrate() and + def_shell_mode(), def_prog_mode() + + fix some memory leaks in delscreen() and wide acs. + +20080614 + + modify test/ditto.c to illustrate multi-threaded use_screen(). + + change CC_SHARED_OPTS from -KPIC to -xcode=pic32 for Solaris. + + add "-shared" option to MK_SHARED_LIB for gcc on Solaris (report + by Poor Yorick). + +20080607 + + finish changes to wgetch(), making it switch as needed to the + window's actual screen when calling wrefresh() and wgetnstr(). That + allows wgetch() to get used concurrently in different threads with + some minor restrictions, e.g., the application should not delete a + window which is being used in a wgetch(). + + simplify mutex's, combining the window- and screen-mutex's. + +20080531 + + modify wgetch() to use the screen which corresponds to its window + parameter rather than relying on SP; some dependent functions still + use SP internally. + + factor out most use of SP in lib_mouse.c, using parameter. + + add internal _nc_keyname(), replacing keyname() to associate with a + particular SCREEN rather than the global SP. + + add internal _nc_unctrl(), replacing unctrl() to associate with a + particular SCREEN rather than the global SP. + + add internal _nc_tracemouse(), replacing _tracemouse() to eliminate + its associated global buffer _nc_globals.tracemse_buf now in SCREEN. + + add internal _nc_tracechar(), replacing _tracechar() to use SCREEN in + preference to the global _nc_globals.tracechr_buf buffer. + +20080524 + + modify _nc_keypad() to make it switch temporarily as needed to the + screen which must be updated. + + wrap cur_term variable to help make _nc_keymap() thread-safe, and + always set the screen's copy of this variable in set_curterm(). + + restore curs_set() state after endwin()/refresh() (report/patch + Miroslav Lichvar) + +20080517 + + modify configure script to note that --enable-ext-colors and + --enable-ext-mouse are not experimental, but extensions from + the ncurses ABI 5. + + corrected manpage description of setcchar() (discussion with + Emanuele Giaquinta). + + fix for adding a non-spacing character at the beginning of a line + (report/patch by Miroslav Lichvar). + +20080503 + + modify screen.* terminfo entries using new screen+fkeys to fix + overridden keys in screen.rxvt (Debian #478094) -TD + + modify internal interfaces to reduce wgetch()'s dependency on the + global SP. + + simplify some loops with macros each_screen(), each_window() and + each_ripoff(). + +20080426 + + continue modifying test/ditto.c toward making it demonstrate + multithreaded use_screen(), using fifos to pass data between screens. + + fix typo in form.3x (report by Mike Gran). + +20080419 + + add screen.rxvt terminfo entry -TD + + modify tic -f option to format spaces as \s to prevent them from + being lost when that is read back in unformatted strings. + + improve test/ditto.c, using a "talk"-style layout. + +20080412 + + change test/ditto.c to use openpty() and xterm. + + add locks for copywin(), dupwin(), overlap(), overlay() on their + window parameters. + + add locks for initscr() and newterm() on updates to the SCREEN + pointer. + + finish table in curs_thread.3x manpage. + +20080405 + + begin table in curs_thread.3x manpage describing the scope of data + used by each function (or symbol) for threading analysis. + + add null-pointer checks to setsyx() and getsyx() (prompted by + discussion by Martin v. Lowis and Jeroen Ruigrok van der Werven on + python-dev2 mailing list). + +20080329 + + add null-pointer checks in set_term() and delscreen(). + + move _nc_windows into _nc_globals, since windows can be pads, which + are not associated with a particular screen. + + change use_screen() to pass the SCREEN* parameter rather than + stdscr to the callback function. + + force libtool to use tag for 'CC' in case it does not detect this, + e.g., on aix when using CC=powerpc-ibm-aix5.3.0.0-gcc + (report/patch by Michael Haubenwallner). + + override OBJEXT to "lo" when building with libtool, to work on + platforms such as AIX where libtool may use a different suffix for + the object files than ".o" (report/patch by Michael Haubenwallner). + + add configure --with-pthread option, for building with the POSIX + thread library. + +20080322 + + fill in extended-color pair two more places in wbkgrndset() and + waddch_nosync() (prompted by Sedeno's patch). + + fill in extended-color pair in _nc_build_wch() to make colors work + for wide-characters using extended-colors (patch by Alejandro R + Sedeno). + + add x/X toggles to ncurses.c C color test to test/demo + wide-characters with extended-colors. + + add a/A toggles to ncurses.c c/C color tests. + + modify test/ditto.c to use use_screen(). + + finish modifying test/rain.c to demonstrate threads. + +20080308 + + start modifying test/rain.c for threading demo. + + modify test/ncurses.c to make 'f' test accept the f/F/b/F/ toggles + that the 'F' accepts. + + modify test/worm.c to show trail in reverse-video when other threads + are working concurrently. + + fix a deadlock from improper nesting of mutexes for windowlist and + window. + +20080301 + + fixes from 20080223 resolved issue with mutexes; change to use + recursive mutexes to fix memory leak in delwin() as called from + _nc_free_and_exit(). + +20080223 + + fix a size-difference in _nc_globals which caused hanging of mutex + lock/unlock when termlib was built separately. + +20080216 + + avoid using nanosleep() in threaded configuration since that often + is implemented to suspend the entire process. + +20080209 + + update test programs to build/work with various UNIX curses for + comparisons. This was to reinvestigate statement in X/Open curses + that insnstr and winsnstr perform wrapping. None of the Unix-branded + implementations do this, as noted in manpage (cf: 20040228). + +20080203 + + modify _nc_setupscreen() to set the legacy-coding value the same + for both narrow/wide models. It had been set only for wide model, + but is needed to make unctrl() work with locale in the narrow model. + + improve waddch() and winsch() handling of EILSEQ from mbrtowc() by + using unctrl() to display illegal bytes rather than trying to append + further bytes to make up a valid sequence (reported by Andrey A + Chernov). + + modify unctrl() to check codes in 128-255 range versus isprint(). + If they are not printable, and locale was set, use a "M-" or "~" + sequence. + +20080126 + + improve threading in test/worm.c (wrap refresh calls, and KEY_RESIZE + handling). Now it hangs in napms(), no matter whether nanosleep() + or poll() or select() are used on Linux. + +20080119 + + fixes to build with --disable-ext-funcs + + add manpage for use_window and use_screen. + + add set_tabsize() and set_escdelay() functions. + +20080112 + + remove recursive-mutex definitions, finish threading demo for worm.c + + remove a redundant adjustment of lines in resizeterm.c's + adjust_window() which caused occasional misadjustment of stdscr when + softkeys were used. + +20080105 + + several improvements to terminfo entries based on xterm #230 -TD + + modify MKlib_gen.sh to handle keyname/key_name prototypes, so the + "link_test" builds properly. + + fix for toe command-line options -u/-U to ensure filename is given. + + fix allocation-size for command-line parsing in infocmp from 20070728 + (report by Miroslav Lichvar) + + improve resizeterm() by moving ripped-off lines, and repainting the + soft-keys (report by Katarina Machalkova) + + add clarification in wclear's manpage noting that the screen will be + cleared even if a subwindow is cleared (prompted by Christer Enfors + question). + + change test/ncurses.c soft-key tests to work with KEY_RESIZE. + +20071222 + + continue implementing support for threading demo by adding mutex + for delwin(). + +20071215 + + add several functions to C++ binding which wrap C functions that + pass a WINDOW* parameter (request by Chris Lee). + +20071201 + + add note about configure options needed for Berkeley database to the + INSTALL file. + + improve checks for version of Berkeley database libraries. + + amend fix for rpath to not modify LDFLAGS if the platform has no + applicable transformation (report by Christian Ebert, cf: 20071124). + +20071124 + + modify configure option --with-hashed-db to accept a parameter which + is the install-prefix of a given Berkeley Database (prompted by + pierre4d2 comments). + + rewrite wrapper for wcrtomb(), making it work on Solaris. This is + used in the form library to determine the length of the buffer needed + by field_buffer (report by Alfred Fung). + + remove unneeded window-parameter from C++ binding for wresize (report + by Chris Lee). + +20071117 + + modify the support for filesystems which do not support mixed-case to + generate 2-character (hexadecimal) codes for the lower-level of the + filesystem terminfo database (request by Michail Vidiassov). + + add configure option --enable-mixed-case, to allow overriding the + configure script's check if the filesystem supports mixed-case + filenames. + + add wresize() to C++ binding (request by Chris Lee). + + define NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS in curses.h to make + it simpler to tell if the extended functions and/or colors are + declared. + +20071103 + + update memory-leak checks for changes to names.c and codes.c + + correct acsc strings in h19, z100 (patch by Benjamin C W Sittler). + +20071020 + + continue implementing support for threading demo by adding mutex + for use_window(). + + add mrxvt terminfo entry, add/fix xterm building blocks for modified + cursor keys -TD + + compile with FreeBSD "contemporary" TTY interface (patch by + Rong-En Fan). + +20071013 + + modify makefile rules to allow clear, tput and tset to be built + without libtic. The other programs (infocmp, tic and toe) rely on + that library. + + add/modify null-pointer checks in several functions for SP and/or + the WINDOW* parameter (report by Thorben Krueger). + + fixes for field_buffer() in formw library (see Redhat Bugzilla + #310071, patches by Miroslav Lichvar). + + improve performance of NCURSES_CHAR_EQ code (patch by Miroslav + Lichvar). + + update/improve mlterm and rxvt terminfo entries, e.g., for + the modified cursor- and keypad-keys -TD + +20071006 + + add code to curses.priv.h ifdef'd with NCURSES_CHAR_EQ, which + changes the CharEq() macro to an inline function to allow comparing + cchar_t struct's without comparing gaps in a possibly unpacked + memory layout (report by Miroslav Lichvar). + +20070929 + + add new functions to lib_trace.c to setup mutex's for the _tracef() + calls within the ncurses library. + + for the reentrant model, move _nc_tputs_trace and _nc_outchars into + the SCREEN. + + start modifying test/worm.c to provide threading demo (incomplete). + + separated ifdef's for some BSD-related symbols in tset.c, to make + it compile on LynxOS (report by Greg Gemmer). +20070915 + + modify Ada95/gen/Makefile to use shlib script, to simplify building + shared-library configuration on platforms lacking rpath support. + + build-fix for Ada95/src/Makefile to reflect changed dependency for + the terminal-interface-curses-aux.adb file which is now generated. + + restructuring test/worm.c, for use_window() example. + +20070908 + + add use_window() and use_screen() functions, to develop into support + for threaded library (incomplete). + + fix typos in man/curs_opaque.3x which kept the install script from + creating symbolic links to two aliases created in 20070818 (report by + Rong-En Fan). + +20070901 + + remove a spurious newline from output of html.m4, which caused links + for Ada95 html to be incorrect for the files generated using m4. + + start investigating mutex's for SCREEN manipulation (incomplete). + + minor cleanup of codes.c/names.c for --enable-const + + expand/revise "Routine and Argument Names" section of ncurses manpage + to address report by David Givens in newsgroup discussion. + + fix interaction between --without-progs/--with-termcap configure + options (report by Michail Vidiassov). + + fix typo in "--disable-relink" option (report by Michail Vidiassov). + +20070825 + + fix a sign-extension bug in infocmp's repair_acsc() function + (cf: 971004). + + fix old configure script bug which prevented "--disable-warnings" + option from working (patch by Mike Frysinger). + +20070818 + + add 9term terminal description (request by Juhapekka Tolvanen) -TD + + modify comp_hash.c's string output to avoid misinterpreting a null + "\0" followed by a digit. + + modify MKnames.awk and MKcodes.awk to support big-strings. + This only applies to the cases (broken linker, reentrant) where + the corresponding arrays are accessed via wrapper functions. + + split MKnames.awk into two scripts, eliminating the shell redirection + which complicated the make process and also the bogus timestamp file + which was introduced to fix "make -j". + + add test/test_opaque.c, test/test_arrays.c + + add wgetscrreg() and wgetparent() for applications that may need it + when NCURSES_OPAQUE is defined (prompted by Bryan Christ). + +20070812 + + amend treatment of infocmp "-r" option to retain the 1023-byte limit + unless "-T" is given (cf: 981017). + + modify comp_captab.c generation to use big-strings. + + make _nc_capalias_table and _nc_infoalias_table private accessed via + _nc_get_alias_table() since the tables are used only within the tic + library. + + modify configure script to skip Intel compiler in CF_C_INLINE. + + make _nc_info_hash_table and _nc_cap_hash_table private accessed via + _nc_get_hash_table() since the tables are used only within the tic + library. + +20070728 + + make _nc_capalias_table and _nc_infoalias_table private, accessed via + _nc_get_alias_table() since they are used only by parse_entry.c + + make _nc_key_names private since it is used only by lib_keyname.c + + add --disable-big-strings configure option to control whether + unctrl.c is generated using the big-string optimization - which may + use strings longer than supported by a given compiler. + + reduce relocation tables for tic, infocmp by changing type of + internal hash tables to short, and make those private symbols. + + eliminate large fixed arrays from progs/infocmp.c + +20070721 + + change winnstr() to stop at the end of the line (cf: 970315). + + add test/test_get_wstr.c + + add test/test_getstr.c + + add test/test_inwstr.c + + add test/test_instr.c + +20070716 + + restore a call to obtain screen-size in _nc_setupterm(), which + is used in tput and other non-screen applications via setupterm() + (Debian #433357, reported by Florent Bayle, Christian Ohm, + cf: 20070310). + +20070714 + + add test/savescreen.c test-program + + add check to trace-file open, if the given name is a directory, add + ".log" to the name and try again. + + add konsole-256color entry -TD + + add extra gcc warning options from xterm. + + minor fixes for ncurses/hashmap test-program. + + modify configure script to quiet c++ build with libtool when the + --disable-echo option is used. + + modify configure script to disable ada95 if libtool is selected, + writing a warning message (addresses FreeBSD ports/114493). + + update config.guess, config.sub + +20070707 + + add continuous-move "M" to demo_panels to help test refresh changes. + + improve fix for refresh of window on top of multi-column characters, + taking into account some split characters on left/right window + boundaries. + +20070630 + + add "widec" row to _tracedump() output to help diagnose remaining + problems with multi-column characters. + + partial fix for refresh of window on top of multi-column characters + which are partly overwritten (report by Sadrul H Chowdhury). + + ignore A_CHARTEXT bits in vidattr() and vid_attr(), in case + multi-column extension bits are passed there. + + add setlocale() call to demo_panels.c, needed for wide-characters. + + add some output flags to _nc_trace_ttymode to help diagnose a bug + report by Larry Virden, i.e., ONLCR, OCRNL, ONOCR and ONLRET, + +20070623 + + add test/demo_panels.c + + implement opaque version of setsyx() and getsyx(). + +20070612 + + corrected xterm+pcf2 terminfo modifiers for F1-F4, to match xterm + #226 -TD + + split-out key_name() from MKkeyname.awk since it now depends upon + wunctrl() which is not in libtinfo (report by Rong-En Fan). + +20070609 + + add test/key_name.c + + add stdscr cases to test/inchs.c and test/inch_wide.c + + update test/configure + + correct formatting of DEL (0x7f) in _nc_vischar(). + + null-terminate result of wunctrl(). + + add null-pointer check in key_name() (report by Andreas Krennmair, + cf: 20020901). + +20070602 + + adapt mouse-handling code from menu library in form-library + (discussion with Clive Nicolson). + + add a modification of test/dots.c, i.e., test/dots_mvcur.c to + illustrate how to use mvcur(). + + modify wide-character flavor of SetAttr() to preserve the + WidecExt() value stored in the .attr field, e.g., in case it + is overwritten by chgat (report by Aleksi Torhamo). + + correct buffer-size for _nc_viswbuf2n() (report by Aleksi Torhamo). + + build-fixes for Solaris 2.6 and 2.7 (patch by Peter O'Gorman). + +20070526 + + modify keyname() to use "^X" form only if meta() has been called, or + if keyname() is called without initializing curses, e.g., via + initscr() or newterm() (prompted by LinuxBase #1604). + + document some portability issues in man/curs_util.3x + + add a shadow copy of TTY buffer to _nc_prescreen to fix applications + broken by moving that data into SCREEN (cf: 20061230). + +20070512 + + add 'O' (wide-character panel test) in ncurses.c to demonstrate a + problem reported by Sadrul H Chowdhury with repainting parts of + a fullwidth cell. + + modify slk_init() so that if there are preceding calls to + ripoffline(), those affect the available lines for soft-keys (adapted + from patch by Clive Nicolson). + + document some portability issues in man/curs_getyx.3x + +20070505 + + fix a bug in Ada95/samples/ncurses which caused a variable to + become uninitialized in the "b" test. + + fix Ada95/gen/Makefile.in adahtml rule to account for recent + movement of files, fix a few incorrect manpage references in the + generated html. + + add Ada95 binding to _nc_freeall() as Curses_Free_All to help with + memory-checking. + + correct some functions in Ada95 binding which were using return value + from C where none was returned: idcok(), immedok() and wtimeout(). + + amend recent changes for Ada95 binding to make it build with + Cygwin's linker, e.g., with configure options + --enable-broken-linker --with-ticlib + +20070428 + + add a configure check for gcc's options for inlining, use that to + quiet a warning message where gcc's default behavior changed from + 3.x to 4.x. + + improve warning message when checking if GPM is linked to curses + library by not warning if its use of "wgetch" is via a weak symbol. + + add loader options when building with static libraries to ensure that + an installed shared library for ncurses does not conflict. This is + reported as problem with Tru64, but could affect other platforms + (report Martin Mokrejs, analysis by Tim Mooney). + + fix build on cygwin after recent ticlib/termlib changes, i.e., + + adjust TINFO_SUFFIX value to work with cygwin's dll naming + + revert a change from 20070303 which commented out dependency of + SHLIB_LIST in form/menu/panel/c++ libraries. + + fix initialization of ripoff stack pointer (cf: 20070421). + +20070421 + + move most static variables into structures _nc_globals and + _nc_prescreen, to simplify storage. + + add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding + type for data manipulated by signal handlers (prompted by comments + in mailing.openbsd.bugs newsgroup). + + modify CF_WITH_LIBTOOL to allow one to pass options such as -static + to the libtool create- and link-operations. + +20070414 + + fix whitespace in curs_opaque.3x which caused a spurious ';' in + the installed aliases (report by Peter Santoro). + + fix configure script to not try to generate adacurses-config when + Ada95 tree is not built. + +20070407 + + add man/curs_legacy.3x, man/curs_opaque.3x + + fix acs_map binding for Ada95 when --enable-reentrant is used. + + add adacurses-config to the Ada95 install, based on version from + FreeBSD port, in turn by Juergen Pfeifer in 2000 (prompted by + comment on comp.lang.ada newsgroup). + + fix includes in c++ binding to build with Intel compiler + (cf: 20061209). + + update install rule in Ada95 to use mkdirs.sh + > other fixes prompted by inspection for Coverity report: + + modify ifdef's for c++ binding to use try/catch/throw statements + + add a null-pointer check in tack/ansi.c request_cfss() + + fix a memory leak in ncurses/base/wresize.c + + corrected check for valid memu/meml capabilities in + progs/dump_entry.c when handling V_HPUX case. + > fixes based on Coverity report: + + remove dead code in test/bs.c + + remove dead code in test/demo_defkey.c + + remove an unused assignment in progs/infocmp.c + + fix a limit check in tack/ansi.c tools_charset() + + fix tack/ansi.c tools_status() to perform the VT320/VT420 + tests in request_cfss(). The function had exited too soon. + + fix a memory leak in tic.c's make_namelist() + + fix a couple of places in tack/output.c which did not check for EOF. + + fix a loop-condition in test/bs.c + + add index checks in lib_color.c for color palettes + + add index checks in progs/dump_entry.c for version_filter() handling + of V_BSD case. + + fix a possible null-pointer dereference in copywin() + + fix a possible null-pointer dereference in waddchnstr() + + add a null-pointer check in _nc_expand_try() + + add a null-pointer check in tic.c's make_namelist() + + add a null-pointer check in _nc_expand_try() + + add null-pointer checks in test/cardfile.c + + fix a double-free in ncurses/tinfo/trim_sgr0.c + + fix a double-free in ncurses/base/wresize.c + + add try/catch block to c++/cursesmain.cc + +20070331 + + modify Ada95 binding to build with --enable-reentrant by wrapping + global variables (bug: acs_map does not yet work). + + modify Ada95 binding to use the new access-functions, allowing it + to build/run when NCURSES_OPAQUE is set. + + add access-functions and macros to return properties of the WINDOW + structure, e.g., when NCURSES_OPAQUE is set. + + improved install-sh's quoting. + + use mkdirs.sh rather than mkinstalldirs, e.g., to use fixes from + other programs. + +20070324 + + eliminate part of the direct use of WINDOW data from Ada95 interface. + + fix substitutions for termlib filename to make configure option + --enable-reentrant work with --with-termlib. + + change a constructor for NCursesWindow to allow compiling with + NCURSES_OPAQUE set, since we cannot pass a reference to + an opaque pointer. + +20070317 + + ignore --with-chtype=unsigned since unsigned is always added to + the type in curses.h; do the same for --with-mmask-t. + + change warning regarding --enable-ext-colors and wide-character + in the configure script to an error. + + tweak error message in CF_WITH_LIBTOOL to distinguish other programs + such as Darwin's libtool program (report by Michail Vidiassov) + + modify edit_man.sh to allow for multiple substitutions per line. + + set locale in misc/ncurses-config.in since it uses a range + + change permissions libncurses++.a install (report by Michail + Vidiassov). + + corrected length of temporary buffer in wide-character version + of set_field_buffer() (related to report by Bryan Christ). + +20070311 + + fix mk-1st.awk script install_shlib() function, broken in 20070224 + changes for cygwin (report by Michail Vidiassov). + +20070310 + + increase size of array in _nc_visbuf2n() to make "tic -v" work + properly in its similar_sgr() function (report/analysis by Peter + Santoro). + + add --enable-reentrant configure option for ongoing changes to + implement a reentrant version of ncurses: + + libraries are suffixed with "t" + + wrap several global variables (curscr, newscr, stdscr, ttytype, + COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES and TABSIZE) as + functions returning values stored in SCREEN or cur_term. + + move some initialization (LINES, COLS) from lib_setup.c, + i.e., setupterm() to _nc_setupscreen(), i.e., newterm(). + +20070303 + + regenerated html documentation. + + add NCURSES_OPAQUE symbol to curses.h, will use to make structs + opaque in selected configurations. + + move the chunk in lib_acs.c which resets acs capabilities when + running on a terminal whose locale interferes with those into + _nc_setupscreen(), so the libtinfo/libtinfow files can be made + identical (requested by Miroslav Lichvar). + + do not use configure variable SHLIB_LIBS for building libraries + outside the ncurses directory, since that symbol is customized + only for that directory, and using it introduces an unneeded + dependency on libdl (requested by Miroslav Lichvar). + + modify mk-1st.awk so the generated makefile rules for linking or + installing shared libraries do not first remove the library, in + case it is in use, e.g., libncurses.so by /bin/sh (report by Jeff + Chua). + + revised section "Using NCURSES under XTERM" in ncurses-intro.html + (prompted by newsgroup comment by Nick Guenther). + +20070224 + + change internal return codes of _nc_wgetch() to check for cases + where KEY_CODE_YES should be returned, e.g., if a KEY_RESIZE was + ungetch'd, and read by wget_wch(). + + fix static-library build broken in 20070217 changes to remove "-ldl" + (report by Miroslav Lichvar). + + change makefile/scripts for cygwin to allow building termlib. + + use Form_Hook in manpages to match form.h + + use Menu_Hook in manpages, as well as a few places in menu.h + + correct form- and menu-manpages to use specific Field_Options, + Menu_Options and Item_Options types. + + correct prototype for _tracechar() in manpage (cf: 20011229). + + correct prototype for wunctrl() in manpage. + +20070217 + + fixes for $(TICS_LIST) in ncurses/Makefile (report by Miroslav + Lichvar). + + modify relinking of shared libraries to apply only when rpath is + enabled, and add --disable-relink option which can be used to + disable the feature altogether (reports by Michail Vidiassov, + Adam J Richter). + + fix --with-termlib option for wide-character configuration, stripping + the "w" suffix in one place (report by Miroslav Lichvar). + + remove "-ldl" from some library lists to reduce dependencies in + programs (report by Miroslav Lichvar). + + correct description of --enable-signed-char in configure --help + (report by Michail Vidiassov). + + add pattern for GNU/kFreeBSD configuration to CF_XOPEN_SOURCE, + which matches an earlier change to CF_SHARED_OPTS, from xterm #224 + fixes. + + remove "${DESTDIR}" from -install_name option used for linking + shared libraries on Darwin (report by Michail Vidiassov). + +20070210 + + add test/inchs.c, test/inch_wide.c, to test win_wchnstr(). + + remove libdl from library list for termlib (report by Miroslav + Lichvar). + + fix configure.in to allow --without-progs --with-termlib (patch by + Miroslav Lichvar). + + modify win_wchnstr() to ensure that only a base cell is returned + for each multi-column character (prompted by report by Wei Kong + regarding change in mvwin_wch() cf: 20041023). + +20070203 + + modify fix_wchnstr() in form library to strip attributes (and color) + from the cchar_t array (field cells) read from a field's window. + Otherwise, when copying the field cells back to the window, the + associated color overrides the field's background color (report by + Ricardo Cantu). + + improve tracing for form library, showing created forms, fields, etc. + + ignore --enable-rpath configure option if --with-shared was omitted. + + add _nc_leaks_tinfo(), _nc_free_tic(), _nc_free_tinfo() entrypoints + to allow leak-checking when both tic- and tinfo-libraries are built. + + drop CF_CPP_VSCAN_FUNC macro from configure script, since C++ binding + no longer relies on it. + + disallow combining configure script options --with-ticlib and + --enable-termcap (report by Rong-En Fan). + + remove tack from ncurses tree. + +20070128 + + fix typo in configure script that broke --with-termlib option + (report by Rong-En Fan). + +20070127 + + improve fix for FreeBSD gnu/98975, to allow for null pointer passed + to tgetent() (report by Rong-en Fan). + + update tack/HISTORY and tack/README to tell how to build it after + it is removed from the ncurses tree. + + fix configure check for libtool's version to trim blank lines + (report by sci-fi@hush.ai). + + review/eliminate other original-file artifacts in cursesw.cc, making + its license consistent with ncurses. + + use ncurses vw_scanw() rather than reading into a fixed buffer in + the c++ binding for scanw() methods (prompted by report by Nuno Dias). + + eliminate fixed-buffer vsprintf() calls in c++ binding. + +20070120 + + add _nc_leaks_tic() to separate leak-checking of tic library from + term/ncurses libraries, and thereby eliminate a library dependency. + + fix test/mk-test.awk to ignore blank lines. + + correct paths in include/headers, for --srcdir (patch by Miroslav + Lichvar). + +20070113 + + add a break-statement in misc/shlib to ensure that it exits on the + _first_ matched directory (report by Paul Novak). + + add tack/configure, which can be used to build tack outside the + ncurses build-tree. + + add --with-ticlib option, to build/install the tic-support functions + in a separate library (suggested by Miroslav Lichvar). + +20070106 + + change MKunctrl.awk to reduce relocation table for unctrl.o + + change MKkeyname.awk to reduce relocation table for keyname.o + (patch by Miroslav Lichvar). + +20061230 + + modify configure check for libtool's version to trim blank lines + (report by sci-fi@hush.ai). + + modify some modules to allow them to be reentrant if _REENTRANT is + defined: lib_baudrate.c, resizeterm.c (local data only) + + eliminate static data from some modules: add_tries.c, hardscroll.c, + lib_ttyflags.c, lib_twait.c + + improve manpage install to add aliases for the transformed program + names, e.g., from --program-prefix. + + used linklint to verify links in the HTML documentation, made fixes + to manpages as needed. + + fix a typo in curs_mouse.3x (report by William McBrine). + + fix install-rule for ncurses5-config to make the bin-directory. + +20061223 + + modify configure script to omit the tic (terminfo compiler) support + from ncurses library if --without-progs option is given. + + modify install rule for ncurses5-config to do this via "install.libs" + + modify shared-library rules to allow FreeBSD 3.x to use rpath. + + update config.guess, config.sub + +20061217 5.6 release for upload to ftp.gnu.org + +20061217 + + add ifdef's for for HPUX, which has the corresponding + definitions in . + + revert the va_copy() change from 20061202, since it was neither + correct nor portable. + + add $(LOCAL_LIBS) definition to progs/Makefile.in, needed for + rpath on Solaris. + + ignore wide-acs line-drawing characters that wcwidth() claims are + not one-column. This is a workaround for Solaris' broken locale + support. + +20061216 + + modify configure --with-gpm option to allow it to accept a parameter, + i.e., the name of the dynamic GPM library to load via dlopen() + (requested by Bryan Henderson). + + add configure option --with-valgrind, changes from vile. + + modify configure script AC_TRY_RUN and AC_TRY_LINK checks to use + 'return' in preference to 'exit()'. + +20061209 + + change default for --with-develop back to "no". + + add XTABS to tracing of TTY bits. + + updated autoconf patch to ifdef-out the misfeature which declares + exit() for configure tests. This fixes a redefinition warning on + Solaris. + + use ${CC} rather than ${LD} in shared library rules for IRIX64, + Solaris to help ensure that initialization sections are provided for + extra linkage requirements, e.g., of C++ applications (prompted by + comment by Casper Dik in newsgroup). + + rename "$target" in CF_MAN_PAGES to make it easier to distinguish + from the autoconf predefined symbol. There was no conflict, + since "$target" was used only in the generated edit_man.sh file, + but SuSE's rpm package contains a patch. + +20061202 + + update man/term.5 to reflect extended terminfo support and hashed + database configuration. + + updates for test/configure script. + + adapted from SuSE rpm package: + + remove long-obsolete workaround for broken-linker which declared + cur_term in tic.c + + improve error recovery in PUTC() macro when wcrtomb() does not + return usable results for an 8-bit character. + + patches from rpm package (SuSE): + + use va_copy() in extra varargs manipulation for tracing version + of printw, etc. + + use a va_list rather than a null in _nc_freeall()'s call to + _nc_printf_string(). + + add some see-also references in manpages to show related + wide-character functions (suggested by Claus Fischer). + +20061125 + + add a check in lib_color.c to ensure caller does not increase COLORS + above max_colors, which is used as an array index (discussion with + Simon Sasburg). + + add ifdef's allowing ncurses to be built with tparm() using either + varargs (the existing status), or using a fixed-parameter list (to + match X/Open). + +20061104 + + fix redrawing of windows other than stdscr using wredrawln() by + touching the corresponding rows in curscr (discussion with Dan + Gookin). + + add test/redraw.c + + add test/echochar.c + + review/cleanup manpage descriptions of error-returns for form- and + menu-libraries (prompted by FreeBSD docs/46196). + +20061028 + + add AUTHORS file -TD + + omit the -D options from output of the new config script --cflags + option (suggested by Ralf S Engelschall). + + make NCURSES_INLINE unconditionally defined in curses.h + +20061021 + + revert change to accommodate bash 3.2, since that breaks other + platforms, e.g., Solaris. + + minor fixes to NEWS file to simplify scripting to obtain list of + contributors. + + improve some shared-library configure scripting for Linux, FreeBSD + and NetBSD to make "--with-shlib-version" work. + + change configure-script rules for FreeBSD shared libraries to allow + for rpath support in versions past 3. + + use $(DESTDIR) in makefile rules for installing/uninstalling the + package config script (reports/patches by Christian Wiese, + Ralf S Engelschall). + + fix a warning in the configure script for NetBSD 2.0, working around + spurious blanks embedded in its ${MAKEFLAGS} symbol. + + change test/Makefile to simplify installing test programs in a + different directory when --enable-rpath is used. + +20061014 + + work around bug in bash 3.2 by adding extra quotes (Jim Gifford). + + add/install a package config script, e.g., "ncurses5-config" or + "ncursesw5-config", according to configuration options. + +20061007 + + add several GNU Screen terminfo variations with 16- and 256-colors, + and status line (Alain Bench). + + change the way shared libraries (other than libtool) are installed. + Rather than copying the build-tree's libraries, link the shared + objects into the install directory. This makes the --with-rpath + option work except with $(DESTDIR) (cf: 20000930). + +20060930 + + fix ifdef in c++/internal.h for QNX 6.1 + + test-compiled with (old) egcs-1.1.2, modified configure script to + not unset the $CXX and related variables which would prevent this. + + fix a few terminfo.src typos exposed by improvments to "-f" option. + + improve infocmp/tic "-f" option formatting. + +20060923 + + make --disable-largefile option work (report by Thomas M Ott). + + updated html documentation. + + add ka2, kb1, kb3, kc2 to vt220-keypad as an extension -TD + + minor improvements to rxvt+pcfkeys -TD + +20060916 + + move static data from lib_mouse.c into SCREEN struct. + + improve ifdef's for _POSIX_VDISABLE in tset to work with Mac OS X + (report by Michail Vidiassov). + + modify CF_PATH_SYNTAX to ensure it uses the result from --prefix + option (from lynx changes) -TD + + adapt AC_PROG_EGREP check, noting that this is likely to be another + place aggravated by POSIXLY_CORRECT. + + modify configure check for awk to ensure that it is found (prompted + by report by Christopher Parker). + + update config.sub + +20060909 + + add kon, kon2 and jfbterm terminfo entry (request by Till Maas) -TD + + remove invis capability from klone+sgr, mainly used by linux entry, + since it does not really do this -TD + +20060903 + + correct logic in wadd_wch() and wecho_wch(), which did not guard + against passing the multi-column attribute into a call on waddch(), + e.g., using data returned by win_wch() (cf: 20041023) + (report by Sadrul H Chowdhury). + +20060902 + + fix kterm's acsc string -TD + + fix for change to tic/infocmp in 20060819 to ensure no blank is + embedded into a termcap description. + + workaround for 20050806 ifdef's change to allow visbuf.c to compile + when using --with-termlib --with-trace options. + + improve tgetstr() by making the return value point into the user's + buffer, if provided (patch by Miroslav Lichvar (see Redhat Bugzilla + #202480)). + + correct libraries needed for foldkeys (report by Stanislav Ievlev) + +20060826 + + add terminfo entries for xfce terminal (xfce) and multi gnome + terminal (mgt) -TD + + add test/foldkeys.c + +20060819 + + modify tic and infocmp to avoid writing trailing blanks on terminfo + source output (Debian #378783). + + modify configure script to ensure that if the C compiler is used + rather than the loader in making shared libraries, the $(CFLAGS) + variable is also used (Redhat Bugzilla #199369). + + port hashed-db code to db2 and db3. + + fix a bug in tgetent() from 20060625 and 20060715 changes + (patch/analysis by Miroslav Lichvar (see Redhat Bugzilla #202480)). + +20060805 + + updated xterm function-keys terminfo to match xterm #216 -TD + + add configure --with-hashed-db option (tested only with FreeBSD 6.0, + e.g., the db 1.8.5 interface). + +20060729 + + modify toe to access termcap data, e.g., via cgetent() functions, + or as a text file if those are not available. + + use _nc_basename() in tset to improve $SHELL check for csh/sh. + + modify _nc_read_entry() and _nc_read_termcap_entry() so infocmp, + can access termcap data when the terminfo database is disabled. + +20060722 + + widen the test for xterm kmous a little to allow for other strings + than \E[M, e.g., for xterm-sco functionality in xterm. + + update xterm-related terminfo entries to match xterm patch #216 -TD + + update config.guess, config.sub + +20060715 + + fix for install-rule in Ada95 to add terminal_interface.ads + and terminal_interface.ali (anonymous posting in comp.lang.ada). + + correction to manpage for getcchar() (report by William McBrine). + + add test/chgat.c + + modify wchgat() to mark updated cells as changed so a refresh will + repaint those cells (comments by Sadrul H Chowdhury and William + McBrine). + + split up dependency of names.c and codes.c in ncurses/Makefile to + work with parallel make (report/analysis by Joseph S Myers). + + suppress a warning message (which is ignored) for systems without + an ldconfig program (patch by Justin Hibbits). + + modify configure script --disable-symlinks option to allow one to + disable symlink() in tic even when link() does not work (report by + Nigel Horne). + + modify MKfallback.sh to use tic -x when constructing fallback tables + to allow extended capabilities to be retrieved from a fallback entry. + + improve leak-checking logic in tgetent() from 20060625 to ensure that + it does not free the current screen (report by Miroslav Lichvar). + +20060708 + + add a check for _POSIX_VDISABLE in tset (NetBSD #33916). + + correct _nc_free_entries() and related functions used for memory leak + checking of tic. + +20060701 + + revert a minor change for magic-cookie support from 20060513, which + caused unexpected reset of attributes, e.g., when resizing test/view + in color mode. + + note in clear manpage that the program ignores command-line + parameters (prompted by Debian #371855). + + fixes to make lib_gen.c build properly with changes to the configure + --disable-macros option and NCURSES_NOMACROS (cf: 20060527) + + update/correct several terminfo entries -TD + + add some notes regarding copyright to terminfo.src -TD + +20060625 + + fixes to build Ada95 binding with gnat-4.1.0 + + modify read_termtype() so the term_names data is always allocated as + part of the str_table, a better fix for a memory leak (cf: 20030809). + + reduce memory leaks in repeated calls to tgetent() by remembering the + last TERMINAL* value allocated to hold the corresponding data and + freeing that if the tgetent() result buffer is the same as the + previous call (report by "Matt" for FreeBSD gnu/98975). + + modify tack to test extended capability function-key strings. + + improved gnome terminfo entry (GenToo #122566). + + improved xterm-256color terminfo entry (patch by Alain Bench). + +20060617 + + fix two small memory leaks related to repeated tgetent() calls + with TERM=screen (report by "Matt" for FreeBSD gnu/98975). + + add --enable-signed-char to simplify Debian package. + + reduce name-pollution in term.h by removing #define's for HAVE_xxx + symbols. + + correct typo in curs_terminfo.3x (Debian #369168). + +20060603 + + enable the mouse in test/movewindow.c + + improve a limit-check in frm_def.c (John Heasley). + + minor copyright fixes. + + change configure script to produce test/Makefile from data file. + +20060527 + + add a configure option --enable-wgetch-events to enable + NCURSES_WGETCH_EVENTS, and correct the associated loop-logic in + lib_twait.c (report by Bernd Jendrissek). + + remove include/nomacros.h from build, since the ifdef for + NCURSES_NOMACROS makes that obsolete. + + add entrypoints for some functions which were only provided as macros + to make NCURSES_NOMACROS ifdef work properly: getcurx(), getcury(), + getbegx(), getbegy(), getmaxx(), getmaxy(), getparx() and getpary(), + wgetbkgrnd(). + + provide ifdef for NCURSES_NOMACROS which suppresses most macro + definitions from curses.h, i.e., where a macro is defined to override + a function to improve performance. Allowing a developer to suppress + these definitions can simplify some application (discussion with + Stanislav Ievlev). + + improve description of memu/meml in terminfo manpage. + +20060520 + + if msgr is false, reset video attributes when doing an automargin + wrap to the next line. This makes the ncurses 'k' test work properly + for hpterm. + + correct caching of keyname(), which was using only half of its table. + + minor fixes to memory-leak checking. + + make SCREEN._acs_map and SCREEN._screen_acs_map pointers rather than + arrays, making ACS_LEN less visible to applications (suggested by + Stanislav Ievlev). + + move chunk in SCREEN ifdef'd for USE_WIDEC_SUPPORT to the end, so + _screen_acs_map will have the same offset in both ncurses/ncursesw, + making the corresponding tinfo/tinfow libraries binary-compatible + (cf: 20041016, report by Stanislav Ievlev). + +20060513 + + improve debug-tracing for EmitRange(). + + change default for --with-develop to "yes". Add NCURSES_NO_HARD_TABS + and NCURSES_NO_MAGIC_COOKIE environment variables to allow runtime + suppression of the related hard-tabs and xmc-glitch features. + + add ncurses version number to top-level manpages, e.g., ncurses, tic, + infocmp, terminfo as well as form, menu, panel. + + update config.guess, config.sub + + modify ncurses.c to work around a bug in NetBSD 3.0 curses + (field_buffer returning null for a valid field). The 'r' test + appears to not work with that configuration since the new_fieldtype() + function is broken in that implementation. + +20060506 + + add hpterm-color terminfo entry -TD + + fixes to compile test-programs with HPUX 11.23 + +20060422 + + add copyright notices to files other than those that are generated, + data or adapted from pdcurses (reports by William McBrine, David + Taylor). + + improve rendering on hpterm by not resetting attributes at the end + of doupdate() if the terminal has the magic-cookie feature (report + by Bernd Rieke). + + add 256color variants of terminfo entries for programs which are + reported to implement this feature -TD + +20060416 + + fix typo in change to NewChar() macro from 20060311 changes, which + broke tab-expansion (report by Frederic L W Meunier). + +20060415 + + document -U option of tic and infocmp. + + modify tic/infocmp to suppress smacs/rmacs when acsc is suppressed + due to size limit, e.g., converting to termcap format. Also + suppress them if the output format does not contain acsc and it + was not VT100-like, i.e., a one-one mapping (Novell #163715). + + add configure check to ensure that SIGWINCH is defined on platforms + such as OS X which exclude that when _XOPEN_SOURCE, etc., are + defined (report by Nicholas Cole) + +20060408 + + modify write_object() to not write coincidental extensions of an + entry made due to it being referenced in a use= clause (report by + Alain Bench). + + another fix for infocmp -i option, which did not ensure that some + escape sequences had comparable prefixes (report by Alain Bench). + +20060401 + + improve discussion of init/reset in terminfo and tput manpages + (report by Alain Bench). + + use is3 string for a fallback of rs3 in the reset program; it was + using is2 (report by Alain Bench). + + correct logic for infocmp -i option, which did not account for + multiple digits in a parameter (cf: 20040828) (report by Alain + Bench). + + move _nc_handle_sigwinch() to lib_setup.c to make --with-termlib + option work after 20060114 changes (report by Arkadiusz Miskiewicz). + + add copyright notices to test-programs as needed (report by William + McBrine). + +20060318 + + modify ncurses.c 'F' test to combine the wide-characters with color + and/or video attributes. + + modify test/ncurses to use CTL/Q or ESC consistently for exiting + a test-screen (some commands used 'x' or 'q'). + +20060312 + + fix an off-by-one in the scrolling-region change (cf_ 20060311). + +20060311 + + add checks in waddchnstr() and wadd_wchnstr() to stop copying when + a null character is found (report by Igor Bogomazov). + + modify progs/Makefile.in to make "tput init" work properly with + cygwin, i.e., do not pass a ".exe" in the reference string used + in check_aliases (report by Samuel Thibault). + + add some checks to ensure current position is within scrolling + region before scrolling on a new line (report by Dan Gookin). + + change some NewChar() usage to static variables to work around + stack garbage introduced when cchar_t is not packed (Redhat #182024). + +20060225 + + workarounds to build test/movewindow with PDcurses 2.7. + + fix for nsterm-16color entry (patch by Alain Bench). + + correct a typo in infocmp manpage (Debian #354281). + +20060218 + + add nsterm-16color entry -TD + + updated mlterm terminfo entry -TD + + remove 970913 feature for copying subwindows as they are moved in + mvwin() (discussion with Bryan Christ). + + modify test/demo_menus.c to demonstrate moving a menu (both the + window and subwindow) using shifted cursor-keys. + + start implementing recursive mvwin() in movewindow.c (incomplete). + + add a fallback definition for GCC_PRINTFLIKE() in test.priv.h, + for movewindow.c (report by William McBrine). + + add help-message to test/movewindow.c + +20060211 + + add test/movewindow.c, to test mvderwin(). + + fix ncurses soft-key test so color changes are shown immediately + rather than delayed. + + modify ncurses soft-key test to hide the keys when exiting the test + screen. + + fixes to build test programs with PDCurses 2.7, e.g., its headers + rely on autoconf symbols, and it declares stubs for nonfunctional + terminfo and termcap entrypoints. + +20060204 + + improved test/configure to build test/ncurses on HPUX 11 using the + vendor curses. + + documented ALTERNATE CONFIGURATIONS in the ncurses manpage, for the + benefit of developers who do not read INSTALL. + +20060128 + + correct form library Window_To_Buffer() change (cf: 20040516), which + should ignore the video attributes (report by Ricardo Cantu). + +20060121 + + minor fixes to xmc-glitch experimental code: + + suppress line-drawing + + implement max_attributes + tested with xterm. + + minor fixes for the database iterator. + + fix some buffer limits in c++ demo (comment by Falk Hueffner in + Debian #348117). + +20060114 + + add toe -a option, to show all databases. This uses new private + interfaces in the ncurses library for iterating through the list of + databases. + + fix toe from 20000909 changes which made it not look at + $HOME/.terminfo + + make toe's -v option parameter optional as per manpage. + + improve SIGWINCH handling by postponing its effect during newterm(), + etc., when allocating screens. + +20060111 + + modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs. Use + this in test/filter.c + + fix an error in filter() modification which caused some applications + to fail. + +20060107 + + check if filter() was called when getting the screensize. Keep it + at 1 if so (based on Redhat #174498). + + add extension nofilter(). + + refined the workaround for ACS mapping. + + make ifdef's consistent in curses.h for the extended colors so the + header file can be used for the normal curses library. The header + file installed for extended colors is a variation of the + wide-character configuration (report by Frederic L W Meunier). + +20051231 + + add a workaround to ACS mapping to allow applications such as + test/blue.c to use the "PC ROM" characters by masking them with + A_ALTCHARSET. This worked up til 5.5, but was lost in the revision + of legacy coding (report by Michael Deutschmann). + + add a null-pointer check in the wide-character version of + calculate_actual_width() (report by Victor Julien). + + improve test/ncurses 'd' (color-edit) test by allowing the RGB + values to be set independently (patch by William McBrine). + + modify test/configure script to allow building test programs with + PDCurses/X11. + + modified test programs to allow some to work with NetBSD curses. + Several do not because NetBSD curses implements a subset of X/Open + curses, and also lacks much of SVr4 additions. But it's enough for + comparison. + + update config.guess and config.sub + +20051224 + + use BSD-specific fix for return-value from cgetent() from CVS where + an unknown terminal type would be reportd as "database not found". + + make tgetent() return code more readable using new symbols + TGETENT_YES, etc. + + remove references to non-existent "tctest" program. + + remove TESTPROGS from progs/Makefile.in (it was referring to code + that was never built in that directory). + + typos in curs_addchstr.3x, some doc files (noticed in OpenBSD CVS). + +20051217 + + add use_legacy_coding() function to support lynx's font-switching + feature. + + fix formatting in curs_termcap.3x (report by Mike Frysinger). + + modify MKlib_gen.sh to change preprocessor-expanded _Bool back to + bool. + +20051210 + + extend test/ncurses.c 's' (overlay window) test to exercise overlay(), + overwrite() and copywin() with different combinations of colors and + attributes (including background color) to make it easy to see the + effect of the different functions. + + corrections to menu/m_global.c for wide-characters (report by + Victor Julien). + +20051203 + + add configure option --without-dlsym, allowing developers to + configure GPM support without using dlsym() (discussion with Michael + Setzer). + + fix wins_nwstr(), which did not handle single-column non-8bit codes + (Debian #341661). + +20051126 + + move prototypes for wide-character trace functions from curses.tail + to curses.wide to avoid accidental reference to those if + _XOPEN_SOURCE_EXTENDED is defined without ensuring that is + included. + + add/use NCURSES_INLINE definition. + + change some internal functions to use int/unsigned rather than the + short equivalents. + +20051119 + + remove a redundant check in lib_color.c (Debian #335655). + + use ld's -search_paths_first option on Darwin to work around odd + search rules on that platform (report by Christian Gennerat, analysis + by Andrea Govoni). + + remove special case for Darwin in CF_XOPEN_SOURCE configure macro. + + ignore EINTR in tcgetattr/tcsetattr calls (Debian #339518). + + fix several bugs in test/bs.c (patch by Stephen Lindholm). + +20051112 + + other minor fixes to cygwin based on tack -TD + + correct smacs in cygwin (Debian #338234, report by Baurzhan + Ismagulov, who noted that it was fixed in Cygwin). + +20051029 + + add shifted up/down arrow codes to xterm-new as kind/kri strings -TD + + modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits + since those record the state of multicolumn characters (Debian + #316663). + + modify werase to clear multicolumn characters that extend into + a derived window (Debian #316663). + +20051022 + + move assignment from environment variable ESCDELAY from initscr() + down to newterm() so the environment variable affects timeouts for + terminals opened with newterm() as well. + + fix a memory leak in keyname(). + + add test/demo_altkeys.c + + modify test/demo_defkey.c to exit from loop via 'q' to allow + leak-checking, as well as fix a buffer size in winnstr() call. + +20051015 + + correct order of use-clauses in rxvt-basic entry which made codes for + f1-f4 vt100-style rather than vt220-style (report by Gabor Z Papp). + + suppress configure check for gnatmake if Ada95/Makefile.in is not + found. + + correct a typo in configure --with-bool option for the case where + --without-cxx is used (report by Daniel Jacobowitz). + + add a note to INSTALL's discussion of --with-normal, pointing out + that one may wish to use --without-gpm to ensure a completely + static link (prompted by report by Felix von Leitner). + +20051010 5.5 release for upload to ftp.gnu.org + +20051008 + + document in demo_forms.c some portability issues. + +20051001 + + document side-effect of werase() which sets the cursor position. + + save/restore the current position in form field editing to make + overlay mode work. + +20050924 + + correct header dependencies in progs, allowing parallel make (report + by Daniel Jacobowitz). + + modify CF_BUILD_CC to ensure that pre-setting $BUILD_CC overrides + the configure check for --with-build-cc (report by Daniel Jacobowitz). + + modify CF_CFG_DEFAULTS to not use /usr as the default prefix for + NetBSD. + + update config.guess and config.sub from + http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + +20050917 + + modify sed expression which computes path for /usr/lib/terminfo + symbolic link in install to ensure that it does not change unexpected + levels of the path (Gentoo #42336). + + modify default for --disable-lp64 configure option to reduce impact + on existing 64-bit builds. Enabling the _LP64 option may change the + size of chtype and mmask_t. However, for ABI 6, it is enabled by + default (report by Mike Frysinger). + + add configure script check for --enable-ext-mouse, bump ABI to 6 by + default if it is used. + + improve configure script logic for bumping ABI to omit this if the + --with-abi-version option was used. + + update address for Free Software Foundation in tack's source. + + correct wins_wch(), which was not marking the filler-cells of + multi-column characters (cf: 20041023). + +20050910 + + modify mouse initialization to ensure that Gpm_Open() is called only + once. Otherwise GPM gets confused in its initialization of signal + handlers (Debian #326709). + +20050903 + + modify logic for backspacing in a multiline form field to ensure that + it works even when the preceding line is full (report by Frank van + Vugt). + + remove comment about BUGS section of ncurses manpage (Debian #325481) + +20050827 + + document some workarounds for shared and libtool library + configurations in INSTALL (see --with-shared and --with-libtool). + + modify CF_GCC_VERSION and CF_GXX_VERSION macros to accommodate + cross-compilers which emit the platform name in their version + message, e.g., + arm-sa1100-linux-gnu-g++ (GCC) 4.0.1 + (report by Frank van Vugt). + +20050820 + + start updating documentation for upcoming 5.5 release. + + fix to make libtool and libtinfo work together again (cf: 20050122). + + fixes to allow building traces into libtinfo + + add debug trace to tic that shows if/how ncurses will write to the + lower corner of a terminal's screen. + + update llib-l* files. + +20050813 + + modify initializers in c++ binding to build with old versions of g++. + + improve special case for 20050115 repainting fix, ensuring that if + the first changed cell is not a character that the range to be + repainted is adjusted to start at a character's beginning (Debian + #316663). + +20050806 + + fixes to build on QNX 6.1 + + improve configure script checks for Intel 9.0 compiler. + + remove #include's for libc.h (obsolete). + + adjust ifdef's in curses.priv.h so that when cross-compiling to + produce comp_hash and make_keys, no dependency on wchar.h is needed. + That simplifies the build-cppflags (report by Frank van Vugt). + + move modules related to key-binding into libtinfo to fix linkage + problem caused by 20050430 changes to MKkeyname.sh (report by + Konstantin Andreev). + +20050723 + + updates/fixes for configure script macros from vile -TD + + make prism9's sgr string agree with the rest of the terminfo -TD + + make vt220's sgr0 string consistent with sgr string, do this for + several related cases -TD + + improve translation to termcap by filtering the 'me' (sgr0) strings + as in the runtime call to tgetent() (prompted by a discussion with + Thomas Klausner). + + improve tic check for sgr0 versus sgr(0), to help ensure that sgr0 + resets line-drawing. + +20050716 + + fix special cases for trimming sgr0 for hurd and vt220 (Debian + #318621). + + split-out _nc_trim_sgr0() from modifications made to tgetent(), to + allow it to be used by tic to provide information about the runtime + changes that would be made to sgr0 for termcap applications. + + modify make_sed.sh to make the group-name in the NAME section of + form/menu library manpage agree with the TITLE string when renaming + is done for Debian (Debian #78866). + +20050702 + + modify parameter type in c++ binding for insch() and mvwinsch() to + be consistent with underlying ncurses library (was char, is chtype). + + modify treatment of Intel compiler to allow _GNU_SOURCE to be defined + on Linux. + + improve configure check for nanosleep(), checking that it works since + some older systems such as AIX 4.3 have a nonworking version. + +20050625 + + update config.guess and config.sub from + http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + + modify misc/shlib to work in test-directory. + + suppress $suffix in misc/run_tic.sh when cross-compiling. This + allows cross-compiles to use the host's tic program to handle the + "make install.data" step. + + improve description of $LINES and $COLUMNS variables in manpages + (prompted by report by Dave Ulrick). + + improve description of cross-compiling in INSTALL + + add NCURSES-Programming-HOWTO.html by Pradeep Padala + (see http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/). + + modify configure script to obtain soname for GPM library (discussion + with Daniel Jacobowitz). + + modify configure script so that --with-chtype option will still + compute the unsigned literals suffix for constants in curses.h + (report by Daniel Jacobowitz: + + patches from Daniel Jacobowitz: + + the man_db.renames entry for tack.1 was backwards. + + tack.1 had some 1m's that should have been 1M's. + + the section for curs_inwstr.3 was wrong. + +20050619 + + correction to --with-chtype option (report by Daniel Jacobowitz). + +20050618 + + move build-time edit_man.sh and edit_man.sed scripts to top directory + to simplify reusing them for renaming tack's manpage (prompted by a + review of Debian package). + + revert minor optimization from 20041030 (Debian #313609). + + libtool-specific fixes, tested with libtool 1.4.3, 1.5.0, 1.5.6, + 1.5.10 and 1.5.18 (all work except as noted previously for the c++ + install using libtool 1.5.0): + + modify the clean-rule in c++/Makefile.in to work with IRIX64 make + program. + + use $(LIBTOOL_UNINSTALL) symbol, overlooked in 20030830 + + add configure options --with-chtype and --with-mmask-t, to allow + overriding of the non-LP64 model's use of the corresponding types. + + revise test for size of chtype (and mmask_t), which always returned + "long" due to an uninitialized variable (report by Daniel Jacobowitz). + +20050611 + + change _tracef's that used "%p" format for va_list values to ignore + that, since on some platforms those are not pointers. + + fixes for long-formats in printf's due to largefile support. + +20050604 + + fixes for termcap support: + + reset pointer to _nc_curr_token.tk_name when the input stream is + closed, which could point to free memory (cf: 20030215). + + delink TERMTYPE data which is used by the termcap reader, so that + extended names data will be freed consistently. + + free pointer to TERMTYPE data in _nc_free_termtype() rather than + its callers. + + add some entrypoints for freeing permanently allocated data via + _nc_freeall() when NO_LEAKS is defined. + + amend 20041030 change to _nc_do_color to ensure that optimization is + applied only when the terminal supports back_color_erase (bce). + +20050528 + + add sun-color terminfo entry -TD + + correct a missing assignment in c++ binding's method + NCursesPanel::UserPointer() from 20050409 changes. + + improve configure check for large-files, adding check for dirent64 + from vile -TD + + minor change to configure script to improve linker options for the + Ada95 tree. + +20050515 + + document error conditions for ncurses library functions (report by + Stanislav Ievlev). + + regenerated html documentation for ada binding. + see ftp://invisible-island.net/ncurses/patches/gnathtml + +20050507 + + regenerated html documentation for manpages. + + add $(BUILD_EXEEXT) suffix to invocation of make_keys in + ncurses/Makefile (Gentoo #89772). + + modify c++/demo.cc to build with g++ -fno-implicit-templates option + (patch by Mike Frysinger). + + modify tic to filter out long extended names when translating to + termcap format. Only two characters are permissible for termcap + capability names. + +20050430 + + modify terminfo entries xterm-new and rxvt to add strings for + shift-, control-cursor keys. + + workaround to allow c++ binding to compile with g++ 2.95.3, which + has a broken implementation of static_cast<> (patch by Jeff Chua). + + modify initialization of key lookup table so that if an extended + capability (tic -x) string is defined, and its name begins with 'k', + it will automatically be treated as a key. + + modify test/keynames.c to allow for the possibility of extended + key names, e.g., via define_key(), or via "tic -x". + + add test/demo_termcap.c to show the contents of given entry via the + termcap interface. + +20050423 + + minor fixes for vt100/vt52 entries -TD + + add configure option --enable-largefile + + corrected libraries used to build Ada95/gen/gen, found in testing + gcc 4.0.0. + +20050416 + + update config.guess, config.sub + + modify configure script check for _XOPEN_SOURCE, disable that on + Darwin whose header files have problems (patch by Chris Zubrzycki). + + modify form library Is_Printable_String() to use iswprint() rather + than wcwidth() for determining if a character is printable. The + latter caused it to reject menu items containing non-spacing + characters. + + modify ncurses test program's F-test to handle non-spacing characters + by combining them with a reverse-video blank. + + review/fix several gcc -Wconversion warnings. + +20050409 + + correct an off-by-one error in m_driver() for mouse-clicks used to + position the mouse to a particular item. + + implement test/demo_menus.c + + add some checks in lib_mouse to ensure SP is set. + + modify C++ binding to make 20050403 changes work with the configure + --enable-const option. + +20050403 + + modify start_color() to return ERR if it cannot allocate memory. + + address g++ compiler warnings in C++ binding by adding explicit + member initialization, assignment operators and copy constructors. + Most of the changes simply preserve the existing semantics of the + binding, which can leak memory, etc., but by making these features + visible, it provides a framework for improving the binding. + + improve C++ binding using static_cast, etc. + + modify configure script --enable-warnings to add options to g++ to + correspond to the gcc --enable-warnings. + + modify C++ binding to use some C internal functions to make it + compile properly on Solaris (and other platforms). + +20050327 + + amend change from 20050320 to limit it to configurations with a + valid locale. + + fix a bug introduced in 20050320 which broke the translation of + nonprinting characters to uparrow form (report by Takahashi Tamotsu). + +20050326 + + add ifdef's for _LP64 in curses.h to avoid using wasteful 64-bits for + chtype and mmask_t, but add configure option --disable-lp64 in case + anyone used that configuration. + + update misc/shlib script to account for Mac OS X (report by Michail + Vidiassov). + + correct comparison for wrapping multibyte characters in + waddch_literal() (report by Takahashi Tamotsu). + +20050320 + + add -c and -w options to tset to allow user to suppress ncurses' + resizing of the terminal emulator window in the special case where it + is not able to detect the true size (report by Win Delvaux, Debian + #300419). + + modify waddch_nosync() to account for locale zn_CH.GBK, which uses + codes 128-159 as part of multibyte characters (report by Wang + WenRui, Debian #300512). + +20050319 + + modify ncurses.c 'd' test to make it work with 88-color + configuration, i.e., by implementing scrolling. + + improve scrolling in ncurses.c 'c' and 'C' tests, e.g., for 88-color + configuration. + +20050312 + + change tracemunch to use strict checking. + + modify ncurses.c 'p' test to test line-drawing within a pad. + + implement environment variable NCURSES_NO_UTF8_ACS to support + miscellaneous terminal emulators which ignore alternate character + set escape sequences when in UTF-8 mode. + +20050305 + + change NCursesWindow::err_handler() to a virtual function (request by + Steve Beal). + + modify fty_int.c and fty_num.c to handle wide characters (report by + Wolfgang Gutjahr). + + adapt fix for fty_alpha.c to fty_alnum.c, which also handled normal + and wide characters inconsistently (report by Wolfgang Gutjahr). + + update llib-* files to reflect internal interface additions/changes. + +20050226 + + improve test/configure script, adding tests for _XOPEN_SOURCE, etc., + from lynx. + + add aixterm-16color terminfo entry -TD + + modified xterm-new terminfo entry to work with tgetent() changes -TD + + extended changes in tgetent() from 20040710 to allow the substring of + sgr0 which matches rmacs to be at the beginning of the sgr0 string + (request by Thomas Wolff). Wolff says the visual effect in + combination with pre-20040710 ncurses is improved. + + fix off-by-one in winnstr() call which caused form field validation + of multibyte characters to ignore the last character in a field. + + correct logic in winsch() for inserting multibyte strings; the code + would clear cells after the insertion rather than push them to the + right (cf: 20040228). + + fix an inconsistency in Check_Alpha_Field() between normal and wide + character logic (report by Wolfgang Gutjahr). + +20050219 + + fix a bug in editing wide-characters in form library: deleting a + nonwide character modified the previous wide-character. + + update manpage to describe NCURSES_MOUSE_VERSION 2. + + correct manpage description of mouseinterval() (Debian #280687). + + add a note to default_colors.3x explaining why this extension was + added (Debian #295083). + + add traces to panel library. + +20050212 + + improve editing of wide-characters in form library: left/right + cursor movement, and single-character deletions work properly. + + disable GPM mouse support when $TERM happens to be prefixed with + "xterm". Gpm_Open() would otherwise assert that it can deal with + mouse events in this case. + + modify GPM mouse support so it closes the server connection when + the caller disables the mouse (report by Stanislav Ievlev). + +20050205 + + add traces for callback functions in form library. + + add experimental configure option --enable-ext-mouse, which defines + NCURSES_MOUSE_VERSION 2, and modifies the encoding of mouse events to + support wheel mice, which may transmit buttons 4 and 5. This works + with xterm and similar X terminal emulators (prompted by question by + Andreas Henningsson, this is also related to Debian #230990). + + improve configure macros CF_XOPEN_SOURCE and CF_POSIX_C_SOURCE to + avoid redefinition warnings on cygwin. + +20050129 + + merge remaining development changes for extended colors (mostly + complete, does not appear to break other configurations). + + add xterm-88color.dat (part of extended colors testing). + + improve _tracedump() handling of color pairs past 96. + + modify return-value from start_color() to return OK if colors have + already been started. + + modify curs_color.3x list error conditions for init_pair(), + pair_content() and color_content(). + + modify pair_content() to return -1 for consistency with init_pair() + if it corresponds to the default-color. + + change internal representation of default-color to allow application + to use color number 255. This does not affect the total number of + color pairs which are allowed. + + add a top-level tags rule. + +20050122 + + add a null-pointer check in wgetch() in case it is called without + first calling initscr(). + + add some null-pointer checks for SP, which is not set by libtinfo. + + modify misc/shlib to ensure that absolute pathnames are used. + + modify test/Makefile.in, etc., to link test programs only against the + libraries needed, e.g., omit form/menu/panel library for the ones + that are curses-specific. + + change SP->_current_attr to a pointer, adjust ifdef's to ensure that + libtinfo.so and libtinfow.so have the same ABI. The reason for this + is that the corresponding data which belongs to the upper-level + ncurses library has a different size in each model (report by + Stanislav Ievlev). + +20050115 + + minor fixes to allow test-compiles with g++. + + correct column value shown in tic's warnings, which did not account + for leading whitespace. + + add a check in _nc_trans_string() for improperly ended strings, i.e., + where a following line begins in column 1. + + modify _nc_save_str() to return a null pointer on buffer overflow. + + improve repainting while scrolling wide-character data (Eungkyu Song). + +20050108 + + merge some development changes to extend color capabilities. + +20050101 + + merge some development changes to extend color capabilities. + + fix manpage typo (FreeBSD report docs/75544). + + update config.guess, config.sub + > patches for configure script (Albert Chin-A-Young): + + improved fix to make mbstate_t recognized on HPUX 11i (cf: + 20030705), making vsscanf() prototype visible on IRIX64. Tested for + on HP-UX 11i, Solaris 7, 8, 9, AIX 4.3.3, 5.2, Tru64 UNIX 4.0D, 5.1, + IRIX64 6.5, Redhat Linux 7.1, 9, and RHEL 2.1, 3.0. + + print the result of the --disable-home-terminfo option. + + use -rpath when compiling with SGI C compiler. + +20041225 + + add trace calls to remaining public functions in form and menu + libraries. + + fix check for numeric digits in test/ncurses.c 'b' and 'B' tests. + + fix typo in test/ncurses.c 'c' test from 20041218. + +20041218 + + revise test/ncurses.c 'c' color test to improve use for xterm-88color + and xterm-256color, added 'C' test using the wide-character color_set + and attr_set functions. + +20041211 + + modify configure script to work with Intel compiler. + + fix an limit-check in wadd_wchnstr() which caused labels in the + forms-demo to be one character short. + + fix typo in curs_addchstr.3x (Jared Yanovich). + + add trace calls to most functions in form and menu libraries. + + update working-position for adding wide-characters when window is + scrolled (prompted by related report by Eungkyu Song). + +20041204 + + replace some references on Linux to wcrtomb() which use it to obtain + the length of a multibyte string with _nc_wcrtomb, since wcrtomb() is + broken in glibc (see Debian #284260). + + corrected length-computation in wide-character support for + field_buffer(). + + some fixes to frm_driver.c to allow it to accept multibyte input. + + modify configure script to work with Intel 8.0 compiler. + +20041127 + + amend change to setupterm() in 20030405 which would reuse the value + of cur_term if the same output was selected. This now reuses it only + when setupterm() is called from tgetent(), which has no notion of + separate SCREENs. Note that tgetent() must be called after initscr() + or newterm() to use this feature (Redhat Bugzilla #140326). + + add a check in CF_BUILD_CC macro to ensure that developer has given + the --with-build-cc option when cross-compiling (report by Alexandre + Campo). + + improved configure script checks for _XOPEN_SOURCE and + _POSIX_C_SOURCE (fix for IRIX 5.3 from Georg Schwarz, _POSIX_C_SOURCE + updates from lynx). + + cosmetic fix to test/gdc.c to recolor the bottom edge of the box + for consistency (comment by Dan Nelson). + +20041120 + + update wsvt25 terminfo entry -TD + + modify test/ins_wide.c to test all flavors of ins_wstr(). + + ignore filler-cells in wadd_wchnstr() when adding a cchar_t array + which consists of multi-column characters, since this function + constructs them (cf: 20041023). + + modify winnstr() to return multibyte character strings for the + wide-character configuration. + +20041106 + + fixes to make slk_set() and slk_wset() accept and store multibyte + or multicolumn characters. + +20041030 + + improve color optimization a little by making _nc_do_color() check + if the old/new pairs are equivalent to the default pair 0. + + modify assume_default_colors() to not require that + use_default_colors() be called first. + +20041023 + + modify term_attrs() to use termattrs(), add the extended attributes + such as enter_horizontal_hl_mode for WA_HORIZONTAL to term_attrs(). + + add logic in waddch_literal() to clear orphaned cells when one + multi-column character partly overwrites another. + + improved logic for clearing cells when a multi-column character + must be wrapped to a new line. + + revise storage of cells for multi-column characters to correct a + problem with repainting. In the old scheme, it was possible for + doupdate() to decide that only part of a multi-column character + should be repainted since the filler cells stored only an attribute + to denote them as fillers, rather than the character value and the + attribute. + +20041016 + + minor fixes for traces. + + add SP->_screen_acs_map[], used to ensure that mapping of missing + line-drawing characters is handled properly. For example, ACS_DARROW + is absent from xterm-new, and it was coincidentally displayed the + same as ACS_BTEE. + +20041009 + + amend 20021221 workaround for broken acs to reset the sgr, rmacs + and smacs strings as well. Also modify the check for screen's + limitations in that area to allow the multi-character shift-in + and shift-out which seem to work. + + change GPM initialization, using dl library to load it dynamically + at runtime (Debian #110586). + +20041002 + + correct logic for color pair in setcchar() and getcchar() (patch by + Marcin 'Qrczak' Kowalczyk). + + add t/T commands to ncurses b/B tests to allow a different color to + be tested for the attrset part of the test than is used in the + background color. + +20040925 + + fix to make setcchar() to work when its wchar_t* parameter is + pointing to a string which contains more data than can be converted. + + modify wget_wstr() and example in ncurses.c to work if wchar_t and + wint_t are different sizes (report by Marcin 'Qrczak' Kowalczyk). + +20040918 + + remove check in wget_wch() added to fix an infinite loop, appears to + have been working around a transitory glibc bug, and interferes + with normal operation (report by Marcin 'Qrczak' Kowalczyk). + + correct wadd_wch() and wecho_wch(), which did not pass the rendition + information (report by Marcin 'Qrczak' Kowalczyk). + + fix aclocal.m4 so that the wide-character version of ncurses gets + compiled as libncursesw.5.dylib, instead of libncurses.5w.dylib + (adapted from patch by James J Ramsey). + + change configure script for --with-caps option to indicate that it + is no longer experimental. + + change configure script to reflect the fact that --enable-widec has + not been "experimental" since 5.3 (report by Bruno Lustosa). + +20040911 + + add 'B' test to ncurses.c, to exercise some wide-character functions. + +20040828 + + modify infocmp -i option to match 8-bit controls against its table + entries, e.g., so it can analyze the xterm-8bit entry. + + add morphos terminfo entry, improve amiga-8bit entry (Pavel Fedin). + + correct translation of "%%" in terminfo format to termcap, e.g., + using "tic -C" (Redhat Bugzilla #130921). + + modified configure script CF_XOPEN_SOURCE macro to ensure that if + it defines _POSIX_C_SOURCE, that it defines it to a specific value + (comp.os.stratus newsgroup comment). + +20040821 + + fixes to build with Ada95 binding with gnat 3.4 (all warnings are + fatal, and gnat does not follow the guidelines for pragmas). + However that did find a coding error in Assume_Default_Colors(). + + modify several terminfo entries to ensure xterm mouse and cursor + visibility are reset in rs2 string: hurd, putty, gnome, + konsole-base, mlterm, Eterm, screen (Debian #265784, #55637). The + xterm entries are left alone - old ones for compatibility, and the + new ones do not require this change. -TD + +20040814 + + fake a SIGWINCH in newterm() to accommodate buggy terminal emulators + and window managers (Debian #265631). + > terminfo updates -TD + + remove dch/dch1 from rxvt because they are implemented inconsistently + with the common usage of bce/ech + + remove khome from vt220 (vt220's have no home key) + + add rxvt+pcfkeys + +20040807 + + modify test/ncurses.c 'b' test, adding v/V toggles to cycle through + combinations of video attributes so that for instance bold and + underline can be tested. This made the legend too crowded, added + a help window as well. + + modify test/ncurses.c 'b' test to cycle through default colors if + the -d option is set. + + update putty terminfo entry (Robert de Bath). + +20040731 + + modify test/cardfile.c to allow it to read more data than can be + displayed. + + correct logic in resizeterm.c which kept it from processing all + levels of window hierarchy (reports by Folkert van Heusden, + Chris Share). + +20040724 + + modify "tic -cv" to ignore delays when comparing strings. Also + modify it to ignore a canceled sgr string, e.g., for terminals which + cannot properly combine attributes in one control sequence. + + corrections for gnome and konsole entries (Redhat Bugzilla #122815, + patch by Hans de Goede) + > terminfo updates -TD + + make ncsa-m rmacs/smacs consistent with sgr + + add sgr, rc/sc and ech to syscons entries + + add function-keys to decansi + + add sgr to mterm-ansi + + add sgr, civis, cnorm to emu + + correct/simplify cup in addrinfo + +20040717 + > terminfo updates -TD + + add xterm-pc-fkeys + + review/update gnome and gnome-rh90 entries (prompted by Redhat + Bugzilla #122815). + + review/update konsole entries + + add sgr, correct sgr0 for kterm and mlterm + + correct tsl string in kterm + +20040711 + + add configure option --without-xterm-new + +20040710 + + add check in wget_wch() for printable bytes that are not part of a + multibyte character. + + modify wadd_wchnstr() to render text using window's background + attributes. + + improve tic's check to compare sgr and sgr0. + + fix c++ directory's .cc.i rule. + + modify logic in tgetent() which adjusts the termcap "me" string + to work with ISO-2022 string used in xterm-new (cf: 20010908). + + modify tic's check for conflicting function keys to omit that if + converting termcap to termcap format. + + add -U option to tic and infocmp. + + add rmam/smam to linux terminfo entry (Trevor Van Bremen) + > terminfo updates -TD + + minor fixes for emu + + add emu-220 + + change wyse acsc strings to use 'i' map rather than 'I' + + fixes for avatar0 + + fixes for vp3a+ + +20040703 + + use tic -x to install terminfo database -TD + + add -x to infocmp's usage message. + + correct field used for comparing O_ROWMAJOR in set_menu_format() + (report/patch by Tony Li). + + fix a missing nul check in set_field_buffer() from 20040508 changes. + > terminfo updates -TD + + make xterm-xf86-v43 derived from xterm-xf86-v40 rather than + xterm-basic -TD + + align with xterm patch #192's use of xterm-new -TD + + update xterm-new and xterm-8bit for cvvis/cnorm strings -TD + + make xterm-new the default "xterm" entry -TD + +20040626 + + correct BUILD_CPPFLAGS substitution in ncurses/Makefile.in, to allow + cross-compiling from a separate directory tree (report/patch by + Dan Engel). + + modify is_term_resized() to ensure that window sizes are nonzero, + as documented in the manpage (report by Ian Collier). + + modify CF_XOPEN_SOURCE configure macro to make Hurd port build + (Debian #249214, report/patch by Jeff Bailey). + + configure-script mods from xterm, e.g., updates to CF_ADD_CFLAGS + + update config.guess, config.sub + > terminfo updates -TD + + add mlterm + + add xterm-xf86-v44 + + modify xterm-new aka xterm-xfree86 to accommodate luit, which + relies on G1 being used via an ISO-2022 escape sequence (report by + Juliusz Chroboczek) + + add 'hurd' entry + +20040619 + + reconsidered winsnstr(), decided after comparing other + implementations that wrapping is an X/Open documentation error. + + modify test/inserts.c to test all flavors of insstr(). + +20040605 + + add setlocale() calls to a few test programs which may require it: + demo_forms.c, filter.c, ins_wide.c, inserts.c + + correct a few misspelled function names in ncurses-intro.html (report + by Tony Li). + + correct internal name of key_defined() manpage, which conflicted with + define_key(). + +20040529 + + correct size of internal pad used for holding wide-character + field_buffer() results. + + modify data_ahead() to work with wide-characters. + +20040522 + + improve description of terminfo if-then-else expressions (suggested + by Arne Thomassen). + + improve test/ncurses.c 'd' test, allow it to use external file for + initial palette (added xterm-16color.dat and linux-color.dat), and + reset colors to the initial palette when starting/ending the test. + + change limit-check in init_color() to allow r/g/b component to + reach 1000 (cf: 20020928). + +20040516 + + modify form library to use cchar_t's rather than char's in the + wide-character configuration for storing data for field buffers. + + correct logic of win_wchnstr(), which did not work for more than + one cell. + +20040508 + + replace memset/memcpy usage in form library with for-loops to + simplify changing the datatype of FIELD.buf, part of wide-character + changes. + + fix some inconsistent use of #if/#ifdef (report by Alain Guibert). + +20040501 + + modify menu library to account for actual number of columns used by + multibyte character strings, in the wide-character configuration + (adapted from patch by Philipp Tomsich). + + add "-x" option to infocmp like tic's "-x", for use in "-F" + comparisons. This modifies infocmp to only report extended + capabilities if the -x option is given, making this more consistent + with tic. Some scripts may break, since infocmp previous gave this + information without an option. + + modify termcap-parsing to retain 2-character aliases at the beginning + of an entry if the "-x" option is used in tic. + +20040424 + + minor compiler-warning and test-program fixes. + +20040417 + + modify tic's missing-sgr warning to apply to terminfo only. + + free some memory leaks in tic. + + remove check in post_menu() that prevented menus from extending + beyond the screen (request by Max J. Werner). + + remove check in newwin() that prevents allocating windows + that extend beyond the screen. Solaris curses does this. + + add ifdef in test/color_set.c to allow it to compile with older + curses. + + add napms() calls to test/dots.c to make it not be a CPU hog. + +20040403 + + modify unctrl() to return null if its parameter does not correspond + to an unsigned char. + + add some limit-checks to guard isprint(), etc., from being used on + values that do not fit into an unsigned char (report by Sami Farin). + +20040328 + + fix a typo in the _nc_get_locale() change. + +20040327 + + modify _nc_get_locale() to use setlocale() to query the program's + current locale rather than using getenv(). This fixes a case in tin + which relies on legacy treatment of 8-bit characters when the locale + is not initialized (reported by Urs Jansen). + + add sgr string to screen's and rxvt's terminfo entries -TD. + + add a check in tic for terminfo entries having an sgr0 but no sgr + string. This confuses Tru64 and HPUX curses when combined with + color, e.g., making them leave line-drawing characters in odd places. + + correct casts used in ABSENT_BOOLEAN, CANCELLED_BOOLEAN, matches the + original definitions used in Debian package to fix PowerPC bug before + 20030802 (Debian #237629). + +20040320 + + modify PutAttrChar() and PUTC() macro to improve use of + A_ALTCHARSET attribute to prevent line-drawing characters from + being lost in situations where the locale would otherwise treat the + raw data as nonprintable (Debian #227879). + +20040313 + + fix a redefinition of CTRL() macro in test/view.c for AIX 5.2 (report + by Jim Idle). + + remove ".PP" after ".SH NAME" in a few manpages; this confuses + some apropos script (Debian #237831). + +20040306 + + modify ncurses.c 'r' test so editing commands, like inserted text, + set the field background, and the state of insert/overlay editing + mode is shown in that test. + + change syntax of dummy targets in Ada95 makefiles to work with pmake. + + correct logic in test/ncurses.c 'b' for noncolor terminals which + did not recognize a quit-command (cf: 20030419). + +20040228 + + modify _nc_insert_ch() to allow for its input to be part of a + multibyte string. + + split out lib_insnstr.c, to prepare to rewrite it. X/Open states + that this function performs wrapping, unlike all of the other + insert-functions. Currently it does not wrap. + + check for nl_langinfo(CODESET), use it if available (report by + Stanislav Ievlev). + + split-out CF_BUILD_CC macro, actually did this for lynx first. + + fixes for configure script CF_WITH_DBMALLOC and CF_WITH_DMALLOC, + which happened to work with bash, but not with Bourne shell (report + by Marco d'Itri via tin-dev). + +20040221 + + some changes to adapt the form library to wide characters, incomplete + (request by Mike Aubury). + + add symbol to curses.h which can be used to suppress include of + stdbool.h, e.g., + #define NCURSES_ENABLE_STDBOOL_H 0 + #include + (discussion on XFree86 mailing list). + +20040214 + + modify configure --with-termlib option to accept a value which sets + the name of the terminfo library. This would allow a packager to + build libtinfow.so renamed to coincide with libtinfo.so (discussion + with Stanislav Ievlev). + + improve documentation of --with-install-prefix, --prefix and + $(DESTDIR) in INSTALL (prompted by discussion with Paul Lew). + + add configure check if the compiler can use -c -o options to rename + its output file, use that to omit the 'cd' command which was used to + ensure object files are created in a separate staging directory + (prompted by comments by Johnny Wezel, Martin Mokrejs). 20040208 5.4 release for upload to ftp.gnu.org + update TO-DO. @@ -57,10 +2271,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add terminfo entries for SFU aka Interix aka OpenNT (Federico Bianchi). + modify tput's error messages to prefix them with the program name - (report by Vincent Lefevre, patch by Daniel Jacobowitz, Debian - #227586). + (report by Vincent Lefevre, patch by Daniel Jacobowitz (see Debian + #227586)). + correct a place in tack where exit_standout_mode was used instead of - exit_attribute_mode (patch by Jochen Voss, Debian #224443). + exit_attribute_mode (patch by Jochen Voss (see Debian #224443)). + modify c++/cursesf.h to use const in the Enumeration_Field method. + remove an ambiguous (actually redundant) method from c++/cursesf.h + make $HOME/.terminfo update optional (suggested by Stanislav Ievlev). @@ -176,7 +2390,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20031108 + add DJGPP to special case of DOS-style drive letters potentially appearing in TERMCAP environment variable. - + fix some spelling in comments (reports by jmc, Jonathon Gray). + + fix some spelling in comments (reports by Jason McIntyre, Jonathon + Gray). + update config.guess, config.sub 20031101 @@ -240,7 +2455,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. with a zero as the minor-version value (request by Chris Zubrzycki). + modify CF_MIXEDCASE_FILENAMES macro to work with cross-compiling. + modify tack to allow it to run from fallback terminfo data. - > Philippe Blain: + > patch by Philippe Blain: + improve PutRange() by adjusting call to EmitRange() and corresponding return-value to not emit unchanged characters on the end of the range. @@ -250,7 +2465,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. in the clr_bol logic. 20030913 - > Philippe Blain: + > patch by Philippe Blain: + in ncurses/tty/lib_mvcur.c, move the label 'nonlocal' just before the second gettimeofday() to be able to compute the diff time when 'goto nonlocal' used. @@ -281,7 +2496,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. --with-install-prefix is used. 20030823 - > Philippe Blain: + > patch by Philippe Blain: + move assignments to SP->_cursrow, SP->_curscol into online_mvcur(). + make baudrate computation in delay_output() consistent with the assumption in _nc_mvcur_init(), i.e., a byte is 9 bits. @@ -293,7 +2508,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + improve storage used by _nc_safe_strcpy() by ensuring that the size is reset based on the initialization call, in case it were called after other strcpy/strcat calls (report by Philippe Blain). - > Philippe Blain: + > patch by Philippe Blain: + remove an unused ifdef for REAL_ATTR & WANT_CHAR + correct a place where _cup_cost was used rather than _cuu_cost @@ -309,7 +2524,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20030802 + modify casts used for ABSENT_BOOLEAN and CANCELLED_BOOLEAN (report by Daniel Jacobowitz). - > Philippe Blain: + > patch by Philippe Blain: + change padding for change_scroll_region to not be proportional to the size of the scroll-region. + correct error-return in _nc_safe_strcat(). @@ -362,7 +2577,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. get mbstate_t declaration on HPUX 11.11 (report by David Ellement). + add _nc_pathlast() to get rid of casts in _nc_basename() calls. + correct a sign-extension in wadd_wch() and wecho_wchar() from - 20030628 (report by Tomohiro KUBOTA). + 20030628 (report by Tomohiro Kubota). + work around omission of btowc() and wctob() from wide-character support (sic) in NetBSD 1.6 using mbtowc() and wctomb() (report by Gabor Z Papp). @@ -376,7 +2591,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + remove logic from waddnstr() which transformed multibyte character strings into wide-characters. Rewrite of waddch_literal() from 20030621 assumes its input is raw multibyte data rather than wide - characters (report by Tomohiro KUBOTA). + characters (report by Tomohiro Kubota). 20030621 + write getyx() and related 2-return macros in terms of getcury(), @@ -384,7 +2599,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify waddch_literal() in case an application passes bytes of a multibyte character directly to waddch(). In this case, waddch() must reassemble the bytes into a wide-character (report by Tomohiro - KUBOTA ). + Kubota ). 20030614 + modify waddch_literal() in case a multibyte value occupies more than @@ -466,7 +2681,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. "--srcdir" work (report by Warren L Dodge). + correct missing definition of $(CC) in Ada95/gen/Makefile.in (reported by Warren L Dodge ). - + fix typos and whitespace in manpages (patch by jmc + + fix typos and whitespace in manpages (patch by Jason McIntyre ). 20030503 @@ -587,7 +2802,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. results (reports by Gerben Wierda and Thomas Esser ). + do not try to open gpm mouse driver if standard output is not a tty; - the gpm library does not make this check (from bug report for dialog + the gpm library does not make this check (bug report for dialog by David Oliveira ). 20030125 @@ -614,8 +2829,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Polterak). + change several sed scripts to avoid using "\+" since it is not a BRE (basic regular expression). One instance caused terminfo.5 to be - misformatted on FreeBSD (from a FreeBSD bug report by Kazuo Horikawa - ). + misformatted on FreeBSD (report by Kazuo Horikawa + (see FreeBSD docs/46709)). + correct misspelled 'wint_t' in curs_get_wch.3x (Michael Elkins). 20030105 @@ -626,7 +2841,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. specialized type for the middle initial/name. + fix MKterminfo.sh, another workaround for POSIXLY_CORRECT misfeature of sed 4.0 - > Philippe Blain: + > patch by Philippe Blain: + optimize can_clear_with() a little by testing first if the parameter is indeed a "blank". + simplify ClrBottom() a little by allowing it to use clr_eos to clear @@ -653,14 +2868,14 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + correct line/column reference in adjust_window(), needed to make special windows such as curscr track properly when resizing (report by Lucas Gonze ). - > Philippe Blain: + > patch by Philippe Blain: + correct the value used for blank in ClrBottom() (broken in 20000708). + correct an off-by-one in GoTo() parameter in _nc_scrolln(). 20021221 + change several tputs() calls in scrolling code to use putp(), to enable padding which may be needed for some terminals (patch by - by Philippe Blain). + Philippe Blain). + use '%' as sed substitute delimiter in run_tic script to avoid problems with pathname delimiters such as ':' and '@' (report by John Polterak). @@ -849,7 +3064,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + documented getbegx(), etc. + minor fixes to configure script to use '%' consistently as a sed delimiter rather than '@'. - > Philippe Blain: + > patch by Philippe Blain: + add check in lib_overlay.c to ensure that the windows to be merged actually overlap, and in copywin(), limit the area to be touched to the lines given for the destination window. @@ -863,7 +3078,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. pads (request by Philippe Blain). + correct attribute-merging in wborder(), broken in 20020216 (report by Tomasz Wasiak ). - > Philippe Blain: + > patch by Philippe Blain: + corrected pop-counts in tparam_internal() to '!' and '~' cases. + use sizeof(NCURSES_CH_T) in one place that used sizeof(chtype). + remove some unused variables from mvcur test-driver. @@ -877,7 +3092,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + fix mismatched enums in vsscanf.c, which caused warning on Solaris. + update README.emx to reflect current patch used for autoconf. + change web- and ftp-site to invisible-island.net - > Philippe Blain: + > patch by Philippe Blain: + change case for 'P' in tparam_internal() to indicate that it pops a variable from the stack. + correct sense of precision and width in parse_format(), to avoid @@ -906,7 +3121,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. (adapted from patch by Ilya Zakharevich - see ncurses/README.IZ). + amend check in kgetch() from 20020824 to look only for function-keys, otherwise escape sequences are not resolved properly. - > Philippe Blain: + > patch by Philippe Blain: + removed redundant assignment to SP->_checkfd from newterm(). + check return-value of setupterm() in restartterm(). + use sizeof(NCURSES_CH_T) in a few places that used sizeof(chtype). @@ -1145,7 +3360,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20020406 + modified several of the test programs to allow them to compile with - vendor curses implementations (Solaris, AIX). + vendor curses implementations, e.g., Solaris, AIX -TD 20020323 + modified test/configure to allow configuring against ncursesw. @@ -1247,7 +3462,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 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 + since HPUX is handled properly (reported by Niibe Yutaka ). + add configure check for mbstate_t, needed for wide-character configuration. On some platforms we must include to @@ -1780,7 +3995,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add a missing pathname for ncurses_dll.h, needed when building in a directory outside the source tree (patch by Sven Verdoolaege ). - > fix 2 bugs in test/bs.c (patch by Erik Sigra ): + > fix 2 bugs in test/bs.c Erik Sigra : + 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. @@ -1794,7 +4009,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify screen's terminfo entry to match the khome/kend in screen 3.09.08 (Debian bug report #92215). + correct a memory leak in forms library (report by Stefan Vogtner - , patch by Juergen Pfeifer). + ) (patch by Juergen Pfeifer). 20010324 + change symbols used to guard against repeated includes to begin @@ -1909,7 +4124,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add ncurses_dll.h and related definitions to support generating DLL's with cygwin (adapted from a patch by Charles Wilson , changed NCURSES_EXPORT macro to make it - work with 'indent'). + work with 'indent') -TD 20001202 + correct prototypes for some functions in curs_termcap.3x, matching @@ -2039,12 +4254,12 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + correct logic for 'reverse' variable in lib_vidattr.c, which was setting it true without checking if newmode had A_REVERSE set, e.g., using $TERM=ansi on OS/2 EMX (see 20000917). - > patch by Todd Miller: + > patch by Todd C Miller: + add a few missing use_terminfo_vars() and fixes up _nc_tgetent(). Previously, _nc_cgetset() would still get called on cp so the simplest thing is to set cp to NULL if !use_terminfo_vars(). + added checks for an empty $HOME environment variable. - > patches by Ilya Zakharevich for OS/2 EMX: + > patches for OS/2 EMX (Ilya Zakharevich): + modify convert_configure.pl to support INSTALL. Change compiler options in that script to use multithreading, needed for the mouse. + modify OS/2 mouse support, retrying as a 2-button mouse if code fails @@ -2102,8 +4317,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20000923 + modify rs2 capability in xterm-r6 and similar where cursor save/restore bracketed the sequence for resetting video attributes. - The cursor restore would undo that (from a NetBSD bug report by John - Hawkinson ). + The cursor restore would undo that (report by John Hawkinson + (see NetBSD misc/11052)). + using parameter check added to tic, corrected 27 typos in terminfo.src -TD + modify tic to verify that its inputs are really files, in case @@ -2392,8 +4607,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. the subwindow's background color cover the subwindow. + modify configure script so AC_MSG_ERROR is temporarily defined to a warning in AC_PROG_CXX to make it recover from a missing C++ compiler - without requiring user to add --without-cxx option (from comment by - Akim Demaille to autoconf mailing list). + without requiring user to add --without-cxx option (adapted from + comment by Akim Demaille to autoconf mailing list). + modify headers.sh to avoid creating temporary files in the build directory when installing headers (reported by Sergei Pokrovsky ) @@ -2407,8 +4622,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. if -fPIC is supported by gcc rather than -fpic. The former option allows larger symbol tables. + update config.guess and config.sub (patches by - Kevin Buettner for elf64_ia64 - Bernd Kuemmerlen and MacOS X). + Kevin Buettner (for elf64_ia64), + Bernd Kuemmerlen (for MacOS X)). + add warning for 'tic -cv' about use of '^?' in terminfo source, which is an extension. @@ -2436,13 +4651,13 @@ Changes since 1.9.9e are recorded by Thomas Dickey. LANG contain the string "UTF-8", this driver will be used to translate the output to UTF-8. This works with XFree86 xterm. + modify configure script to allow building shared libraries on BeOS - (from a patch by by Valeriy E Ushakov). + (from a patch by Valeriy E Ushakov). + modify lib_addch.c to allow repeated update to the lower-right corner, rather than displaying only the first character written until the cursor is moved. Recent versions of SVr4 curses can update the lower-right corner, and behave this way (reported by Neil Zanella). + add a limit-check in _nc_do_color(), to avoid using invalid color - pair value (from bug report by Brendan O'Dea ). + pair value (report by Brendan O'Dea ). 20000513 + the tack program knows how to use smcup and rmcup but the "show caps @@ -2496,10 +4711,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + corrections/updates for some IBM terminfo entries -TD + modify _nc_screen_wrap() so that when exiting curses mode with non-default colors, the last line on the screen will be cleared to - the screen's default colors (request by Alexander Lukyanov). + the screen's default colors (request by Alexander V Lukyanov). + modify ncurses.c 'r' example to set nonl(), allowing control/M to be read for demonstrating the REQ_NEW_LINE operation (prompted by a - question by Tony L Keith" ). + question by Tony L Keith ). + modify ncurses.c 'r' example of field_info() to work on Solaris 2.7, documented extension of ncurses which allows a zero pointer. + modify fmt_complex() to avoid buffer overflow in case of excess @@ -2534,7 +4749,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + improve logic in _nc_do_color() implementing assume_default_colors() by passing in previous color pair info to eliminate redundant call to set_original_colors(). (Part of this is from a patch by Alexander - Lukyanov). + V Lukyanov). + modify warning in _nc_trans_string() about a possibly too-long string to do this once only rather than for each character past the threshold (600). Change interface of _nc_trans_string() to allow @@ -2553,7 +4768,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20000318 + revert part of the vt220 change (request by Todd C Miller). - + add ansi-* terminfo entries from Eric's version. + + add ansi-* terminfo entries from ESR's version. + add -a option to tic and infocmp, which retains commented-out capabilities during source translation/comparison, e.g., captoinfo and infotocap. @@ -2582,9 +4797,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. keeping the existing format as the default, though not retaining the previous behavior that made the -F option compare each entry to itself. - + adapted patch by Eric Raymond to make infocmp -F less verbose + + adapted patch by ESR to make infocmp -F less verbose -TD (the submitted patch was unusable because it did not compile - properly): + properly) + modify write_entry.c to ensure that absent or cancelled booleans are written as FALSE, for consistency with infocmp which now assumes this. Note that for the small-core configuration, tic @@ -2650,8 +4865,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20000219 + store default-color code consistently as C_MASK, even if given as - -1 for convenience (adapted from patches by Alexander Lukyanov). - > patches by Alexander Lukyanov: + -1 for convenience (adapted from patches by Alexander V Lukyanov). + > patches by Alexander V Lukyanov: + change can_clear_with() macro to accommodate logic for assume_default_colors(), making most of the FILL_BCE logic unnecessary. Made can_clear_with() an inline function to make it @@ -2660,7 +4875,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20000212 + corrected form of recent copyright dates. + minor corrections to xterm-xf86-v333 terminfo entry -TD - > patches by Alexander Lukyanov: + > patches by Alexander V Lukyanov: + reworded dft_fgbg.3x to avoid assuming that the terminal's default colors are white on black. + fix initialization of tstLine so that it is filled with current blank @@ -2683,7 +4898,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + correct CF_MATH_LIB parameter, must be sin(x), not sqrt(x). 20000122 - + resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm. + + resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm -TD + modify CF_MATH_LIB configure macro to parameterize the test function used, for reuse in dialog and similar packages. + correct tests for file-descriptors in OS/2 EMX mouse support. A @@ -2736,12 +4951,12 @@ Changes since 1.9.9e are recorded by Thomas Dickey. found an incomplete entry such as "dumb" because it did not initialize its buffer for _nc_read_file_entry(). + use -fPIC rather than -fpic for shared libraries on Linux, not - needed for i386 but some ports (from Debian diffs for 5.0). + needed for i386 but some ports (from Debian diffs for 5.0) -TD + use explicit VALID_NUMERIC() checks in a few places that had been overlooked, and add a check to ensure that init_tabs is nonzero, to avoid divide-by-zero (reported by Todd C Miller). + minor fix for CF_ANSI_CC_CHECK configure macro, for HPUX 10.x (from - tin). + tin) -TD 19991218 + reorder tests during mouse initialization to allow for gpm to run in @@ -2911,14 +5126,14 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 991002 pre-release + minor fixes for _nc_msec_cost(), color_content(), pair_content(), _nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe - Blain, comments by Alexander Lukyanov). + Blain, comments by Alexander V Lukyanov). + simplify definition of PANEL and eliminate internal functions _nc_calculate_obscure(), _nc_free_obscure() and _nc_override(), - (patch by Juergen Pfeifer, based on analysis by Philippe Blain + (patch by Juergen Pfeifer, analysis by Philippe Blain )). + change renaming of dft_fgbg.3x to use_default_colors.3ncurses in man_db.renames, since Debian is not concerned with 14-character - filename limitation (from Debian bug report by Josip Rodin + filename limitation (Debian bug report by Josip Rodin ). + corrected scoansi terminfo entry by testing with scoterm and console. + revert change from 990614 to terminal_interface-curses-forms.ads.m4, @@ -2953,8 +5168,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add top-level uninstall.data and uninstall.man makefile rules. + correct logic of CF_LINK_FUNCS configure script, from BeOS changes so that hard-links work on Unix again. - + change default value of cf_cv_builtin_bool to 1 as suggested by - Jeremy Buhler, making it less likely that a conflicting declaration + + change default value of cf_cv_builtin_bool to 1 (suggested by + Jeremy Buhler), making it less likely that a conflicting declaration of bool will be seen when compiling with C++. 990911 pre-release @@ -2977,9 +5192,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. for libg++, since qt uses the same filename incompatibly. + correct logic of lib_termcap.c tgetstr function, which did not copy the result to the buffer parameter. Testing shows Solaris does - update this, though of course tgetent's buffer is untouched (from - mpc.lists.freebsd.current newsgroup item by Peter Edwards - ). + update this, though of course tgetent's buffer is untouched (reported + in Peter Edwards in + mpc.lists.freebsd.current newsgroup. + corrected beterm terminfo entry, which lists some capabilities which are not actually provided by the BeOS Terminal. + add special logic to replace select() calls on BeOS, whose select() @@ -3112,10 +5327,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + fix some compiler warnings in tack. + add a check for predefined bool type in CC, based on report that BeOS predefines a bool type. - + correct logic for infocmp -e option (i.e., the configure - --with-fallbacks option), which I'd not updated when implementing - extended names (cf: 990301). The new implementation adds a -E - option to infocmp. + + correct logic for infocmp -e option, i.e., the configure + --with-fallbacks option, which I'd not updated when implementing + extended names (cf: 990301). The new implementation adds a "-E" + option to infocmp -TD > patch by Juergen Pfeifer: + introduce the private type Curses_Bool in the Ada95 binding implementation. This is to clearly represent the use of "bool" also @@ -3144,8 +5359,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 (prompted by + discussion with Alexander V Lukyanov). 990605 pre-release + include time.h in lib_napms.c if nanosleep is used (patch by @@ -3213,7 +5428,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add sigismember() to base/sigaction.c compatibility to link on NeXT (reported by Francisco A. Tomei Torres). + further refinements to inequality in hashmap.c to cover a case with - ^U in nvi (patch by Alexander Lukyanov). + ^U in nvi (patch by Alexander V Lukyanov). 990316 pre-release + add fallback definition for getcwd, to link on NeXT. @@ -3221,12 +5436,12 @@ Changes since 1.9.9e are recorded by Thomas Dickey. (reported by Francisco A. Tomei Torres). + change inequality in hashmap.c which checks the distance traveled by a chunk so that ^D command in nvi (scrolls 1/2 screen) will use - scrolling logic (patch by Alexander Lukyanov, reported by Jeffrey + scrolling logic (patch by Alexander V Lukyanov, reported by Jeffrey C Honig). 990314 pre-release + modify lib_color.c to handle a special case where the curscr - attributes have been made obsolete (patch by Alexander Lukyanov). + attributes have been made obsolete (patch by Alexander V Lukyanov). + update BSD/OS console terminfo entries to use klone+sgr and klone+color (patch by Jeffrey C Honig). + update glibc addon configure script for extended capabilities. @@ -3238,7 +5453,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + correct typos in linux-c initc string - TD + add 'crt' terminfo entry, update xterm-xfree86 entry - TD + remove a spurious argument to tparm() in lib_sklrefr.c (patch by - Alexander Lukyanov). + Alexander V Lukyanov). 990307 pre-release + back-out change to wgetch because it causes a problem with ^Z @@ -3279,7 +5494,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify define_key() to allow multiple strings to be bound to the same keycode. + correct logic error in _nc_remove_string, from 990220. - > patch by Juergen Pfeifer, for Ada95 binding: + > patch for Ada95 binding (Juergen Pfeifer): + regenerate some of the html documentation + minor cleanup in terminal_interface-curses.adb @@ -3300,8 +5515,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. comp_parse.c into the tic program. + add/use _nc_trace_tries() to show the function keys that will be recognized. - + rename init_acs to _nc_init_acs (request by Alexander Lukyanov). - > patch by Juergen Pfeifer, for Ada95 binding: + + rename init_acs to _nc_init_acs (request by Alexander V Lukyanov). + > patch for Ada95 binding (Juergen Pfeifer): + remove all the *_adabind.c from ncurses, menu and form projects. Those little helper routines have all been implemented in Ada and are no longer required. @@ -3328,7 +5543,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. in smcup/rmcup. This affects only scrolling optimization, to fix a problem reported by several people with xterm's alternate screen, though the problem is more general. - > patch by Juergen Pfeifer, for Ada95 binding: + > patch for Ada95 binding (Juergen Pfeifer): + removed all pragma Preelaborate() stuff, because the just released gnat-3.11p complains on some constructs. + fixed some upper/lower case notations because gnat-3.11p found @@ -3339,17 +5554,17 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 990130 + cache last result from _nc_baudrate, for performance (suggested by - Alexander Lukyanov). + Alexander V Lukyanov). + modify ClrUpdate() function to workaround a problem in nvi, which uses redrawwin in SIGTSTP handling. Jeffrey C Honig reported that ncurses repainted the screen with nulls before resuming normal - operation (patch by Alexander Lukyanov). + operation (patch by Alexander V Lukyanov). + generalize is_xterm() function a little by letting xterm/rxvt/kterm be any substring rather than the prefix. + modify lib_data.c to initialize SP. Some linkers, e.g., IBM's, will not link a module if the only symbols exported from the module are - uninitialized ones (patch by Ilya Zakharevich, who says that he has - seen messages claiming this behaviour conforms to the standard.) + uninitialized ones (patch by Ilya Zakharevich). Ilya says that he + has seen messages claiming this behavior conforms to the standard.) + move call on _nc_signal_handler past _nc_initscr, to avoid a small window where Nttyb hasn't yet been filled (reported by Klaus Weide). + modify lib_tstp.c to block SIGTTOU when handling SIGTSTP, fixes a @@ -3398,7 +5613,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + reviewed/corrected macros in curses.h as per XSI document. + provide support for termcap PC variable by copying it from terminfo data and using it as the padding character in tputs (reported by - Alexander Lukyanov). + Alexander V Lukyanov). + corrected iris-ansi and iris-ansi-ap terminfo entries for kent and kf9-kf12 capabilities, as well as adding kcbt. + document the mouse handling mechanism in menu_driver and make a small @@ -3417,7 +5632,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 990102 + disable scroll hints when hashmap is enabled (patch by Alexander - Lukyanov). + V Lukyanov). + move logic for tic's verify of -e option versus -I and -C so that the terminfo data is not processed if we cannot handle -e (reported by Steven Schwartz . @@ -3428,8 +5643,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. set ospeed, the library behaves as before, except that _nc_timed_wait is no longer used, or needed, since ospeed always has a value. But the application can modify ospeed to adjust the output of padding - characters (from a bug report for screen 3.7.6 and email from Michael - Schroeder ). + characters (prompted by a bug report for screen 3.7.6 and email from + Michael Schroeder ). + removed some unused ifdef's as part of Alexander's restructuring. + reviewed/updated curses.h, term.h against X/Open Curses Issue 4 Version 2. This includes making some parameters NCURSES_CONST @@ -3454,8 +5669,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 981219 + modify _nc_set_writedir() to set a flag in _nc_tic_dir() to prevent it from changing the terminfo directory after chdir'ing to it. - Otherwise, a relative path in $TERMINFO would confuse tic (from a - Debian bug report). + Otherwise, a relative path in $TERMINFO would confuse tic (prompted + by a Debian bug report). + correct/update ncsa terminfo entry (report by Larry Virden). + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur changes @@ -3542,9 +5757,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 981114 + modify install-script for manpages to skip over .orig and .rej files (request by Larry Virden). - > patches/discussion by Alexander Lukyanov: + > patches/discussion by Alexander V Lukyanov: + move base-library sources into ncurses/base and tty (serial terminal) - sources into ncurses/tty, as part of Alexander Lukyanov's proposed + sources into ncurses/tty, as part of Alexander V Lukyanov's proposed changes to ncurses library. + copy _tracemouse() into ncurses.c so that lib_tracemse.c need not be linked into the normal ncurses library. @@ -3560,8 +5775,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + ifdef'd out lib_freeall.c when not configured. + rename _tracebits() to _nc_tracebits(). + move terminfo-library sources into ncurses/tinfo, and trace-support - functions into ncurses/trace as part of Alexander Lukyanov's proposed - changes to ncurses library. + functions into ncurses/trace as part of Alexander V Lukyanov's + proposed changes to ncurses library. + modify generated term.h to always specify its own definitions for HAVE_TERMIOS_H, etc., to guard against inclusion by programs with broken configure scripts. @@ -3687,7 +5902,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add xtermm and xtermc terminfo entries. > from esr's terminfo version: + Added Francesco Potorti's tuned Wyse 99 entries. - + dtterm enacs correction from Alexander V Lukyanov. + + dtterm enacs (from Alexander V Lukyanov). + Add ncsa-ns, ncsa-m-ns and ncsa-m entries from esr version. 980822 @@ -3873,9 +6088,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + put -L$(libdir) first when linking programs, except for HP-UX. + modify comp_scan.c to handle SVr4 terminfo description for att477, which contains a colon in the description field. - + modify configure script to support SCO osr5.0.5 shared libraries - (from comp.unix.sco.programmer newsgroup item by Mike Hopkirk - ). + + modify configure script to support SCO osr5.0.5 shared libraries, + from comp.unix.sco.programmer newsgroup item (Mike Hopkirk). + eliminate extra GoTo call in lib_doupdate.c (patch by Alexander V. Lukyanov). + minor adjustments of const/NCURSES_CONST from IRIX compile. @@ -3962,8 +6176,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 980321 + revise configure macro CF_SPEED_TYPE so that termcap.h has speed_t - declared (from Adam J. Richter ) - + remove spurious curs_set() call from leaveok() (J.T.Conklin). + declared (from Adam J Richter ) + + remove spurious curs_set() call from leaveok() (J T Conklin). + corrected handling leaveok() in doupdate() (patch by Alexander V. Lukyanov). + improved version of wredrawln (patch by Alexander V. Lukyanov). @@ -3994,7 +6208,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify some man-pages so no '.' or '..' falls between TH and SH macros, to accommodate man_db program (reported by Ian T. Zimmerman ). - + terminfo.src 10.2.1 from Eric's webpage. + + terminfo.src 10.2.1 downloaded from ESR's webpage (ESR). > several changes by Juergen Pfeifer: + add copyright notices (and rcs id's) on remaining man-pages. + corrected prototypes for slk_* functions, using chtype rather than @@ -4017,7 +6231,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 980302 4.2 release for upload to prep.ai.mit.edu + correct Florian's email address in ncurses-intro.html - + terminfo.src 10.2.0 from Eric. + + terminfo.src 10.2.0 (ESR). 980228 pre-release + add linux-koi8r replace linux-koi8, which is not KOI8 (patch by @@ -4058,8 +6272,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify Makefile.glibc so that $(objpfx) is defined (H.J.Lu). + ifdef-out true-return from _nc_mouse_inline() which depends on merge of QNX patch (pending 4.2 release). - > patch by J.T.Conklin, to split off seldom-used modules in ncurses - (reduces size by up to 2.6kb): + > patch to split off seldom-used modules in ncurses (J T Conklin): + This reduces size by up to 2.6kb. + move functionality of _nc_usleep into napms, add configuration case for nanosleep(). + moved wchgat() from lib_addch.c to lib_chgat.c @@ -4132,7 +6346,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + progs/infocmp.c: workaround mwcc 32k function data limit 980117 - + correct initialization of color-pair (from 970524) in xmas.c, which + + correct initialization of color-pair (cf: 970524) in xmas.c, which was using only one color-pair for all colors (reported by J.J.G.Ripoll). + add multithread options for objects build on EMX, for compatibility @@ -4177,11 +6391,11 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add a copy of emx.src from J.J.G.Ripoll's OS/2 EMX version of ncurses 1.9.9e, together with fixes/additions for the "ansi" terminal type. + add tic check for save/restore cursor if change_scroll_region is - defined (from O'Reilly book). + defined (reference: O'Reilly book). + modify read_termcap.c to handle EMX-style pathnames (reported by J.J.G.Ripoll). - + modify lib_raw.c to use EMX's setmode (from J.J.G.Ripoll, who says - EMX's curses does this). + + modify lib_raw.c to use EMX's setmode (patch from J.J.G.Ripoll). + Ripoll says EMX's curses does this. + modify _nc_tic_expand() to generate \0 rather than \200. + move/revise 'expand()' from dump_entry.c to ncurses library as _nc_tic_expand(), for use by tack. @@ -4200,7 +6414,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 971227 + modify open/fopen calls to use binary mode, needed for EMX. + modify configure script to work with autoconf 2.10 mods for OS/2 - EMX from J.J.G.Ripoll. + EMX (from J.J.G.Ripoll). + generated ncurses_cfg.h with patch (971222) to autoconf 2.12 which bypasses limited sed buffer length. > several changes from Juan Jose Garcia Ripoll @@ -4308,18 +6522,18 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + replace test for SCO with more precise header tests. + add configure test for unsigned literals, use in NCURSES_BITS macro. + comment-out the -PIC, etc., flags from c++, progs and test makefiles - since they probably are not needed, and are less efficient (noted by. - Ju"rgen Fluk) + since they probably are not needed, and are less efficient (noted by + Juergen Fluk) + add -L$(libdir) to loader options, after -L../lib so that loaders that record this information will tend to do the right thing if - the programs are moved around after installing them (suggested by. - Ju"rgen Fluk). + the programs are moved around after installing them (suggested by + Juergen Fluk). + add -R option to loader options for programs for Solaris if the --enable-rpath option is specified for the libraries. 971112 + correct installed filename for shared libraries on *BSD (reported by - Ju"rgen Fluk). + Juergen Fluk). 971108 + cleanup logic for deciding when tputs() should call delay_output(), @@ -4383,7 +6597,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. than uname, which is unreliable on some systems. + updated Makefile.glibc, test-built with glibc 2.0.5c + modify keyname() to return values consistent with SVr4 curses (patch - by Ju"rgen Fluk). + by Juergen Fluk). > changes requested by Daniel Weaver: + modify delay_output() so that it uses the same output function as tputs() if called from that function. @@ -4437,8 +6651,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + install C++ binding as -lncurses++ and associated headers with the other ncurses headers. + fix header uninstall if configure --srcdir is used. - > minor interface changes (request by Daniel Weaver , - to support 'tack' program): + > minor interface changes to support 'tack' program -TD + (request by Daniel Weaver ). + export functions _nc_trans_string() and _nc_msec_cost(). + add variable _nc_nulls_sent, to record the number of padding characters output in delay_output(). @@ -4449,7 +6663,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify ClrBottom() to avoid using clr_eos if there is only one line to erase. + typo in configure --help. - > patch by J.T.Conklin (with minor resync against Juergen's changes) + > patch by J T Conklin (with minor resync against Juergen's changes) + split-out lib_flash.c from lib_beep.c + split-out lib_hline.c and lib_vline.c from lib_box.c + split-out lib_wattron.c, lib_wattroff.c from lib_addch.c @@ -4616,7 +6830,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + Modified lib_bkgd.c: hopefully correct implementation of wbkgdset(); streamlined implementation of wbkgd() + Modified lib_mvwin.c: Disable move of a pad. Implement (costly) - move of subwindows. Fixed update behaviour of movements of regular + move of subwindows. Fixed update behavior of movements of regular windows. + Fixed lib_pad.c: make chtype argument of pechochar() const. + Fixed lib_window.c: dupwin() is not(!) in every bit a really clone @@ -4770,7 +6984,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + rewrote the hashmap algorithm to be one-pass, this avoids multiple cost_effective() calls on the same lines. + modified cost_effective() so it is now slightly more precise. - > patches by H.J.Lu for glibc integration: + > patches for glibc integration (H.J.Lu): + add modules define_key, keyok, name_match, tries + add makefile rules for some of the unit tests in ncurses (mvcur, captoinfo, hardscroll, hashmap). @@ -4931,7 +7145,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + removed buffer-allocation for name and description from m_item_new.c, since this might result in incompatibilities with SVr4. Also fixed the corresponding Ada95 binding module (patch by Juergen Pfeifer, - from report by Avery Pennarun ) + report by Avery Pennarun ) + removed the mechanism to timestamp the generated Ada95 sources. This resulted always in generating patches for the HTML doc, even when nothing really changed (patch by Juergen Pfeifer). @@ -4975,7 +7189,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add extensions keyok() and define_key(). These are designed to allow the user's application better control over the use of function keys, e.g., disabling the ncurses KEY_MOUSE. (The define_key idea was from - a mailing-list thread started by kjahds@kjahds.com Nov'1995). + a mailing-list thread started by Kenneth Albanowski + Nov'1995). + restore original behavior in ncurses 'g' test, i.e., explicitly set the keypad mode rather than use the default, since it confuses people. @@ -4994,9 +7209,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. ) + move calls of _nc_background() out of various loops, as its return value will be the same for the whole window being operated on (patch - by J.T.Conklin). + by J T Conklin). + add macros getcur[xy] getbeg[xy] getpar[xy], which are defined in - SVr4 headers (patch by J.T.Conklin ) + SVr4 headers (patch by J T Conklin ) + modify glibc addon-configure scripts (patch by H.J.Lu). + correct a bug in hashmap.c: the size used for clearing the hashmap table was incorrect, causing stack corruption for large values of @@ -5160,18 +7375,18 @@ Changes since 1.9.9e are recorded by Thomas Dickey. function in lib_doupdate.c (patch by Alexander V. Lukyanov). + correct hashmap.c, which did not update index information (patch by Alexander V. Lukyanov). - + patch by Juergen Pfeifer for C++ binding and demo (see c++/NEWS) + + fixes for C++ binding and demo (see c++/NEWS) (Juergen Pfeifer). + correct index in lib_instr.c (Juergen Pfeifer). + correct typo in 970426 patch from Tom's cleanup of lib_overlay.c - (Juergen Pfeifer). + (patch by Juergen Pfeifer). 970426 + corrected cost computation in PutRange(), which was using milliseconds compared to characters by adding two new members to the SCREEN struct, _hpa_ch_cost and _cup_ch_cost. + drop ncurses/lib_unctrl.c, add ncurses/MKunctrl.awk to generate a - const array of strings (suggested by Alexander V. Lukyanov, though - with a perl script 970118). + const array of strings (suggested by Alexander V. Lukyanov). The + original suggestion in 970118 used a perl script. + rewrote ncurses 'b' test to better exercise magic-cookie (xmc), as well as noting the attributes that are not supported by a terminal. + trace the computation of cost values in lib_mvcur.c @@ -5199,8 +7414,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Henderson ). 970412 - + corrected ifdef'ing of inline (from 970321) for TRACE vs C++. - + corrected toggle_attr_off() macro (patch by Andries.Brouwer). + + corrected ifdef'ing of inline (cf: 970321) for TRACE vs C++. + + corrected toggle_attr_off() macro (patch by Andries Brouwer). + modify treatment of empty token in $MANPATH to /usr/man (reported by ) + modify traces that record functions-called so that chtype and attr_t @@ -5221,12 +7436,12 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + 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). + ncurses is integrated into larger systems (adapted 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 - Kriang Lerdsuwanakij 970329). + was true (patch by Alexander V Lukyanov (in 970124), reported + by Kriang Lerdsuwanakij in 970329). + modify 'clean' rule in include/Makefile so that files created by configure script are removed in 'distclean' rule instead. @@ -5281,7 +7496,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. implements an expanded form of certain complex macros, for testing with ATAC. + disable CHECK_POSITION unless --with-assertions is configured - (Alexander Lukyanov pointed out that this is redundant). + (Alexander V Lukyanov pointed out that this is redundant). + use keyname() to show traced chtype values where applicable rather than _tracechar(), which truncates the value to 8-bits. + minor fixes to TRACE_ICALLS, added T_CREATE, TRACE_CCALLS macros. @@ -5298,7 +7513,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify worm.c to hide cursor while running. + add -Wcast-qual to gcc warnings, fix accordingly. + use PutChar rather than PutAttrChar in ClrToEOL to properly handle - wrapping (Alexander Lukyanov). + wrapping (Alexander V Lukyanov). + correct spurious echoing of input in hanoi.c from eric's #291 & #292 patches (reported by Vernon C. Hoxie ). + extend IRIX configuration to IRIX64 @@ -5311,7 +7526,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + autogenerated object-dependencies for test directory + add configure option --with-rcs-ids + modify configuration scripts to generate major/minor/patch versions - (suggested by Alexander Lukyanov). + (suggested by Alexander V Lukyanov). + supply missing va_end's in lib_scanw.c + use stream I/O for trace-output, to eliminate fixed-size buffer + add TRACE_ICALLS definition/support to lib_trace.c @@ -5324,8 +7539,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. the returned buffer. + invoke ldconfig after installing shared library + modify install so that overwrite applies to shared library -lcurses - in preference to static library (reported by Zeyd 960928). - + correct missing ';' in 961221 mod to overwrite option use of $(LN_S). + in preference to static library (reported by Zeyd M Ben-Halim 960928). + + correct missing ';' in 961221 mod to overwrite optional use of $(LN_S) + symbol. + fixes to allow "make install" to work without first doing a "make all" (suggested by Larry Virden). @@ -5373,7 +7589,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify lib_doupdate to make el, el1 and ed optimization use the can_clear_with macro, and change EmitRange to allow leaving cursor at the middle of interval, rather than always at the end (patch by - Alexander Lukyanov originally 960929, resync 970106). + Alexander V Lukyanov). This was originally 960929, resync 970106. 970104 + workaround defect in autoconf 2.12 (which terminates configuration @@ -5416,11 +7632,11 @@ Changes since 1.9.9e are recorded by Thomas Dickey. descriptors, needed for GPM. + integrate patch by Andrew Kuchling for GPM (mouse) support, correcting logic in wgetch() and _nc_mouse_parse() which - prevented patch from working properly. + prevented patch from working properly -TD + improve performance of panel algorithm (Juergen Pfeifer 961203). + strip RCS id's from generated .html files in Ada95 subtree. + resync with generated .html files (Juergen Pfeifer 961223). - + terminfo.src 10.1.0 from Eric. + + terminfo.src 10.1.0 (ESR). 961224 4.0 release + release as 4.0 to accommodate Linux ld.so.1.8.5 @@ -5435,7 +7651,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. include-path to /usr/include if gcc is used (reported by Florian La Roche). + modify setupterm() to allocate new TERMINAL for each call, just as - solaris' curses does (Alexander Lukyanov 960829). + solaris' curses does (Alexander V Lukyanov 960829). + corrected memory leaks in read_entry.c + add configure options --with-dbmalloc, --with-dmalloc, and --disable-leaks, tested by instrumenting infocmp, ncurses programs. @@ -5446,10 +7662,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + split-out panel.priv.h, improve dependencies for forms, menus (Juergen Pfeifer 961204). + modify _nc_freewin() to reset globals curscr/newscr/stdscr when - freeing the corresponding WINDOW (Purify). + freeing the corresponding WINDOW (found using Purify). + modify delwin() to return ERR if the window to be deleted has - subwindows, needed as a side-effect of resizeterm() (Purify). Tested - and found that SVr4 curses behaves this way. + subwindows, needed as a side-effect of resizeterm() (found using + Purify). Tested and found that SVr4 curses behaves this way. + implement logic for _nc_freeall(), bringing stub up to date. 961215 @@ -5481,16 +7697,16 @@ Changes since 1.9.9e are recorded by Thomas Dickey. handled as an exception to the rule, since some linkers do bulk inclusion of libraries when given the full name - T.Dickey). + modify configure script to allow user-supplied $CFLAGS to set the - debug-option in all libraries (requested by lots of people). + debug-option in all libraries (requested by lots of people) -TD + use return consistently from main(), rather than exit (reported by Florian La Roche). + add --enable-getcap-cache option to configure, normally disabled (requested by Florian La Roche). + make configure test for gettimeofday() and possibly -lbsd more - efficient (requested by Florian La Roche florian@knorke.saar.de) + efficient (requested by Florian La Roche ) + minor adjustments to Ada95 binding (patches by Juergen Pfeifer) + correct attributes after emitting orig_pair in lib_vidattr.c (patch - by lav@yars.free.net). + by Alexander V Lukyanov). 961208 + corrected README wrt Ada95 (Juergen Pfeifer) @@ -5503,7 +7719,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. data used in ncurses library. + initialize _nc_idcok, _nc_idlok statically to resolve discrepancy between initscr() and newwin() initialization (reported by - lav@yars.free.net). + Alexander V Lukyanov). + test built VERSION=4.0, SHARED_ABI=4 with Linux ld.so.1.8.5 (set beta versions to those values -- NOTE that subsequent pre-4.0 beta may not be interchangeable). @@ -5514,7 +7730,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Dickey). 961127 - > patch by Juergen Pfeifer (mostly for panel): + > patch, mostly for panel (Juergen Pfeifer): + cosmetic improvement for a few routines in the ncurses core library to avoid warning messages. + the panel overlap detection was broken @@ -5544,7 +7760,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. (Juergen Pfeifer) + use MODULE_ID (rcs keywords) in forms and menus libraries (Juergen Pfeifer). - > patch #324 by Eric. + > patch #324 (ESR): + typo in curs_termcap man page (reported by Hendrik Reichel <106065.2344@compuserve.com>) + change default xterm entry to xterm-r6. @@ -5561,8 +7777,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify hanoi.c to work on non-color terminals, and to use timing delays when in autoplay mode. + correct 'echochar()' to refresh immediately (reported by Adrian - Garside 94ajg2@eng.cam.ac.uk) - > patch #322 by eric: + Garside <94ajg2@eng.cam.ac.uk>) + > patch #322 (ESR): + reorganize terminfo.src entries for xterm. 961109 - snapshot @@ -5585,10 +7801,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. resize test, use wbkgd and corrected box() parameters. + make flushinp() test work in ncurses.c by using napms() instead of sleep(). - + undo Eric's changes to xterm-x11r6 (it no longer matched the X11R6.1 + + undo ESR's changes to xterm-x11r6 (it no longer matched the X11R6.1 distribution, as stated) - + terminfo 9.13.18 (resync by Eric) - + check for getenv("HOME") returning null (Eric). + + terminfo 9.13.18 resync (ESR) + + check for getenv("HOME") returning null (ESR). + change buffer used to decode xterm-mouse commands to unsigned to handle displays wider than 128 chars (Juergen Pfeifer). + correct typo curs_outopts.3x (Juergen Pfeifer). @@ -5650,17 +7866,16 @@ Changes since 1.9.9e are recorded by Thomas Dickey. $datadir instead of actual terminfo path. + correct whitespace in include/Caps, which caused kf11, clr_eol and clr_end to be omitted from terminfo.5 - + fix memory leaks in delscreen() (adapted from Alexander Lukyanov). + + fix memory leaks in delscreen() (adapted from Alexander V Lukyanov). + improve appearance of marker in multi-selection menu (Juergen Pfeifer) - + fix behaviour for forms with all fields inactive (Juergen - Pfeifer) + + fix behavior for forms with all fields inactive (Juergen Pfeifer) + document 'field_index()' (Juergen Pfeifer) - > patch #321 by eric: + > patch #321 (ESR): + add some more XENIX keycap translations to include/Caps. + modify newwin to set initial state of each line to 'touched' (from patch by Peter Wemm ) - + in SET_TTY, replace TCSANOW with TCSADRAIN (Alexander Lukyanov). + + in SET_TTY, replace TCSANOW with TCSADRAIN (Alexander V Lukyanov). 960928 - snapshot + ifdef'd out _nc_hash_map (still slower) @@ -5672,36 +7887,36 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + ensure that 'doupdate()' sets the .oldindex values back to a sane state; this was causing a spurious refresh in ncurses 'r'. + add logic to configure (from vile) to guard against builders who - don't remove config.cache & config.status when doing new builds. - + corrected logic for 'repeat_char' in EmitRange (from #317), which + don't remove config.cache & config.status when doing new builds -TD + + corrected logic for 'repeat_char' in EmitRange (cf: eric #317), which did not follow the 2-parameter scheme specified in XSI. + corrected logic of wrefresh, wnoutrefresh broken in #319, making - clearok work properly (from report by Michael Elkins). + clearok work properly (report by Michael Elkins). + corrected problem with endwin introduced by #314 (removing the scrolling-region reset) that broke ncurses.c tests. + corrected order of args in AC_CHECK_LIB (from report by Ami Fischman ). + corrected formatting of terminfo.5 tables (Juergen Ehling) - > patch 320 by eric: + > patch 320 (ESR): + change ABI to 3.3 + emit a carriage-return in 'endwin()' to workaround a kernel bug in BSDI. (requested by Mike Karels ) + reverse the default o configure --enable-termcap (consensus). - > patch 319 by eric: + > patch 319 (ESR): + modified logic for clearok and related functions (from report by Michael Elkins) - untested - > patch 318 by eric: + > patch 318 (ESR): + correction to #317. - > patch 317 by eric: + > patch 317 (ESR): + re-add _nc_hash_map + modify EmitRange to maintain position as per original design. + add hashtest.c, program to time the hashmap optimization. - > patch 316 by eric: + > patch 316 (ESR): + add logic to deal with magic-cookie (how was this tested?) (lib_doupdate.c). + add ncurses.c driver for magic-cookie, some fixes to ncurses.c - > patch 315 by eric: - + merged A. Lukyanov's patch to use ech and rep - untested + > patch 315 (ESR): + + merged Alexander V Lukyanov's patch to use ech and rep - untested (lib_doupdate.c). + modified handling of interrupted system calls - untested (lib_getch.c, lib_twait.c). @@ -5719,11 +7934,11 @@ Changes since 1.9.9e are recorded by Thomas Dickey. either ;-) + clarify the documentation for the builtin form fieldtypes (Juergen Pfeifer) - > patch 314 by eric: - + Enhancement suggested by A. Lukyanov -- reset scroll region on - startup rather than at wrapup time. - + Fix suggested by A. Lukyanov, make storage of palette tables - and their size counts per-screen for multi-terminal applications. + > patch 314 (ESR): + + reset scroll region on startup rather than at wrapup time + (enhancement suggested by Alexander V Lukyanov). + + make storage of palette tables and their size counts per-screen for + multi-terminal applications (suggested by Alexander V Lukyanov). + Improved error reporting for infotocap translation errors. + Update terminfo.src to 9.13.14. @@ -5742,7 +7957,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. the corresponding logic from raw, cbreak, etc. + disable ONLCR during initialization, to match SVr4 (this is needed for cursor optimization when the cursor-down is a newline). - + replaced Eric's imitation of wresize with my original (his didn't + + replaced ESR's imitation of wresize with my original (his didn't work). 960831 - snapshot @@ -5772,7 +7987,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. descriptions that existed in directories past the first one searched (reported by Alexander V. Lukyanov) + corrected typo in dtterm description. - > patch 313 by eric: + > patch 313 (ESR): + add dtterm description + clarify ncurses 'i' test (drop vscanf subtest) @@ -5785,9 +8000,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 960804 + revised fix to tparm; previous fix reversed parameter order. - > patch 312 by eric: + > patch 312 (ESR): correct terminfo.src corrupted by #310 - > patch 311 by eric: + > patch 311 (ESR): + fix idlok() and idcok() and the default of the idlok switch. 960803 - snapshot @@ -5795,7 +8010,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. (reported by William P Setzer) + add fallback def for GCC_NORETURN, GCC_UNUSED for termcap users (reported by Tim Mooney). - > patch 310 by eric: + > patch 310 (ESR): + documentation and prototyping errors for has_color, immedok and idcok (reported by William P Setzer ) + updated qnx terminfo entry (by Michael Hunter) @@ -5809,14 +8024,14 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 960727 - snapshot + call cbreak() in initscr(), as per XSI & SVr4. + turn off hardware echo in initscr() as per XSI & SVr4 - > patch 309 by eric: + > patch 309 (ESR): + terminfo changes (9.3.10), from BRL + add more checks to terminfo parser. + add more symbols to infocmp. 960720 - snapshot + save previous-attribute in lib_vidattr.c if SP is null (reported by - Ju"rgen Fluk ) + Juergen Fluk ) + corrected calls on _nc_render so that background character is set as per XSI. + corrected wbkgdset macro (XSI allows background character to be @@ -5826,7 +8041,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. because not all systems declare it in the headers that we can safely include therein). + move the ifdefs for errno into curses.priv.h - > patch 308 by eric: + > patch 308 (ESR): + terminfo changes (9.3.8) + modified logic of error-reporting in terminfo parser @@ -5834,15 +8049,15 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + always check for since ISC needs it to declare fd_set (Juergen Pfeifer) + install shared-libraries on NetBSD/FreeBSD with ABI-version (reported - by several people: Juergen Pfeifer, Mike Long) + by Juergen Pfeifer, Mike Long) + add LOCAL_LDFLAGS2 symbol (Juergen Pfeifer) + corrected prototype for delay_output() -- bump ABI to 3.2 - + terminfo patches #306/307 from Eric. + + terminfo patches #306/307 (ESR). + moved logic that filters out rmul and rmso from setupterm to newterm where it is less likely to interfere with termcap applications. 960707 - + rollback Eric's #305 change to terminfo.src (it breaks existing + + rollback ESR's #305 change to terminfo.src (it breaks existing applications, e.g., 'less 290'). + correct path of edit_man.sh, and fix typo that made all man-pages preformatted. @@ -5854,8 +8069,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + make lib_vidattr.c more readable using macros. + filter out rmul, rmso that conflict with sgr0 when reading terminal descriptions. - + added sanity-checking of various paired string attributes (Eric). - + work around autoconf bug, force $INSTALL to absolute path. + + added sanity-checking of various paired string attributes (ESR). + + work around autoconf bug, force $INSTALL to absolute path (reported by Zeyd). + modify man-page install for BSDI to install preformatted .0 files (reported by David MacKenzie). @@ -5910,7 +8125,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. screen (Juergen Pfeifer). + modified autoconf scripts to prepare for Ada95 (GNAT) binding to ncurses (Juergen Pfeifer). - + incorrect buffer-size in _nc_read_entry, reported by Eric Raymond. + + incorrect buffer-size in _nc_read_entry, reported by ESR. 960617 + corrected two logic errors in read_entry.c, write_entry.c (called by @@ -5930,8 +8145,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. warnings turned on, which makes config.log hard to read. + added 'lint' rule to top-level Makefile. + added configure option '--with-install-prefix' for use by system - builders to install into staging locations (from request by - charles@comm.polymtl.ca) + builders to install into staging locations (requested by + Charles Levert ). + corrected autoconfigure for Debian man program; it's not installed as "man_db". + set noecho in 'worm'; it was ifdef'd for debug only @@ -5943,8 +8158,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modified lib_doupdate.c to use lower-level SP's current_attr state instead of curscr's state, since it is redundant. + correction to IDcTransformLine logic which controls where InsStr is - invoked (refined by lav@yars.free.net). - > patches 303 by eric + invoked (refined by Alexander V Lukyanov). + > patch 303 (ESR): + conditionally include Chris Torek's hash function _nc_hash_map(). + better fix for nvi refresh-bug (Rick Marshall) + fix for bug in handling of interrupted keystroke waits, @@ -5977,19 +8192,19 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + include stdlib.h before defs for EXIT_SUCCESS, for OSF/1. + include sys/types.h in case stdlib.h does not declare size_t. + fixes for makefile (Tim Mooney) - + fixes for menus & forms (Juergen.Pfeifer@T-Online.de) + + fixes for menus & forms (Juergen Pfeifer) 960518 - snapshot + revised ncurses.c panner test, let pad abut all 4 sides of screen. + refined case in lib_doupdate.c for ClrToEOL(). - + corrected prior change for PutRange (Alexander V. Lukyanov: - lav@yars.free.net). - + autoconf mods (Tim Mooney: mooney@dogbert.cc.ndsu.NoDak.edu). - + locale fix for forms (Philippe De Muyter: phdemuyt@ulb.ac.be) + + corrected prior change for PutRange (Alexander V Lukyanov + ). + + autoconf mods (Tim Mooney ). + + locale fix for forms (Philippe De Muyter ) + renamed "--with-datadir" option to "--with-ticdir" to avoid confusion, and made this check for the /usr/lib/terminfo pre-existing directory. - > patches 299-301 by eric: + > patches 299-301 (ESR): + added hashmap.c + mods to tracing, especially for ACS chars. + corrected off-by-one in IDCtransform. @@ -6006,7 +8221,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + added -T options to tic and infocmp (for testing/analysis) + refined the length criteria for termcap and terminfo + optimize lib_doupdate with memcpy, PutRange - > patches 297, 298 by eric + > patches 297, 298 (ESR): + implement TERMINFO_DIRS, and -o option of tic + added TRACE_IEVENT + removed boolean version of 'getm' @@ -6014,12 +8229,13 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + added has_key() + added 't' to ncurses.c test. + moved delay_output() to lib_tputs.c - + removed tparam(). + + removed tparam() (was added in 1.9.9, but conflicts with emacs and + is not part of X/Open Curses). + misc cursor & optimization fixes. 960504 - snapshot + modified ncurses 'p' test to allow full-screen range for panner size. - + fixes for locale (phdm@labauto1.ulb.ac.be) + + fixes for locale (Philippe De Muyter ) + don't use fixed buffer-size in fmt_entry(). + added usage-message to 'infocmp'. + modified install.includes rules to prepend subdirectory-name to @@ -6039,7 +8255,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + change ncurses 'a' test to run in raw mode. + make TIOCGWINSZ configure test less stringent, in case user configures via terminal that cannot get screen size. - > patches 295, 296 by eric: + > patches 295, 296 (ESR): + new "-e" option of tic. + fix for "infocmp -e". + restore working-directory in read_termcap.c @@ -6051,7 +8267,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + fix for AIX 3.2.5 (must define _POSIX_SOURCE to get termios struct definitions via , modified macros in lib_raw.c to avoid K&R-style substitution) - > patches 293, 294 by eric: + > patches 293, 294 (ESR): + mods to wgetch() in cooked mode + corrected askuser() logic in tset + correct interaction of endwin() with mouse processing @@ -6583,3 +8799,5 @@ available separately from netcom.com:pub/zmbenhal/ * ANSIfication of some functions. * Disabling cost analysis 'cause it's incorrect. * A quick hack for a terminfo entry. + +-- vile:txtmode: diff --git a/contrib/ncurses/README b/contrib/ncurses/README index 6fd3098d70..56bc38586f 100644 --- a/contrib/ncurses/README +++ b/contrib/ncurses/README @@ -1,4 +1,31 @@ --- $Id: README,v 1.21 2003/02/08 19:36:39 tom Exp $ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-2004,2006 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: README,v 1.23 2006/04/22 22:19:37 tom Exp $ ------------------------------------------------------------------------------- README file for the ncurses package @@ -64,7 +91,7 @@ install.libs' rule as libncurses++. In the `Ada95' directory, you'll find code and documentation for an Ada95 binding of the curses API, to be used with the GNAT compiler. This binding is built by a normal top-level `make' if configure detects -an usable version of GNAT (3.10 or above). It is not installed automatically. +an usable version of GNAT (3.11 or above). It is not installed automatically. See the Ada95 directory for more build and installation instructions and for documentation of the binding. diff --git a/contrib/ncurses/README.DELETED b/contrib/ncurses/README.DELETED index 041d19dfbc..583e8572be 100644 --- a/contrib/ncurses/README.DELETED +++ b/contrib/ncurses/README.DELETED @@ -1,5 +1,78 @@ -Ada95/* +Ada95/ +Makefile.in +Makefile.os2 +README.emx +aclocal.m4 +announce.html.in +c++/ config.guess config.sub configure -man/* +configure.in +convert_configure.pl +dist.mk +doc/ +form/Makefile.in +form/READ.ME +form/headers +form/llib-lform +form/llib-lformw +form/modules +include/Caps.aix4 +include/Caps.hpux11 +include/Caps.keys +include/Caps.osf1r5 +include/Caps.uwin +include/MKterm.h.awk.in +include/curses.h.in +include/headers +include/ncurses_cfg.hin +install-sh +man/ +menu/Makefile.in +menu/READ.ME +menu/headers +menu/llib-lmenu +menu/llib-lmenuw +menu/modules +misc/Makefile.in +misc/chkdef.cmd +misc/cleantic.cmd +misc/cmpdef.cmd +misc/csort +misc/emx.src +misc/gen_edit.sh +misc/jpf-indent +misc/makedef.cmd +misc/makellib +misc/ncu-indent +misc/ncurses-config.in +misc/ncurses.supp +misc/run_tic.in +misc/shlib +misc/tdlint +misc/terminfo.src +mk-0th.awk +mk-1st.awk +mk-2nd.awk +mk-hdr.awk +mkdirs.sh +ncurses/Makefile.in +ncurses/README +ncurses/README.IZ +ncurses/base/README +ncurses/llib-lncurses +ncurses/llib-lncursest +ncurses/llib-lncursesw +ncurses/modules +ncurses/tinfo/README +ncurses/trace/README +ncurses/tty/tty_display.h +panel/Makefile.in +panel/headers +panel/llib-lpanel +panel/llib-lpanelw +panel/modules +progs/ +tar-copy.sh +test/ diff --git a/contrib/ncurses/README.DRAGONFLY b/contrib/ncurses/README.DRAGONFLY index 794b6298b0..1bf7e464cd 100644 --- a/contrib/ncurses/README.DRAGONFLY +++ b/contrib/ncurses/README.DRAGONFLY @@ -1,5 +1,5 @@ - ncursese 5.4 AS USED BY DRAGONFLY + ncurses 5.7 AS USED BY DRAGONFLY This directory contains a selected set of files from the gnu ncurses-5.4.tar.gz distribution. No files have been moved @@ -9,7 +9,8 @@ http://ftp.gnu.org/pub/gnu/ncurses/ - MD5 (ncurses-5.4.tar.gz) = 069c8880072060373290a4fefff43520 + MD5 (ncurses-5.7.tar.gz) = cce05daf61a64501ef6cd8da1f727ec6 + SHA1 (ncurses-5.7.tar.gz) = 8233ee56ed84ae05421e4e6d6db6c1fe72ee6797 DO NOT CREATE OR EDIT ANY FILES IN THIS DIRECTORY HIERARCHY! THIS HIERARCHY REPRESENTS AN EXACT COPY, MINUS UNNEEDED FILES, OF THE @@ -17,11 +18,18 @@ DragonFly build wrapper, in /usr/src/gnu/lib/libncurses by creating overrides or performing surgery on the distribution into local files. The only additional files added to this directory - are README.DRAGONFLY and README.DELETED. + are README.DRAGONFLY and README.DELETED. + + The .h files copied into base where created using configure opts: + --enable-widec + --enable-const + --with-sysmouse + --enable-termcap + --enable-bsdpad UPGRADE PROCEDURE: - * download a new ncurses-5.X dist greater then 5.4 + * download a new ncurses-5.X dist greater then 5.7 * extract the archive into the contrib/ directory. diff --git a/contrib/ncurses/README.emx b/contrib/ncurses/README.emx deleted file mode 100644 index 0605e67bd4..0000000000 --- a/contrib/ncurses/README.emx +++ /dev/null @@ -1,45 +0,0 @@ --- $Id: README.emx,v 1.6 2002/09/07 17:03:19 tom Exp $ --- Author: Thomas Dickey -------------------------------------------------------------------------------- - -You can build ncurses on OS/2 in the EMX environment. But you must build and -acquire tools. Not all of the tools distributed with EMX work properly, and -some additional ones are required. - -First, the configure script distributed with ncurses will not run as-is in EMX. -You can generate a new one if you have autoconf built for EMX. You will need -the EMX development tools, of course. Get these programs to start: - - GNU m4 program (version 1.4) - GNU autoconf (version 2.13). - GNU patch (version 2.5) - -Apply the autoconf patches from - - http://invisible-island.net/autoconf - ftp://invisible-island.net/autoconf - -These are ordered by date: - - autoconf-2.13-20020210.patch.gz - autoconf-2.13-20020210-emx.patch.gz - -I built my development environment for ncurses using EMX 0.9c at the end of -1997. Much of the EMX patch for autoconf was done originally by J.J.G.Ripoll, -using a similar environment (he prefers using the 'ash' shell). Newer versions -may fix these problems: - - + The pdksh program distributed at Hobbes and Leo (with a 1996 date) is - defective. It does not process "here documents" correctly (which - renders it useless for running the autoconf script). I built my own - copy of pdksh 5.2.13, which does have the bug corrected (documented - in the change log for pdksh). - - + I also built from sources (because the distributed binaries did not - work) the cmp, diff programs. - - Other required utilities such as ar, cat, chmod, cp, gawk, grep, mv, - ls, rm, mkdir, sed, sort and tr worked. - -Once you have autoconf patched and installed, run 'autoconf' from the top-level -directory of ncurses to generate the EMX-specific configure script. diff --git a/contrib/ncurses/TO-DO b/contrib/ncurses/TO-DO index a689447b72..ca47d02d0e 100644 --- a/contrib/ncurses/TO-DO +++ b/contrib/ncurses/TO-DO @@ -1,77 +1,111 @@ --- $Id: TO-DO,v 1.43 2004/02/08 21:09:00 tom Exp $ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-2007,2008 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: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $ +------------------------------------------------------------------------------- SHORT-TERM TO-DO ITEMS: Known Problems: -* The form/menu libraries do not use wide-character features. ++ libtool does not work with GNAT. -* Some users would like to build a single version of libtinfo which can be - used from either libncursesw or libncurses. - -* libtool does not work with GNAT. - -* The screen optimization has been tested only in an ad hoc manner. We should ++ The screen optimization has been tested only in an ad hoc manner. We should develop a good set of regression tests to cover lib_doupdate.c and lib_mvcur.c. -* Magic cookie support does not work, since the logic does not take into account - refresh. Also, the initial optimize does not adjust the current location - when a cookie is emitted. ++ Magic cookie support (for nonzero xmc values) does not work, since the logic + does not take into account refresh. Also, the initial optimize does not + adjust the current location when a cookie is emitted. -* Scrolling optimization has holes: for example, it forces repaints of the ++ Scrolling optimization has holes: for example, it forces repaints of the screen between calls to refresh(). -* SVr4 uses slightly different rules for determining when softkeys are shown. ++ SVr4 uses slightly different rules for determining when softkeys are shown. For example, they are initially displayed (before the ncurses 'e' test activates them), and a touchwin can apparently also force them to be displayed. -* The code departs from perfect 8-bit cleanness in one respect; you cannot - specify a character \200 as part of a capability string, because the terminfo - library interprets \200 as a request to embed NUL (\000) at that point. This - is a legacy terminfo property we can't mess with. ++ The code departs from perfect 8-bit cleanness in one respect; you cannot + specify a character \200 as part of a capability string, because the + terminfo library interprets \200 as a request to embed NUL (\000) at that + point. This is a legacy terminfo property we can't mess with. + ++ The window classes defined in the c++ subdirectory need documentation. Some + C++ programmer could earn a lot of good karma by doing this... -* The window classes defined in the c++ subdirectory need documentation. - Some C++ programmer could earn a lot of good karma by doing this... ++ vid_attr() should support the set_a_attributes (sgr1) string, but does not. + There appear to be no terminals that require that functionality. -* The resizeterm() function does not handle ripped-off lines such as that - done for the slk_XXX functions. ++ the configure --disable-ext-funcs option does not work for Ada95 tree. + ++ the --with-pthread configuration builds for Cygwin, but does not work + properly (test/worm.c shows all of the worms in the same location). + ++ the --enable-rpath configure option builds for the corresponding platforms; + however combining it with --with-ticlib and --with-termlib does not always + produce libraries that can be run without setting environment variables. + Building those with libtool does not work either. (This is a problem with + the BSD platforms). Portability (or lack thereof): -* Users of older System V UNIXes (but not Solaris, and probably not SVr4) - may trip over a known problem with the signal-handling code which causes - abrupt termination of ncurses applications following resume from a ^Z - suspend (this problem was first seen running lynx). You will not see - this problem if you are running Linux or one of the 4.4BSD derivatives - like FreeBSD, NetBSD, or BSDI. For details, see the analysis in the - header comment of ncurses/tty/lib_tstp.c . - -* In theory, vwprintw and vwscanf are supposed to use the older varargs.h - interface for handling variadic argument lists. Linux doesn't have - varargs.h, it has the newer X/Open-standard stdargs.h equivalent. So - these functions use stdargs instead. This is unlikely to be a problem - unless you're building ncurses on a System V old enough to only have - varargs.h. (Solaris 2.5.1 uses the stdarg.h binding as well). - -* If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to - have a native vsscanf(3) in its library, vwscanw() will not work. You lose. - (It should work on any System V, however). If you want to fix this, add - an implementation to ncurses/vsscanf.c. - -* The C++ binding fails to build with a few C++ compilers, mainly with - configure script problems with vsscanf(). - -* terminfo.5 does not format with the SunOS (and most other platform's) tbl - utility because it relies on a diversion for each table entry. Get the groff - package. ++ Users of older System V UNIXes (but not Solaris, and probably not SVr4) may + trip over a known problem with the signal-handling code which causes abrupt + termination of ncurses applications following resume from a ^Z suspend (this + problem was first seen running lynx). You will not see this problem if you + are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or + BSDI. For details, see the analysis in the header comment of + ncurses/tty/lib_tstp.c . + ++ In theory, vwprintw and vwscanf are supposed to use the older varargs.h + interface for handling variadic argument lists (and are deprecated by X/Open + for that reason). Linux doesn't have varargs.h, it has the newer + X/Open-standard stdargs.h equivalent. So these functions use stdargs + instead. This is unlikely to be a problem unless you're building ncurses on + a System V old enough to only have varargs.h. (Solaris 2.5.1 used the + stdarg.h binding as well). + ++ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have + a native vsscanf(3) in its library, vwscanw() will not work. You lose. (It + should work on any System V, however). If you want to fix this, add an + implementation to ncurses/vsscanf.c. + ++ The C++ binding fails to build with a few C++ compilers. + ++ terminfo.5 does not format with the SunOS (and most other platform's) tbl + utility because it relies on a diversion for each table entry. Get the + groff package. Untested features: -* The code for the HP color model using set_color_pair is untested. ++ The code for the HP color model using set_color_pair is untested. -* The code for handling soft labels on a terminal type with built-in support ++ The code for handling soft labels on a terminal type with built-in support for them (num_labels > 0, label_height, label_width, label_format, label_off, label_on, plab_norm, lab_f*) has not been tested. The label_format and lab_f* capabilities aren't presently used. @@ -80,14 +114,14 @@ LONGER-TERM TO-DO ITEMS: 1. Extended COSE conformance -There is an XPG4 standard recently released which describes a superset +There is an XPG4 standard released in 1996 which describes a superset of the SVr4 API. The library is BASE conformant with this standard. We would like to make ncurses fully conformant at the EXTENDED level supporting internationalization. 2. DOS port -Only 16 of the 55 files in the library depend on the terminfo format. +Only a few of the files in the library depend on the terminfo format. It should be possible to further kernelize the package, then rewrite a small number of core files to produce a functionally-compatible port that would do updates to a memory-mapped screen area. The first @@ -174,3 +208,5 @@ These are the potentially important ones for ncurses. Notes: ii) We probably don't care about dest_tabs_magic_smso; only Telerays used it and they're all long obsolete. + +-- vile:txtmode diff --git a/contrib/ncurses/aclocal.m4 b/contrib/ncurses/aclocal.m4 deleted file mode 100644 index a70a64e1a3..0000000000 --- a/contrib/ncurses/aclocal.m4 +++ /dev/null @@ -1,3711 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 1998-2003,2004 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl Author: Thomas E. Dickey 1995-2003 -dnl -dnl $Id: aclocal.m4,v 1.333 2004/01/30 20:59:56 tom Exp $ -dnl Macros used in NCURSES auto-configuration script. -dnl -dnl See http://invisible-island.net/autoconf/ for additional information. -dnl -dnl --------------------------------------------------------------------------- -dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15 -dnl ------------------- -dnl Construct the list of include-options for the C programs in the Ada95 -dnl binding. -AC_DEFUN([CF_ADA_INCLUDE_DIRS], -[ -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" -if test "$srcdir" != "."; then - ACPPFLAGS="-I\$(srcdir)/../../include $ACPPFLAGS" -fi -if test "$GCC" != yes; then - ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" -elif test "$includedir" != "/usr/include"; then - if test "$includedir" = '${prefix}/include' ; then - if test $prefix != /usr ; then - ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" - fi - else - ACPPFLAGS="$ACPPFLAGS -I\$(includedir)" - fi -fi -AC_SUBST(ACPPFLAGS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 5 updated: 2002/12/01 00:12:15 -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) #(vi - ;; - *) #(vi - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - 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="$cf_new_cppflags $CPPFLAGS" -fi - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 -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_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" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -do - CF_ADD_CFLAGS($cf_arg) - AC_TRY_COMPILE( -[ -#ifndef CC_HAS_PROTOS -#if !defined(__STDC__) || (__STDC__ != 1) -choke me -#endif -#endif -],[ - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);};], - [cf_cv_ansi_cc="$cf_arg"; break]) -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" -]) - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CF_ADD_CFLAGS($cf_cv_ansi_cc) -else - AC_DEFINE(CC_HAS_PROTOS) -fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44 -dnl --------------- -dnl For programs that must use an ANSI compiler, obtain compiler options that -dnl will make it recognize prototypes. We'll do preprocessor checks in other -dnl macros, since tools such as unproto can fake prototypes, but only part of -dnl the preprocessor. -AC_DEFUN([CF_ANSI_CC_REQD], -[AC_REQUIRE([CF_ANSI_CC_CHECK]) -if test "$cf_cv_ansi_cc" = "no"; then - AC_ERROR( -[Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto]) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18 -dnl ------------ -dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some -dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc -dnl 2.6.3 does, in anticipation of the ANSI C++ standard. -dnl -dnl Treat the configuration-variable specially here, since we're directly -dnl substituting its value (i.e., 1/0). -dnl -dnl $1 is the shell variable to store the result in, if not $cv_cv_builtin_bool -AC_DEFUN([CF_BOOL_DECL], -[ -AC_MSG_CHECKING(if we should include stdbool.h) - -AC_CACHE_VAL(cf_cv_header_stdbool_h,[ - AC_TRY_COMPILE([],[bool foo = false], - [cf_cv_header_stdbool_h=0], - [AC_TRY_COMPILE([ -#ifndef __BEOS__ -#include -#endif -],[bool foo = false], - [cf_cv_header_stdbool_h=1], - [cf_cv_header_stdbool_h=0])])]) - -if test "$cf_cv_header_stdbool_h" = 1 -then AC_MSG_RESULT(yes) -else AC_MSG_RESULT(no) -fi - -AC_MSG_CHECKING([for builtin bool type]) - -AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ - AC_TRY_COMPILE([ -#include -#include -],[bool x = false], - [ifelse($1,,cf_cv_builtin_bool,[$1])=1], - [ifelse($1,,cf_cv_builtin_bool,[$1])=0]) - ]) - -if test "$ifelse($1,,cf_cv_builtin_bool,[$1])" = 1 -then AC_MSG_RESULT(yes) -else AC_MSG_RESULT(no) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_BOOL_SIZE version: 10 updated: 2002/02/23 20:38:31 -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 . -AC_DEFUN([CF_BOOL_SIZE], -[ -AC_MSG_CHECKING([for size of bool]) -AC_CACHE_VAL(cf_cv_type_of_bool,[ - rm -f cf_test.out - AC_TRY_RUN([ -#include -#include - -#if defined(__cplusplus) - -#ifdef HAVE_GXX_BUILTIN_H -#include -#elif HAVE_GPP_BUILTIN_H -#include -#elif HAVE_BUILTIN_H -#include -#endif - -#else - -#if $cf_cv_header_stdbool_h -#include -#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); -} - ], - [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 - 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 --------------------------------------------------------------------------- -dnl CF_CFG_DEFAULTS version: 6 updated: 2003/07/12 15:15:19 -dnl --------------- -dnl Determine the default configuration into which we'll install ncurses. This -dnl can be overridden by the user's command-line options. There's two items to -dnl look for: -dnl 1. the prefix (e.g., /usr) -dnl 2. the header files (e.g., /usr/include/ncurses) -dnl We'll look for a previous installation of ncurses and use the same defaults. -dnl -dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and -dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's -dnl programs from a vendor's. -AC_DEFUN([CF_CFG_DEFAULTS], -[ -AC_MSG_CHECKING(for prefix) -if test "x$prefix" = "xNONE" ; then - case "$cf_cv_system_name" in - # non-vendor systems don't have a conflict - openbsd*|netbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu) - prefix=/usr - ;; - *) prefix=$ac_default_prefix - ;; - esac -fi -AC_MSG_RESULT($prefix) - -if test "x$prefix" = "xNONE" ; then -AC_MSG_CHECKING(for default include-directory) -test -n "$verbose" && echo 1>&AC_FD_MSG -for cf_symbol in \ - $includedir \ - $includedir/ncurses \ - $prefix/include \ - $prefix/include/ncurses \ - /usr/local/include \ - /usr/local/include/ncurses \ - /usr/include \ - /usr/include/ncurses -do - cf_dir=`eval echo $cf_symbol` - if test -f $cf_dir/curses.h ; then - if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then - includedir="$cf_symbol" - test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG - break - fi - fi - test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG -done -AC_MSG_RESULT($includedir) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CGETENT version: 3 updated: 2000/08/12 23:18:52 -dnl ---------- -dnl Check if the terminal-capability database functions are available. If not, -dnl ncurses has a much-reduced version. -AC_DEFUN([CF_CGETENT],[ -AC_MSG_CHECKING(for terminal-capability database functions) -AC_CACHE_VAL(cf_cv_cgetent,[ -AC_TRY_LINK([ -#include ],[ - char temp[128]; - char *buf = temp; - char *db_array = temp; - cgetent(&buf, /* int *, */ &db_array, "vt100"); - cgetcap(buf, "tc", '='); - cgetmatch(buf, "tc"); - ], - [cf_cv_cgetent=yes], - [cf_cv_cgetent=no]) -]) -AC_MSG_RESULT($cf_cv_cgetent) -test "$cf_cv_cgetent" = yes && AC_DEFINE(HAVE_BSD_CGETENT) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 9 updated: 2004/01/30 15:59:13 -dnl -------------- -dnl Check if we're accidentally using a cache from a different machine. -dnl Derive the system name, as a check for reusing the autoconf cache. -dnl -dnl If we've packaged config.guess and config.sub, run that (since it does a -dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow -dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM -dnl which is useful in cross-compiles. -dnl -dnl Note: we would use $ac_config_sub, but that is one of the places where -dnl autoconf 2.5x broke compatibility with autoconf 2.13 -AC_DEFUN([CF_CHECK_CACHE], -[ -if test -f $srcdir/config.guess ; then - ifelse([$1],,[AC_CANONICAL_HOST],[$1]) - system_name="$host_os" -else - system_name="`(uname -s -r) 2>/dev/null`" - if test -z "$system_name" ; then - system_name="`(hostname) 2>/dev/null`" - fi -fi -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) - -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)) - AC_ERROR("Please remove config.cache and try again.") -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23 -dnl -------------- -dnl Check for data that is usually declared in or , e.g., -dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it -dnl ourselves. -dnl -dnl $1 = the name to check -AC_DEFUN([CF_CHECK_ERRNO], -[ -AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ - AC_TRY_COMPILE([ -#ifdef HAVE_STDLIB_H -#include -#endif -#include -#include -#include ], - [long x = (long) $1], - [cf_cv_dcl_$1=yes], - [cf_cv_dcl_$1=no]) -]) - -if test "$cf_cv_dcl_$1" = no ; then - CF_UPPER(cf_result,decl_$1) - AC_DEFINE_UNQUOTED($cf_result) -fi - -# It's possible (for near-UNIX clones) that the data doesn't exist -CF_CHECK_EXTERN_DATA($1,int) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 -dnl -------------------- -dnl Check for existence of external data in the current set of libraries. If -dnl we can modify it, it's real enough. -dnl $1 = the name to check -dnl $2 = its type -AC_DEFUN([CF_CHECK_EXTERN_DATA], -[ -AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ - AC_TRY_LINK([ -#undef $1 -extern $2 $1; -], - [$1 = 2], - [cf_cv_have_$1=yes], - [cf_cv_have_$1=no]) -]) - -if test "$cf_cv_have_$1" = yes ; then - CF_UPPER(cf_result,have_$1) - AC_DEFINE_UNQUOTED($cf_result) -fi - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CPP_PARAM_INIT version: 4 updated: 2001/04/07 22:31:18 -dnl ----------------- -dnl Check if the C++ compiler accepts duplicate parameter initialization. This -dnl is a late feature for the standard and is not in some recent compilers -dnl (1999/9/11). -AC_DEFUN([CF_CPP_PARAM_INIT], -[ -if test -n "$CXX"; then -AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_RUN([ -class TEST { -private: - int value; -public: - TEST(int x = 1); - ~TEST(); -}; - -TEST::TEST(int x = 1) // some compilers do not like second initializer -{ - value = x; -} -void main() { } -], - [cf_cv_cpp_param_init=yes], - [cf_cv_cpp_param_init=no], - [cf_cv_cpp_param_init=unknown]) - AC_LANG_RESTORE -]) -fi -test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CPP_VSCAN_FUNC version: 5 updated: 2001/12/02 01:39:28 -dnl ----------------- -dnl Check if the g++ compiler supports vscan function (not a standard feature). -AC_DEFUN([CF_CPP_VSCAN_FUNC], -[ -if test -n "$CXX"; then - -AC_LANG_SAVE -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 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 -#include -#define $cf_vscan_defs 1 -#if defined(USE_STDIO_VSCAN) -#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN) -#include -#endif - -int scanw(const char* fmt, ...) -{ - int result = -1; - char buf[BUFSIZ]; - - va_list args; - va_start(args, fmt); -#if defined(USE_STDIO_VSCAN) - 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); - return result; -} -],[int tmp, foo = scanw("%d", &tmp)], - [cf_cv_cpp_vscan_func=$cf_vscan_func; break], - [cf_cv_cpp_vscan_func=no]) - test "$cf_cv_cpp_vscan_func" != no && break - done -]) - -AC_LANG_RESTORE -fi - -case $cf_cv_cpp_vscan_func in #(vi -stdio) #(vi - AC_DEFINE(CPP_HAS_VSCAN_FUNC) - AC_DEFINE(USE_STDIO_VSCAN) - ;; -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 --------------------------------------------------------------------------- -dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 -dnl ---------- -dnl "dirname" is not portable, so we fake it with a shell script. -AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl -dnl --------------------------------------------------------------------------- -dnl CF_DIRS_TO_MAKE version: 3 updated: 2002/02/23 20:38:31 -dnl --------------- -AC_DEFUN([CF_DIRS_TO_MAKE], -[ -DIRS_TO_MAKE="lib" -for cf_item in $cf_list_models -do - CF_OBJ_SUBDIR($cf_item,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 - test ! -d $cf_dir && mkdir $cf_dir -done -AC_SUBST(DIRS_TO_MAKE) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 -dnl -------- -dnl Check if 'errno' is declared in -AC_DEFUN([CF_ERRNO], -[ -CF_CHECK_ERRNO(errno) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ETIP_DEFINES version: 3 updated: 2003/03/22 19:13:43 -dnl --------------- -dnl Test for conflicting definitions of exception in gcc 2.8.0, etc., between -dnl math.h and builtin.h, only for ncurses -AC_DEFUN([CF_ETIP_DEFINES], -[ -AC_MSG_CHECKING(for special defines needed for etip.h) -cf_save_CXXFLAGS="$CXXFLAGS" -cf_result="none" -for cf_math in "" MATH_H -do -for cf_excp in "" MATH_EXCEPTION -do - CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu -I${srcdir}/include" - test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" - test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" -AC_TRY_COMPILE([ -#include -],[],[ - test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math}) - test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp}) - cf_result="$cf_math $cf_excp" - break -],[]) -done -done -AC_MSG_RESULT($cf_result) -CXXFLAGS="$cf_save_CXXFLAGS" -]) -dnl --------------------------------------------------------------------------- -dnl CF_FUNC_MEMMOVE version: 5 updated: 2000/08/12 23:18:52 -dnl --------------- -dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither -dnl is found, add our own version of memmove to the list of objects. -AC_DEFUN([CF_FUNC_MEMMOVE], -[ -AC_CHECK_FUNC(memmove,,[ -AC_CHECK_FUNC(bcopy,[ - AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[ - AC_TRY_RUN([ -int main() { - static char data[] = "abcdefghijklmnopqrstuwwxyz"; - char temp[40]; - bcopy(data, temp, sizeof(data)); - bcopy(temp+10, temp, 15); - bcopy(temp+5, temp+15, 10); - exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); -} - ], - [cf_cv_good_bcopy=yes], - [cf_cv_good_bcopy=no], - [cf_cv_good_bcopy=unknown]) - ]) - ],[cf_cv_good_bcopy=no]) - if test "$cf_cv_good_bcopy" = yes ; then - AC_DEFINE(USE_OK_BCOPY) - else - AC_DEFINE(USE_MY_MEMMOVE) - fi -])])dnl -dnl --------------------------------------------------------------------------- -dnl CF_FUNC_POLL version: 2 updated: 2000/02/06 01:38:04 -dnl ------------ -dnl See if the poll function really works. Some platforms have poll(), but -dnl it does not work for terminals or files. -AC_DEFUN([CF_FUNC_POLL],[ -AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[ -AC_TRY_RUN([ -#include -#ifdef HAVE_POLL_H -#include -#else -#include -#endif -int main() { - struct pollfd myfds; - int ret; - - myfds.fd = 0; - myfds.events = POLLIN; - - ret = poll(&myfds, 1, 100); - exit(ret != 0); -}], - [cf_cv_working_poll=yes], - [cf_cv_working_poll=no], - [cf_cv_working_poll=unknown])]) -test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_FUNC_TERMIOS version: 2 updated: 2000/07/22 23:37:24 -dnl --------------- -dnl Some old/broken variations define tcgetattr() only as a macro in -dnl termio(s).h -AC_DEFUN([CF_FUNC_TERMIOS],[ -AC_REQUIRE([CF_STRUCT_TERMIOS]) -AC_CACHE_CHECK(for tcgetattr, cf_cv_have_tcgetattr,[ -AC_TRY_LINK([ -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_TERMIOS_H -#include -#define TTY struct termios -#else -#ifdef HAVE_TERMIO_H -#include -#define TTY struct termio -#endif -#endif -],[ -TTY foo; -tcgetattr(1, &foo);], -[cf_cv_have_tcgetattr=yes], -[cf_cv_have_tcgetattr=no])]) -test "$cf_cv_have_tcgetattr" = yes && AC_DEFINE(HAVE_TCGETATTR) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_FUNC_VSSCANF version: 3 updated: 2001/12/19 00:50:10 -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 -#include ],[ - va_list ap; - vsscanf("from", "%d", ap)],[cf_cv_func_vsscanf=vsscanf],[ -AC_TRY_LINK([ -#include -#include ],[ - 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 -#include ],[ - 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 CF_GCC_ATTRIBUTES version: 9 updated: 2002/12/21 19:25:52 -dnl ----------------- -dnl Test for availability of useful gcc __attribute__ directives to quiet -dnl compiler warnings. Though useful, not all are supported -- and contrary -dnl to documentation, unrecognized directives cause older compilers to barf. -AC_DEFUN([CF_GCC_ATTRIBUTES], -[ -if test "$GCC" = yes -then -cat > conftest.i < conftest.$ac_ext <&AC_FD_CC - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <>confdefs.h - fi - done -else - fgrep define conftest.i >>confdefs.h -fi -rm -rf conftest* -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GCC_VERSION version: 3 updated: 2003/09/06 19:16:57 -dnl -------------- -dnl Find version of gcc -AC_DEFUN([CF_GCC_VERSION],[ -AC_REQUIRE([AC_PROG_CC]) -GCC_VERSION=none -if test "$GCC" = yes ; then - AC_MSG_CHECKING(version of $CC) - GCC_VERSION="`${CC} --version|sed -e '2,$d' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" - test -z "$GCC_VERSION" && GCC_VERSION=unknown - AC_MSG_RESULT($GCC_VERSION) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 15 updated: 2003/07/05 18:42:30 -dnl --------------- -dnl Check if the compiler supports useful warning options. There's a few that -dnl we don't use, simply because they're too noisy: -dnl -dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) -dnl -Wredundant-decls (system headers make this too noisy) -dnl -Wtraditional (combines too many unrelated messages, only a few useful) -dnl -Wwrite-strings (too noisy, but should review occasionally). This -dnl is enabled for ncurses using "--enable-const". -dnl -pedantic -dnl -AC_DEFUN([CF_GCC_WARNINGS], -[ -AC_REQUIRE([CF_GCC_VERSION]) -if test "$GCC" = yes -then - cat > conftest.$ac_ext <>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then - if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then -ifelse($3,, :,[ $3]) -ifelse($4,,,[ else - $4]) - fi -ifelse($4,,,[else - $4]) -fi -rm -f conftest* -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GNAT_VERSION version: 11 updated: 2003/09/06 19:42:09 -dnl --------------- -dnl Verify version of GNAT. -AC_DEFUN([CF_GNAT_VERSION], -[ -AC_MSG_CHECKING(for gnat version) -cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ - sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` -AC_MSG_RESULT($cf_gnat_version) - -case $cf_gnat_version in - 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; -esac -case $cf_gnat_version in - 3.[[1-9]]*|[[4-9]].*) - cf_compile_generics=generics - cf_generic_objects="\$(GENOBJS)" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; -esac -]) -dnl --------------------------------------------------------------------------- -dnl CF_GNU_SOURCE version: 3 updated: 2000/10/29 23:30:53 -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 ],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - AC_TRY_COMPILE([#include ],[ -#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 CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46 -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. -AC_DEFUN([CF_GPP_LIBRARY], -[ -cf_cxx_library=unknown -case $cf_cv_system_name in #(vi -os2*) #(vi - cf_gpp_libname=gpp - ;; -*) - cf_gpp_libname=g++ - ;; -esac -if test "$GXX" = yes; then - AC_MSG_CHECKING([for lib$cf_gpp_libname]) - cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" - AC_TRY_LINK([ -#include <$cf_gpp_libname/builtin.h> - ], - [two_arg_error_handler_t foo2 = lib_error_handler], - [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" - if test "$cf_gpp_libname" = cpp ; then - AC_DEFINE(HAVE_GPP_BUILTIN_H) - else - AC_DEFINE(HAVE_GXX_BUILTIN_H) - fi], - [AC_TRY_LINK([ -#include - ], - [two_arg_error_handler_t foo2 = lib_error_handler], - [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" - AC_DEFINE(HAVE_BUILTIN_H)], - [cf_cxx_library=no])]) - LIBS="$cf_save" - AC_MSG_RESULT($cf_cxx_library) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GXX_VERSION version: 3 updated: 2003/09/06 19:16:21 -dnl -------------- -dnl Check for version of g++ -AC_DEFUN([CF_GXX_VERSION],[ -AC_REQUIRE([AC_PROG_CPP]) -GXX_VERSION=none -if test "$GXX" = yes; then - AC_MSG_CHECKING(version of g++) - GXX_VERSION="`${CXX-g++} --version|sed -e '2,$d'`" - AC_MSG_RESULT($GXX_VERSION) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 -dnl --------------- -dnl Insert text into the help-message, for readability, from AC_ARG_WITH. -AC_DEFUN([CF_HELP_MESSAGE], -[AC_DIVERT_HELP([$1])dnl -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15 -dnl --------------- -dnl Construct the list of include-options according to whether we're building -dnl in the source directory or using '--srcdir=DIR' option. If we're building -dnl with gcc, don't append the includedir if it happens to be /usr/include, -dnl since that usually breaks gcc's shadow-includes. -AC_DEFUN([CF_INCLUDE_DIRS], -[ -CPPFLAGS="-I. -I../include $CPPFLAGS" -if test "$srcdir" != "."; then - CPPFLAGS="-I\$(srcdir)/../include $CPPFLAGS" -fi -if test "$GCC" != yes; then - CPPFLAGS="$CPPFLAGS -I\$(includedir)" -elif test "$includedir" != "/usr/include"; then - if test "$includedir" = '${prefix}/include' ; then - if test $prefix != /usr ; then - CPPFLAGS="$CPPFLAGS -I\$(includedir)" - fi - else - CPPFLAGS="$CPPFLAGS -I\$(includedir)" - fi -fi -AC_SUBST(CPPFLAGS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ISASCII version: 3 updated: 2000/08/12 23:18:52 -dnl ---------- -dnl Check if we have either a function or macro for 'isascii()'. -AC_DEFUN([CF_ISASCII], -[ -AC_MSG_CHECKING(for isascii) -AC_CACHE_VAL(cf_cv_have_isascii,[ - AC_TRY_LINK([#include ],[int x = isascii(' ')], - [cf_cv_have_isascii=yes], - [cf_cv_have_isascii=no]) -])dnl -AC_MSG_RESULT($cf_cv_have_isascii) -test "$cf_cv_have_isascii" = yes && AC_DEFINE(HAVE_ISASCII) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LIBUTF8 version: 2 updated: 2002/01/19 22:51:32 -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 ],[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 CF_LIB_PREFIX version: 7 updated: 2001/01/12 01:23:48 -dnl ------------- -dnl Compute the library-prefix for the given host system -dnl $1 = variable to set -AC_DEFUN([CF_LIB_PREFIX], -[ - case $cf_cv_system_name in - OS/2*) LIB_PREFIX='' ;; - os2*) LIB_PREFIX='' ;; - *) LIB_PREFIX='lib' ;; - esac -ifelse($1,,,[$1=$LIB_PREFIX]) - AC_SUBST(LIB_PREFIX) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 30 updated: 2004/01/10 15:50:50 -dnl ------------ -dnl Append definitions and rules for the given models to the subdirectory -dnl Makefiles, and the recursion rule for the top-level Makefile. If the -dnl subdirectory is a library-source directory, modify the LIBRARIES list in -dnl the corresponding makefile to list the models that we'll generate. -dnl -dnl For shared libraries, make a list of symbolic links to construct when -dnl generating each library. The convention used for Linux is the simplest -dnl one: -dnl lib.so -> -dnl lib.so. -> -dnl lib.so.. -AC_DEFUN([CF_LIB_RULES], -[ -CF_LIB_PREFIX(cf_prefix) -AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) -for cf_dir in $SRC_SUBDIRS -do - if test -f $srcdir/$cf_dir/modules; then - - 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) #(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 - # use autodetected ${cf_prefix} for import lib and static lib, but - # use 'cyg' prefix for shared lib. - if test $cf_cv_shlib_version = cygdll ; then - SHARED_LIB="../lib/cyg${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 - LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" - done - - if test $cf_dir = ncurses ; then - cf_subsets="$LIB_SUBSETS" - cf_termlib=`echo "$cf_subsets" |sed -e 's/ .*$//'` - if test "$cf_termlib" != "$cf_subsets" ; then - cf_item=`echo $LIBS_TO_MAKE |sed -e s%$LIB_NAME%$TINFO_NAME%g` - LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" - fi - else - cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib.* //'` - fi - - 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 \ - libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ - $srcdir/$cf_dir/modules >>$cf_dir/Makefile - - for cf_subset in $cf_subsets - do - 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) - - # These dependencies really are for development, not - # builds, but they are useful in porting, too. - cf_depend="../include/ncurses_cfg.h" - if test "$srcdir" = "."; then - cf_reldir="." - else - cf_reldir="\$(srcdir)" - fi - - if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then - cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h" - elif test -f $srcdir/$cf_dir/curses.priv.h; then - cf_depend="$cf_depend $cf_reldir/curses.priv.h" - fi - - $AWK -f $srcdir/mk-1st.awk \ - name=$cf_dir \ - traces=$LIB_TRACING \ - MODEL=$CF_ITEM \ - model=$cf_subdir \ - prefix=$cf_prefix \ - 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" \ - overwrite=$WITH_OVERWRITE \ - depend="$cf_depend" \ - host="$host" \ - $srcdir/$cf_dir/modules >>$cf_dir/Makefile - 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 \ - MODEL=$CF_ITEM \ - model=$cf_subdir \ - subset=$cf_subset \ - srcdir=$srcdir \ - echo=$WITH_ECHO \ - $srcdir/$cf_dir/modules >>$cf_dir/Makefile - cf_subdirs="$cf_subdirs $cf_subdir" - done - done - fi - - echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) [$]@' >>Makefile -done - -for cf_dir in $SRC_SUBDIRS -do - if test -f $cf_dir/Makefile ; then - case "$cf_dir" in - Ada95) #(vi - echo 'libs \' >> Makefile - echo 'install.libs \' >> Makefile - echo 'uninstall.libs ::' >> Makefile - echo ' cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) [$]@' >> Makefile - ;; - esac - fi - - if test -f $srcdir/$cf_dir/modules; then - echo >> Makefile - if test -f $srcdir/$cf_dir/headers; then -cat >> Makefile <> Makefile -fi -cat >> Makefile <> Makefile <> Makefile <> Makefile <headers.sh <>headers.sh </<\$END\/\$NAME>/" >> \$TMPSED - done - ;; -*) - echo "" >> \$TMPSED - ;; -esac -CF_EOF -else - cat >>headers.sh <//" >> \$TMPSED - NAME=ncurses.h - fi - echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED - done - ;; -*) - echo "s///" >> \$TMPSED - ;; -esac -CF_EOF -fi -cat >>headers.sh < \$TMPSRC -NAME=\`basename \$SRC\` -CF_EOF -if test $WITH_CURSES_H != yes; then - cat >>headers.sh <>headers.sh <>$cf_dir/Makefile <>$cf_dir/Makefile - j=$i - done - echo " $j" >>$cf_dir/Makefile - for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"` - do - echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile - test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile - done - - cat >>$cf_dir/Makefile <>$cf_dir/Makefile - test $i = curses.h && echo " -@ (cd \$(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 -dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 13 updated: 2003/11/01 16:09:07 -dnl ------------- -dnl Compute the library file-suffix from the given model name -dnl $1 = model name -dnl $2 = variable to set -dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. -AC_DEFUN([CF_LIB_SUFFIX], -[ - AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - case $1 in - libtool) $2='.la' ;; - normal) $2='.a' ;; - debug) $2='_g.a' ;; - profile) $2='_p.a' ;; - shared) - case $cf_cv_system_name in - cygwin*) $2='.dll' ;; - darwin*) $2='.dylib' ;; - hpux*) - case $target in - ia64*) $2='.so' ;; - *) $2='.sl' ;; - esac - ;; - *) $2='.so' ;; - esac - esac - test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LIB_TYPE version: 4 updated: 2000/10/20 22:57:49 -dnl ----------- -dnl Compute the string to append to -library from the given model name -dnl $1 = model name -dnl $2 = variable to set -dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. -AC_DEFUN([CF_LIB_TYPE], -[ - case $1 in - libtool) $2='' ;; - normal) $2='' ;; - debug) $2='_g' ;; - profile) $2='_p' ;; - shared) $2='' ;; - esac - test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 6 updated: 2003/02/02 01:41:46 -dnl ---------------- -dnl Some systems have a non-ANSI linker that doesn't pull in modules that have -dnl only data (i.e., no functions), for example NeXT. On those systems we'll -dnl have to provide wrappers for global tables to ensure they're linked -dnl properly. -AC_DEFUN([CF_LINK_DATAONLY], -[ -AC_MSG_CHECKING([if data-only library module links]) -AC_CACHE_VAL(cf_cv_link_dataonly,[ - rm -f conftest.a - cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null - fi - rm -f conftest.$ac_ext data.o - cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null - fi - rm -f conftest.$ac_ext func.o - ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null - cf_saveLIBS="$LIBS" - LIBS="conftest.a $LIBS" - AC_TRY_RUN([ - int main() - { - extern int testfunc(); - exit (!testfunc()); - } - ], - [cf_cv_link_dataonly=yes], - [cf_cv_link_dataonly=no], - [cf_cv_link_dataonly=unknown]) - LIBS="$cf_saveLIBS" - ]) -AC_MSG_RESULT($cf_cv_link_dataonly) - -if test "$cf_cv_link_dataonly" = no ; then - AC_DEFINE(BROKEN_LINKER) - BROKEN_LINKER=1 -fi - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LINK_FUNCS version: 5 updated: 2003/02/02 01:41:46 -dnl ------------- -dnl Most Unix systems have both link and symlink, a few don't have symlink. -dnl A few non-Unix systems implement symlink, but not link. -dnl A few non-systems implement neither (or have nonfunctional versions). -AC_DEFUN([CF_LINK_FUNCS], -[ -AC_CHECK_FUNCS( \ - remove \ - unlink ) - -if test "$cross_compiling" = yes ; then - AC_CHECK_FUNCS( \ - link \ - symlink ) -else - AC_CACHE_CHECK(if link/symlink functions work,cf_cv_link_funcs,[ - cf_cv_link_funcs= - for cf_func in link symlink ; do - AC_TRY_RUN([ -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -int main() -{ - int fail = 0; - char *src = "config.log"; - char *dst = "conftest.chk"; - struct stat src_sb; - struct stat dst_sb; - - stat(src, &src_sb); - fail = ($cf_func("config.log", "conftest.chk") < 0) - || (stat(dst, &dst_sb) < 0) - || (dst_sb.st_mtime != src_sb.st_mtime); -#ifdef HAVE_UNLINK - unlink(dst); -#else - remove(dst); -#endif - exit (fail); -} - ],[ - cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" - eval 'ac_cv_func_'$cf_func'=yes'],[ - eval 'ac_cv_func_'$cf_func'=no'],[ - eval 'ac_cv_func_'$cf_func'=error']) - done - test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no - ]) - test "$ac_cv_func_link" = yes && AC_DEFINE(HAVE_LINK) - test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 9 updated: 2001/12/30 18:17:27 -dnl ------------ -dnl Some 'make' programs support $(MAKEFLAGS), some $(MFLAGS), to pass 'make' -dnl options to lower-levels. It's very useful for "make -n" -- if we have it. -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_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ - cf_cv_makeflags='' - for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)' - do - cat >cf_makeflags.tmp </dev/null` - case "$cf_result" in - .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` - case "$cf_result" in - .*CC=*) cf_cv_makeflags= - ;; - *) cf_cv_makeflags=$cf_option - ;; - esac - break - ;; - *) echo no match "$cf_result" - ;; - esac - done - rm -f cf_makeflags.tmp -]) - -AC_SUBST(cf_cv_makeflags) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40 -dnl ------------ -dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have -dnl a monocase filesystem. -AC_DEFUN([CF_MAKE_TAGS],[ -AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) -AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no) - -if test "$cf_cv_mixedcase" = yes ; then - AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) -else - MAKE_UPPER_TAGS=no -fi - -if test "$MAKE_UPPER_TAGS" = yes ; then - MAKE_UPPER_TAGS= -else - MAKE_UPPER_TAGS="#" -fi -AC_SUBST(MAKE_UPPER_TAGS) - -if test "$MAKE_LOWER_TAGS" = yes ; then - MAKE_LOWER_TAGS= -else - MAKE_LOWER_TAGS="#" -fi -AC_SUBST(MAKE_LOWER_TAGS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34 -dnl ----------------- -dnl Option to allow user to override automatic configuration of manpage format. -dnl There are several special cases: -dnl -dnl gzip - man checks for, can display gzip'd files -dnl compress - man checks for, can display compressed files -dnl BSDI - files in the cat-directories are suffixed ".0" -dnl formatted - installer should format (put files in cat-directory) -dnl catonly - installer should only format, e.g., for a turnkey system. -dnl -dnl There are other configurations which this macro does not test, e.g., HPUX's -dnl compressed manpages (but uncompressed manpages are fine, and HPUX's naming -dnl convention would not match our use). -AC_DEFUN([CF_MANPAGE_FORMAT], -[ -AC_REQUIRE([CF_PATHSEP]) -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/catonly, e.g., gzip,formatted], - [MANPAGE_FORMAT=$withval], - [MANPAGE_FORMAT=unknown]) - -test -z "$MANPAGE_FORMAT" && MANPAGE_FORMAT=unknown -MANPAGE_FORMAT=`echo "$MANPAGE_FORMAT" | sed -e 's/,/ /g'` - -cf_unknown= - -case $MANPAGE_FORMAT in -unknown) - if test -z "$MANPATH" ; then - MANPATH="/usr/man:/usr/share/man" - fi - - # look for the 'date' man-page (it's most likely to be installed!) - MANPAGE_FORMAT= - cf_preform=no - cf_catonly=yes - cf_example=date - - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" - for cf_dir in $MANPATH; do - test -z "$cf_dir" && cf_dir=/usr/man - for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example - do - cf_test=`echo $cf_name | sed -e 's/*//'` - if test "x$cf_test" = "x$cf_name" ; then - - case "$cf_name" in - *.gz) MANPAGE_FORMAT="$MANPAGE_FORMAT gzip";; - *.Z) MANPAGE_FORMAT="$MANPAGE_FORMAT compress";; - *.0) MANPAGE_FORMAT="$MANPAGE_FORMAT BSDI";; - *) MANPAGE_FORMAT="$MANPAGE_FORMAT normal";; - esac - - case "$cf_name" in - $cf_dir/man*) - cf_catonly=no - ;; - $cf_dir/cat*) - cf_preform=yes - ;; - esac - break - fi - - # if we found a match in either man* or cat*, stop looking - if test -n "$MANPAGE_FORMAT" ; then - cf_found=no - test "$cf_preform" = yes && MANPAGE_FORMAT="$MANPAGE_FORMAT formatted" - test "$cf_catonly" = yes && MANPAGE_FORMAT="$MANPAGE_FORMAT catonly" - case "$cf_name" in - $cf_dir/cat*) - cf_found=yes - ;; - esac - test $cf_found=yes && break - fi - done - # only check the first directory in $MANPATH where we find manpages - if test -n "$MANPAGE_FORMAT" ; then - break - fi - done - # if we did not find the example, just assume it is normal - test -z "$MANPAGE_FORMAT" && MANPAGE_FORMAT=normal - IFS="$ac_save_ifs" - ;; -*) - for cf_option in $MANPAGE_FORMAT; do - case $cf_option in #(vi - gzip|compress|BSDI|normal|formatted|catonly) - ;; - *) - cf_unknown="$cf_unknown $cf_option" - ;; - esac - done - ;; -esac - -AC_MSG_RESULT($MANPAGE_FORMAT) -if test -n "$cf_unknown" ; then - AC_MSG_WARN(Unexpected manpage-format $cf_unknown) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_RENAMES version: 6 updated: 2002/01/19 22:51:32 -dnl ------------------ -dnl The Debian people have their own naming convention for manpages. This -dnl option lets us override the name of the file containing renaming, or -dnl disable it altogether. -AC_DEFUN([CF_MANPAGE_RENAMES], -[ -AC_MSG_CHECKING(for manpage renaming) - -AC_ARG_WITH(manpage-renames, - [ --with-manpage-renames specify manpage-renaming], - [MANPAGE_RENAMES=$withval], - [MANPAGE_RENAMES=yes]) - -case ".$MANPAGE_RENAMES" in #(vi -.no) #(vi - ;; -.|.yes) - # Debian 'man' program? - if test -f /etc/debian_version ; then - MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames - else - MANPAGE_RENAMES=no - fi - ;; -esac - -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 "$MANPAGE_RENAMES" ; then - test ! -d man && mkdir man - sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed - fi -fi - -AC_MSG_RESULT($MANPAGE_RENAMES) -AC_SUBST(MANPAGE_RENAMES) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58 -dnl ------------------- -dnl Some people expect each tool to make all aliases for manpages in the -dnl man-directory. This accommodates the older, less-capable implementations -dnl of 'man', and is optional. -AC_DEFUN([CF_MANPAGE_SYMLINKS], -[ -AC_MSG_CHECKING(if manpage aliases will be installed) - -AC_ARG_WITH(manpage-aliases, - [ --with-manpage-aliases specify manpage-aliases using .so], - [MANPAGE_ALIASES=$withval], - [MANPAGE_ALIASES=yes]) - -AC_MSG_RESULT($MANPAGE_ALIASES) - -if test "$LN_S" = "ln -s"; then - cf_use_symlinks=yes -else - cf_use_symlinks=no -fi - -MANPAGE_SYMLINKS=no -if test "$MANPAGE_ALIASES" = yes ; then -AC_MSG_CHECKING(if manpage symlinks should be used) - -AC_ARG_WITH(manpage-symlinks, - [ --with-manpage-symlinks specify manpage-aliases using symlinks], - [MANPAGE_SYMLINKS=$withval], - [MANPAGE_SYMLINKS=$cf_use_symlinks]) - -if test "$$cf_use_symlinks" = no; then -if test "$MANPAGE_SYMLINKS" = yes ; then - AC_MSG_WARN(cannot make symlinks, will use .so files) - MANPAGE_SYMLINKS=no -fi -fi - -AC_MSG_RESULT($MANPAGE_SYMLINKS) -fi - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_TBL version: 3 updated: 2002/01/19 22:51:32 -dnl -------------- -dnl This option causes manpages to be run through tbl(1) to generate tables -dnl correctly. -AC_DEFUN([CF_MANPAGE_TBL], -[ -AC_MSG_CHECKING(for manpage tbl) - -AC_ARG_WITH(manpage-tbl, - [ --with-manpage-tbl specify manpage processing with tbl], - [MANPAGE_TBL=$withval], - [MANPAGE_TBL=no]) - -AC_MSG_RESULT($MANPAGE_TBL) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 27 updated: 2003/12/20 20:39:45 -dnl ------------ -dnl Try to determine if the man-pages on the system are compressed, and if -dnl so, what format is used. Use this information to construct a script that -dnl will install man-pages. -AC_DEFUN([CF_MAN_PAGES], -[ -CF_HELP_MESSAGE(Options to Specify How Manpages are Installed:) -CF_MANPAGE_FORMAT -CF_MANPAGE_RENAMES -CF_MANPAGE_SYMLINKS -CF_MANPAGE_TBL - - if test "$prefix" = "NONE" ; then - cf_prefix="$ac_default_prefix" - else - cf_prefix="$prefix" - fi - - case "$MANPAGE_FORMAT" in # (vi - *catonly*) # (vi - cf_format=yes - cf_inboth=no - ;; - *formatted*) # (vi - cf_format=yes - cf_inboth=yes - ;; - *) - cf_format=no - cf_inboth=no - ;; - esac - -test ! -d man && mkdir man - -cf_so_strip= -cf_compress= -case "$MANPAGE_FORMAT" in #(vi -*compress*) #(vi - cf_so_strip="Z" - cf_compress=compress - ;; -*gzip*) #(vi - cf_so_strip="gz" - cf_compress=gzip - ;; -esac - -cf_edit_man=man/edit_man.sh - -cat >$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP -CF_EOF -else -cat >>$cf_edit_man <\$TMP -CF_EOF -fi - -cat >>$cf_edit_man <\$TMP.out - mv \$TMP.out \$TMP -fi -CF_EOF - -if test $with_curses_h != yes ; then -cat >>$cf_edit_man <\$TMP.out - mv \$TMP.out \$TMP -CF_EOF -fi - -cat >>$cf_edit_man <\$TMP.out - mv \$TMP.out \$TMP - fi -CF_EOF - -if test -n "$cf_compress" ; then -cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP -CF_EOF -if test -n "$cf_compress" ; then -cat >>$cf_edit_man <>$cf_edit_man < - #include - ], - [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)], - [cf_cv_need_libm=no], - [cf_cv_need_libm=yes])]) -if test "$cf_cv_need_libm" = yes -then -ifelse($1,,[ - LIBS="$LIBS -lm" -],[$1=-lm]) -fi -]) -dnl --------------------------------------------------------------------------- -dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55 -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], -[ -AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ -if test "$cross_compiling" = yes ; then - case $target_alias in #(vi - *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi - cf_cv_mixedcase=no - ;; - *) - cf_cv_mixedcase=yes - ;; - esac -else - rm -f conftest CONFTEST - echo test >conftest - if test -f CONFTEST ; then - cf_cv_mixedcase=no - else - cf_cv_mixedcase=yes - fi - rm -f conftest CONFTEST -fi -]) -test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 3 updated: 2001/11/08 20:59:59 -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 -#include -#include -#include -#include -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 CF_NUMBER_SYNTAX version: 1 updated: 2003/09/20 18:12:49 -dnl ---------------- -dnl Check if the given variable is a number. If not, report an error. -dnl $1 is the variable -dnl $2 is the message -AC_DEFUN([CF_NUMBER_SYNTAX],[ -if test -n "$1" ; then - case $1 in #(vi - [[0-9]]*) #(vi - ;; - *) - AC_MSG_ERROR($2 is not a number: $1) - ;; - esac -else - AC_MSG_ERROR($2 value is empty) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_OBJ_SUBDIR version: 4 updated: 2002/02/23 20:38:31 -dnl ------------- -dnl Compute the object-directory name from the given model name -AC_DEFUN([CF_OBJ_SUBDIR], -[ - case $1 in - libtool) $2='obj_lo' ;; - normal) $2='objects' ;; - debug) $2='obj_g' ;; - profile) $2='obj_p' ;; - shared) - case $cf_cv_system_name in #(vi - cygwin) #(vi - $2='objects' ;; - *) - $2='obj_s' ;; - esac - esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53 -dnl ---------- -dnl Provide a value for the $PATH and similar separator -AC_DEFUN([CF_PATHSEP], -[ - case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; - esac -ifelse($1,,,[$1=$PATHSEP]) - AC_SUBST(PATHSEP) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38 -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 work around autoconf's -dnl delayed evaluation of those symbols. -AC_DEFUN([CF_PATH_SYNTAX],[ -case ".[$]$1" in #(vi -.\[$]\(*\)*|.\'*\'*) #(vi - ;; -..|./*|.\\*) #(vi - ;; -.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX - ;; -.\[$]{*prefix}*) #(vi - eval $1="[$]$1" - case ".[$]$1" in #(vi - .NONE/*) - $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` - ;; - esac - ;; #(vi -.NONE/*) - $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` - ;; -*) - ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2) - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56 -dnl ------------ -dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles. -dnl -dnl $1 = symbol to test -dnl $2 = value (if any) to use for a predefinition -AC_DEFUN([CF_PREDEFINE], -[ -AC_MSG_CHECKING(if we must define $1) -AC_TRY_COMPILE([#include -],[ -#ifndef $1 -make an error -#endif],[cf_result=no],[cf_result=yes]) -AC_MSG_RESULT($cf_result) - -if test "$cf_result" = yes ; then - CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])" -elif test "x$2" != "x" ; then - AC_MSG_CHECKING(checking for compatible value versus $2) - AC_TRY_COMPILE([#include -],[ -#if $1-$2 < 0 -make an error -#endif],[cf_result=yes],[cf_result=no]) - AC_MSG_RESULT($cf_result) - if test "$cf_result" = no ; then - # perhaps we can override it - try... - CPPFLAGS="$CPPFLAGS -D$1=$2" - fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 -dnl ----------- -dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. -AC_DEFUN([CF_PROG_EXT], -[ -AC_REQUIRE([CF_CHECK_CACHE]) -case $cf_cv_system_name in -os2*) - CFLAGS="$CFLAGS -Zmt" - CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt" - # autoconf's macro sets -Zexe and suffix both, which conflict:w - LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" - ac_cv_exeext=.exe - ;; -esac - -AC_EXEEXT -AC_OBJEXT - -PROG_EXT="$EXEEXT" -AC_SUBST(PROG_EXT) -test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 -dnl --------------- -dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the -dnl misc/tabset install won't work properly. Usually this happens only when -dnl using the fallback mkinstalldirs script -AC_DEFUN([CF_PROG_INSTALL], -[AC_PROG_INSTALL -case $INSTALL in -/*) - ;; -*) - CF_DIRNAME(cf_dir,$INSTALL) - test -z "$cf_dir" && cf_dir=. - INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'` - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55 -dnl ---------------- -dnl Check for ldconfig, needed to fixup shared libraries that would be built -dnl and then used in the install. -AC_DEFUN([CF_PROG_LDCONFIG],[ -if test "$cross_compiling" = yes ; then - LDCONFIG=: -else -case "$cf_cv_system_name" in #(vi -freebsd*) #(vi - test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" - ;; -*) LDPATH=$PATH:/sbin:/usr/sbin - AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH) - ;; -esac -fi -AC_SUBST(LDCONFIG) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01 -dnl -------- -dnl Attempt to determine if we've got one of the flavors of regular-expression -dnl code that we can support. -AC_DEFUN([CF_REGEX], -[ -AC_MSG_CHECKING([for regular-expression headers]) -AC_CACHE_VAL(cf_cv_regex,[ -AC_TRY_LINK([#include -#include ],[ - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - ],[cf_cv_regex="regex.h"],[ - AC_TRY_LINK([#include ],[ - char *p = compile("", "", "", 0); - int x = step("", ""); - ],[cf_cv_regex="regexp.h"],[ - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" - AC_TRY_LINK([#include ],[ - char *p = compile("", "", ""); - int x = step("", ""); - ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])]) -]) -AC_MSG_RESULT($cf_cv_regex) -case $cf_cv_regex in - regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; - regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; - regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 30 updated: 2003/12/27 20:48:07 -dnl -------------- -dnl Attempt to determine the appropriate CC/LD options for creating a shared -dnl library. -dnl -dnl Note: $(LOCAL_LDFLAGS) is used to link executables that will run within the -dnl build-tree, i.e., by making use of the libraries that are compiled in ../lib -dnl We avoid compiling-in a ../lib path for the shared library since that can -dnl lead to unexpected results at runtime. -dnl $(LOCAL_LDFLAGS2) has the same intention but assumes that the shared libraries -dnl are compiled in ../../lib -dnl -dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure -dnl to install symbolic links to the rel/abi versions of shared libraries. -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..dylib) or postfix -dnl (ex: libncurses.so.). -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= - LD_SHARED_OPTS= - INSTALL_LIB="-m 644" - - cf_cv_do_symlinks=no - - AC_MSG_CHECKING(if release/abi version should be used for shared libs) - AC_ARG_WITH(shlib-version, - [ --with-shlib-version=X Specify rel or abi version for shared libs], - [test -z "$withval" && withval=auto - case $withval in #(vi - yes) #(vi - cf_cv_shlib_version=auto - ;; - rel|abi|auto|no) #(vi - cf_cv_shlib_version=$withval - ;; - *) - AC_ERROR([option value must be one of: rel, abi, auto or no]) - ;; - esac - ],[cf_cv_shlib_version=auto]) - AC_MSG_RESULT($cf_cv_shlib_version) - - cf_cv_rm_so_locs=no - - # Some less-capable ports of gcc support only -fpic - CC_SHARED_OPTS= - if test "$GCC" = yes - then - AC_MSG_CHECKING(which $CC option to use) - cf_save_CFLAGS="$CFLAGS" - for CC_SHARED_OPTS in -fPIC -fpic '' - do - CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" - AC_TRY_COMPILE([#include ],[int x = 1],[break],[]) - done - AC_MSG_RESULT($CC_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 - LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)' - else - CC_SHARED_OPTS='+Z' - LD_SHARED_OPTS='-Wl,+b,$(libdir)' - fi - MK_SHARED_LIB='$(LD) +b $(libdir) -b -o $[@]' - # HP-UX shared libraries must be executable, and should be - # readonly to exploit a quirk in the memory manager. - INSTALL_LIB="-m 555" - ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" - fi - # tested with IRIX 5.2 and 'cc'. - if test "$GCC" != yes; then - CC_SHARED_OPTS='-KPIC' - fi - MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $[@]` -o $[@]' - cf_cv_rm_so_locs=yes - ;; - linux*|gnu*|k*bsd*-gnu) - if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel - MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $[@]' - ;; - openbsd2*) - CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $[@].$(ABI_VERSION)` -o $[@]' - ;; - freebsd[[45]]*) - CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - MK_SHARED_LIB='$(LD) -Bshareable -soname=`basename $[@]` -o $[@]' - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel - -# This doesn't work - I keep getting spurious references to needing -# libncurses.so.5.3 when ldd says it's resolved. LOCAL_LDFLAGS2 seems to be -# no longer used anyway. And the rpath logic isn't relative - so I have to -# add the local and install lib-directories: -# -# if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then -# LOCAL_LDFLAGS="-rpath `pwd`/lib" -# LOCAL_LDFLAGS2="-rpath \$(libdir) $LOCAL_LDFLAGS" -# cf_ld_rpath_opt="-rpath " -# EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" -# fi - ;; - openbsd*|freebsd*) - CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - MK_SHARED_LIB='$(LD) -Bshareable -o $[@]' - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel - ;; - netbsd*) - CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" - MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' - if test "$cf_cv_shlib_version" = auto; then - if test ! -f /usr/libexec/ld.elf_so; then - cf_cv_shlib_version=rel - fi - fi - else - MK_SHARED_LIB='$(LD) -Bshareable -o $[@]' - fi - ;; - osf*|mls+*) - # 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 $[@]`' - case $host_os in - osf4*) - MK_SHARED_LIB="${MK_SHARED_LIB} -msym" - ;; - esac - MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' - if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi - cf_cv_rm_so_locs=yes - ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 - # tested with osr5.0.5 - if test "$GCC" != yes; then - CC_SHARED_OPTS='-belf -KPIC' - fi - MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o [$]@' - if test "$cf_cv_ld_rpath" = yes ; then - # only way is to set LD_RUN_PATH but no switch for it - RUN_PATH=$libdir - fi - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel - LINK_PROGS='LD_RUN_PATH=$(libdir)' - LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' - ;; - sunos4*) - # tested with SunOS 4.1.1 and gcc 2.7.0 - if test "$GCC" != yes; then - CC_SHARED_OPTS='-KPIC' - fi - MK_SHARED_LIB='$(LD) -assert pure-text -o $[@]' - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel - ;; - solaris2*) - # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 - if test "$GCC" != yes; then - CC_SHARED_OPTS='-KPIC' - fi - 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" - fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel - ;; - sysv5uw7*|unix_sv*) - # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) - if test "$GCC" != yes; then - CC_SHARED_OPTS='-KPIC' - fi - MK_SHARED_LIB='$(LD) -d y -G -o [$]@' - ;; - *) - CC_SHARED_OPTS='unknown' - MK_SHARED_LIB='echo unknown' - ;; - esac - - # This works if the last tokens in $MK_SHARED_LIB are the -o target. - case "$cf_cv_shlib_version" in #(vi - rel|abi) - case "$MK_SHARED_LIB" in #(vi - *'-o $[@]') - test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes - ;; - *) - AC_MSG_WARN(ignored --with-shlib-version) - ;; - esac - ;; - esac - - if test -n "$cf_ld_rpath_opt" ; then - AC_MSG_CHECKING(if we need a space after rpath option) - cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" - AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) - LIBS="$cf_save_LIBS" - AC_MSG_RESULT($cf_rpath_space) - test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " - MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)" - fi - - AC_SUBST(CC_SHARED_OPTS) - AC_SUBST(LD_SHARED_OPTS) - AC_SUBST(MK_SHARED_LIB) - AC_SUBST(LINK_PROGS) - AC_SUBST(LINK_TESTS) - AC_SUBST(EXTRA_LDFLAGS) - AC_SUBST(LOCAL_LDFLAGS) - AC_SUBST(LOCAL_LDFLAGS2) - AC_SUBST(INSTALL_LIB) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16 -dnl ------------- -dnl Check for definitions & structures needed for window size-changing -dnl FIXME: check that this works with "snake" (HP-UX 10.x) -AC_DEFUN([CF_SIZECHANGE], -[ -AC_REQUIRE([CF_STRUCT_TERMIOS]) -AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[ - cf_cv_sizechange=unknown - cf_save_CPPFLAGS="$CPPFLAGS" - -for cf_opts in "" "NEED_PTEM_H" -do - - CPPFLAGS="$cf_save_CPPFLAGS" - test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" - AC_TRY_COMPILE([#include -#ifdef HAVE_TERMIOS_H -#include -#else -#ifdef HAVE_TERMIO_H -#include -#endif -#endif -#ifdef NEED_PTEM_H -/* This is a workaround for SCO: they neglected to define struct winsize in - * termios.h -- it's only in termio.h and ptem.h - */ -#include -#include -#endif -#if !defined(sun) || !defined(HAVE_TERMIOS_H) -#include -#endif -],[ -#ifdef TIOCGSIZE - struct ttysize win; /* FIXME: what system is this? */ - int y = win.ts_lines; - int x = win.ts_cols; -#else -#ifdef TIOCGWINSZ - struct winsize win; - int y = win.ws_row; - int x = win.ws_col; -#else - no TIOCGSIZE or TIOCGWINSZ -#endif /* TIOCGWINSZ */ -#endif /* TIOCGSIZE */ - ], - [cf_cv_sizechange=yes], - [cf_cv_sizechange=no]) - - CPPFLAGS="$cf_save_CPPFLAGS" - if test "$cf_cv_sizechange" = yes ; then - echo "size-change succeeded ($cf_opts)" >&AC_FD_CC - test -n "$cf_opts" && cf_cv_sizechange="$cf_opts" - break - fi -done -]) -if test "$cf_cv_sizechange" != no ; then - AC_DEFINE(HAVE_SIZECHANGE) - case $cf_cv_sizechange in #(vi - NEED*) - AC_DEFINE_UNQUOTED($cf_cv_sizechange ) - ;; - esac -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 15 updated: 2004/01/10 16:05:16 -dnl -------------- -dnl For each parameter, test if the source-directory exists, and if it contains -dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll -dnl use in CF_LIB_RULES. -dnl -dnl This uses the configured value to make the lists SRC_SUBDIRS and -dnl SUB_MAKEFILES which are used in the makefile-generation scheme. -AC_DEFUN([CF_SRC_MODULES], -[ -AC_MSG_CHECKING(for src modules) - -# dependencies and linker-arguments for test-programs -TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS" -if test "$DFT_LWR_MODEL" = "libtool"; then - TEST_ARGS="${TEST_DEPS}" -else - TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS" -fi - -# dependencies and linker-arguments for utility-programs -test "$with_termlib" != yes && PROG_ARGS="$TEST_ARGS" - -cf_cv_src_modules= -for cf_dir in $1 -do - if test -f $srcdir/$cf_dir/modules; then - - # We may/may not have tack in the distribution, though the - # makefile is. - if test $cf_dir = tack ; then - if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then - continue - fi - fi - - if test -z "$cf_cv_src_modules"; then - cf_cv_src_modules=$cf_dir - else - cf_cv_src_modules="$cf_cv_src_modules $cf_dir" - fi - - # Make the ncurses_cfg.h file record the library interface files as - # well. These are header files that are the same name as their - # directory. Ncurses is the only library that does not follow - # that pattern. - if test $cf_dir = tack ; then - continue - elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then - CF_UPPER(cf_have_include,$cf_dir) - AC_DEFINE_UNQUOTED(HAVE_${cf_have_include}_H) - AC_DEFINE_UNQUOTED(HAVE_LIB${cf_have_include}) - TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS" - if test "$DFT_LWR_MODEL" = "libtool"; then - TEST_ARGS="${TEST_DEPS}" - else - TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS" - fi - fi - fi -done -AC_MSG_RESULT($cf_cv_src_modules) -TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" -AC_SUBST(TEST_DEPS) -AC_SUBST(TEST_ARGS) - -PROG_ARGS="-L${LIB_DIR} $PROG_ARGS" -AC_SUBST(PROG_ARGS) - -SRC_SUBDIRS="man include" -for cf_dir in $cf_cv_src_modules -do - SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" -done -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= -if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" -fi - -SUB_MAKEFILES= -for cf_dir in $SRC_SUBDIRS -do - SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile" -done - -if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done - AC_SUBST(ADA_SUBDIRS) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52 -dnl ----------------- -dnl Check for -lstdc++, which is GNU's standard C++ library. -AC_DEFUN([CF_STDCPP_LIBRARY], -[ -if test -n "$GXX" ; then -case $cf_cv_system_name in #(vi -os2*) #(vi - cf_stdcpp_libname=stdcpp - ;; -*) - cf_stdcpp_libname=stdc++ - ;; -esac -AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ - cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" -AC_TRY_LINK([ -#include ],[ -char buf[80]; -strstreambuf foo(buf, sizeof(buf)) -], - [cf_cv_libstdcpp=yes], - [cf_cv_libstdcpp=no]) - LIBS="$cf_save" -]) -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52 -dnl -------------- -dnl Remove "-g" option from the compiler options -AC_DEFUN([CF_STRIP_G_OPT], -[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl -dnl --------------------------------------------------------------------------- -dnl CF_STRUCT_SIGACTION version: 3 updated: 2000/08/12 23:18:52 -dnl ------------------- -dnl Check if we need _POSIX_SOURCE defined to use struct sigaction. We'll only -dnl do this if we've found the sigaction function. -dnl -dnl If needed, define SVR4_ACTION. -AC_DEFUN([CF_STRUCT_SIGACTION],[ -if test "$ac_cv_func_sigaction" = yes; then -AC_MSG_CHECKING(whether sigaction needs _POSIX_SOURCE) -AC_TRY_COMPILE([ -#include -#include ], - [struct sigaction act], - [sigact_bad=no], - [ -AC_TRY_COMPILE([ -#define _POSIX_SOURCE -#include -#include ], - [struct sigaction act], - [sigact_bad=yes - AC_DEFINE(SVR4_ACTION)], - [sigact_bad=unknown])]) -AC_MSG_RESULT($sigact_bad) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_STRUCT_TERMIOS version: 5 updated: 2000/11/04 12:22:46 -dnl ----------------- -dnl Some machines require _POSIX_SOURCE to completely define struct termios. -dnl If so, define SVR4_TERMIO -AC_DEFUN([CF_STRUCT_TERMIOS],[ -AC_CHECK_HEADERS( \ -termio.h \ -termios.h \ -unistd.h \ -) -if test "$ISC" = yes ; then - AC_CHECK_HEADERS( sys/termio.h ) -fi -if test "$ac_cv_header_termios_h" = yes ; then - case "$CFLAGS $CPPFLAGS" in - *-D_POSIX_SOURCE*) - termios_bad=dunno ;; - *) termios_bad=maybe ;; - esac - if test "$termios_bad" = maybe ; then - AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE) - AC_TRY_COMPILE([#include ], - [struct termios foo; int x = foo.c_iflag], - termios_bad=no, [ - AC_TRY_COMPILE([ -#define _POSIX_SOURCE -#include ], - [struct termios foo; int x = foo.c_iflag], - termios_bad=unknown, - termios_bad=yes AC_DEFINE(SVR4_TERMIO)) - ]) - AC_MSG_RESULT($termios_bad) - fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SUBST version: 2 updated: 1997/09/06 23:41:28 -dnl -------- -dnl Shorthand macro for substituting things that the user may override -dnl with an environment variable. -dnl -dnl $1 = long/descriptive name -dnl $2 = environment variable -dnl $3 = default value -AC_DEFUN([CF_SUBST], -[AC_CACHE_VAL(cf_cv_subst_$2,[ -AC_MSG_CHECKING(for $1 (symbol $2)) -test -z "[$]$2" && $2=$3 -AC_MSG_RESULT([$]$2) -AC_SUBST($2) -cf_cv_subst_$2=[$]$2]) -$2=${cf_cv_subst_$2} -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SUBST_NCURSES_VERSION version: 7 updated: 2003/06/07 16:22:51 -dnl ------------------------ -dnl Get the version-number for use in shared-library naming, etc. -AC_DEFUN([CF_SUBST_NCURSES_VERSION], -[ -NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[[ ]]*=' $srcdir/dist.mk | sed -e 's/^[[^0-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} -dnl Show the computed version, for logging -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) -AC_SUBST(NCURSES_PATCH) -dnl We need these values in the generated makefiles -AC_SUBST(cf_cv_rel_version) -AC_SUBST(cf_cv_abi_version) -AC_SUBST(cf_cv_builtin_bool) -AC_SUBST(cf_cv_header_stdbool_h) -AC_SUBST(cf_cv_type_of_bool)dnl -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40 -dnl ------------------ -dnl Check if we can include with ; this breaks on -dnl older SCO configurations. -AC_DEFUN([CF_SYS_TIME_SELECT], -[ -AC_MSG_CHECKING(if sys/time.h works with sys/select.h) -AC_CACHE_VAL(cf_cv_sys_time_select,[ -AC_TRY_COMPILE([ -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -],[],[cf_cv_sys_time_select=yes], - [cf_cv_sys_time_select=no]) - ]) -AC_MSG_RESULT($cf_cv_sys_time_select) -test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_TYPEOF_CHTYPE version: 4 updated: 2000/10/04 09:18:40 -dnl ---------------- -dnl Determine the type we should use for chtype (and attr_t, which is treated -dnl as the same thing). We want around 32 bits, so on most machines want a -dnl long, but on newer 64-bit machines, probably want an int. If we're using -dnl wide characters, we have to have a type compatible with that, as well. -AC_DEFUN([CF_TYPEOF_CHTYPE], -[ -AC_REQUIRE([CF_UNSIGNED_LITERALS]) -AC_MSG_CHECKING([for type of chtype]) -AC_CACHE_VAL(cf_cv_typeof_chtype,[ - AC_TRY_RUN([ -#ifdef USE_WIDEC_SUPPORT -#include /* we want wchar_t */ -#define WANT_BITS 39 -#else -#define WANT_BITS 31 -#endif -#include -int main() -{ - FILE *fp = fopen("cf_test.out", "w"); - if (fp != 0) { - char *result = "long"; -#ifdef USE_WIDEC_SUPPORT - /* - * If wchar_t is smaller than a long, it must be an int or a - * short. We prefer not to use a short anyway. - */ - if (sizeof(unsigned long) > sizeof(wchar_t)) - result = "int"; -#endif - if (sizeof(unsigned long) > sizeof(unsigned int)) { - int n; - unsigned int x; - for (n = 0; n < WANT_BITS; n++) { - unsigned int y = (x >> n); - if (y != 1 || x == 0) { - x = 0; - break; - } - } - /* - * If x is nonzero, an int is big enough for the bits - * that we want. - */ - result = (x != 0) ? "int" : "long"; - } - fputs(result, fp); - fclose(fp); - } - exit(0); -} - ], - [cf_cv_typeof_chtype=`cat cf_test.out`], - [cf_cv_typeof_chtype=long], - [cf_cv_typeof_chtype=long]) - rm -f cf_test.out - ]) -AC_MSG_RESULT($cf_cv_typeof_chtype) - -AC_SUBST(cf_cv_typeof_chtype) -AC_DEFINE_UNQUOTED(TYPEOF_CHTYPE,$cf_cv_typeof_chtype) - -cf_cv_1UL="1" -test "$cf_cv_unsigned_literals" = yes && cf_cv_1UL="${cf_cv_1UL}U" -test "$cf_cv_typeof_chtype" = long && cf_cv_1UL="${cf_cv_1UL}L" -AC_SUBST(cf_cv_1UL) - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_TYPE_SIGACTION version: 3 updated: 2000/08/12 23:18:52 -dnl ----------------- -dnl -AC_DEFUN([CF_TYPE_SIGACTION], -[ -AC_MSG_CHECKING([for type sigaction_t]) -AC_CACHE_VAL(cf_cv_type_sigaction,[ - AC_TRY_COMPILE([ -#include ], - [sigaction_t x], - [cf_cv_type_sigaction=yes], - [cf_cv_type_sigaction=no])]) -AC_MSG_RESULT($cf_cv_type_sigaction) -test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_UNSIGNED_LITERALS version: 2 updated: 1998/02/07 22:10:16 -dnl -------------------- -dnl Test if the compiler supports 'U' and 'L' suffixes. Only old compilers -dnl won't, but they're still there. -AC_DEFUN([CF_UNSIGNED_LITERALS], -[ -AC_MSG_CHECKING([if unsigned literals are legal]) -AC_CACHE_VAL(cf_cv_unsigned_literals,[ - AC_TRY_COMPILE([],[long x = 1L + 1UL + 1U + 1], - [cf_cv_unsigned_literals=yes], - [cf_cv_unsigned_literals=no]) - ]) -AC_MSG_RESULT($cf_cv_unsigned_literals) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 -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 CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14 -dnl ---------- -dnl Use AC_VERBOSE w/o the warnings -AC_DEFUN([CF_VERBOSE], -[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20 -dnl ------------- -dnl Check if type wide-character type $1 is declared, and if so, which header -dnl file is needed. The second parameter is used to set a shell variable when -dnl the type is not found. The first parameter sets a shell variable for the -dnl opposite sense. -AC_DEFUN([CF_WCHAR_TYPE], -[ -# This is needed on Tru64 5.0 to declare $1 -AC_CACHE_CHECK(if we must include wchar.h to declare $1,cf_cv_$1,[ -AC_TRY_COMPILE([ -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif], - [$1 state], - [cf_cv_$1=no], - [AC_TRY_COMPILE([ -#include -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif], - [$1 value], - [cf_cv_$1=yes], - [cf_cv_$1=unknown])])]) - -if test "$cf_cv_$1" = yes ; then - AC_DEFINE(NEED_WCHAR_H) - NEED_WCHAR_H=1 -fi - -ifelse($2,,,[ -# if we do not find $1 in either place, use substitution to provide a fallback. -if test "$cf_cv_$1" = unknown ; then - $2=1 -fi -]) -ifelse($3,,,[ -# if we find $1 in either place, use substitution to provide a fallback. -if test "$cf_cv_$1" != unknown ; then - $3=1 -fi -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_ABI_VERSION version: 1 updated: 2003/09/20 18:12:49 -dnl ------------------- -dnl Allow library's ABI to be overridden. Generally this happens when a -dnl packager has incremented the ABI past that used in the original package, -dnl and wishes to keep doing this. -dnl -dnl $1 is the package name, if any, to derive a corresponding {package}_ABI -dnl symbol. -AC_DEFUN([CF_WITH_ABI_VERSION],[ -test -z "$cf_cv_abi_version" && cf_cv_abi_version=0 -AC_ARG_WITH(abi-version, -[ --with-abi-version=XXX override derived ABI version], -[AC_MSG_WARN(overriding ABI version $cf_cv_abi_version to $withval) - cf_cv_abi_version=$withval]) - CF_NUMBER_SYNTAX($cf_cv_abi_version,ABI version) -ifelse($1,,,[ -$1_ABI=$cf_cv_abi_version -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_DBMALLOC version: 2 updated: 2002/12/29 21:11:45 -dnl ---------------- -dnl Configure-option for dbmalloc -AC_DEFUN([CF_WITH_DBMALLOC],[ -AC_MSG_CHECKING(if you want to link with dbmalloc for testing) -AC_ARG_WITH(dbmalloc, - [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], - [with_dbmalloc=$withval], - [with_dbmalloc=no]) -AC_MSG_RESULT($with_dbmalloc) -if test $with_dbmalloc = yes ; then - AC_CHECK_LIB(dbmalloc,debug_malloc) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_DMALLOC version: 2 updated: 2002/12/29 21:11:45 -dnl --------------- -dnl Configure-option for dmalloc -AC_DEFUN([CF_WITH_DMALLOC],[ -AC_MSG_CHECKING(if you want to link with dmalloc for testing) -AC_ARG_WITH(dmalloc, - [ --with-dmalloc test: use Gray Watson's dmalloc library], - [with_dmalloc=$withval], - [with_dmalloc=no]) -AC_MSG_RESULT($with_dmalloc) -if test $with_dmalloc = yes ; then - AC_CHECK_LIB(dmalloc,dmalloc_debug) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_LIBTOOL version: 9 updated: 2004/01/16 14:55:37 -dnl --------------- -dnl Provide a configure option to incorporate libtool. Define several useful -dnl symbols for the makefile rules. -dnl -dnl The reference to AC_PROG_LIBTOOL does not normally work, since it uses -dnl macros from libtool.m4 which is in the aclocal directory of automake. -dnl Following is a simple script which turns on the AC_PROG_LIBTOOL macro. -dnl But that still does not work properly since the macro is expanded outside -dnl the CF_WITH_LIBTOOL macro: -dnl -dnl #!/bin/sh -dnl ACLOCAL=`aclocal --print-ac-dir` -dnl if test -z "$ACLOCAL" ; then -dnl echo cannot find aclocal directory -dnl exit 1 -dnl elif test ! -f $ACLOCAL/libtool.m4 ; then -dnl echo cannot find libtool.m4 file -dnl exit 1 -dnl fi -dnl -dnl LOCAL=aclocal.m4 -dnl ORIG=aclocal.m4.orig -dnl -dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15 -dnl rm -f $ORIG -dnl mv $LOCAL $ORIG -dnl -dnl # sed the LIBTOOL= assignment to omit the current directory? -dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL -dnl cat $ORIG >>$LOCAL -dnl -dnl autoconf-257 $* -dnl -AC_DEFUN([CF_WITH_LIBTOOL], -[ -ifdef([AC_PROG_LIBTOOL],,[ -LIBTOOL= -]) -# common library maintenance symbols that are convenient for libtool scripts: -LIB_CREATE='$(AR) -cr' -LIB_OBJECT='$(OBJECTS)' -LIB_SUFFIX=.a -LIB_PREP="$RANLIB" - -# symbols used to prop libtool up to enable it to determine what it should be -# doing: -LIB_CLEAN= -LIB_COMPILE= -LIB_LINK= -LIB_INSTALL= -LIB_UNINSTALL= - -AC_MSG_CHECKING(if you want to build libraries with libtool) -AC_ARG_WITH(libtool, - [ --with-libtool generate libraries with libtool], - [with_libtool=$withval], - [with_libtool=no]) -AC_MSG_RESULT($with_libtool) -if test "$with_libtool" != "no"; then -ifdef([AC_PROG_LIBTOOL],[ - # missing_content_AC_PROG_LIBTOOL{{ - AC_PROG_LIBTOOL - # missing_content_AC_PROG_LIBTOOL}} -],[ - if test "$with_libtool" != "yes" ; then - CF_PATH_SYNTAX(with_libtool) - LIBTOOL=$with_libtool - else - AC_PATH_PROG(LIBTOOL,libtool) - fi - if test -z "$LIBTOOL" ; then - AC_MSG_ERROR(Cannot find libtool) - fi -])dnl - LIB_CREATE='$(LIBTOOL) --mode=link $(CC) -rpath $(DESTDIR)$(libdir) -version-info `cut -f1 $(srcdir)/VERSION` -o' - LIB_OBJECT='$(OBJECTS:.o=.lo)' - LIB_SUFFIX=.la - LIB_CLEAN='$(LIBTOOL) --mode=clean' - LIB_COMPILE='$(LIBTOOL) --mode=compile' - LIB_LINK='$(LIBTOOL) --mode=link' - LIB_INSTALL='$(LIBTOOL) --mode=install' - LIB_UNINSTALL='$(LIBTOOL) --mode=uninstall' - LIB_PREP=: - - # Show the version of libtool - AC_MSG_CHECKING(version of libtool) - - # Save the version in a cache variable - this is not entirely a good - # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. - cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'` - AC_MSG_RESULT($cf_cv_libtool_version) - if test -z "$cf_cv_libtool_version" ; then - AC_MSG_ERROR(This is not libtool) - fi - - # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[[5-9]]*|[[2-9]]*) - LIBTOOL_CXX="$LIBTOOL --tag=CXX" - ;; - *) - LIBTOOL_CXX="$LIBTOOL" - ;; - esac -else - LIBTOOL="" - LIBTOOL_CXX="" -fi - -test -z "$LIBTOOL" && ECHO_LT= - -AC_SUBST(LIBTOOL) -AC_SUBST(LIBTOOL_CXX) - -AC_SUBST(LIB_CREATE) -AC_SUBST(LIB_OBJECT) -AC_SUBST(LIB_SUFFIX) -AC_SUBST(LIB_PREP) - -AC_SUBST(LIB_CLEAN) -AC_SUBST(LIB_COMPILE) -AC_SUBST(LIB_LINK) -AC_SUBST(LIB_INSTALL) -AC_SUBST(LIB_UNINSTALL) - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 6 updated: 1998/10/11 00:40:17 -dnl ------------ -dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just -dnl defaulting to yes/no. -dnl -dnl $1 = option name -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 -AC_DEFUN([CF_WITH_PATH], -[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl -CF_PATH_SYNTAX(withval) -eval $3="$withval" -AC_SUBST($3)dnl -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30 -dnl ---------------- -dnl Process an option specifying a list of colon-separated paths. -dnl -dnl $1 = option name -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 - -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" -cf_dst_path= -for cf_src_path in $withval -do - CF_PATH_SYNTAX(cf_src_path) - 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" - -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 -dnl --------------------------------------------------------------------------- -dnl CF_WITH_REL_VERSION version: 1 updated: 2003/09/20 18:12:49 -dnl ------------------- -dnl Allow library's release-version to be overridden. Generally this happens when a -dnl packager has incremented the release-version past that used in the original package, -dnl and wishes to keep doing this. -dnl -dnl $1 is the package name, if any, to derive corresponding {package}_MAJOR -dnl and {package}_MINOR symbols -dnl symbol. -AC_DEFUN([CF_WITH_REL_VERSION],[ -test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 -AC_ARG_WITH(rel-version, -[ --with-rel-version=XXX override derived release version], -[AC_MSG_WARN(overriding release version $cf_cv_rel_version to $withval) - cf_cv_rel_version=$withval]) -ifelse($1,,[ - CF_NUMBER_SYNTAX($cf_cv_rel_version,Release version) -],[ - $1_MAJOR=`echo "$cf_cv_rel_version" | sed -e 's/\..*//'` - $1_MINOR=`echo "$cf_cv_rel_version" | sed -e 's/^[[^.]]*//' -e 's/^\.//' -e 's/\..*//'` - CF_NUMBER_SYNTAX([$]$1_MAJOR,Release major-version) - CF_NUMBER_SYNTAX([$]$1_MINOR,Release minor-version) -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_SYSMOUSE version: 2 updated: 2003/03/22 19:13:43 -dnl ---------------- -dnl If we can compile with sysmouse, make it available unless it is not wanted. -AC_DEFUN([CF_WITH_SYSMOUSE],[ -# not everyone has "test -c" -if test -c /dev/sysmouse 2>/dev/null ; then -AC_MSG_CHECKING(if you want to use sysmouse) -AC_ARG_WITH(sysmouse, - [ --with-sysmouse use sysmouse (FreeBSD console)], - [cf_with_sysmouse=$withval], - [cf_with_sysmouse=maybe]) - if test "$cf_with_sysmouse" != no ; then - AC_TRY_COMPILE([ -#include -#if (__FreeBSD_version >= 400017) -#include -#include -#else -#include -#endif -],[ - struct mouse_info the_mouse; - ioctl(0, CONS_MOUSECTL, &the_mouse); -],[cf_with_sysmouse=yes],[cf_with_sysmouse=no]) - fi -AC_MSG_RESULT($cf_with_sysmouse) -test "$cf_with_sysmouse" = yes && AC_DEFINE(USE_SYSMOUSE) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 11 updated: 2004/01/26 20:58:41 -dnl --------------- -dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, -dnl or adapt to the vendor's definitions to get equivalent functionality. -AC_DEFUN([CF_XOPEN_SOURCE],[ -case $host_os in #(vi -freebsd*) #(vi - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" - ;; -hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" - ;; -irix6.*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" - ;; -linux*) #(vi - CF_GNU_SOURCE - ;; -mirbsd*) #(vi - # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks - ;; -netbsd*) #(vi - # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw - ;; -openbsd*) #(vi - # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw - ;; -osf[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" - ;; -sco*) #(vi - # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer - ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" - ;; -*) - AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE([#include ],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" - AC_TRY_COMPILE([#include ],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=yes]) - CPPFLAGS="$cf_save" - ]) -]) -test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" - - # FreeBSD 5.x headers demand this... - AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE([#include ],[ -#ifndef _POSIX_C_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE" - AC_TRY_COMPILE([#include ],[ -#ifdef _POSIX_C_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=yes]) - CPPFLAGS="$cf_save" - ]) -]) -test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE" - ;; -esac -]) diff --git a/contrib/ncurses/announce.html.in b/contrib/ncurses/announce.html.in deleted file mode 100644 index 11fb87c354..0000000000 --- a/contrib/ncurses/announce.html.in +++ /dev/null @@ -1,569 +0,0 @@ - - - - -Announcing ncurses @VERSION@ - - - - - -

Announcing ncurses @VERSION@

- -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

- -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and is encouraging the keepers of -Unix releases such as BSD/OS, freeBSD and netBSD to switch over to -ncurses.

- -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

- -The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

- -The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . - -

Release Notes

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

-Interface changes: -

    -
  • add the remaining functions for X/Open curses wide-character - support. -
      -
    • pecho_wchar() -
    • slk_wset() -
    - These are only available if the library is configured using the - --enable-widec option. - -
  • write getyx() and related 2-return macros in terms of - getcury(), - getcurx(), etc. - -
  • simplify ifdef for bool declaration in curses.h - -
  • modify ifdef's in curses.h that disabled use of - __attribute__() for g++, since recent versions - implement the cases which ncurses uses. - -
  • add key_defined() function, to tell which keycode a - string is bound to. -
-New features and improvements: -
    -
  • library -
      -
    • implement logic in lib_mouse.c to handle position reports which - are generated when XFree86 xterm is initialized with private - modes 1002 or 1003. These are returned to the application as the - REPORT_MOUSE_POSITION mask, which was not implemented. -
    • modify soft-key initialization to use A_REVERSE if A_STANDOUT - would not be shown when colors are used, i.e., if ncv#1 is set in - the terminfo as is done in "screen". -
    • add configure option for FreeBSD sysmouse, --with-sysmouse, and - implement library support for that. -
    - -
  • programs: - -
      -
    • tack: - -
        -
      • allow it to run from fallback terminfo data. -
      • reset colors after each color test, correct a place - where exit_standout_mode was used instead of - exit_attribute_mode. -
      • improve bce test by making it set colors other - than black on white. -
      - -
    • tic: - -
        -
      • handle a case where an entry has no - description, and capabilities begin on the same line as the entry - name. -
      • allow a terminfo entry with a leading 2-character name. -
      • improved warnings when suppressing items to fit in termcap's - 1023-byte limit. -
      • add check for multiple "tc=" clauses in a termcap. -
      • correct logic for resolving "use=" clauses - allow infocmp and tic to show cancelled capabilities. -
      • check for incomplete line-drawing character mapping. -
      • check for missing/empty/illegal terminfo name. -
      - -
    • tput: -
        -
      • modify tput to use the same parameter analysis as tparm() does, - to provide for user-defined strings, e.g., for xterm title, a - corresponding capability might be - title=\E]2;%p1%s^G, -
      - -
    • tset: - -
        -
      • use the system's default values for CKILL and other default - control characters. -
      • correct interchanged defaults for kill and interrupt - characters, which caused it to report unnecessarily. -
      - -
    -
-Major bug fixes: -
    -
  • prevent recursion in wgetch() via wgetnstr() if the connection - cannot be switched between cooked/raw modes because it is not a TTY. - -
  • correct a case in _nc_remove_string(), used by - define_key(), to avoid infinite loop if the given string - happens to be a substring of other strings which are assigned to keys. - -
  • modify logic of acsc to use the original character if no mapping is - defined, rather than a null. - -
  • several improvements for handling multi-cell display of wide - characters. -
      -
    • modify setcchar() to allow converting control characters to complex - characters. -
    • correct handling of multibyte characters in waddch_literal() which - force wrapping because they are started too late on the line. -
    • modify setcchar() to allow for wchar_t input strings that have - more than one spacing character. -
    - -
  • other fixes for wide-character support: -
      -
    • rewrote lib_acs.c to allow PutAttrChar() to decide how to render - alternate-characters, i.e., to work with Linux console and UTF-8 - locale. -
    • implement a workaround so that line-drawing works with screen's - crippled UTF-8 support (tested with 3.9.13). This only works with - the wide-character support (--enable-widec); the normal library - will simply suppress line-drawing when running in a UTF-8 locale in - screen. -
    • corrections to lib_get_wstr.c: -
        -
      • null-terminate buffer passed to setcchar(), which occasionally - failed. -
      • map special characters such as erase- and kill-characters into - key-codes so those will work as expected even if they are not - mentioned in the terminfo. -
      -
    - -
  • modify setupterm() to check if the terminfo and - terminal-modes have already been read. This ensures that it does not - reinvoke def_prog_mode() when an application calls more - than one function, such as tgetent() and - initscr(). - -
  • fix form_driver() cases for REQ_CLR_EOF, REQ_CLR_EOL, REQ_DEL_CHAR, - REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure the cursor was at - the editing position before making modifications. - -
  • correct keybound(), which reported definitions in the - wrong table, i.e., the list of definitions which are disabled by - keyok(). - -
  • fixes related to safe_sprintf.c: -
      -
    • correct an allocation size in safe_sprintf.c for the "*" format - code. -
    • correct safe_sprintf.c to not return a null pointer if the format - happens to be an empty string. -
    • make return value from _nc_printf_string() consistent. Before, - depending on whether --enable-safe-sprintf was used, it might not - be cached for reallocating. -
    - -
  • other low-level improvements to the optimization code include: -
      -
    • if the output is a socket or other non-tty device, use 1 - millisecond - for the cost in mvcur; previously it was 9 milliseconds because the - baudrate was not known. -
    • modify lib_getch.c to avoid recursion via wgetnstr() when the - input - is not a tty and consequently mode-changes do not work. -
    • fix several places in tack/pad.c which tested and used the - parameter- and parameterless strings inconsistently. -
    • change several tputs() calls in scrolling code to use putp(), to - enable padding which may be needed for some terminals. -
    • improve mvcur() by checking if it is safe to move when video - attributes are set (msgr), and if not, reset/restore attributes - within that function rather than doing it separately in the GoTo() - function in tty_update.c. -
    • use tputs() rather than putp() in a few cases in tty_update.c - since the corresponding delays are proportional to the number of - lines affected: repeat_char, clr_eos, change_scroll_region. -
    - -
  • correct line/column reference in adjust_window(), needed to make - special windows such as curscr track properly when resizing. - -
  • fix a potential recursion between napms() and _nc_timed_wait() - -
  • rewrote lib_insch.c, combining it with lib_insstr.c so both handle - tab and other control characters consistently. - -
  • do not try to open gpm mouse driver if standard output is not a - tty; the gpm library does not make this check. -
- -Portability: -
    -
  • configure script: -
      -
    • new options: -
      -
      --with-abi-version option. -
      addresses platforms where packagers have diverged from - ncurses ABI numbering. -
      --with-manpage-format=catonly -
      addresses - behavior of BSDI, allow install of man+cat files on NetBSD, - whose behavior has diverged by requiring both to be present. -
      --with-manpage-aliases -
      extends - "--with-manpage-aliases" to provide the option of generating - ".so" files rather than symbolic links for manpage aliases. -
      --with-rel-version -
      workaround to force - libtool on Darwin generate the "same" library names as with - the "--with-shared" option. The Darwin ld program does not - work well with a zero as the minor-version value. -
      --with-trace -
      simplifies defining TRACE to incorporate trace() in libraries. -
      - -
    • fixes/improvements for cross-compiling: - -
        -
      • allow BUILD_CC and related configure script variables to be - overridden from the environment. -
      • use AC_CHECK_TOOL to get proper values for AR and LD for cross - compiling. -
      • use $cross_compiling variable in configure script - rather than comparing $host_alias and - $target alias, since "host" is traditionally misused - in autoconf to refer to the target platform. -
      • modify run_tic.in to avoid using wrong shared libraries when - cross-compiling. -
      - -
    • fixes for Mac OS X: -
        -
      • fix a redefinition of $RANLIB in the configure - script when libtool is used. -
      • modify MKlib_gen.sh to avoid passing "#" tokens through the C - preprocessor. This works around Mac OS X's preprocessor, which - insists on adding a blank on each side of the token. -
      - -
    • workarounds for broken tools: -
        -
      • add configure check for wchar_t and wint_t types, rather than - rely on preprocessor definitions. Also work around for gcc - fixinclude bug which creates a shadow copy of - curses.h if it sees these symbols apparently typedef'd. -
      • modify configure script to omit -Winline for gcc 3.3, since - that feature is broken. -
      • several script fixes to work around the ironically named - POSIXLY_CORRECT feature of GNU sed 4.0. -
      • modify configure script to avoid using "head -1", which does - not work if POSIXLY_CORRECT (sic) is set. -
      • update configure script to reflect fix for - AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac - OS X 10.2.3. -
      • repair check for missing C++ compiler, which is broken in - autoconf 2.5x by hardcoding it to g++. -
      - -
    • corrected ifdef's relating to configure check for wchar_t, etc. -
    • remove configure script check to allow -Wconversion for older - versions of gcc -
    • modify configure script to accommodate libtool 1.5, as well as - add an parameter to the "--with-libtool" option which can specify - the pathname of libtool. -
    • change several sed scripts to avoid using "\+" since it is not a - BRE (basic regular expression). One instance caused terminfo.5 to - be misformatted on FreeBSD. -
    • use '%' as sed substitute delimiter in run_tic script to avoid - problems with pathname delimiters such as ':' and '@'. -
    • add -D_XOPEN_SOURCE=500 if needed when configuring with - "--enable-widec", to get mbstate_t declaration on HPUX - 11.11. -
    - -
  • library: -
      -
    • adjust include-options in CF_ETIP_DEFINES to avoid missing - ncurses_dll.h, fixing special definitions that may be needed for - etip.h. -
    • modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use a - ".so" suffix. -
    • improve ifdef's to guard against redefinition of wchar_t and wint_t - in curses.h. -
    • remove an #undef for KEY_EVENT from curses.tail used in the - experimental NCURSES_WGETCH_EVENTS feature. The #undef confuses - Debian dpkg's build script. -
    -
- -

Features of Ncurses

- -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
- -The ncurses package also has many useful extensions over SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -but not all EXTENDED features). Most EXTENDED-level features not directly -concerned with wide-character support are implemented, including many -function calls not supported under SVr4 curses (but portability of all -calls is documented so you can use the SVr4 subset only). -
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
  • Ada95 and C++ bindings. -
  • Support for mouse event reporting with X Window xterm and OS/2 console windows. -
  • Extended mouse support via Alessandro Rubini's gpm package. -
  • The function wresize() allows you to resize windows, preserving -their data. -
  • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
  • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
  • Support for 16-color terminals, such as aixterm and XFree86 xterm. -
  • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
  • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
  • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
  • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
  • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
  • A BSD-like tset(1) utility is provided. -
  • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
  • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
  • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
  • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
  • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
  • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
  • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
  • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
- -

State of the Package

- -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

- -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -

-
cdk -
Curses Development Kit -
-http://invisible-island.net/cdk/ -
-http://www.vexus.ca/products/CDK/ -
ded -
directory-editor -
-http://invisible-island.net/ded/ -
dialog -
the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
-http://invisible-island.net/dialog/ -
lynx -
the character-screen WWW browser -
-http://lynx.isc.org/release/ -
Midnight Commander -
file manager -
-http://www.ibiblio.org/mc/ -
mutt -
mail utility -
-http://www.mutt.org/ -
ncftp -
file-transfer utility -
-http://www.ncftp.com/ -
nvi -
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
-http://www.bostic.com/vi/ -
-
pinfo -
Lynx-like info browser. -http://dione.ids.pl/~pborys/software/pinfo/ -
tin -
newsreader, supporting color, MIME -http://www.tin.org/ -
vh-1.6 -
Volks-Hypertext browser for the Jargon File -
-http://www.debian.org/Packages/unstable/text/vh.html -
-as well as some that use ncurses for the terminfo support alone: -
-
minicom -
terminal emulator -
-http://www.netsonic.fi/~walker/minicom.html -
vile -
vi-like-emacs -
-http://invisible-island.net/vile/ -
-

- -The ncurses distribution includes a selection of test programs (including -a few games). - -

Who's Who and What's What

- -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

- -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -

-             subscribe <name>@<host.domain>
-
- -This list is open to anyone interested in helping with the development and -testing of this package.

- -Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . - -

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. - -

Other Related Resources

- -The distribution provides a newer version of the terminfo-format -terminal description file maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file.

- -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - diff --git a/contrib/ncurses/c++/Makefile.in b/contrib/ncurses/c++/Makefile.in deleted file mode 100644 index c389449464..0000000000 --- a/contrib/ncurses/c++/Makefile.in +++ /dev/null @@ -1,230 +0,0 @@ -# $Id: Makefile.in,v 1.72 2004/01/16 22:44:56 tom Exp $ -############################################################################## -# Copyright (c) 1998-2002,2003 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 -# -# Simple makefile for c++ window class demo - -# turn off _all_ suffix rules; we'll generate our own -.SUFFIXES: - -SHELL = /bin/sh - -CF_MFLAGS = @cf_cv_makeflags@ -@SET_MAKE@ -x = @EXEEXT@ -o = .@OBJEXT@ - -MODEL = ../@DFT_OBJ_SUBDIR@ -DESTDIR = @DESTDIR@ -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -libdir = @libdir@ -includedir = @includedir@ - -LIBTOOL = @LIBTOOL_CXX@ -LIBTOOL_CLEAN = @LIB_CLEAN@ -LIBTOOL_COMPILE = @LIB_COMPILE@ -LIBTOOL_LINK = @LIB_LINK@ -LIBTOOL_INSTALL = @LIB_INSTALL@ -LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ - -AR = @AR@ -AR_OPTS = @AR_OPTS@ - -CXX_AR = @CXX_AR@ -CXX_AR_OPTS = @CXX_AR_OPTS@ -RANLIB = @LIB_PREP@ - -CXX = @CXX@ -CPP = @CPP@ -CXXFLAGS = @CXXFLAGS@ -CXXLIBS = @CXXLIBS@ - -INCDIR = ../include -CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ - -CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) - -CFLAGS_LIBTOOL = $(CCFLAGS) -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ - -CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) - -NCURSES_MAJOR = @NCURSES_MAJOR@ -NCURSES_MINOR = @NCURSES_MINOR@ -REL_VERSION = @cf_cv_rel_version@ -ABI_VERSION = @cf_cv_abi_version@ - -LINK = @LINK_PROGS@ $(LIBTOOL_LINK) $(CXX) @CXXLDFLAGS@ -SHLIB_DIRS = -L../lib -SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ - -LIBROOT = ncurses++ - -LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la -LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a -LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ - -LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ - -LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib ../lib/$(LIBNAME) -LINK_NORMAL = $(LINK_FLAGS) -LINK_DEBUG = $(LINK_FLAGS) -LINK_PROFILE = $(LINK_FLAGS) -LINK_SHARED = $(LINK_FLAGS) - -LDFLAGS = @TEST_ARGS@ @LDFLAGS@ \ - @LD_MODEL@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS) - -LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL) -LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL) -LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG) -LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) -LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@ - -LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@) - -AUTO_SRC = \ - etip.h - -all \ -libs :: $(AUTO_SRC) ../lib/$(LIBNAME) - -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. -LIB_OBJS = \ - $(MODEL)/cursesf$o \ - $(MODEL)/cursesm$o \ - $(MODEL)/cursesw$o \ - $(MODEL)/cursespad$o \ - $(MODEL)/cursesp$o \ - $(MODEL)/cursslk$o \ - $(MODEL)/cursesapp$o \ - $(MODEL)/cursesmain$o - -../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) - $(CXX_AR) $(CXX_AR_OPTS) $@ $? - $(RANLIB) $@ - -../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) - cd ../lib && $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) \ - -o $(LIBNAME) $(LIB_OBJS:$o=.lo) \ - -rpath $(INSTALL_PREFIX)$(libdir) \ - -version-info $(NCURSES_MAJOR):$(NCURSES_MINOR) $(SHLIB_LIST) - -OBJS_DEMO = $(MODEL)/demo$o - -$(MODEL)/demo$o : $(srcdir)/demo.cc \ - $(cursesf_h) $(cursesm_h) $(cursesapp_h) - -demo$x: $(OBJS_DEMO) \ - ../lib/$(LIBNAME) \ - @TEST_DEPS@ - @ECHO_LINK@ $(LINK) -o $@ $(OBJS_DEMO) $(LDFLAGS_DEFAULT) - -etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh - cp $(srcdir)/etip.h.in $@ - sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ - -$(DESTDIR)$(libdir) : - sh $(srcdir)/../mkinstalldirs $@ - -install \ -install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir) - $(LIBTOOL_INSTALL) $(INSTALL) ../lib/$(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME) - -uninstall \ -uninstall.libs:: - -$(LIBTOOL_UNINSTALL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) - -mostlyclean :: - -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace - -clean :: mostlyclean - -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi" - -rm -rf $(MODEL)/SunWS_cache - -$(LIBTOOL_CLEAN) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:$o=.lo) $(OBJS_DEMO) - -rm -rf .libs - -distclean :: clean - -rm -f Makefile - -realclean :: distclean - -############################################################################### - -cursesw_h = $(srcdir)/cursesw.h \ - etip.h \ - $(INCDIR)/curses.h - -cursesp_h = $(srcdir)/cursesp.h \ - $(cursesw_h) \ - $(INCDIR)/panel.h - -cursesf_h = $(srcdir)/cursesf.h \ - $(cursesp_h) \ - $(INCDIR)/form.h - -cursesm_h = $(srcdir)/cursesm.h \ - $(cursesp_h) \ - $(INCDIR)/menu.h - -cursslk_h = $(srcdir)/cursslk.h \ - $(cursesw_h) - -cursesapp_h = $(srcdir)/cursesapp.h \ - $(cursslk_h) - -$(INCDIR)/form.h : - cd ../form && $(MAKE) $@ - -$(INCDIR)/menu.h : - cd ../menu && $(MAKE) $@ - -$(INCDIR)/panel.h : - cd ../panel && $(MAKE) $@ - -############################################################################### -# The remainder of this file is automatically generated during configuration -############################################################################### diff --git a/contrib/ncurses/c++/NEWS b/contrib/ncurses/c++/NEWS deleted file mode 100644 index 299292d18a..0000000000 --- a/contrib/ncurses/c++/NEWS +++ /dev/null @@ -1,42 +0,0 @@ -This is a log of changes that the ncurses C++ binding has gone -through starting with the integration of menu and forms integration -into the binding. - -990731 + Improve support for pads. A viewport window may now be added to - a pad. It will then be possible to use a builtin panning mechanism - to view the pad. - -970908 + Improve NCursesWindow class: added additional methods to - cover more ncurses functionality. Make refresh() and - noutrefresh() virtual members to allow different implementation - in the NCursesPanel class. - + CAUTION: changed order of parameters in vline() and hline() of - NCursesWindow class. - + Make refresh() in NCursesPanel non-static, it is now a - reimplementation of refresh() in the base class. Added - noutrefresh() to NCursesPanel. - + Added NCursesForm and related classes to support libform - functionality. - + Moved most of configuration related stuff from cursesw.h to - etip.h - + Added NCursesApplication class to support easy configuration - of menu and forms related attributes as well as ripped of - title lines and Soft-Label-Keys for an application. - + Support of Auto-Cleanup for a menus fieldlist. - + Change of return type for current_item() and operator[] for - menus. - + Enhanced demo. -970502 - + Introduced the THROW and THROWS functions/macros to prepare - a smoother transition to real exception handling. - + Exception classes provided in etip.h - + Added the NCursesMenu class to support libmenu functionality. - + The inheritace relation between NCursesWindow and NCursesColorWindow - was kind of brain damage. Monochrome is a special case of colored, so - the relation should be just the opposite. This would allow all - derived classes like NCursesPanel, NCursesMenu or NCursesForm to - have colors. - To resolve that design flaw I put the color functionality into the - NCursesWindow class and it can be switched on by the static member - useColors(). NCursesColorWindow is still there for compatibility - reasons. diff --git a/contrib/ncurses/c++/PROBLEMS b/contrib/ncurses/c++/PROBLEMS deleted file mode 100644 index 81c1ebaf89..0000000000 --- a/contrib/ncurses/c++/PROBLEMS +++ /dev/null @@ -1,5 +0,0 @@ -This is a list of open problems. This mainly lists known missing pieces -and design flaws. - -1. Testing!!! -2. Better demo program diff --git a/contrib/ncurses/c++/README-first b/contrib/ncurses/c++/README-first deleted file mode 100644 index ff1e5c5d96..0000000000 --- a/contrib/ncurses/c++/README-first +++ /dev/null @@ -1,60 +0,0 @@ --- $Id: README-first,v 1.7 2003/10/25 15:13:23 tom Exp $ -------------------------------------------------------------------------------- - C++ interface to ncurses routines ------------------------------------------------------------------------ - -This directory contains the source code for several C++ classes which -ease the use of writing ncurses-based programs. The code is derived -from the libg++ CursesWindow class but enhanced for ncurses. - -The classes simplify the use of window specific functions by -encapsulating them in the window object. Function overloading is -used in order to narrow the interface. E.g. you don't have the -distinction between `printw' and `mvprintw' anymore. - -A second benefit is the removal of all #defines which are included in -the curses.h file. This is a steady cause of trouble because many -common identifiers are used. Instead now all #defines are inline -functions which also allows strict type checking of arguments. - -The next enhancement is color support. It was originally provided by a -derived class. This caused some trouble if you think about Panels or -Menus and Forms with colors. We decided to put color support into the -base class so that any derived class may use color support also. -The implementation chosen here is directed to unrestricted use -of mixes of color and monochrome windows. The original NCursesColorWindow -class is maintained for compatibility reasons. - -The last point to mention is the support of other packages that are -distributed with the ncurses package: the panels library, the menu library -and the form library. This support is provided by the NCursesPanel class, -which is also derived from the NCursesWindow class and the NCursesMenu -and NCursesForm classes which are derived from NCursesPanel. This allows -building interfaces with windows. - -Please see the example program for a quick introduction. - -Note that at this point, there is no documentation for these classes. -Hopefully some will be written in the not too distant future. For now, -to find out how to use the classes, read the code and the example program. - -Suggestions for enhancements and contributions of code (and docs) are -welcome. Please let us know which functionality you miss. - - ATTENTION LINUX USERS: There is currently some discussion of - replacing the BSD curses in the Linux libc with ncurses. If - this is done we could perhaps include these classes in the Linux - libg++ replacing the original CursesWindow class (and renaming it - to CursesWindow). This could be done because NCursesWindow can - be made easily to a superset of the CursesWindow class. - - -Original author: - Eric Newton for FSF's libg++ - -Authors of first ncurses based release (NCursesWindow, NCursesPanel): - Ulrich Drepper - and Anatoly Ivasyuk - -Author of this release: - Juergen Pfeifer diff --git a/contrib/ncurses/c++/cursesapp.cc b/contrib/ncurses/c++/cursesapp.cc deleted file mode 100644 index 82432c5c8d..0000000000 --- a/contrib/ncurses/c++/cursesapp.cc +++ /dev/null @@ -1,146 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesapp.cc,v 1.10 2003/10/25 15:04:46 tom Exp $") - -void -NCursesApplication::init(bool bColors) { - if (bColors) - NCursesWindow::useColors(); - - if (Root_Window->colors() > 1) { - b_Colors = TRUE; - Root_Window->setcolor(1); - Root_Window->setpalette(COLOR_YELLOW,COLOR_BLUE); - Root_Window->setcolor(2); - Root_Window->setpalette(COLOR_CYAN,COLOR_BLUE); - Root_Window->setcolor(3); - Root_Window->setpalette(COLOR_BLACK,COLOR_BLUE); - Root_Window->setcolor(4); - Root_Window->setpalette(COLOR_BLACK,COLOR_CYAN); - Root_Window->setcolor(5); - Root_Window->setpalette(COLOR_BLUE,COLOR_YELLOW); - Root_Window->setcolor(6); - Root_Window->setpalette(COLOR_BLACK,COLOR_GREEN); - } - else - b_Colors = FALSE; - - Root_Window->bkgd(' '|window_backgrounds()); -} - -NCursesApplication* NCursesApplication::theApp = 0; -NCursesWindow* NCursesApplication::titleWindow = 0; -NCursesApplication::SLK_Link* NCursesApplication::slk_stack = 0; - -NCursesApplication::~NCursesApplication() { - Soft_Label_Key_Set* S; - - delete titleWindow; - while( (S=top()) ) { - pop(); - delete S; - } - delete Root_Window; - ::endwin(); -} - -int NCursesApplication::rinit(NCursesWindow& w) { - titleWindow = &w; - return OK; -} - -void NCursesApplication::push(Soft_Label_Key_Set& S) { - SLK_Link* L = new SLK_Link; - assert(L != 0); - L->prev = slk_stack; - L->SLKs = &S; - slk_stack = L; - if (Root_Window) - S.show(); -} - -bool NCursesApplication::pop() { - if (slk_stack) { - SLK_Link* L = slk_stack; - slk_stack = slk_stack->prev; - delete L; - if (Root_Window && top()) - top()->show(); - } - return (slk_stack ? FALSE : TRUE); -} - -Soft_Label_Key_Set* NCursesApplication::top() const { - if (slk_stack) - return slk_stack->SLKs; - else - return (Soft_Label_Key_Set*)0; -} - -int NCursesApplication::operator()(void) { - bool bColors = b_Colors; - Soft_Label_Key_Set* S; - - int ts = titlesize(); - if (ts>0) - NCursesWindow::ripoffline(ts,rinit); - Soft_Label_Key_Set::Label_Layout fmt = useSLKs(); - if (fmt!=Soft_Label_Key_Set::None) { - S = new Soft_Label_Key_Set(fmt); - assert(S != 0); - init_labels(*S); - } - - Root_Window = new NCursesWindow(::stdscr); - init(bColors); - - if (ts>0) - title(); - if (fmt!=Soft_Label_Key_Set::None) { - push(*S); - } - - return run(); -} - -NCursesApplication::NCursesApplication(bool bColors) { - b_Colors = bColors; - if (theApp) - THROW(new NCursesException("Application object already created.")); - else - theApp = this; -} diff --git a/contrib/ncurses/c++/cursesapp.h b/contrib/ncurses/c++/cursesapp.h deleted file mode 100644 index 4a7a21f1f7..0000000000 --- a/contrib/ncurses/c++/cursesapp.h +++ /dev/null @@ -1,163 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesapp.h,v 1.9 2003/10/25 15:04:46 tom Exp $ - -#ifndef NCURSES_CURSESAPP_H_incl -#define NCURSES_CURSESAPP_H_incl - -#include - -class NCURSES_IMPEXP NCursesApplication { -public: - typedef struct _slk_link { // This structure is used to maintain - struct _slk_link* prev; // a stack of SLKs - Soft_Label_Key_Set* SLKs; - } SLK_Link; -private: - static int rinit(NCursesWindow& w); // Internal Init function for title - static NCursesApplication* theApp; // Global ref. to the application - - static SLK_Link* slk_stack; - -protected: - static NCursesWindow* titleWindow; // The Title Window (if any) - - bool b_Colors; // Is this a color application? - NCursesWindow* Root_Window; // This is the stdscr equiv. - - // Initialization of attributes; - // Rewrite this in your derived class if you prefer other settings - virtual void init(bool bColors); - - // The number of lines for the title window. Default is no title window - // You may rewrite this in your derived class - virtual int titlesize() const { - return 0; - } - - // This method is called to put something into the title window initially - // You may rewrite this in your derived class - virtual void title() { - } - - // The layout used for the Soft Label Keys. Default is to have no SLKs. - // You may rewrite this in your derived class - virtual Soft_Label_Key_Set::Label_Layout useSLKs() const { - return Soft_Label_Key_Set::None; - } - - // This method is called to initialize the SLKs. Default is nothing. - // You may rewrite this in your derived class - virtual void init_labels(Soft_Label_Key_Set& S) const { - } - - // Your derived class must implement this method. The return value must - // be the exit value of your application. - virtual int run() = 0; - - - // The constructor is protected, so you may use it in your derived - // class constructor. The argument tells whether or not you want colors. - NCursesApplication(bool wantColors = FALSE); - -public: - virtual ~NCursesApplication(); - - // Get a pointer to the current application object - static NCursesApplication* getApplication() { - return theApp; - } - - // This method runs the application and returns its exit value - int operator()(void); - - // Process the commandline arguments. The default implementation simply - // ignores them. Your derived class may rewrite this. - virtual void handleArgs(int argc, char* argv[]) { - } - - // Does this application use colors? - inline bool useColors() const { - return b_Colors; - } - - // Push the Key Set S onto the SLK Stack. S then becomes the current set - // of Soft Labelled Keys. - void push(Soft_Label_Key_Set& S); - - // Throw away the current set of SLKs and make the previous one the - // new current set. - bool pop(); - - // Retrieve the current set of Soft Labelled Keys. - Soft_Label_Key_Set* top() const; - - // Attributes to use for menu and forms foregrounds - virtual chtype foregrounds() const { - return b_Colors ? COLOR_PAIR(1) : A_BOLD; - } - - // Attributes to use for menu and forms backgrounds - virtual chtype backgrounds() const { - return b_Colors ? COLOR_PAIR(2) : A_NORMAL; - } - - // Attributes to use for inactive (menu) elements - virtual chtype inactives() const { - return b_Colors ? (COLOR_PAIR(3)|A_DIM) : A_DIM; - } - - // Attributes to use for (form) labels and SLKs - virtual chtype labels() const { - return b_Colors ? COLOR_PAIR(4) : A_NORMAL; - } - - // Attributes to use for form backgrounds - virtual chtype dialog_backgrounds() const { - return b_Colors ? COLOR_PAIR(4) : A_NORMAL; - } - - // Attributes to use as default for (form) window backgrounds - virtual chtype window_backgrounds() const { - return b_Colors ? COLOR_PAIR(5) : A_NORMAL; - } - - // Attributes to use for the title window - virtual chtype screen_titles() const { - return b_Colors ? COLOR_PAIR(6) : A_BOLD; - } - -}; - -#endif // NCURSES_CURSESAPP_H_incl diff --git a/contrib/ncurses/c++/cursesf.cc b/contrib/ncurses/c++/cursesf.cc deleted file mode 100644 index b6a0a59369..0000000000 --- a/contrib/ncurses/c++/cursesf.cc +++ /dev/null @@ -1,426 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesf.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesf.cc,v 1.16 2003/10/25 15:04:46 tom Exp $") - -NCursesFormField::~NCursesFormField () { - if (field) - OnError(::free_field (field)); -} - -/* Construct a FIELD* array from an array of NCursesFormField - * objects. - */ -FIELD** -NCursesForm::mapFields(NCursesFormField* nfields[]) { - int fieldCount = 0,lcv; - FIELD** old_fields; - - assert(nfields != 0); - - for (lcv=0; nfields[lcv]->field; ++lcv) - ++fieldCount; - - FIELD** fields = new FIELD*[fieldCount + 1]; - - for (lcv=0;nfields[lcv]->field;++lcv) { - fields[lcv] = nfields[lcv]->field; - } - fields[lcv] = NULL; - - my_fields = nfields; - - if (form && (old_fields = ::form_fields(form))) { - ::set_form_fields(form,(FIELD**)0); - delete[] old_fields; - } - return fields; -} - -void NCursesForm::setDefaultAttributes() { - NCursesApplication* S = NCursesApplication::getApplication(); - - int n = count(); - if (n > 0) { - for(int i=0; ioptions() & (O_EDIT|O_ACTIVE))==(O_EDIT|O_ACTIVE)) { - if (S) { - f->set_foreground(S->foregrounds()); - f->set_background(S->backgrounds()); - } - f->set_pad_character('_'); - } - else { - if (S) - f->set_background(S->labels()); - } - } - } - - if (S) { - bkgd(' '|S->dialog_backgrounds()); - if (sub) - sub->bkgd(' '|S->dialog_backgrounds()); - } -} - -void -NCursesForm::InitForm(NCursesFormField* nfields[], - bool with_frame, - bool autoDelete_Fields) { - int mrows, mcols; - - keypad(TRUE); - meta(TRUE); - - b_framed = with_frame; - b_autoDelete = autoDelete_Fields; - - form = (FORM*)0; - form = ::new_form(mapFields(nfields)); - if (!form) - OnError (E_SYSTEM_ERROR); - - UserHook* hook = new UserHook; - hook->m_user = NULL; - hook->m_back = this; - hook->m_owner = form; - ::set_form_userptr(form,(void*)hook); - - ::set_form_init (form, NCursesForm::frm_init); - ::set_form_term (form, NCursesForm::frm_term); - ::set_field_init (form, NCursesForm::fld_init); - ::set_field_term (form, NCursesForm::fld_term); - - scale(mrows, mcols); - ::set_form_win(form, w); - - if (with_frame) { - if ((mrows > height()-2) || (mcols > width()-2)) - OnError(E_NO_ROOM); - sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); - ::set_form_sub(form, sub->w); - b_sub_owner = TRUE; - } - else { - sub = (NCursesWindow*)0; - b_sub_owner = FALSE; - } - options_on(O_NL_OVERLOAD); - setDefaultAttributes(); -} - -NCursesForm::~NCursesForm() { - UserHook* hook = (UserHook*)::form_userptr(form); - delete hook; - if (b_sub_owner) { - delete sub; - ::set_form_sub(form,(WINDOW *)0); - } - if (form) { - FIELD** fields = ::form_fields(form); - int cnt = count(); - - OnError(::set_form_fields(form,(FIELD**)0)); - - if (b_autoDelete) { - if (cnt>0) { - for (int i=0; i <= cnt; i++) - delete my_fields[i]; - } - delete[] my_fields; - } - - ::free_form(form); - // It's essential to do this after free_form() - delete[] fields; - } -} - -void -NCursesForm::setSubWindow(NCursesWindow& nsub) { - if (!isDescendant(nsub)) - OnError(E_SYSTEM_ERROR); - else { - if (b_sub_owner) - delete sub; - sub = ⊄ - ::set_form_sub(form,sub->w); - } -} - -/* Internal hook functions. They will route the hook - * calls to virtual methods of the NCursesForm class, - * so in C++ providing a hook is done simply by - * implementing a virtual method in a derived class - */ -void -NCursesForm::frm_init(FORM *f) { - getHook(f)->On_Form_Init(); -} - -void -NCursesForm::frm_term(FORM *f) { - getHook(f)->On_Form_Termination(); -} - -void -NCursesForm::fld_init(FORM *f) { - NCursesForm* F = getHook(f); - F->On_Field_Init (*(F->current_field ())); -} - -void -NCursesForm::fld_term(FORM *f) { - NCursesForm* F = getHook(f); - F->On_Field_Termination (*(F->current_field ())); -} - -void -NCursesForm::On_Form_Init() { -} - -void -NCursesForm::On_Form_Termination() { -} - -void -NCursesForm::On_Field_Init(NCursesFormField& field) { -} - -void -NCursesForm::On_Field_Termination(NCursesFormField& field) { -} - -// call the form driver and do basic error checking. -int -NCursesForm::driver (int c) { - int res = ::form_driver (form, c); - switch (res) { - case E_OK: - case E_REQUEST_DENIED: - case E_INVALID_FIELD: - case E_UNKNOWN_COMMAND: - break; - default: - OnError (res); - } - return (res); -} - -void NCursesForm::On_Request_Denied(int c) const { - ::beep(); -} - -void NCursesForm::On_Invalid_Field(int c) const { - ::beep(); -} - -void NCursesForm::On_Unknown_Command(int c) const { - ::beep(); -} - -static const int CMD_QUIT = MAX_COMMAND + 1; - -NCursesFormField* -NCursesForm::operator()(void) { - int drvCmnd; - int err; - int c; - - post(); - show(); - refresh(); - - while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { - switch((err=driver(drvCmnd))) { - case E_REQUEST_DENIED: - On_Request_Denied(c); - break; - case E_INVALID_FIELD: - On_Invalid_Field(c); - break; - case E_UNKNOWN_COMMAND: - On_Unknown_Command(c); - break; - case E_OK: - break; - default: - OnError(err); - } - } - - unpost(); - hide(); - refresh(); - return my_fields[::field_index (::current_field (form))]; -} - -// Provide a default key virtualization. Translate the keyboard -// code c into a form request code. -// The default implementation provides a hopefully straightforward -// mapping for the most common keystrokes and form requests. -int -NCursesForm::virtualize(int c) { - switch(c) { - - case KEY_HOME : return(REQ_FIRST_FIELD); - case KEY_END : return(REQ_LAST_FIELD); - - case KEY_DOWN : return(REQ_DOWN_CHAR); - case KEY_UP : return(REQ_UP_CHAR); - case KEY_LEFT : return(REQ_PREV_CHAR); - case KEY_RIGHT : return(REQ_NEXT_CHAR); - - case KEY_NPAGE : return(REQ_NEXT_PAGE); - case KEY_PPAGE : return(REQ_PREV_PAGE); - - case KEY_BACKSPACE : return(REQ_DEL_PREV); - case KEY_ENTER : return(REQ_NEW_LINE); - case KEY_CLEAR : return(REQ_CLR_FIELD); - - case CTRL('X') : return(CMD_QUIT); // eXit - - case CTRL('F') : return(REQ_NEXT_FIELD); // Forward - case CTRL('B') : return(REQ_PREV_FIELD); // Backward - case CTRL('L') : return(REQ_LEFT_FIELD); // Left - case CTRL('R') : return(REQ_RIGHT_FIELD); // Right - case CTRL('U') : return(REQ_UP_FIELD); // Up - case CTRL('D') : return(REQ_DOWN_FIELD); // Down - - case CTRL('W') : return(REQ_NEXT_WORD); - case CTRL('T') : return(REQ_PREV_WORD); - - case CTRL('A') : return(REQ_BEG_FIELD); - case CTRL('E') : return(REQ_END_FIELD); - - case CTRL('I') : return(REQ_INS_CHAR); - case CTRL('M') : - case CTRL('J') : return(REQ_NEW_LINE); - case CTRL('O') : return(REQ_INS_LINE); - case CTRL('V') : return(REQ_DEL_CHAR); - case CTRL('H') : return(REQ_DEL_PREV); - case CTRL('Y') : return(REQ_DEL_LINE); - case CTRL('G') : return(REQ_DEL_WORD); - case CTRL('K') : return(REQ_CLR_EOF); - - case CTRL('N') : return(REQ_NEXT_CHOICE); - case CTRL('P') : return(REQ_PREV_CHOICE); - - default: - return(c); - } -} -// -// ------------------------------------------------------------------------- -// User Defined Fieldtypes -// ------------------------------------------------------------------------- -// -bool UserDefinedFieldType::fcheck(FIELD *f, const void *u) { - NCursesFormField* F = (NCursesFormField*)u; - assert(F != 0); - UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); - assert(udf != 0); - return udf->field_check(*F); -} - -bool UserDefinedFieldType::ccheck(int c, const void *u) { - NCursesFormField* F = (NCursesFormField*)u; - assert(F != 0); - UserDefinedFieldType* udf = - (UserDefinedFieldType*)(F->fieldtype()); - assert(udf != 0); - return udf->char_check(c); -} - -void* UserDefinedFieldType::makearg(va_list* va) { - return va_arg(*va,NCursesFormField*); -} - -FIELDTYPE* UserDefinedFieldType::generic_fieldtype = - ::new_fieldtype(UserDefinedFieldType::fcheck, - UserDefinedFieldType::ccheck); - -FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = - ::new_fieldtype(UserDefinedFieldType::fcheck, - UserDefinedFieldType::ccheck); - -bool UserDefinedFieldType_With_Choice::next_choice(FIELD *f, const void *u) { - NCursesFormField* F = (NCursesFormField*)u; - assert(F != 0); - UserDefinedFieldType_With_Choice* udf = - (UserDefinedFieldType_With_Choice*)(F->fieldtype()); - assert(udf != 0); - return udf->next(*F); -} - -bool UserDefinedFieldType_With_Choice::prev_choice(FIELD *f, const void *u) { - NCursesFormField* F = (NCursesFormField*)u; - assert(F != 0); - UserDefinedFieldType_With_Choice* udf = - (UserDefinedFieldType_With_Choice*)(F->fieldtype()); - assert(udf != 0); - return udf->previous(*F); -} - -class UDF_Init { -private: - int code; - static UDF_Init* I; -public: - UDF_Init() { - code = ::set_fieldtype_arg(UserDefinedFieldType::generic_fieldtype, - UserDefinedFieldType::makearg, - NULL, - NULL); - if (code==E_OK) - code = ::set_fieldtype_arg - (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, - UserDefinedFieldType::makearg, - NULL, - NULL); - if (code==E_OK) - code = ::set_fieldtype_choice - (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, - UserDefinedFieldType_With_Choice::next_choice, - UserDefinedFieldType_With_Choice::prev_choice); - } -}; - -UDF_Init* UDF_Init::I = new UDF_Init(); - diff --git a/contrib/ncurses/c++/cursesf.h b/contrib/ncurses/c++/cursesf.h deleted file mode 100644 index 91b390b238..0000000000 --- a/contrib/ncurses/c++/cursesf.h +++ /dev/null @@ -1,818 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2004 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesf.h,v 1.19 2004/01/15 00:43:46 tom Exp $ - -#ifndef NCURSES_CURSESF_H_incl -#define NCURSES_CURSESF_H_incl 1 - -#include -#include - -extern "C" { -# include -} -// -// ------------------------------------------------------------------------- -// The abstract base class for buitin and user defined Fieldtypes. -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesFormField; // forward declaration - -// Class to represent builtin field types as well as C++ written new -// fieldtypes (see classes UserDefineFieldType... -class NCURSES_IMPEXP NCursesFieldType { - friend class NCursesFormField; - -protected: - FIELDTYPE* fieldtype; - - inline void OnError(int err) const THROWS(NCursesFormException) { - if (err!=E_OK) - THROW(new NCursesFormException (err)); - } - - NCursesFieldType(FIELDTYPE *f) : fieldtype(f) { - } - - virtual ~NCursesFieldType() {} - - // Set the fields f fieldtype to this one. - virtual void set(NCursesFormField& f) = 0; - -public: - NCursesFieldType() : fieldtype((FIELDTYPE*)0) { - } -}; - -// -// ------------------------------------------------------------------------- -// The class representing a forms field, wrapping the lowlevel FIELD struct -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesFormField { - friend class NCursesForm; - -protected: - FIELD *field; // lowlevel structure - NCursesFieldType* ftype; // Associated field type - - // Error handler - inline void OnError (int err) const THROWS(NCursesFormException) { - if (err != E_OK) - THROW(new NCursesFormException (err)); - } - -public: - // Create a 'Null' field. Can be used to delimit a field list - NCursesFormField() - : field((FIELD*)0), ftype((NCursesFieldType*)0) { - } - - // Create a new field - NCursesFormField (int rows, - int cols, - int first_row = 0, - int first_col = 0, - int offscreen_rows = 0, - int additional_buffers = 0) - : ftype((NCursesFieldType*)0) { - field = ::new_field(rows,cols,first_row,first_col, - offscreen_rows, additional_buffers); - if (!field) - OnError(errno); - } - - virtual ~NCursesFormField (); - - // Duplicate the field at a new position - inline NCursesFormField* dup(int first_row, int first_col) { - NCursesFormField* f = new NCursesFormField(); - if (!f) - OnError(E_SYSTEM_ERROR); - else { - f->ftype = ftype; - f->field = ::dup_field(field,first_row,first_col); - if (!f->field) - OnError(errno); - } - return f; - } - - // Link the field to a new location - inline NCursesFormField* link(int first_row, int first_col) { - NCursesFormField* f = new NCursesFormField(); - if (!f) - OnError(E_SYSTEM_ERROR); - else { - f->ftype = ftype; - f->field = ::link_field(field,first_row,first_col); - if (!f->field) - OnError(errno); - } - return f; - } - - // Get the lowlevel field representation - inline FIELD* get_field() const { - return field; - } - - // Retrieve info about the field - inline void info(int& rows, int& cols, - int& first_row, int& first_col, - int& offscreen_rows, int& additional_buffers) const { - OnError(::field_info(field, &rows, &cols, - &first_row, &first_col, - &offscreen_rows, &additional_buffers)); - } - - // Retrieve info about the fields dynamic properties. - inline void dynamic_info(int& dynamic_rows, int& dynamic_cols, - int& max_growth) const { - OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols, - &max_growth)); - } - - // For a dynamic field you may set the maximum growth limit. - // A zero means unlimited growth. - inline void set_maximum_growth(int growth = 0) { - OnError(::set_max_field(field,growth)); - } - - // Move the field to a new position - inline void move(int row, int col) { - OnError(::move_field(field,row,col)); - } - - // Mark the field to start a new page - inline void new_page(bool pageFlag = FALSE) { - OnError(::set_new_page(field,pageFlag)); - } - - // Retrieve whether or not the field starts a new page. - inline bool is_new_page() const { - return ::new_page(field); - } - - // Set the justification for the field - inline void set_justification(int just) { - OnError(::set_field_just(field,just)); - } - - // Retrieve the fields justification - inline int justification() const { - return ::field_just(field); - } - // Set the foreground attribute for the field - inline void set_foreground(chtype fore) { - OnError(::set_field_fore(field,fore)); - } - - // Retrieve the fields foreground attribute - inline chtype fore() const { - return ::field_fore(field); - } - - // Set the background attribute for the field - inline void set_background(chtype back) { - OnError(::set_field_back(field,back)); - } - - // Retrieve the fields background attribute - inline chtype back() const { - return ::field_back(field); - } - - // Set the padding character for the field - inline void set_pad_character(int pad) { - OnError(::set_field_pad(field,pad)); - } - - // Retrieve the fields padding character - inline int pad() const { - return ::field_pad(field); - } - - // Switch on the fields options - inline void options_on (Field_Options options) { - OnError (::field_opts_on (field, options)); - } - - // Switch off the fields options - inline void options_off (Field_Options options) { - OnError (::field_opts_off (field, options)); - } - - // Retrieve the fields options - inline Field_Options options () const { - return ::field_opts (field); - } - - // Set the fields options - inline void set_options (Field_Options options) { - OnError (::set_field_opts (field, options)); - } - - // Mark the field as changed - inline void set_changed(bool changeFlag = TRUE) { - OnError(::set_field_status(field,changeFlag)); - } - - // Test whether or not the field is marked as changed - inline bool changed() const { - return ::field_status(field); - } - - // Return the index of the field in the field array of a form - // or -1 if the field is not associated to a form - inline int (index)() const { - return ::field_index(field); - } - - // Store a value in a fields buffer. The default buffer is nr. 0 - inline void set_value(const char *val, int buffer = 0) { - OnError(::set_field_buffer(field,buffer,val)); - } - - // 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); - } - - // Set the validation type of the field. - inline void set_fieldtype(NCursesFieldType& f) { - ftype = &f; - f.set(*this); // A good friend may do that... - } - - // Retrieve the validation type of the field. - inline NCursesFieldType* fieldtype() const { - return ftype; - } - -}; - -// -// ------------------------------------------------------------------------- -// The class representing a form, wrapping the lowlevel FORM struct -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesForm : public NCursesPanel { -protected: - FORM* form; // the lowlevel structure - -private: - NCursesWindow* sub; // the subwindow object - bool b_sub_owner; // is this our own subwindow? - bool b_framed; // has the form a border? - bool b_autoDelete; // Delete fields when deleting form? - - NCursesFormField** my_fields; // The array of fields for this form - - // This structure is used for the form's user data field to link the - // FORM* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesForm* m_back; // backward pointer to C++ object - const FORM* m_owner; - } UserHook; - - // Get the backward pointer to the C++ object from a FORM - static inline NCursesForm* getHook(const FORM *f) { - UserHook* hook = (UserHook*)::form_userptr(f); - assert(hook != 0 && hook->m_owner==f); - return (NCursesForm*)(hook->m_back); - } - - // This are the built-in hook functions in this C++ binding. In C++ we use - // virtual member functions (see below On_..._Init and On_..._Termination) - // to provide this functionality in an object oriented manner. - static void frm_init(FORM *); - static void frm_term(FORM *); - static void fld_init(FORM *); - static void fld_term(FORM *); - - // Calculate FIELD* array for the menu - FIELD** mapFields(NCursesFormField* nfields[]); - -protected: - // internal routines - inline void set_user(void *user) { - UserHook* uptr = (UserHook*)::form_userptr (form); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); - uptr->m_user = user; - } - - inline void *get_user() { - UserHook* uptr = (UserHook*)::form_userptr (form); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); - return uptr->m_user; - } - - void InitForm (NCursesFormField* Fields[], - bool with_frame, - bool autoDeleteFields); - - inline void OnError (int err) const THROWS(NCursesFormException) { - if (err != E_OK) - THROW(new NCursesFormException (err)); - } - - // this wraps the form_driver call. - virtual int driver (int c) ; - - // 'Internal' constructor, builds an object without association to a - // field array. - NCursesForm( int lines, - int cols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(lines,cols,begin_y,begin_x), - form ((FORM*)0) { - } - -public: - // Create form for the default panel. - NCursesForm (NCursesFormField* Fields[], - bool with_frame=FALSE, // reserve space for a frame? - bool autoDelete_Fields=FALSE) // do automatic cleanup? - : NCursesPanel() { - InitForm(Fields, with_frame, autoDelete_Fields); - } - - // Create a form in a panel with the given position and size. - NCursesForm (NCursesFormField* Fields[], - int lines, - int cols, - int begin_y, - int begin_x, - bool with_frame=FALSE, // reserve space for a frame? - bool autoDelete_Fields=FALSE) // do automatic cleanup? - : NCursesPanel(lines, cols, begin_y, begin_x) { - InitForm(Fields, with_frame, autoDelete_Fields); - } - - virtual ~NCursesForm(); - - // Set the default attributes for the form - virtual void setDefaultAttributes(); - - // Retrieve current field of the form. - inline NCursesFormField* current_field() const { - return my_fields[::field_index(::current_field(form))]; - } - - // Set the forms subwindow - void setSubWindow(NCursesWindow& sub); - - // Set these fields for the form - inline void setFields(NCursesFormField* Fields[]) { - OnError(::set_form_fields(form,mapFields(Fields))); - } - - // Remove the form from the screen - inline void unpost (void) { - OnError (::unpost_form (form)); - } - - // Post the form to the screen if flag is true, unpost it otherwise - inline void post(bool flag = TRUE) { - OnError (flag ? ::post_form(form) : ::unpost_form (form)); - } - - // Decorations - inline void frame(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::frame(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void boldframe(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::boldframe(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void label(const char *topLabel, const char *bottomLabel) { - if (b_framed) - NCursesPanel::label(topLabel,bottomLabel); - else - OnError(E_SYSTEM_ERROR); - } - - // ----- - // Hooks - // ----- - - // Called after the form gets repositioned in its window. - // This is especially true if the form is posted. - virtual void On_Form_Init(); - - // Called before the form gets repositioned in its window. - // This is especially true if the form is unposted. - virtual void On_Form_Termination(); - - // Called after the field became the current field - virtual void On_Field_Init(NCursesFormField& field); - - // Called before this field is left as current field. - virtual void On_Field_Termination(NCursesFormField& field); - - // Calculate required window size for the form. - void scale(int& rows, int& cols) const { - OnError(::scale_form(form,&rows,&cols)); - } - - // Retrieve number of fields in the form. - int count() const { - return ::field_count(form); - } - - // Make the page the current page of the form. - void set_page(int page) { - OnError(::set_form_page(form,page)); - } - - // Retrieve current page number - int page() const { - return ::form_page(form); - } - - // Switch on the forms options - inline void options_on (Form_Options options) { - OnError (::form_opts_on (form, options)); - } - - // Switch off the forms options - inline void options_off (Form_Options options) { - OnError (::form_opts_off (form, options)); - } - - // Retrieve the forms options - inline Form_Options options () const { - return ::form_opts (form); - } - - // Set the forms options - inline void set_options (Form_Options options) { - OnError (::set_form_opts (form, options)); - } - - // Are there more data in the current field after the data shown - inline bool data_ahead() const { - return ::data_ahead(form); - } - - // Are there more data in the current field before the data shown - inline bool data_behind() const { - return ::data_behind(form); - } - - // Position the cursor to the current field - inline void position_cursor () { - OnError (::pos_form_cursor (form)); - } - // Set the current field - inline void set_current(NCursesFormField& F) { - OnError (::set_current_field(form, F.field)); - } - - // Provide a default key virtualization. Translate the keyboard - // code c into a form request code. - // The default implementation provides a hopefully straightforward - // mapping for the most common keystrokes and form requests. - virtual int virtualize(int c); - - // Operators - inline NCursesFormField* operator[](int i) const { - if ( (i < 0) || (i >= ::field_count (form)) ) - OnError (E_BAD_ARGUMENT); - return my_fields[i]; - } - - // Perform the menu's operation - // Return the field where you left the form. - virtual NCursesFormField* operator()(void); - - // Exception handlers. The default is a Beep. - virtual void On_Request_Denied(int c) const; - virtual void On_Invalid_Field(int c) const; - virtual void On_Unknown_Command(int c) const; - -}; - -// -// ------------------------------------------------------------------------- -// This is the typical C++ typesafe way to allow to attach -// user data to a field of a form. Its assumed that the user -// data belongs to some class T. Use T as template argument -// to create a UserField. -// ------------------------------------------------------------------------- -template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField -{ -public: - NCursesUserField (int rows, - int cols, - int first_row = 0, - int first_col = 0, - const T* p_UserData = (T*)0, - int offscreen_rows = 0, - int additional_buffers = 0) - : NCursesFormField (rows, cols, - first_row, first_col, - offscreen_rows, additional_buffers) { - if (field) - OnError(::set_field_userptr(field,(void *)p_UserData)); - } - - virtual ~NCursesUserField() {}; - - inline const T* UserData (void) const { - return (const T*)::field_userptr (field); - } - - inline virtual void setUserData(const T* p_UserData) { - if (field) - OnError (::set_field_userptr (field, (void *)p_UserData)); - } -}; -// -// ------------------------------------------------------------------------- -// The same mechanism is used to attach user data to a form -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm -{ -protected: - // 'Internal' constructor, builds an object without association to a - // field array. - NCursesUserForm( int lines, - int cols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = (T*)0) - : NCursesForm(lines,cols,begin_y,begin_x) { - if (form) - set_user ((void *)p_UserData); - } - -public: - NCursesUserForm (NCursesFormField Fields[], - const T* p_UserData = (T*)0, - bool with_frame=FALSE, - bool autoDelete_Fields=FALSE) - : NCursesForm (Fields, with_frame, autoDelete_Fields) { - if (form) - set_user ((void *)p_UserData); - }; - - NCursesUserForm (NCursesFormField Fields[], - int lines, - int cols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = (T*)0, - bool with_frame=FALSE, - bool autoDelete_Fields=FALSE) - : NCursesForm (Fields, lines, cols, begin_y, begin_x, - with_frame, autoDelete_Fields) { - if (form) - set_user ((void *)p_UserData); - }; - - virtual ~NCursesUserForm() { - }; - - inline T* UserData (void) const { - return (T*)get_user (); - }; - - inline virtual void setUserData (const T* p_UserData) { - if (form) - set_user ((void *)p_UserData); - } - -}; -// -// ------------------------------------------------------------------------- -// Builtin Fieldtypes -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType { -private: - int min_field_width; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); - } - -public: - Alpha_Field(int width) - : NCursesFieldType(TYPE_ALPHA), - min_field_width(width) { - } -}; - -class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType { -private: - int min_field_width; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); - } - -public: - Alphanumeric_Field(int width) - : NCursesFieldType(TYPE_ALNUM), - min_field_width(width) { - } -}; - -class NCURSES_IMPEXP Integer_Field : public NCursesFieldType { -private: - int precision; - long lower_limit, upper_limit; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - precision,lower_limit,upper_limit)); - } - -public: - Integer_Field(int prec, long low=0L, long high=0L) - : NCursesFieldType(TYPE_INTEGER), - precision(prec), lower_limit(low), upper_limit(high) { - } -}; - -class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType { -private: - int precision; - double lower_limit, upper_limit; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - precision,lower_limit,upper_limit)); - } - -public: - Numeric_Field(int prec, double low=0.0, double high=0.0) - : NCursesFieldType(TYPE_NUMERIC), - precision(prec), lower_limit(low), upper_limit(high) { - } -}; - -class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType { -private: - char* regex; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,regex)); - } - -public: - Regular_Expression_Field(const char *expr) - : NCursesFieldType(TYPE_REGEXP) { - regex = new char[1 + ::strlen(expr)]; - (::strcpy)(regex,expr); - } - - ~Regular_Expression_Field() { - delete[] regex; - } -}; - -class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType { -private: - const char** list; - int case_sensitive; - int non_unique_matches; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - list,case_sensitive,non_unique_matches)); - } -public: - Enumeration_Field(const char* enums[], - bool case_sens=FALSE, - bool non_unique=FALSE) - : NCursesFieldType(TYPE_ENUM), - list(enums), - case_sensitive(case_sens?-1:0), - non_unique_matches(non_unique?-1:0) { - } -}; - -class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType { -private: - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype)); - } - -public: - IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) { - } -}; -// -// ------------------------------------------------------------------------- -// Abstract base class for User-Defined Fieldtypes -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType { - friend class UDF_Init; // Internal helper to set up statics -private: - // For all C++ defined fieldtypes we need only one generic lowlevel - // FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype; - -protected: - // This are the functions required by the low level libforms functions - // to construct a fieldtype. - static bool fcheck(FIELD *, const void*); - static bool ccheck(int c, const void *); - static void* makearg(va_list*); - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,&f)); - } - -protected: - // Redefine this function to do a field validation. The argument - // is a reference to the field you should validate. - virtual bool field_check(NCursesFormField& f) = 0; - - // Redefine this function to do a character validation. The argument - // is the character to be validated. - virtual bool char_check (int c) = 0; - -public: - UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) { - } -}; -// -// ------------------------------------------------------------------------- -// Abstract base class for User-Defined Fieldtypes with Choice functions -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType { - friend class UDF_Init; // Internal helper to set up statics -private: - // For all C++ defined fieldtypes with choice functions we need only one - // generic lowlevel FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype_with_choice; - - // This are the functions required by the low level libforms functions - // to construct a fieldtype with choice functions. - static bool next_choice(FIELD*, const void *); - static bool prev_choice(FIELD*, const void *); - -protected: - // Redefine this function to do the retrieval of the next choice value. - // The argument is a reference to the field tobe examined. - virtual bool next (NCursesFormField& f) = 0; - - // Redefine this function to do the retrieval of the previous choice value. - // The argument is a reference to the field tobe examined. - virtual bool previous(NCursesFormField& f) = 0; - -public: - UserDefinedFieldType_With_Choice() { - fieldtype = generic_fieldtype_with_choice; - } -}; - -#endif // NCURSES_CURSESF_H_incl - diff --git a/contrib/ncurses/c++/cursesm.cc b/contrib/ncurses/c++/cursesm.cc deleted file mode 100644 index 22b785bc62..0000000000 --- a/contrib/ncurses/c++/cursesm.cc +++ /dev/null @@ -1,382 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesm.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesm.cc,v 1.18 2003/10/25 15:04:46 tom Exp $") - -NCursesMenuItem::~NCursesMenuItem() { - if (item) - OnError(::free_item(item)); -} - -bool -NCursesMenuItem::action() { - return FALSE; -}; - -NCursesMenuCallbackItem::~NCursesMenuCallbackItem() { -} - -bool -NCursesMenuCallbackItem::action() { - if (p_fct) - return p_fct (*this); - else - return FALSE; -} - -/* Internal hook functions. They will route the hook - * calls to virtual methods of the NCursesMenu class, - * so in C++ providing a hook is done simply by - * implementing a virtual method in a derived class - */ -void -NCursesMenu::mnu_init(MENU *m) { - getHook(m)->On_Menu_Init(); -} - -void -NCursesMenu::mnu_term(MENU *m) { - getHook(m)->On_Menu_Termination(); -} - -void -NCursesMenu::itm_init(MENU *m) { - NCursesMenu* M = getHook(m); - M->On_Item_Init (*(M->current_item ())); -} - -void -NCursesMenu::itm_term(MENU *m) { - NCursesMenu* M = getHook(m); - M->On_Item_Termination (*(M->current_item ())); -} - -/* Construct an ITEM* array from an array of NCursesMenuItem - * objects. - */ -ITEM** -NCursesMenu::mapItems(NCursesMenuItem* nitems[]) { - int itemCount = 0,lcv; - - for (lcv=0; nitems[lcv]->item; ++lcv) - ++itemCount; - - ITEM** items = new ITEM*[itemCount + 1]; - - for (lcv=0;nitems[lcv]->item;++lcv) { - items[lcv] = nitems[lcv]->item; - } - items[lcv] = NULL; - - my_items = nitems; - - if (menu) - delete[] ::menu_items(menu); - return items; -} - -void -NCursesMenu::InitMenu(NCursesMenuItem* nitems[], - bool with_frame, - bool autoDelete_Items) { - int mrows, mcols; - - keypad(TRUE); - meta(TRUE); - - b_framed = with_frame; - b_autoDelete = autoDelete_Items; - - menu = (MENU*)0; - menu = ::new_menu(mapItems(nitems)); - if (!menu) - OnError (E_SYSTEM_ERROR); - - UserHook* hook = new UserHook; - hook->m_user = NULL; - hook->m_back = this; - hook->m_owner = menu; - ::set_menu_userptr(menu,(void*)hook); - - ::set_menu_init (menu, NCursesMenu::mnu_init); - ::set_menu_term (menu, NCursesMenu::mnu_term); - ::set_item_init (menu, NCursesMenu::itm_init); - ::set_item_term (menu, NCursesMenu::itm_term); - - scale(mrows, mcols); - ::set_menu_win(menu, w); - - if (with_frame) { - if ((mrows > height()-2) || (mcols > width()-2)) - OnError(E_NO_ROOM); - sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); - ::set_menu_sub(menu, sub->w); - b_sub_owner = TRUE; - } - else { - sub = (NCursesWindow*)0; - b_sub_owner = FALSE; - } - setDefaultAttributes(); -} - -void -NCursesMenu::setDefaultAttributes() { - NCursesApplication* S = NCursesApplication::getApplication(); - if (S) { - ::set_menu_fore(menu, S->foregrounds()); - ::set_menu_back(menu, S->backgrounds()); - ::set_menu_grey(menu, S->inactives()); - } -} - -NCursesMenu::~NCursesMenu() { - UserHook* hook = (UserHook*)::menu_userptr(menu); - delete hook; - if (b_sub_owner) { - delete sub; - ::set_menu_sub(menu,(WINDOW *)0); - } - if (menu) { - ITEM** itms = ::menu_items(menu); - int cnt = count(); - - OnError(::set_menu_items(menu,(ITEM**)0)); - - if (b_autoDelete) { - if (cnt>0) { - for (int i=0; i <= cnt; i++) - delete my_items[i]; - } - delete[] my_items; - } - - ::free_menu(menu); - // It's essential to do this after free_menu() - delete[] itms; - } -} - -void -NCursesMenu::setSubWindow(NCursesWindow& nsub) { - if (!isDescendant(nsub)) - OnError(E_SYSTEM_ERROR); - else { - if (b_sub_owner) - delete sub; - sub = ⊄ - ::set_menu_sub(menu,sub->w); - } -} - -bool -NCursesMenu::set_pattern (const char *pat) { - int res = ::set_menu_pattern (menu, pat); - switch(res) { - case E_OK: - break; - case E_NO_MATCH: - return FALSE; - default: - OnError (res); - } - return TRUE; -} - -// call the menu driver and do basic error checking. -int -NCursesMenu::driver (int c) { - int res = ::menu_driver (menu, c); - switch (res) { - case E_OK: - case E_REQUEST_DENIED: - case E_NOT_SELECTABLE: - case E_UNKNOWN_COMMAND: - case E_NO_MATCH: - break; - default: - OnError (res); - } - return (res); -} - -static const int CMD_QUIT = MAX_COMMAND + 1; -static const int CMD_ACTION = MAX_COMMAND + 2; -// -// ------------------------------------------------------------------------- -// Provide a default key virtualization. Translate the keyboard -// code c into a menu request code. -// The default implementation provides a hopefully straightforward -// mapping for the most common keystrokes and menu requests. -// ------------------------------------------------------------------------- -int -NCursesMenu::virtualize(int c) { - switch(c) { - case CTRL('X') : return(CMD_QUIT); // eXit - - case KEY_DOWN : return(REQ_DOWN_ITEM); - case CTRL('N') : return(REQ_NEXT_ITEM); // Next - case KEY_UP : return(REQ_UP_ITEM); - case CTRL('P') : return(REQ_PREV_ITEM); // Previous - - case CTRL('U') : return(REQ_SCR_ULINE); // Up - case CTRL('D') : return(REQ_SCR_DLINE); // Down - case CTRL('F') : return(REQ_SCR_DPAGE); // Forward - case CTRL('B') : return(REQ_SCR_UPAGE); // Backward - - case CTRL('Y') : return(REQ_CLEAR_PATTERN); - case CTRL('H') : return(REQ_BACK_PATTERN); - case CTRL('A') : return(REQ_NEXT_MATCH); - case CTRL('E') : return(REQ_PREV_MATCH); - case CTRL('T') : return(REQ_TOGGLE_ITEM); - - case CTRL('J') : - case CTRL('M') : return(CMD_ACTION); - - case KEY_HOME : return(REQ_FIRST_ITEM); - case KEY_LEFT : return(REQ_LEFT_ITEM); - case KEY_RIGHT : return(REQ_RIGHT_ITEM); - case KEY_END : return(REQ_LAST_ITEM); - case KEY_BACKSPACE : return(REQ_BACK_PATTERN); - case KEY_NPAGE : return(REQ_SCR_DPAGE); - case KEY_PPAGE : return(REQ_SCR_UPAGE); - - default: - return(c); - } -} - -NCursesMenuItem* -NCursesMenu::operator()(void) { - int drvCmnd; - int err; - int c; - bool b_action = FALSE; - - post(); - show(); - refresh(); - - while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { - - switch((err=driver(drvCmnd))) { - case E_REQUEST_DENIED: - On_Request_Denied(c); - break; - case E_NOT_SELECTABLE: - On_Not_Selectable(c); - break; - case E_UNKNOWN_COMMAND: - if (drvCmnd == CMD_ACTION) { - if (options() & O_ONEVALUE) { - NCursesMenuItem* itm = current_item(); - assert(itm != 0); - if (itm->options() & O_SELECTABLE) - { - b_action = itm->action(); - refresh(); - } - else - On_Not_Selectable(c); - } - else { - int n = count(); - for(int i=0; ivalue()) { - b_action |= itm->action(); - refresh(); - } - } - } - } else - On_Unknown_Command(c); - break; - case E_NO_MATCH: - On_No_Match(c); - break; - case E_OK: - break; - default: - OnError(err); - } - } - - unpost(); - hide(); - refresh(); - if (options() & O_ONEVALUE) - return my_items[::item_index (::current_item (menu))]; - else - return NULL; -} - -void -NCursesMenu::On_Menu_Init() { -} - -void -NCursesMenu::On_Menu_Termination() { -} - -void -NCursesMenu::On_Item_Init(NCursesMenuItem& item) { -} - -void -NCursesMenu::On_Item_Termination(NCursesMenuItem& item) { -} - -void -NCursesMenu::On_Request_Denied(int c) const { - ::beep(); -} - -void -NCursesMenu::On_Not_Selectable(int c) const { - ::beep(); -} - -void -NCursesMenu::On_No_Match(int c) const { - ::beep(); -} - -void -NCursesMenu::On_Unknown_Command(int c) const { - ::beep(); -} diff --git a/contrib/ncurses/c++/cursesm.h b/contrib/ncurses/c++/cursesm.h deleted file mode 100644 index cc12d33aeb..0000000000 --- a/contrib/ncurses/c++/cursesm.h +++ /dev/null @@ -1,592 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesm.h,v 1.17 2003/10/25 15:04:46 tom Exp $ - -#ifndef NCURSES_CURSESM_H_incl -#define NCURSES_CURSESM_H_incl 1 - -#include - -extern "C" { -# include -} -// -// ------------------------------------------------------------------------- -// This wraps the ITEM type of -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesMenuItem { - friend class NCursesMenu; - -protected: - ITEM *item; - - inline void OnError (int err) const THROWS(NCursesMenuException) { - if (err != E_OK) - THROW(new NCursesMenuException (err)); - } - -public: - NCursesMenuItem (const char* p_name = NULL, - const char* p_descript = NULL ) { - item = p_name ? ::new_item (p_name, p_descript) : (ITEM*)0; - if (p_name && !item) - OnError (E_SYSTEM_ERROR); - } - // Create an item. If you pass both parameters as NULL, a delimiting - // item is constructed which can be used to terminate a list of - // NCursesMenu objects. - - virtual ~NCursesMenuItem (); - // Release the items memory - - inline const char* name () const { - return ::item_name (item); - } - // Name of the item - - inline const char* description () const { - return ::item_description (item); - } - // Description of the item - - inline int (index) (void) const { - return ::item_index (item); - } - // Index of the item in an item array (or -1) - - inline void options_on (Item_Options options) { - OnError (::item_opts_on (item, options)); - } - // Switch on the items options - - inline void options_off (Item_Options options) { - OnError (::item_opts_off (item, options)); - } - // Switch off the item's option - - inline Item_Options options () const { - return ::item_opts (item); - } - // Retrieve the items options - - inline void set_options (Item_Options options) { - OnError (::set_item_opts (item, options)); - } - // Set the items options - - inline void set_value (bool f) { - OnError (::set_item_value (item,f)); - } - // Set/Reset the items selection state - - inline bool value () const { - return ::item_value (item); - } - // Retrieve the items selection state - - inline bool visible () const { - return ::item_visible (item); - } - // Retrieve visibility of the item - - virtual bool action(); - // Perform an action associated with this item; you may use this in an - // user supplied driver for a menu; you may derive from this class and - // overload action() to supply items with different actions. - // If an action returns true, the menu will be exited. The default action - // is to do nothing. -}; - -// Prototype for an items callback function. -typedef bool ITEMCALLBACK(NCursesMenuItem&); - -// If you don't like to create a child class for individual items to -// overload action(), you may use this class and provide a callback -// function pointer for items. -class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem { -private: - ITEMCALLBACK* p_fct; - -public: - NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, - const char* p_name = NULL, - const char* p_descript = NULL ) - : NCursesMenuItem (p_name, p_descript), - p_fct (fct) { - } - - virtual ~NCursesMenuCallbackItem(); - - bool action(); -}; -// -// ------------------------------------------------------------------------- -// This wraps the MENU type of -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesMenu : public NCursesPanel { -protected: - MENU *menu; - -private: - NCursesWindow* sub; // the subwindow object - bool b_sub_owner; // is this our own subwindow? - bool b_framed; // has the menu a border? - bool b_autoDelete; // Delete items when deleting menu? - - NCursesMenuItem** my_items; // The array of items for this menu - - // This structure is used for the menu's user data field to link the - // MENU* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesMenu* m_back; // backward pointer to C++ object - const MENU* m_owner; - } UserHook; - - // Get the backward pointer to the C++ object from a MENU - static inline NCursesMenu* getHook(const MENU *m) { - UserHook* hook = (UserHook*)::menu_userptr(m); - assert(hook != 0 && hook->m_owner==m); - return (NCursesMenu*)(hook->m_back); - } - - // This are the built-in hook functions in this C++ binding. In C++ we use - // virtual member functions (see below On_..._Init and On_..._Termination) - // to provide this functionality in an object oriented manner. - static void mnu_init(MENU *); - static void mnu_term(MENU *); - static void itm_init(MENU *); - static void itm_term(MENU *); - - // Calculate ITEM* array for the menu - ITEM** mapItems(NCursesMenuItem* nitems[]); - -protected: - // internal routines - inline void set_user(void *user) { - UserHook* uptr = (UserHook*)::menu_userptr (menu); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); - uptr->m_user = user; - } - - inline void *get_user() { - UserHook* uptr = (UserHook*)::menu_userptr (menu); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); - return uptr->m_user; - } - - void InitMenu (NCursesMenuItem* menu[], - bool with_frame, - bool autoDeleteItems); - - inline void OnError (int err) const THROWS(NCursesMenuException) { - if (err != E_OK) - THROW(new NCursesMenuException (this, err)); - } - - // this wraps the menu_driver call. - virtual int driver (int c) ; - - // 'Internal' constructor to create a menu without association to - // an array of items. - NCursesMenu( int lines, - int cols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(lines,cols,begin_y,begin_x), - menu ((MENU*)0) { - } - -public: - // Make a full window size menu - NCursesMenu (NCursesMenuItem* Items[], - bool with_frame=FALSE, // Reserve space for a frame? - bool autoDelete_Items=FALSE) // Autocleanup of Items? - : NCursesPanel() { - InitMenu(Items, with_frame, autoDelete_Items); - } - - // Make a menu with a window of this size. - NCursesMenu (NCursesMenuItem* Items[], - int lines, - int cols, - int begin_y = 0, - int begin_x = 0, - bool with_frame=FALSE, // Reserve space for a frame? - bool autoDelete_Items=FALSE) // Autocleanup of Items? - : NCursesPanel(lines, cols, begin_y, begin_x) { - InitMenu(Items, with_frame, autoDelete_Items); - } - - virtual ~NCursesMenu (); - - // Retrieve the menus subwindow - inline NCursesWindow& subWindow() const { - assert(sub!=NULL); - return *sub; - } - - // Set the menus subwindow - void setSubWindow(NCursesWindow& sub); - - // Set these items for the menu - inline void setItems(NCursesMenuItem* Items[]) { - OnError(::set_menu_items(menu,mapItems(Items))); - } - - // Remove the menu from the screen - inline void unpost (void) { - OnError (::unpost_menu (menu)); - } - - // Post the menu to the screen if flag is true, unpost it otherwise - inline void post(bool flag = TRUE) { - flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu)); - } - - // Get the numer of rows and columns for this menu - inline void scale (int& mrows, int& mcols) const { - OnError (::scale_menu (menu, &mrows, &mcols)); - } - - // Set the format of this menu - inline void set_format(int mrows, int mcols) { - OnError (::set_menu_format(menu, mrows, mcols)); - } - - // Get the format of this menu - inline void menu_format(int& rows,int& cols) { - ::menu_format(menu,&rows,&cols); - } - - // Items of the menu - inline NCursesMenuItem* items() const { - return *my_items; - } - - // Get the number of items in this menu - inline int count() const { - return ::item_count(menu); - } - - // Get the current item (i.e. the one the cursor is located) - inline NCursesMenuItem* current_item() const { - return my_items[::item_index(::current_item(menu))]; - } - - // Get the marker string - inline const char* mark() const { - return ::menu_mark(menu); - } - - // Set the marker string - inline void set_mark(const char *mark) { - OnError (::set_menu_mark (menu, mark)); - } - - // Get the name of the request code c - inline static const char* request_name(int c) { - return ::menu_request_name(c); - } - - // Get the current pattern - inline char* pattern() const { - return ::menu_pattern(menu); - } - - // true if there is a pattern match, false otherwise. - bool set_pattern (const char *pat); - - // set the default attributes for the menu - // i.e. set fore, back and grey attribute - virtual void setDefaultAttributes(); - - // Get the menus background attributes - inline chtype back() const { - return ::menu_back(menu); - } - - // Get the menus foreground attributes - inline chtype fore() const { - return ::menu_fore(menu); - } - - // Get the menus grey attributes (used for unselectable items) - inline chtype grey() const { - return ::menu_grey(menu); - } - - // Set the menus background attributes - inline chtype set_background(chtype a) { - return ::set_menu_back(menu,a); - } - - // Set the menus foreground attributes - inline chtype set_foreground(chtype a) { - return ::set_menu_fore(menu,a); - } - - // Set the menus grey attributes (used for unselectable items) - inline chtype set_grey(chtype a) { - return ::set_menu_grey(menu,a); - } - - inline void options_on (Menu_Options opts) { - OnError (::menu_opts_on (menu,opts)); - } - - inline void options_off(Menu_Options opts) { - OnError (::menu_opts_off(menu,opts)); - } - - inline Menu_Options options() const { - return ::menu_opts(menu); - } - - inline void set_options (Menu_Options opts) { - OnError (::set_menu_opts (menu,opts)); - } - - inline int pad() const { - return ::menu_pad(menu); - } - - inline void set_pad (int padch) { - OnError (::set_menu_pad (menu, padch)); - } - - // Position the cursor to the current item - inline void position_cursor () const { - OnError (::pos_menu_cursor (menu)); - } - - // Set the current item - inline void set_current(NCursesMenuItem& I) { - OnError (::set_current_item(menu, I.item)); - } - - // Get the current top row of the menu - inline int top_row (void) const { - return ::top_row (menu); - } - - // Set the current top row of the menu - inline void set_top_row (int row) { - OnError (::set_top_row (menu, row)); - } - - // spacing control - // Set the spacing for the menu - inline void setSpacing(int spc_description, - int spc_rows, - int spc_columns) { - OnError(::set_menu_spacing(menu, - spc_description, - spc_rows, - spc_columns)); - } - - // Get the spacing info for the menu - inline void Spacing(int& spc_description, - int& spc_rows, - int& spc_columns) const { - OnError(::menu_spacing(menu, - &spc_description, - &spc_rows, - &spc_columns)); - } - - // Decorations - inline void frame(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::frame(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void boldframe(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::boldframe(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void label(const char *topLabel, const char *bottomLabel) { - if (b_framed) - NCursesPanel::label(topLabel,bottomLabel); - else - OnError(E_SYSTEM_ERROR); - } - - // ----- - // Hooks - // ----- - - // Called after the menu gets repositioned in its window. - // This is especially true if the menu is posted. - virtual void On_Menu_Init(); - - // Called before the menu gets repositioned in its window. - // This is especially true if the menu is unposted. - virtual void On_Menu_Termination(); - - // Called after the item became the current item - virtual void On_Item_Init(NCursesMenuItem& item); - - // Called before this item is left as current item. - virtual void On_Item_Termination(NCursesMenuItem& item); - - // Provide a default key virtualization. Translate the keyboard - // code c into a menu request code. - // The default implementation provides a hopefully straightforward - // mapping for the most common keystrokes and menu requests. - virtual int virtualize(int c); - - - // Operators - inline NCursesMenuItem* operator[](int i) const { - if ( (i < 0) || (i >= ::item_count (menu)) ) - OnError (E_BAD_ARGUMENT); - return (my_items[i]); - } - - // Perform the menu's operation - // Return the item where you left the selection mark for a single - // selection menu, or NULL for a multivalued menu. - virtual NCursesMenuItem* operator()(void); - - // -------------------- - // Exception handlers - // Called by operator() - // -------------------- - - // Called if the request is denied - virtual void On_Request_Denied(int c) const; - - // Called if the item is not selectable - virtual void On_Not_Selectable(int c) const; - - // Called if pattern doesn't match - virtual void On_No_Match(int c) const; - - // Called if the command is unknown - virtual void On_Unknown_Command(int c) const; - -}; -// -// ------------------------------------------------------------------------- -// This is the typical C++ typesafe way to allow to attach -// user data to an item of a menu. Its assumed that the user -// data belongs to some class T. Use T as template argument -// to create a UserItem. -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem -{ -public: - NCursesUserItem (const char* p_name, - const char* p_descript = NULL, - const T* p_UserData = (T*)0) - : NCursesMenuItem (p_name, p_descript) { - if (item) - OnError (::set_item_userptr (item, (void *)p_UserData)); - }; - - virtual ~NCursesUserItem() {}; - - inline const T* UserData (void) const { - return (const T*)::item_userptr (item); - }; - - inline virtual void setUserData(const T* p_UserData) { - if (item) - OnError (::set_item_userptr (item, (void *)p_UserData)); - } -}; -// -// ------------------------------------------------------------------------- -// The same mechanism is used to attach user data to a menu -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu -{ -protected: - NCursesUserMenu( int lines, - int cols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = (T*)0) - : NCursesMenu(lines,cols,begin_y,begin_x) { - if (menu) - set_user ((void *)p_UserData); - } - -public: - NCursesUserMenu (NCursesMenuItem Items[], - const T* p_UserData = (T*)0, - bool with_frame=FALSE, - bool autoDelete_Items=FALSE) - : NCursesMenu (Items, with_frame, autoDelete_Items) { - if (menu) - set_user ((void *)p_UserData); - }; - - NCursesUserMenu (NCursesMenuItem Items[], - int lines, - int cols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = (T*)0, - bool with_frame=FALSE) - : NCursesMenu (Items, lines, cols, begin_y, begin_x, with_frame) { - if (menu) - set_user ((void *)p_UserData); - }; - - virtual ~NCursesUserMenu() { - }; - - inline T* UserData (void) const { - return (T*)get_user (); - }; - - inline virtual void setUserData (const T* p_UserData) { - if (menu) - set_user ((void *)p_UserData); - } -}; - -#endif // NCURSES_CURSESM_H_incl diff --git a/contrib/ncurses/c++/cursesmain.cc b/contrib/ncurses/c++/cursesmain.cc deleted file mode 100644 index d10035b5f0..0000000000 --- a/contrib/ncurses/c++/cursesmain.cc +++ /dev/null @@ -1,65 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesmain.cc,v 1.11 2003/10/25 14:53:13 tom Exp $") - -#if HAVE_LOCALE_H -#include -#else -#define setlocale(name,string) /* nothing */ -#endif - -/* This is the default implementation of main() for a NCursesApplication. - * You only have to instantiate a static NCursesApplication object in your - * main application source file and link this module with your application. - */ -int main(int argc, char* argv[]) -{ - setlocale(LC_ALL, ""); - - NCursesApplication* A = NCursesApplication::getApplication(); - if (!A) - return(1); - 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 deleted file mode 100644 index c236d516c7..0000000000 --- a/contrib/ncurses/c++/cursesp.cc +++ /dev/null @@ -1,129 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1993, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesp.h" -#include - -MODULE_ID("$Id: cursesp.cc,v 1.21 2003/10/25 15:04:46 tom Exp $") - -NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; - -void NCursesPanel::init() { - p = ::new_panel(w); - if (!p) - OnError(ERR); - - UserHook* hook = new UserHook; - hook->m_user = NULL; - hook->m_back = this; - hook->m_owner = p; - ::set_panel_userptr(p, (void *)hook); -} - -NCursesPanel::~NCursesPanel() { - UserHook* hook = (UserHook*)::panel_userptr(p); - assert(hook != 0 && hook->m_back==this && hook->m_owner==p); - delete hook; - ::del_panel(p); - ::update_panels(); -} - -void -NCursesPanel::redraw() { - PANEL *pan; - - pan = ::panel_above(NULL); - while (pan) { - ::touchwin(panel_window(pan)); - pan = ::panel_above(pan); - } - ::update_panels(); - ::doupdate(); -} - -int -NCursesPanel::refresh() { - ::update_panels(); - return ::doupdate(); -} - -int -NCursesPanel::noutrefresh() { - ::update_panels(); - return OK; -} - -void -NCursesPanel::boldframe(const char *title, const char* btitle) { - standout(); - frame(title, btitle); - standend(); -} - -void -NCursesPanel::frame(const char *title,const char *btitle) { - int err = OK; - if (!title && !btitle) { - err = box(); - } - else { - err = box(); - if (err==OK) - label(title,btitle); - } - OnError(err); -} - -void -NCursesPanel::label(const char *tLabel, const char *bLabel) { - if (tLabel) - centertext(0,tLabel); - if (bLabel) - centertext(maxy(),bLabel); -} - -void -NCursesPanel::centertext(int row,const char *label) { - if (label) { - int x = (maxx() - ::strlen(label)) / 2; - if (x<0) - x=0; - 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 deleted file mode 100644 index 33eae9b24c..0000000000 --- a/contrib/ncurses/c++/cursesp.h +++ /dev/null @@ -1,221 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#ifndef NCURSES_CURSESP_H_incl -#define NCURSES_CURSESP_H_incl 1 - -// $Id: cursesp.h,v 1.18 2003/10/25 15:04:46 tom Exp $ - -#include - -extern "C" { -# include -} - -class NCURSES_IMPEXP NCursesPanel : public NCursesWindow { -protected: - PANEL *p; - static NCursesPanel *dummy; - -private: - // This structure is used for the panel's user data field to link the - // PANEL* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesPanel* m_back; // backward pointer to C++ object - const PANEL* m_owner; // the panel itself - } UserHook; - - void init(); // Initialize the panel object - -protected: - void set_user(void *user) { - UserHook* uptr = (UserHook*)::panel_userptr (p); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); - uptr->m_user = user; - } - // Set the user pointer of the panel. - - void *get_user() { - UserHook* uptr = (UserHook*)::panel_userptr (p); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); - return uptr->m_user; - } - - void OnError (int err) const THROWS((NCursesPanelException)) { - if (err==ERR) - THROW(new NCursesPanelException (this, err)); - } - // 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, - int begin_y = 0, - int begin_x = 0) - : NCursesWindow(lines,cols,begin_y,begin_x) { - init(); - } - // Create a panel with this size starting at the requested position. - - NCursesPanel() : NCursesWindow(::stdscr) { init(); } - // This constructor creates the default Panel associated with the - // ::stdscr window - - virtual ~NCursesPanel(); - - // basic manipulation - inline void hide() { - OnError (::hide_panel(p)); - } - // Hide the panel. It stays in the stack but becomes invisible. - - inline void show() { - OnError (::show_panel(p)); - } - // Show the panel, i.e. make it visible. - - inline void top() { - OnError (::top_panel(p)); - } - // Make this panel the top panel in the stack. - - inline void bottom() { - OnError (::bottom_panel(p)); - } - // Make this panel the bottom panel in the stack. - // N.B.: The panel associated with ::stdscr is always on the bottom. So - // actually bottom() makes the panel the first above ::stdscr. - - virtual int mvwin(int y, int x) { - OnError(::move_panel(p, y, x)); - return OK; - } - - inline bool hidden() const { - return (::panel_hidden (p) ? TRUE : FALSE); - } - // Return TRUE if the panel is hidden, FALSE otherwise. - -/* The functions panel_above() and panel_below() are not reflected in - the NCursesPanel class. The reason for this is, that we cannot - assume that a panel retrieved by those operations is one wrapped - by a C++ class. Although this situation might be handled, we also - need a reverse mapping from PANEL to NCursesPanel which needs some - redesign of the low level stuff. At the moment, we define them in the - interface but they will always produce an error. */ - inline NCursesPanel& above() const { - OnError(ERR); - return *dummy; - } - - inline NCursesPanel& below() const { - OnError(ERR); - return *dummy; - } - - // Those two are rewrites of the corresponding virtual members of - // NCursesWindow - virtual int refresh(); - // Propagate all panel changes to the virtual screen and update the - // physical screen. - - virtual int noutrefresh(); - // Propagate all panel changes to the virtual screen. - - static void redraw(); - // Redraw all panels. - - // decorations - virtual void frame(const char* title=NULL, - const char* btitle=NULL); - // Put a frame around the panel and put the title centered in the top line - // and btitle in the bottom line. - - virtual void boldframe(const char* title=NULL, - const char* btitle=NULL); - // Same as frame(), but use highlighted attributes. - - virtual void label(const char* topLabel, - const char* bottomLabel); - // Put the title centered in the top line and btitle in the bottom line. - - virtual void centertext(int row,const char* label); - // Put the label text centered in the specified row. -}; - -/* We use templates to provide a typesafe mechanism to associate - * user data with a panel. A NCursesUserPanel is a panel - * associated with some user data of type T. - */ -template class NCursesUserPanel : public NCursesPanel -{ -public: - NCursesUserPanel (int lines, - int cols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = (T*)0) - : NCursesPanel (lines, cols, begin_y, begin_x) { - if (p) - set_user ((void *)p_UserData); - }; - // This creates an user panel of the requested size with associated - // user data pointed to by p_UserData. - - NCursesUserPanel(const T* p_UserData = (T*)0) : NCursesPanel() { - if (p) - set_user((void *)p_UserData); - }; - // This creates an user panel associated with the ::stdscr and user data - // pointed to by p_UserData. - - virtual ~NCursesUserPanel() {}; - - T* UserData (void) const { - return (T*)get_user (); - }; - // Retrieve the user data associated with the panel. - - virtual void setUserData (const T* p_UserData) { - if (p) - set_user ((void *)p_UserData); - } - // Associate the user panel with the user data pointed to by p_UserData. -}; - -#endif // NCURSES_CURSESP_H_incl diff --git a/contrib/ncurses/c++/cursespad.cc b/contrib/ncurses/c++/cursespad.cc deleted file mode 100644 index 2d067a0e56..0000000000 --- a/contrib/ncurses/c++/cursespad.cc +++ /dev/null @@ -1,275 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1999 * - ****************************************************************************/ - -#include "internal.h" -#include "etip.h" -#include "cursesw.h" - -MODULE_ID("$Id: cursespad.cc,v 1.7 2003/10/25 15:04:46 tom Exp $") - -NCursesPad::NCursesPad(int lines, int cols) - : NCursesWindow(), - viewWin((NCursesWindow*)0), - viewSub((NCursesWindow*)0), - h_gridsize(0), v_gridsize(0), - min_row(0), min_col(0) -{ - w = ::newpad(lines,cols); - if ((WINDOW*)0==w) { - count--; - err_handler("Cannot construct window"); - } - alloced = TRUE; -} - - -int NCursesPad::driver (int key) -{ - // Default implementation - switch(key) { - case KEY_UP: - // ======= - return REQ_PAD_UP; - case KEY_DOWN: - // ========= - return REQ_PAD_DOWN; - case KEY_LEFT: - // ========= - return REQ_PAD_LEFT; - case KEY_RIGHT: - // ========== - return REQ_PAD_RIGHT; - case KEY_EXIT: - // ========= - case CTRL('X'): - // ========== - return REQ_PAD_EXIT; - - default: return(key); - } -} - - -void NCursesPad::operator()(void) -{ - NCursesWindow* W = Win(); - - if ((NCursesWindow*)0 != W) { - int Width = W->width(); - int Height = W->height(); - - int req = REQ_PAD_REFRESH; - - W->keypad(TRUE); - W->meta(TRUE); - refresh(); - - do { - bool changed = FALSE; - - switch (req) { - case REQ_PAD_REFRESH: - // ================ - changed = TRUE; - break; - case REQ_PAD_LEFT: - // ============= - if (min_col > 0) { - changed = TRUE; - if (min_col < h_gridsize) - min_col = 0; - else - min_col -= h_gridsize; - } - else - OnNavigationError(req); - break; - case REQ_PAD_RIGHT: - // ============== - if (min_col < (width() - Width - 1)) { - changed = TRUE; - if (min_col > (width() - Width - h_gridsize - 1)) - min_col = width() - Width - 1; - else - min_col += h_gridsize; - } - else - OnNavigationError(req); - break; - case REQ_PAD_UP: - // =========== - if (min_row > 0) { - changed = TRUE; - if (min_row < v_gridsize) - min_row = 0; - else - min_row -= v_gridsize; - } - else - OnNavigationError(req); - break; - case REQ_PAD_DOWN: - // ============= - if (min_row < (height() - Height - 1)) { - changed = TRUE; - if (min_row > (height() - Height - v_gridsize - 1)) - min_row = height() - Height - 1; - else - min_row += v_gridsize; - } - else - OnNavigationError(req); - break; - - default: - OnUnknownOperation(req); - } - - if (changed) { - noutrefresh(); - W->syncup(); - OnOperation(req); - viewWin->refresh(); - } - } while( (req=driver(W->getch())) != REQ_PAD_EXIT ); - } -} - - -int NCursesPad::refresh() -{ - int res = noutrefresh(); - if (res==OK && ((NCursesWindow*)0 != viewWin)) { - res = (viewWin->refresh()); - } - return(res); -} - -int NCursesPad::noutrefresh() -{ - int res = OK; - NCursesWindow* W = Win(); - if ((NCursesWindow*)0 != W) { - res = copywin(*W,min_row,min_col, - 0,0,W->maxy(),W->maxx(), - FALSE); - if (res==OK) { - W->syncup(); - res = viewWin->noutrefresh(); - } - } - return (res); -} - -void NCursesPad::setWindow(NCursesWindow& view, - int v_grid NCURSES_PARAM_INIT(1), - int h_grid NCURSES_PARAM_INIT(1)) -{ - viewWin = &view; - min_row = min_col = 0; - if (h_grid <=0 || v_grid <= 0) - err_handler("Illegal Gridsize"); - else { - h_gridsize = h_grid; - v_gridsize = v_grid; - } -} - -void NCursesPad::setSubWindow(NCursesWindow& sub) -{ - if ((NCursesWindow*)0 == viewWin) - err_handler("Pad has no viewport"); - if (!viewWin->isDescendant(sub)) - THROW(new NCursesException("NCursesFramePad", E_SYSTEM_ERROR)); - viewSub = ⊂ -} - -void NCursesFramedPad::OnOperation(int pad_req) -{ - NCursesWindow* W = Win(); - NCursesWindow* Win = getWindow(); - - if (((NCursesWindow*)0 != W) && ((NCursesWindow*)0 != Win)) { - int Width = W->width(); - int Height = W->height(); - int i, row, col, h_len, v_len; - - h_len = (Width*Width + width() - 1)/width(); - if (h_len==0) - h_len = 1; - if (h_len > Width) - h_len = Width; - - v_len = (Height*Height + height() - 1)/height(); - if (v_len==0) - v_len = 1; - if (v_len > Height) - v_len = Height; - - col = (min_col * Width + width() - 1) / width(); - if (col + h_len > Width) - col = Width - h_len; - - row = (min_row * Height + height() - 1) / height(); - if (row + v_len > Height) - row = Height - v_len; - - Win->vline(1,Width+1,Height); - Win->attron(A_REVERSE); - if (v_len>=2) { - Win->addch(row+1,Width+1,ACS_UARROW); - for(i=2;iaddch(row+i,Width+1,' '); - Win->addch(row+v_len,Width+1,ACS_DARROW); - } - else { - for(i=1;i<=v_len;i++) - Win->addch(row+i,Width+1,' '); - } - Win->attroff(A_REVERSE); - - Win->hline(Height+1,1,Width); - Win->attron(A_REVERSE); - if (h_len >= 2) { - Win->addch(Height+1,col+1,ACS_LARROW); - for(i=2;iaddch(Height+1,col+i,' '); - Win->addch(Height+1,col+h_len,ACS_RARROW); - } - else { - for(i=1;i<=h_len;i++) - Win->addch(Height+1,col+i,' '); - } - Win->attroff(A_REVERSE); - } -} diff --git a/contrib/ncurses/c++/cursesw.cc b/contrib/ncurses/c++/cursesw.cc deleted file mode 100644 index 662edb5ad4..0000000000 --- a/contrib/ncurses/c++/cursesw.cc +++ /dev/null @@ -1,456 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- - -/* - Copyright (C) 1989 Free Software Foundation - written by Eric Newton (newton@rocky.oswego.edu) - - This file is part of the GNU C++ Library. This library is free - software; you can redistribute it and/or modify it under the terms of - the GNU Library General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your - option) any later version. This library is distributed in the hope - that it will be useful, but WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - - modified by Ulrich Drepper (drepper@karlsruhe.gmd.de) - and Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) - - modified by Juergen Pfeifer - and Thomas Dickey (noting that more than 70% of this file has been changed) -*/ - -#include "internal.h" -#include "cursesw.h" - -MODULE_ID("$Id: cursesw.cc,v 1.26 2003/10/25 15:02:46 tom Exp $") - -#define COLORS_NEED_INITIALIZATION -1 -#define COLORS_NOT_INITIALIZED 0 -#define COLORS_MONOCHROME 1 -#define COLORS_ARE_REALLY_THERE 2 - -// declare static variables for the class -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 * -# endif -#endif - -int -NCursesWindow::scanw(const char* fmt, ...) -{ - int result = ERR; - char buf[BUFSIZ]; - - if (::wgetnstr(w, buf, sizeof(buf)) != ERR) { - va_list args; - va_start(args, fmt); -#if USE_STDIO_VSCAN - 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_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); - } - return result; -} - - -int -NCursesWindow::scanw(int y, int x, const char* fmt, ...) -{ - int result = ERR; - char buf[BUFSIZ]; - - if (::wmove(w, y, x) != ERR) { - if (::wgetnstr(w, buf, sizeof(buf)) != ERR) { - va_list args; - va_start(args, fmt); -#if USE_STDIO_VSCAN - 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_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); - } - } - return result; -} - - -int -NCursesWindow::printw(const char * fmt, ...) -{ - va_list args; - va_start(args, fmt); - char buf[BUFSIZ]; - ::vsprintf(buf, fmt, args); - va_end(args); - return waddstr(w, buf); -} - - -int -NCursesWindow::printw(int y, int x, const char * fmt, ...) -{ - va_list args; - va_start(args, fmt); - int result = ::wmove(w, y, x); - if (result == OK) { - char buf[BUFSIZ]; - ::vsprintf(buf, fmt, args); - result = waddstr(w, buf); - } - va_end(args); - return result; -} - - -void -NCursesWindow::init(void) -{ - leaveok(0); - keypad(1); - meta(1); -} - -void -NCursesWindow::err_handler(const char *msg) const THROWS(NCursesException) -{ - THROW(new NCursesException(msg)); -} - -void -NCursesWindow::initialize() { - if (!b_initialized) { - ::initscr(); - b_initialized = TRUE; - if (colorInitialized==COLORS_NEED_INITIALIZATION) { - colorInitialized=COLORS_NOT_INITIALIZED; - useColors(); - } - ::noecho(); - ::cbreak(); - } -} - -NCursesWindow::NCursesWindow() { - initialize(); - - w = (WINDOW *)0; - init(); - alloced = FALSE; - subwins = par = sib = 0; - count++; -} - -NCursesWindow::NCursesWindow(int lines, int cols, int begin_y, int begin_x) -{ - initialize(); - - w = ::newwin(lines, cols, begin_y, begin_x); - if (w == 0) { - err_handler("Cannot construct window"); - } - init(); - - alloced = TRUE; - subwins = par = sib = 0; - count++; -} - -NCursesWindow::NCursesWindow(WINDOW* &window) -{ - initialize(); - - w = window; - init(); - alloced = FALSE; - subwins = par = sib = 0; - count++; -} - -NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c, - int begin_y, int begin_x, char absrel) -{ - initialize(); - if (absrel == 'a') { // absolute origin - begin_y -= win.begy(); - begin_x -= win.begx(); - } - - // Even though we treat subwindows as a tree, the standard curses - // library needs the `subwin' call to link to the parent in - // order to correctly perform refreshes, etc. - // Friendly enough, this also works for pads. - w = ::derwin(win.w, l, c, begin_y, begin_x); - if (w == 0) { - err_handler("Cannot construct subwindow"); - } - - par = &win; - sib = win.subwins; - win.subwins = this; - subwins = 0; - alloced = TRUE; - count++; -} - -NCursesWindow::NCursesWindow(NCursesWindow& win, - bool do_box NCURSES_PARAM_INIT(TRUE)) -{ - initialize(); - w = :: derwin(win.w,win.height()-2,win.width()-2,1,1); - if (w == 0) { - err_handler("Cannot construct subwindow"); - } - - par = &win; - sib = win.subwins; - win.subwins = this; - subwins = 0; - alloced = TRUE; - count++; - - if (do_box) { - win.box(); - win.touchwin(); - } -} - -NCursesWindow NCursesWindow::Clone() { - WINDOW *d = ::dupwin(w); - NCursesWindow W(d); - W.subwins = subwins; - W.sib = sib; - W.par = par; - W.alloced = alloced; - return W; -} - -typedef int (*RIPOFFINIT)(NCursesWindow&); -static RIPOFFINIT R_INIT[5]; // There can't be more -static int r_init_idx = 0; -static RIPOFFINIT* prip = R_INIT; - -extern "C" int _nc_ripoffline(int,int (*init)(WINDOW*,int)); - -NCursesWindow::NCursesWindow(WINDOW *win, int cols) { - initialize(); - w = win; - assert((w->_maxx+1)==cols); - alloced = FALSE; - subwins = par = sib = 0; -} - -int NCursesWindow::ripoff_init(WINDOW *w, int cols) -{ - int res = ERR; - - RIPOFFINIT init = *prip++; - if (init) { - NCursesWindow* W = new NCursesWindow(w,cols); - res = init(*W); - } - return res; -} - -int NCursesWindow::ripoffline(int ripoff_lines, - int (*init)(NCursesWindow& win)) { - int code = ::_nc_ripoffline(ripoff_lines,ripoff_init); - if (code==OK && init && ripoff_lines) { - R_INIT[r_init_idx++] = init; - } - return code; -} - -bool -NCursesWindow::isDescendant(NCursesWindow& win) { - for (NCursesWindow* p = subwins; p != NULL; p = p->sib) { - if (p==&win) - return TRUE; - else { - if (p->isDescendant(win)) - return TRUE; - } - } - return FALSE; -} - -void -NCursesWindow::kill_subwindows() -{ - for (NCursesWindow* p = subwins; p != 0; p = p->sib) { - p->kill_subwindows(); - if (p->alloced) { - if (p->w != 0) - ::delwin(p->w); - p->alloced = FALSE; - } - p->w = 0; // cause a run-time error if anyone attempts to use... - } -} - - -NCursesWindow::~NCursesWindow() -{ - kill_subwindows(); - - if (par != 0) { // Snip us from the parent's list of subwindows. - NCursesWindow * win = par->subwins; - NCursesWindow * trail = 0; - for (;;) { - if (win == 0) - break; - else if (win == this) { - if (trail != 0) - trail->sib = win->sib; - else - par->subwins = win->sib; - break; - } else { - trail = win; - win = win->sib; - } - } - } - - if (alloced && w != 0) - ::delwin(w); - - if (alloced) { - --count; - if (count == 0) { - ::endwin(); - } - else if (count < 0) { // cannot happen! - err_handler("Too many windows destroyed"); - } - } -} - -// --------------------------------------------------------------------- -// Color stuff -// -int NCursesWindow::colorInitialized = COLORS_NOT_INITIALIZED; - -void -NCursesWindow::useColors(void) -{ - if (colorInitialized == COLORS_NOT_INITIALIZED) { - if (b_initialized) { - if (::has_colors()) { - ::start_color(); - colorInitialized = COLORS_ARE_REALLY_THERE; - } - else - colorInitialized = COLORS_MONOCHROME; - } - else - colorInitialized = COLORS_NEED_INITIALIZATION; - } -} - -short -NCursesWindow::getcolor(int getback) const -{ - short fore, back; - - if (colorInitialized==COLORS_ARE_REALLY_THERE) { - if (::pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back)) - err_handler("Can't get color pair"); - } - else { - // Monochrome means white on black - back = COLOR_BLACK; - fore = COLOR_WHITE; - } - return getback ? back : fore; -} - -int NCursesWindow::NumberOfColors() -{ - if (colorInitialized==COLORS_ARE_REALLY_THERE) - return COLORS; - else - return 1; // monochrome (actually there are two ;-) -} - -short -NCursesWindow::getcolor() const -{ - if (colorInitialized==COLORS_ARE_REALLY_THERE) - return PAIR_NUMBER(w->_attrs); - else - return 0; // we only have pair zero -} - -int -NCursesWindow::setpalette(short fore, short back, short pair) -{ - if (colorInitialized==COLORS_ARE_REALLY_THERE) - return ::init_pair(pair, fore, back); - else - return OK; -} - -int -NCursesWindow::setpalette(short fore, short back) -{ - if (colorInitialized==COLORS_ARE_REALLY_THERE) - return setpalette(fore, back, (short)PAIR_NUMBER(w->_attrs)); - else - return OK; -} - - -int -NCursesWindow::setcolor(short pair) -{ - if (colorInitialized==COLORS_ARE_REALLY_THERE) { - if ((pair < 1) || (pair > COLOR_PAIRS)) - err_handler("Can't set color pair"); - - attroff(A_COLOR); - attrset(COLOR_PAIR(pair)); - } - return OK; -} - -#if HAVE_HAS_KEY -extern "C" int _nc_has_mouse(void); - -bool NCursesWindow::has_mouse() const { - return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse()) - ? TRUE : FALSE); -} -#endif diff --git a/contrib/ncurses/c++/cursesw.h b/contrib/ncurses/c++/cursesw.h deleted file mode 100644 index 8e86ff99f0..0000000000 --- a/contrib/ncurses/c++/cursesw.h +++ /dev/null @@ -1,1396 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2001,2004 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. * - ****************************************************************************/ - -#ifndef NCURSES_CURSESW_H_incl -#define NCURSES_CURSESW_H_incl 1 - -// $Id: cursesw.h,v 1.30 2004/02/08 00:11:54 tom Exp $ - -#include -#include -#include - -#if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) -#include -#endif - -extern "C" { -# include -} - -/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. - Undefine it here, because NCursesWindow uses lines as a method. */ -#undef lines - -/* "Convert" macros to inlines. We'll define it as another symbol to avoid - * conflict with library symbols. - */ -#undef UNDEF -#define UNDEF(name) CUR_ ##name - -#ifdef addch -inline int UNDEF(addch)(chtype ch) { return addch(ch); } -#undef addch -#define addch UNDEF(addch) -#endif - -#ifdef echochar -inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } -#undef echochar -#define echochar UNDEF(echochar) -#endif - -#ifdef insdelln -inline int UNDEF(insdelln)(int n) { return insdelln(n); } -#undef insdelln -#define insdelln UNDEF(insdelln) -#endif - -#ifdef addstr -inline int UNDEF(addstr)(const char * str) { return addstr(str); } -#undef addstr -#define addstr UNDEF(addstr) -#endif - -#ifdef attron -inline int UNDEF(attron)(chtype at) { return attron(at); } -#undef attron -#define attron UNDEF(attron) -#endif - -#ifdef attroff -inline int UNDEF(attroff)(chtype at) { return attroff(at); } -#undef attroff -#define attroff UNDEF(attroff) -#endif - -#ifdef attrset -inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } -#undef attrset -#define attrset UNDEF(attrset) -#endif - -#ifdef color_set -inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); } -#undef color_set -#define color_set UNDEF(color_set) -#endif - -#ifdef border -inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) -{ return border(ls, rs, ts, bs, tl, tr, bl, br); } -#undef border -#define border UNDEF(border) -#endif - -#ifdef box -inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } -#undef box -#define box UNDEF(box) -#endif - -#ifdef mvwhline -inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwhline(win, y, x, c, n); } -#undef mvwhline -#define mvwhline UNDEF(mvwhline) -#endif - -#ifdef mvwvline -inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwvline(win, y, x, c, n); } -#undef mvwvline -#define mvwvline UNDEF(mvwvline) -#endif - -#ifdef clear -inline int UNDEF(clear)() { return clear(); } -#undef clear -#define clear UNDEF(clear) -#endif - -#ifdef clearok -inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } -#undef clearok -#define clearok UNDEF(clearok) -#else -extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); -#endif - -#ifdef clrtobot -inline int UNDEF(clrtobot)() { return clrtobot(); } -#undef clrtobot -#define clrtobot UNDEF(clrtobot) -#endif - -#ifdef clrtoeol -inline int UNDEF(clrtoeol)() { return clrtoeol(); } -#undef clrtoeol -#define clrtoeol UNDEF(clrtoeol) -#endif - -#ifdef delch -inline int UNDEF(delch)() { return delch(); } -#undef delch -#define delch UNDEF(delch) -#endif - -#ifdef deleteln -inline int UNDEF(deleteln)() { return deleteln(); } -#undef deleteln -#define deleteln UNDEF(deleteln) -#endif - -#ifdef erase -inline int UNDEF(erase)() { return erase(); } -#undef erase -#define erase UNDEF(erase) -#endif - -#ifdef flushok -inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { - return flushok(_win, _bf); } -#undef flushok -#define flushok UNDEF(flushok) -#else -#define _no_flushok -#endif - -#ifdef getch -inline int UNDEF(getch)() { return getch(); } -#undef getch -#define getch UNDEF(getch) -#endif - -#ifdef getstr -inline int UNDEF(getstr)(char *_str) { return getstr(_str); } -#undef getstr -#define getstr UNDEF(getstr) -#endif - -#ifdef instr -inline int UNDEF(instr)(char *_str) { return instr(_str); } -#undef instr -#define instr UNDEF(instr) -#endif - -#ifdef innstr -inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } -#undef innstr -#define innstr UNDEF(innstr) -#endif - -#ifdef mvwinnstr -inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { - return mvwinnstr(win, y, x, _str, n); } -#undef mvwinnstr -#define mvwinnstr UNDEF(mvwinnstr) -#endif - -#ifdef mvinnstr -inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { - return mvinnstr(y, x, _str, n); } -#undef mvinnstr -#define mvinnstr UNDEF(mvinnstr) -#endif - -#ifdef winsstr -inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { - return winsstr(w, _str); } -#undef winsstr -#define winsstr UNDEF(winsstr) -#endif - -#ifdef mvwinsstr -inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { - return mvwinsstr(w, y, x, _str); } -#undef mvwinsstr -#define mvwinsstr UNDEF(mvwinsstr) -#endif - -#ifdef insstr -inline int UNDEF(insstr)(const char *_str) { - return insstr(_str); } -#undef insstr -#define insstr UNDEF(insstr) -#endif - -#ifdef mvinsstr -inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { - return mvinsstr(y, x, _str); } -#undef mvinsstr -#define mvinsstr UNDEF(mvinsstr) -#endif - -#ifdef insnstr -inline int UNDEF(insnstr)(const char *_str, int n) { - return insnstr(_str, n); } -#undef insnstr -#define insnstr UNDEF(insnstr) -#endif - -#ifdef mvwinsnstr -inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { - return mvwinsnstr(w, y, x, _str, n); } -#undef mvwinsnstr -#define mvwinsnstr UNDEF(mvwinsnstr) -#endif - -#ifdef mvinsnstr -inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { - return mvinsnstr(y, x, _str, n); } -#undef mvinsnstr -#define mvinsnstr UNDEF(mvinsnstr) -#endif - -#ifdef getnstr -inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } -#undef getnstr -#define getnstr UNDEF(getnstr) -#endif - -#ifdef getyx -inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { - getyx(win, y, x); } -#undef getyx -#define getyx UNDEF(getyx) -#endif - -#ifdef getbegyx -inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } -#undef getbegyx -#define getbegyx UNDEF(getbegyx) -#endif - -#ifdef getmaxyx -inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } -#undef getmaxyx -#define getmaxyx UNDEF(getmaxyx) -#endif - -#ifdef hline -inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } -#undef hline -#define hline UNDEF(hline) -#endif - -#ifdef inch -inline chtype UNDEF(inch)() { return inch(); } -#undef inch -#define inch UNDEF(inch) -#endif - -#ifdef insch -inline int UNDEF(insch)(char c) { return insch(c); } -#undef insch -#define insch UNDEF(insch) -#endif - -#ifdef insertln -inline int UNDEF(insertln)() { return insertln(); } -#undef insertln -#define insertln UNDEF(insertln) -#endif - -#ifdef leaveok -inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } -#undef leaveok -#define leaveok UNDEF(leaveok) -#else -extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); -#endif - -#ifdef move -inline int UNDEF(move)(int x, int y) { return move(x, y); } -#undef move -#define move UNDEF(move) -#endif - -#ifdef refresh -inline int UNDEF(refresh)() { return refresh(); } -#undef refresh -#define refresh UNDEF(refresh) -#endif - -#ifdef redrawwin -inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } -#undef redrawwin -#define redrawwin UNDEF(redrawwin) -#endif - -#ifdef scrl -inline int UNDEF(scrl)(int l) { return scrl(l); } -#undef scrl -#define scrl UNDEF(scrl) -#endif - -#ifdef scroll -inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } -#undef scroll -#define scroll UNDEF(scroll) -#endif - -#ifdef scrollok -inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } -#undef scrollok -#define scrollok UNDEF(scrollok) -#else -#if defined(__NCURSES_H) -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); -#else -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); -#endif -#endif - -#ifdef setscrreg -inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } -#undef setscrreg -#define setscrreg UNDEF(setscrreg) -#endif - -#ifdef standend -inline int UNDEF(standend)() { return standend(); } -#undef standend -#define standend UNDEF(standend) -#endif - -#ifdef standout -inline int UNDEF(standout)() { return standout(); } -#undef standout -#define standout UNDEF(standout) -#endif - -#ifdef subpad -inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) -{ return derwin(p, l, c, y, x); } -#undef subpad -#define subpad UNDEF(subpad) -#endif - -#ifdef timeout -inline void UNDEF(timeout)(int delay) { timeout(delay); } -#undef timeout -#define timeout UNDEF(timeout) -#endif - -#ifdef touchline -inline int UNDEF(touchline)(WINDOW *win, int s, int c) -{ return touchline(win, s, c); } -#undef touchline -#define touchline UNDEF(touchline) -#endif - -#ifdef touchwin -inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } -#undef touchwin -#define touchwin UNDEF(touchwin) -#endif - -#ifdef untouchwin -inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } -#undef untouchwin -#define untouchwin UNDEF(untouchwin) -#endif - -#ifdef vline -inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } -#undef vline -#define vline UNDEF(vline) -#endif - -#ifdef waddstr -inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } -#undef waddstr -#define waddstr UNDEF(waddstr) -#endif - -#ifdef waddchstr -inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } -#undef waddchstr -#define waddchstr UNDEF(waddchstr) -#endif - -#ifdef wstandend -inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } -#undef wstandend -#define wstandend UNDEF(wstandend) -#endif - -#ifdef wstandout -inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } -#undef wstandout -#define wstandout UNDEF(wstandout) -#endif - - -#ifdef wattroff -inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } -#undef wattroff -#define wattroff UNDEF(wattroff) -#endif - -#ifdef chgat -inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) { - return chgat(n, attr, color, opts); } -#undef chgat -#define chgat UNDEF(chgat) -#endif - -#ifdef mvchgat -inline int UNDEF(mvchgat)(int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvchgat(y, x, n, attr, color, opts); } -#undef mvchgat -#define mvchgat UNDEF(mvchgat) -#endif - -#ifdef mvwchgat -inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvwchgat(win, y, x, n, attr, color, opts); } -#undef mvwchgat -#define mvwchgat UNDEF(mvwchgat) -#endif - -#ifdef wattrset -inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } -#undef wattrset -#define wattrset UNDEF(wattrset) -#endif - -#ifdef winch -inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } -#undef winch -#define winch UNDEF(winch) -#endif - -#ifdef mvwaddch -inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) -{ return mvwaddch(win, y, x, ch); } -#undef mvwaddch -#define mvwaddch UNDEF(mvwaddch) -#endif - -#ifdef mvwaddchnstr -inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, chtype *str, int n) -{ return mvwaddchnstr(win, y, x, str, n); } -#undef mvwaddchnstr -#define mvwaddchnstr UNDEF(mvwaddchnstr) -#endif - -#ifdef mvwaddchstr -inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, chtype *str) -{ return mvwaddchstr(win, y, x, str); } -#undef mvwaddchstr -#define mvwaddchstr UNDEF(mvwaddchstr) -#endif - -#ifdef addnstr -inline int UNDEF(addnstr)(const char *str, int n) -{ return addnstr(str, n); } -#undef addnstr -#define addnstr UNDEF(addnstr) -#endif - -#ifdef mvwaddnstr -inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) -{ return mvwaddnstr(win, y, x, str, n); } -#undef mvwaddnstr -#define mvwaddnstr UNDEF(mvwaddnstr) -#endif - -#ifdef mvwaddstr -inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) -{ return mvwaddstr(win, y, x, str); } -#undef mvwaddstr -#define mvwaddstr UNDEF(mvwaddstr) -#endif - -#ifdef mvwdelch -inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) -{ return mvwdelch(win, y, x); } -#undef mvwdelch -#define mvwdelch UNDEF(mvwdelch) -#endif - -#ifdef mvwgetch -inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} -#undef mvwgetch -#define mvwgetch UNDEF(mvwgetch) -#endif - -#ifdef mvwgetstr -inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) -{return mvwgetstr(win, y, x, str);} -#undef mvwgetstr -#define mvwgetstr UNDEF(mvwgetstr) -#endif - -#ifdef mvwgetnstr -inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) -{return mvwgetnstr(win, y, x, str, n);} -#undef mvwgetnstr -#define mvwgetnstr UNDEF(mvwgetnstr) -#endif - -#ifdef mvwinch -inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { - return mvwinch(win, y, x);} -#undef mvwinch -#define mvwinch UNDEF(mvwinch) -#endif - -#ifdef mvwinsch -inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, char c) -{ return mvwinsch(win, y, x, c); } -#undef mvwinsch -#define mvwinsch UNDEF(mvwinsch) -#endif - -#ifdef mvaddch -inline int UNDEF(mvaddch)(int y, int x, chtype ch) -{ return mvaddch(y, x, ch); } -#undef mvaddch -#define mvaddch UNDEF(mvaddch) -#endif - -#ifdef mvaddnstr -inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) -{ return mvaddnstr(y, x, str, n); } -#undef mvaddnstr -#define mvaddnstr UNDEF(mvaddnstr) -#endif - -#ifdef mvaddstr -inline int UNDEF(mvaddstr)(int y, int x, const char * str) -{ return mvaddstr(y, x, str); } -#undef mvaddstr -#define mvaddstr UNDEF(mvaddstr) -#endif - -#ifdef mvdelch -inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} -#undef mvdelch -#define mvdelch UNDEF(mvdelch) -#endif - -#ifdef mvgetch -inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} -#undef mvgetch -#define mvgetch UNDEF(mvgetch) -#endif - -#ifdef mvgetstr -inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} -#undef mvgetstr -#define mvgetstr UNDEF(mvgetstr) -#endif - -#ifdef mvgetnstr -inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { - return mvgetnstr(y, x, str, n);} -#undef mvgetnstr -#define mvgetnstr UNDEF(mvgetnstr) -#endif - -#ifdef mvinch -inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} -#undef mvinch -#define mvinch UNDEF(mvinch) -#endif - -#ifdef mvinsch -inline int UNDEF(mvinsch)(int y, int x, char c) -{ return mvinsch(y, x, c); } -#undef mvinsch -#define mvinsch UNDEF(mvinsch) -#endif - -#ifdef napms -inline void UNDEF(napms)(unsigned long x) { napms(x); } -#undef napms -#define napms UNDEF(napms) -#endif - -#ifdef fixterm -inline int UNDEF(fixterm)(void) { return fixterm(); } -#undef fixterm -#define fixterm UNDEF(fixterm) -#endif - -#ifdef resetterm -inline int UNDEF(resetterm)(void) { return resetterm(); } -#undef resetterm -#define resetterm UNDEF(resetterm) -#endif - -#ifdef saveterm -inline int UNDEF(saveterm)(void) { return saveterm(); } -#undef saveterm -#define saveterm UNDEF(saveterm) -#endif - -#ifdef crmode -inline int UNDEF(crmode)(void) { return crmode(); } -#undef crmode -#define crmode UNDEF(crmode) -#endif - -#ifdef nocrmode -inline int UNDEF(nocrmode)(void) { return nocrmode(); } -#undef nocrmode -#define nocrmode UNDEF(nocrmode) -#endif - -#ifdef getbkgd -inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } -#undef getbkgd -#define getbkgd UNDEF(getbkgd) -#endif - -#ifdef bkgd -inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } -#undef bkgd -#define bkgd UNDEF(bkgd) -#endif - -#ifdef bkgdset -inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } -#undef bkgdset -#define bkgdset UNDEF(bkgdset) -#endif - -/* - * - * C++ class for windows. - * - * - */ - -class NCURSES_IMPEXP NCursesWindow -{ - friend class NCursesMenu; - friend class NCursesForm; - -private: - static bool b_initialized; - static void initialize(); - static int ripoff_init(WINDOW *, int); - - void init(); - - short getcolor(int getback) const; - - static int setpalette(short fore, short back, short pair); - static int colorInitialized; - - // This private constructor is only used during the initialization - // of windows generated by ripoffline() calls. - NCursesWindow(WINDOW* win, int cols); - -protected: - void err_handler(const char *) const THROWS(NCursesException); - // Signal an error with the given message text. - - static long count; // count of all active windows: - // We rely on the c++ promise that - // all otherwise uninitialized - // static class vars are set to 0 - - WINDOW* w; // the curses WINDOW - - bool alloced; // TRUE if we own the WINDOW - - NCursesWindow* par; // parent, if subwindow - NCursesWindow* subwins; // head of subwindows list - NCursesWindow* sib; // next subwindow of parent - - void kill_subwindows(); // disable all subwindows - // Destroy all subwindows. - - /* Only for use by derived classes. They are then in charge to - fill the member variables correctly. */ - NCursesWindow(); - -public: - NCursesWindow(WINDOW* &window); // useful only for stdscr - - NCursesWindow(int lines, // number of lines - int cols, // number of columns - int begin_y, // line origin - int begin_x); // col origin - - NCursesWindow(NCursesWindow& par,// parent window - int lines, // number of lines - int cols, // number of columns - int begin_y, // absolute or relative - int begin_x, // origins: - 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 - bool do_box = TRUE); - // this is the very common case that we want to create the subwindow that - // is two lines and two columns smaller and begins at (1,1). - // We may automatically request the box around it. - - virtual ~NCursesWindow(); - - NCursesWindow Clone(); - // Make an exact copy of the window. - - // Initialization. - static void useColors(void); - // Call this routine very early if you want to have colors. - - static int ripoffline(int ripoff_lines, - int (*init)(NCursesWindow& win)); - // This function is used to generate a window of ripped-of lines. - // If the argument is positive, lines are removed from the top, if it - // is negative lines are removed from the bottom. This enhances the - // 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 deferred until ncurses gets initialized. - // The initialization function is then called. - - // ------------------------------------------------------------------------- - // terminal status - // ------------------------------------------------------------------------- - int lines() const { initialize(); return LINES; } - // Number of lines on terminal, *not* window - - int cols() const { initialize(); return COLS; } - // Number of cols on terminal, *not* window - - int tabsize() const { initialize(); return TABSIZE; } - // Size of a tab on terminal, *not* window - - static int NumberOfColors(); - // Number of available colors - - int colors() const { return NumberOfColors(); } - // Number of available colors - - // ------------------------------------------------------------------------- - // window status - // ------------------------------------------------------------------------- - int height() const { return maxy() + 1; } - // Number of lines in this window - - int width() const { return maxx() + 1; } - // Number of columns in this window - - int begx() const { return w->_begx; } - // Column of top left corner relative to stdscr - - int begy() const { return w->_begy; } - // Line of top left corner relative to stdscr - - int maxx() const { return w->_maxx; } - // Largest x coord in window - - int maxy() const { return w->_maxy; } - // Largest y coord in window - - short getcolor() const; - // Actual color pair - - short foreground() const { return getcolor(0); } - // Actual foreground color - - short background() const { return getcolor(1); } - // Actual background color - - int setpalette(short fore, short back); - // Set color palette entry - - int setcolor(short pair); - // Set actually used palette entry - - // ------------------------------------------------------------------------- - // window positioning - // ------------------------------------------------------------------------- - 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. - - // ------------------------------------------------------------------------- - // coordinate positioning - // ------------------------------------------------------------------------- - int move(int y, int x) { return ::wmove(w, y, x); } - // Move cursor the this position - - void getyx(int& y, int& x) const { ::getyx(w, y, x); } - // Get current position of the cursor - - int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { - return ::mvcur(oldrow, oldcol, newrow, newcol); } - // Perform lowlevel cursor motion that takes effect immediately. - - // ------------------------------------------------------------------------- - // input - // ------------------------------------------------------------------------- - int getch() { return ::wgetch(w); } - // Get a keystroke from the window. - - int getch(int y, int x) { return ::mvwgetch(w, y, x); } - // Move cursor to position and get a keystroke from the window - - int getstr(char* str, int n=-1) { - return ::wgetnstr(w, str, n); } - // Read a series of characters into str until a newline or carriage return - // is received. Read at most n characters. If n is negative, the limit is - // ignored. - - int getstr(int y, int x, char* str, int n=-1) { - return ::mvwgetnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the getstr() - // as described above. - - int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } - // Get a string of characters from the window into the buffer s. Retrieve - // at most n characters, if n is negative retrieve all characters up to the - // end of the current line. Attributes are stripped from the characters. - - int instr(int y, int x, char *s, int n=-1) { - return ::mvwinnstr(w, y, x, s, n); } - // Move the cursor to the requested position and then perform the instr() - // as described above. - - int scanw(const char* fmt, ...) - // Perform a scanw function from the window. -#if __GNUG__ >= 2 - __attribute__ ((format (scanf, 2, 3))); -#else - ; -#endif - - int scanw(int y, int x, const char* fmt, ...) - // Move the cursor to the requested position and then perform a scanw - // from the window. -#if __GNUG__ >= 2 - __attribute__ ((format (scanf, 4, 5))); -#else - ; -#endif - - // ------------------------------------------------------------------------- - // output - // ------------------------------------------------------------------------- - int addch(const chtype ch) { return ::waddch(w, ch); } - // Put attributed character to the window. - - int addch(int y, int x, const chtype ch) { - return ::mvwaddch(w, y, x, ch); } - // Move cursor to the requested position and then put attributed character - // to the window. - - int echochar(const chtype ch) { return ::wechochar(w, ch); } - // Put attributed character to the window and refresh it immediately. - - int addstr(const char* str, int n=-1) { - return ::waddnstr(w, str, n); } - // Write the string str to the window, stop writing if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int addstr(int y, int x, const char * str, int n=-1) { - return ::mvwaddnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the addstr - // as described above. - - int printw(const char* fmt, ...) - // Do a formatted print to the window. -#if (__GNUG__ >= 2) && !defined(printf) - __attribute__ ((format (printf, 2, 3))); -#else - ; -#endif - - int printw(int y, int x, const char * fmt, ...) - // Move the cursor and then do a formatted print to the window. -#if (__GNUG__ >= 2) && !defined(printf) - __attribute__ ((format (printf, 4, 5))); -#else - ; -#endif - - chtype inch() const { return ::winch(w); } - // Retrieve attributed character under the current cursor position. - - chtype inch(int y, int x) { return ::mvwinch(w, y, x); } - // Move cursor to requested position and then retrieve attributed character - // at this position. - - int insch(chtype ch) { return ::winsch(w, ch); } - // Insert attributed character into the window before current cursor - // position. - - int insch(int y, int x, chtype ch) { - return ::mvwinsch(w, y, x, ch); } - // Move cursor to requested position and then insert the attributed - // character before that position. - - int insertln() { return ::winsdelln(w, 1); } - // Insert an empty line above the current line. - - int insdelln(int n=1) { return ::winsdelln(w, n); } - // If n>0 insert that many lines above the current line. If n<0 delete - // that many lines beginning with the current line. - - int insstr(const char *s, int n=-1) { - return ::winsnstr(w, s, n); } - // Insert the string into the window before the current cursor position. - // Insert stops at end of string or when the limit n is reached. If n is - // negative, it is ignored. - - int insstr(int y, int x, const char *s, int n=-1) { - return ::mvwinsnstr(w, y, x, s, n); } - // Move the cursor to the requested position and then perform the insstr() - // as described above. - - int attron (chtype at) { return ::wattron (w, at); } - // Switch on the window attributes; - - int attroff(chtype at) { return ::wattroff(w, (int) at); } - // Switch off the window attributes; - - int attrset(chtype at) { return ::wattrset(w, (int) at); } - // Set the window attributes; - - int color_set(short color_pair_number, void* opts=NULL) { - return ::wcolor_set(w, color_pair_number, opts); } - // Set the window color attribute; - - int chgat(int n, attr_t attr, short color, const void *opts=NULL) { - return ::wchgat(w, n, attr, color, opts); } - // Change the attributes of the next n characters in the current line. If - // n is negative or greater than the number of remaining characters in the - // line, the attributes will be changed up to the end of the line. - - int chgat(int y, int x, - int n, attr_t attr, short color, const void *opts=NULL) { - return ::mvwchgat(w, y, x, n, attr, color, opts); } - // Move the cursor to the requested position and then perform chgat() as - // described above. - - // ------------------------------------------------------------------------- - // background - // ------------------------------------------------------------------------- - chtype getbkgd() const { return ::getbkgd(w); } - // Get current background setting. - - int bkgd(const chtype ch) { return ::wbkgd(w, ch); } - // Set the background property and apply it to the window. - - void bkgdset(chtype ch) { ::wbkgdset(w, ch); } - // Set the background property. - - // ------------------------------------------------------------------------- - // borders - // ------------------------------------------------------------------------- - 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 specify a zero as character, curses will try - // to find a "nice" character. - - int border(chtype left=0, chtype right=0, - chtype top =0, chtype bottom=0, - chtype top_left =0, chtype top_right=0, - chtype bottom_left =0, chtype bottom_right=0) { - return ::wborder(w, left, right, top, bottom, top_left, top_right, - bottom_left, bottom_right); } - // Draw a border around the window with the given characters for the - // various parts of the border. If you pass zero for a character, curses - // will try to find "nice" characters. - - // ------------------------------------------------------------------------- - // lines and boxes - // ------------------------------------------------------------------------- - int hline(int len, chtype ch=0) { return ::whline(w, ch, len); } - // Draw a horizontal line of len characters with the given character. If - // you pass zero for the character, curses will try to find a "nice" one. - - int hline(int y, int x, int len, chtype ch=0) { - return ::mvwhline(w, y, x, ch, len); } - // Move the cursor to the requested position and then draw a horizontal line. - - int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); } - // Draw a vertical line of len characters with the given character. If - // you pass zero for the character, curses will try to find a "nice" one. - - int vline(int y, int x, int len, chtype ch=0) { - return ::mvwvline(w, y, x, ch, len); } - // Move the cursor to the requested position and then draw a vertical line. - - // ------------------------------------------------------------------------- - // erasure - // ------------------------------------------------------------------------- - int erase() { return ::werase(w); } - // Erase the window. - - int clear() { return ::wclear(w); } - // Clear the window. - - int clearok(bool bf) { return ::clearok(w, bf); } - // Set/Reset the clear flag. If set, the next refresh() will clear the - // screen. - - int clrtobot() { return ::wclrtobot(w); } - // Clear to the end of the window. - - int clrtoeol() { return ::wclrtoeol(w); } - // Clear to the end of the line. - - int delch() { return ::wdelch(w); } - // Delete character under the cursor. - - int delch(int y, int x) { return ::mvwdelch(w, y, x); } - // Move cursor to requested position and delete the character under the - // cursor. - - int deleteln() { return ::winsdelln(w, -1); } - // Delete the current line. - - // ------------------------------------------------------------------------- - // screen control - // ------------------------------------------------------------------------- - int scroll(int amount=1) { return ::wscrl(w, amount); } - // Scroll amount lines. If amount is positive, scroll up, otherwise - // scroll down. - - int scrollok(bool bf) { return ::scrollok(w, bf); } - // If bf is TRUE, window scrolls if cursor is moved off the bottom - // edge of the window or a scrolling region, otherwise the cursor is left - // at the bottom line. - - int setscrreg(int from, int to) { - return ::wsetscrreg(w, from, to); } - // Define a soft scrolling region. - - int idlok(bool bf) { return ::idlok(w, bf); } - // If bf is TRUE, use insert/delete line hardware support if possible. - // Otherwise do it in software. - - - void idcok(bool bf) { ::idcok(w, bf); } - // If bf is TRUE, use insert/delete character hardware support if possible. - // Otherwise do it in software. - - int touchwin() { return ::wtouchln(w, 0, height(), 1); } - // Mark the whole window as modified. - - int untouchwin() { return ::wtouchln(w, 0, height(), 0); } - // Mark the whole window as unmodified. - - int touchln(int s, int cnt, bool changed=TRUE) { - return ::wtouchln(w, s, cnt, (int)(changed?1:0)); } - // Mark cnt lines beginning from line s as changed or unchanged, depending - // on the value of the changed flag. - - bool is_linetouched(int line) const { - return (::is_linetouched(w, line) ? TRUE:FALSE); } - // Return TRUE if line is marked as changed, FALSE otherwise - - bool is_wintouched() const { - return (::is_wintouched(w) ? TRUE:FALSE); } - // Return TRUE if window is marked as changed, FALSE otherwise - - int leaveok(bool bf) { return ::leaveok(w, bf); } - // If bf is TRUE, curses will leave the cursor after an update whereever - // it is after the update. - - int redrawln(int from, int n) { return ::wredrawln(w, from, n); } - // Redraw n lines starting from the requested line - - int redrawwin() { return ::wredrawln(w, 0, height()); } - // Redraw the whole window - - int doupdate() { return ::doupdate(); } - // Do all outputs to make the physical screen looking like the virtual one - - void syncdown() { ::wsyncdown(w); } - // Propagate the changes down to all descendant windows - - void syncup() { ::wsyncup(w); } - // Propagate the changes up in the hierarchy - - void cursyncup() { ::wcursyncup(w); } - // Position the cursor in all ancestor windows corresponding to our setting - - int syncok(bool bf) { return ::syncok(w, bf); } - // If called with bf=TRUE, syncup() is called whenever the window is changed - -#ifndef _no_flushok - int flushok(bool bf) { return ::flushok(w, bf); } -#endif - - void immedok(bool bf) { ::immedok(w, bf); } - // If called with bf=TRUE, any change in the window will cause an - // automatic immediate refresh() - - int keypad(bool bf) { return ::keypad(w, bf); } - // If called with bf=TRUE, the application will interpret function keys. - - int meta(bool bf) { return ::meta(w, bf); } - // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise - // 7-Bit characters are generated. - - int standout() { return ::wstandout(w); } - // Enable "standout" attributes - - int standend() { return ::wstandend(w); } - // Disable "standout" attributes - - // ------------------------------------------------------------------------- - // The next two are virtual, because we redefine them in the - // NCursesPanel class. - // ------------------------------------------------------------------------- - virtual int refresh() { return ::wrefresh(w); } - // Propagate the changes in this window to the virtual screen and call - // doupdate(). This is redefined in NCursesPanel. - - virtual int noutrefresh() { return ::wnoutrefresh(w); } - // Propagate the changes in this window to the virtual screen. This is - // redefined in NCursesPanel. - - // ------------------------------------------------------------------------- - // multiple window control - // ------------------------------------------------------------------------- - int overlay(NCursesWindow& win) { - return ::overlay(w, win.w); } - // Overlay this window over win. - - int overwrite(NCursesWindow& win) { - return ::overwrite(w, win.w); } - // Overwrite win with this window. - - int copywin(NCursesWindow& win, - int sminrow, int smincol, - int dminrow, int dmincol, - int dmaxrow, int dmaxcol, bool overlay=TRUE) { - return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, - dmaxrow, dmaxcol, (int)(overlay?1:0)); } - // Overlay or overwrite the rectangle in win given by dminrow,dmincol, - // dmaxrow,dmaxcol with the rectangle in this window beginning at - // sminrow,smincol. - - // ------------------------------------------------------------------------- - // Mouse related - // ------------------------------------------------------------------------- - bool has_mouse() const; - // Return TRUE if terminal supports a mouse, FALSE otherwise - - // ------------------------------------------------------------------------- - // traversal support - // ------------------------------------------------------------------------- - NCursesWindow* child() { return subwins; } - // Get the first child window. - - NCursesWindow* sibling() { return sib; } - // Get the next child of my parent. - - NCursesWindow* parent() { return par; } - // Get my parent. - - bool isDescendant(NCursesWindow& win); - // Return TRUE if win is a descendant of this. -}; - -// ------------------------------------------------------------------------- -// We leave this here for compatibility reasons. -// ------------------------------------------------------------------------- -class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow { -public: - NCursesColorWindow(WINDOW* &window) // useful only for stdscr - : NCursesWindow(window) { - useColors(); } - - NCursesColorWindow(int lines, // number of lines - int cols, // number of columns - int begin_y, // line origin - int begin_x) // col origin - : NCursesWindow(lines, cols, begin_y, begin_x) { - useColors(); } - - NCursesColorWindow(NCursesWindow& par,// parent window - int lines, // number of lines - int cols, // number of columns - int begin_y, // absolute or relative - int begin_x, // origins: - char absrel = 'a') // if `a', by & bx are - : NCursesWindow(par, lines, cols, // absolute screen pos, - begin_y, begin_x, // else if `r', they are - absrel ) { // relative to par origin - useColors(); } -}; - -// These enum definitions really belong inside the NCursesPad class, but only -// recent compilers support that feature. - - typedef enum { - REQ_PAD_REFRESH = KEY_MAX + 1, - REQ_PAD_UP, - REQ_PAD_DOWN, - REQ_PAD_LEFT, - REQ_PAD_RIGHT, - REQ_PAD_EXIT - } Pad_Request; - - const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code - const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code - -// ------------------------------------------------------------------------- -// Pad Support. We allow an association of a pad with a "real" window -// through which the pad may be viewed. -// ------------------------------------------------------------------------- -class NCURSES_IMPEXP NCursesPad : public NCursesWindow { -private: - NCursesWindow* viewWin; // the "viewport" window - NCursesWindow* viewSub; // the "viewport" subwindow - - int h_gridsize, v_gridsize; - -protected: - int min_row, min_col; // top left row/col of the pads display area - - NCursesWindow* Win(void) const { - // Get the window into which the pad should be copied (if any) - return (viewSub?viewSub:(viewWin?viewWin:0)); - } - - NCursesWindow* getWindow(void) const { - return viewWin; - } - - NCursesWindow* getSubWindow(void) const { - return viewSub; - } - - virtual int driver (int key); // Virtualize keystroke key - // The driver translates the keystroke c into an Pad_Request - - virtual void OnUnknownOperation(int pad_req) { - ::beep(); - } - // This is called if the driver returns an unknown op-code - - virtual void OnNavigationError(int pad_req) { - ::beep(); - } - // This is called if a navigation request couldn't be satisfied - - virtual void OnOperation(int pad_req) { - }; - // OnOperation is called if a Pad_Operation was executed and just before - // the refresh() operation is done. - -public: - NCursesPad(int lines, int cols); - // create a pad with the given size - - virtual ~NCursesPad() {} - - int echochar(const chtype ch) { return ::pechochar(w, ch); } - // Put the attributed character onto the pad and immediately do a - // prefresh(). - - int refresh(); - // If a viewport is defined the pad is displayed in this window, otherwise - // this is a noop. - - int refresh(int pminrow, int pmincol, - int sminrow, int smincol, - int smaxrow, int smaxcol) { - return ::prefresh(w, pminrow, pmincol, - sminrow, smincol, smaxrow, smaxcol); - } - // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle - // on the screen. refresh copies a rectangle of this size beginning - // with top left corner pminrow,pmincol onto the screen and calls doupdate(). - - int noutrefresh(); - // If a viewport is defined the pad is displayed in this window, otherwise - // this is a noop. - - int noutrefresh(int pminrow, int pmincol, - int sminrow, int smincol, - int smaxrow, int smaxcol) { - return ::pnoutrefresh(w, pminrow, pmincol, - sminrow, smincol, smaxrow, smaxcol); - } - // Does the same as refresh() but without calling doupdate(). - - virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1); - // Add the window "view" as viewing window to the pad. - - virtual void setSubWindow(NCursesWindow& sub); - // Use the subwindow "sub" of the viewport window for the actual viewing. - // The full viewport window is usually used to provide some decorations - // like frames, titles etc. - - virtual void operator() (void); - // Perform Pad's operation -}; - -// A FramedPad is constructed always with a viewport window. This viewport -// will be framed (by a box() command) and the interior of the box is the -// viewport subwindow. On the frame we display scrollbar sliders. -class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad { -protected: - virtual void OnOperation(int pad_req); - -public: - NCursesFramedPad(NCursesWindow& win, int lines, int cols, - int v_grid = 1, int h_grid = 1) - : NCursesPad(lines, cols) { - NCursesPad::setWindow(win, v_grid, h_grid); - NCursesPad::setSubWindow(*(new NCursesWindow(win))); - } - // Construct the FramedPad with the given Window win as viewport. - - virtual ~NCursesFramedPad() { - delete getSubWindow(); - } - - void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { - err_handler("Operation not allowed"); - } - // Disable this call; the viewport is already defined - - void setSubWindow(NCursesWindow& sub) { - err_handler("Operation not allowed"); - } - // Disable this call; the viewport subwindow is already defined - -}; - -#endif // NCURSES_CURSESW_H_incl diff --git a/contrib/ncurses/c++/cursslk.cc b/contrib/ncurses/c++/cursslk.cc deleted file mode 100644 index fbc5cda40b..0000000000 --- a/contrib/ncurses/c++/cursslk.cc +++ /dev/null @@ -1,122 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursslk.h" -#include "cursesapp.h" -#include - -MODULE_ID("$Id: cursslk.cc,v 1.11 2003/10/25 15:04:46 tom Exp $") - -void Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) { - delete[] label; - label = new char[1 + ::strlen(text)]; - (::strcpy)(label,text); -} - -long Soft_Label_Key_Set::count = 0L; -int Soft_Label_Key_Set::num_labels = 0; - -Soft_Label_Key_Set::Label_Layout - Soft_Label_Key_Set::format = None; - -void Soft_Label_Key_Set::init() { - slk_array = new Soft_Label_Key[num_labels]; - for(int i=0; i < num_labels; i++) { - slk_array[i].num = i+1; - } - b_attrInit = FALSE; -} - -Soft_Label_Key_Set::Soft_Label_Key_Set() { - if (format==None) - Error("No default SLK layout"); - init(); -} - -Soft_Label_Key_Set::Soft_Label_Key_Set(Soft_Label_Key_Set::Label_Layout fmt) { - if (fmt==None) - Error("Invalid SLK Layout"); - if (count++==0) { - format = fmt; - if (ERR == ::slk_init((int)fmt)) - Error("slk_init"); - num_labels = (fmt>=PC_Style?12:8); - } - else if (fmt!=format) - Error("All SLKs must have same layout"); - init(); -} - -Soft_Label_Key_Set::~Soft_Label_Key_Set() { - if (!::isendwin()) - clear(); - delete[] slk_array; - count--; -} - -Soft_Label_Key_Set::Soft_Label_Key& Soft_Label_Key_Set::operator[](int i) { - if (i<1 || i>num_labels) - Error("Invalid Label index"); - return slk_array[i-1]; -} - -void Soft_Label_Key_Set::activate_label(int i, bool bf) { - if (!b_attrInit) { - NCursesApplication* A = NCursesApplication::getApplication(); - if (A) attrset(A->labels()); - b_attrInit = TRUE; - } - Soft_Label_Key& K = (*this)[i]; - if (ERR==::slk_set(K.num,bf?K.label:"",K.format)) - Error("slk_set"); - noutrefresh(); -} - -void Soft_Label_Key_Set::activate_labels(bool bf) { - if (!b_attrInit) { - NCursesApplication* A = NCursesApplication::getApplication(); - if (A) attrset(A->labels()); - b_attrInit = TRUE; - } - for(int i=1; i <= num_labels; i++) { - Soft_Label_Key& K = (*this)[i]; - if (ERR==::slk_set(K.num,bf?K.label:"",K.format)) - Error("slk_set"); - } - if (bf) - restore(); - else - clear(); - noutrefresh(); -} diff --git a/contrib/ncurses/c++/cursslk.h b/contrib/ncurses/c++/cursslk.h deleted file mode 100644 index 0fa1f11043..0000000000 --- a/contrib/ncurses/c++/cursslk.h +++ /dev/null @@ -1,205 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursslk.h,v 1.9 2003/10/25 15:04:46 tom Exp $ - -#ifndef NCURSES_CURSSLK_H_incl -#define NCURSES_CURSSLK_H_incl - -#include - -class NCURSES_IMPEXP Soft_Label_Key_Set { -public: - // This inner class represents the attributes of a Soft Label Key (SLK) - class NCURSES_IMPEXP Soft_Label_Key { - friend class Soft_Label_Key_Set; - public: - typedef enum { Left=0, Center=1, Right=2 } Justification; - - private: - char *label; // The Text of the Label - Justification format; // The Justification - int num; // The number of the Label - - Soft_Label_Key() : label((char*)0),format(Left),num(-1) { - } - - virtual ~Soft_Label_Key() { - delete[] label; - }; - - public: - // Set the text of the Label - void operator=(char *text); - - // Set the Justification of the Label - inline void operator=(Justification just) { - format = just; - } - - // Retrieve the text of the label - inline char* operator()(void) const { - return label; - } - }; - -public: - typedef enum { - None = -1, - Three_Two_Three = 0, - Four_Four = 1, - PC_Style = 2, - PC_Style_With_Index = 3 - } Label_Layout; - -private: - static long NCURSES_IMPEXP count; // Number of Key Sets - static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets - static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets - bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized - - Soft_Label_Key *slk_array; // The array of SLK's - - // Init the Key Set - void init(); - - // Activate or Deactivate Label# i, Label counting starts with 1! - void activate_label(int i, bool bf=TRUE); - - // Activate of Deactivate all Labels - void activate_labels(bool bf); - -protected: - inline void Error (const char* msg) const THROWS(NCursesException) { - THROW(new NCursesException (msg)); - } - - // Remove SLK's from screen - void clear() { - if (ERR==::slk_clear()) - Error("slk_clear"); - } - - // Restore them - void restore() { - if (ERR==::slk_restore()) - Error("slk_restore"); - } - -public: - - // Construct a Key Set, use the most comfortable layout as default. - // You must create a Soft_Label_Key_Set before you create any object of - // the NCursesWindow, NCursesPanel or derived classes. (Actually before - // ::initscr() is called). - Soft_Label_Key_Set(Label_Layout fmt); - - // This constructor assumes, that you already constructed a Key Set - // with a layout by the constructor above. This layout will be reused. - NCURSES_IMPEXP Soft_Label_Key_Set(); - - virtual ~Soft_Label_Key_Set(); - - // Get Label# i. Label counting starts with 1! - NCURSES_IMPEXP Soft_Label_Key& operator[](int i); - - // Retrieve number of Labels - inline int labels() const { return num_labels; } - - // Refresh the SLK portion of the screen - inline void refresh() { - if (ERR==::slk_refresh()) - Error("slk_refresh"); - } - - // Mark the SLK portion of the screen for refresh, defer actual refresh - // until next update call. - inline void noutrefresh() { - if (ERR==::slk_noutrefresh()) - Error("slk_noutrefresh"); - } - - // Mark the whole SLK portion of the screen as modified - inline void touch() { - if (ERR==::slk_touch()) - Error("slk_touch"); - } - - // Activate Label# i - inline void show(int i) { - activate_label(i,FALSE); - activate_label(i,TRUE); - } - - // Hide Label# i - inline void hide(int i) { - activate_label(i,FALSE); - } - - // Show all Labels - inline void show() { - activate_labels(FALSE); - activate_labels(TRUE); - } - - // Hide all Labels - inline void hide() { - activate_labels(FALSE); - } - - inline void attron(attr_t attrs) { - if (ERR==::slk_attron(attrs)) - Error("slk_attron"); - } - - inline void attroff(attr_t attrs) { - if (ERR==::slk_attroff(attrs)) - Error("slk_attroff"); - } - - inline void attrset(attr_t attrs) { - if (ERR==::slk_attrset(attrs)) - Error("slk_attrset"); - } - - inline void color(short color_pair_number) { - if (ERR==::slk_color(color_pair_number)) - Error("slk_color"); - } - - inline attr_t attr() const { - return ::slk_attr(); - } -}; - -#endif // NCURSES_CURSSLK_H_incl diff --git a/contrib/ncurses/c++/demo.cc b/contrib/ncurses/c++/demo.cc deleted file mode 100644 index f3fe3e46f7..0000000000 --- a/contrib/ncurses/c++/demo.cc +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Silly demo program for the NCursesPanel class. - * - * written by Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) - * - * Demo code for NCursesMenu and NCursesForm written by - * Juergen Pfeifer - * - * $Id: demo.cc,v 1.24 2004/01/15 00:21:27 tom Exp $ - */ - -#include "cursesapp.h" -#include "cursesm.h" -#include "cursesf.h" - -#if HAVE_LIBC_H -# include -#endif - -extern "C" unsigned int sleep(unsigned int); - -#undef index // needed for NeXT - -// -// ------------------------------------------------------------------------- -// -class SillyDemo -{ - public: - void run(int sleeptime) { - - NCursesPanel *std = new NCursesPanel(); - - // Make a few small demo panels - - NCursesPanel *u = new NCursesPanel(8,20,12,4); - NCursesPanel *v = new NCursesPanel(8,20,10,6); - NCursesPanel *w = new NCursesPanel(8,20,8,8); - NCursesPanel *x = new NCursesPanel(8,20,6,10); - NCursesPanel *y = new NCursesPanel(8,20,4,12); - NCursesPanel *z = new NCursesPanel(8,30,2,14); - - // Draw something on the main screen, so we can see what happens - // when panels get moved or deleted. - - std->box(); - std->move(std->height()/2,1); - std->hline(std->width()-2); - std->move(1,std->width()/2); - std->vline(std->height()-2); - std->addch(0,std->width()/2,ACS_TTEE); - std->addch(std->height()-1,std->width()/2,ACS_BTEE); - std->addch(std->height()/2,0,ACS_LTEE); - std->addch(std->height()/2,std->width()-1,ACS_RTEE); - std->addch(std->height()/2,std->width()/2,ACS_PLUS); - - // Draw frames with titles around panels so that we can see where - // the panels are located. - u->boldframe("Win U"); - v->frame("Win V"); - w->boldframe("Win W"); - x->frame("Win X"); - y->boldframe("Win Y"); - z->frame("Win Z"); - if (NCursesApplication::getApplication()->useColors()) { - u->bkgd(' '|COLOR_PAIR(1)); - w->bkgd(' '|COLOR_PAIR(1)); - y->bkgd(' '|COLOR_PAIR(1)); - v->bkgd(' '|COLOR_PAIR(2)); - x->bkgd(' '|COLOR_PAIR(2)); - z->bkgd(' '|COLOR_PAIR(2)); - } - - // A refresh to any valid panel updates all panels and refreshes - // the screen. Using std is just convenient - We know it's always - // valid until the end of the program. - - std->refresh(); - sleep(sleeptime); - - // Show what happens when panels are deleted and moved. - - sleep(sleeptime); - delete u; - std->refresh(); - - sleep(sleeptime); - delete z; - std->refresh(); - - sleep(sleeptime); - delete v; - std->refresh(); - - // show how it looks when a panel moves - sleep(sleeptime); - y->mvwin(5,30); - std->refresh(); - - sleep(sleeptime); - delete y; - std->refresh(); - - // show how it looks when you raise a panel - sleep(sleeptime); - w->top(); - std->refresh(); - - sleep(sleeptime); - delete w; - std->refresh(); - - sleep(sleeptime); - delete x; - - std->clear(); - std->refresh(); - - // Don't forget to clean up the main screen. Since this is the - // last thing using NCursesWindow, this has the effect of - // shutting down ncurses and restoring the terminal state. - - sleep(sleeptime); - delete std; - } -}; - -class UserData -{ -private: - int u; -public: - UserData(int x) : u(x) {} - int sleeptime() const { return u; } -}; -// -// ------------------------------------------------------------------------- -// -template class MyAction : public NCursesUserItem -{ -public: - MyAction (const char* p_name, - const T* p_UserData) - : NCursesUserItem(p_name, (const char*)0, p_UserData) - {}; - - ~MyAction() {} - - bool action() { - SillyDemo a; - a.run(NCursesUserItem::UserData()->sleeptime()); - return FALSE; - } -}; - -class QuitItem : public NCursesMenuItem -{ -public: - QuitItem() : NCursesMenuItem("Quit") { - } - - bool action() { - return TRUE; - } -}; -// -// ------------------------------------------------------------------------- -// -class Label : public NCursesFormField -{ -public: - Label(const char* title, - int row, int col) - : NCursesFormField(1,(int)::strlen(title),row,col) { - set_value(title); - options_off(O_EDIT|O_ACTIVE); - } -}; -// -// ------------------------------------------------------------------------- -// -class MyFieldType : public UserDefinedFieldType { -private: - int chk; -protected: - bool field_check(NCursesFormField& f) { - return TRUE; - } - bool char_check(int c) { - return (c==chk?TRUE:FALSE); - } -public: - MyFieldType(int x) : chk(x) { - } -}; -// -// ------------------------------------------------------------------------- -// -class TestForm : public NCursesForm -{ -private: - NCursesFormField** F; - MyFieldType* mft; - Integer_Field *ift; - Enumeration_Field *eft; - - static const char *weekdays[]; - -public: - TestForm() : NCursesForm(13,51,(lines()-15)/2,(cols()-53)/2) { - - F = new NCursesFormField*[10]; - mft = new MyFieldType('X'); - ift = new Integer_Field(0,1,10); - eft = new Enumeration_Field(weekdays); - - F[0] = new Label("Demo Entry Form",0,16); - F[1] = new Label("Weekday Enum",2,1); - F[2] = new Label("Number(1-10)",2,21); - F[3] = new Label("Only 'X'",2,35); - F[4] = new Label("Multiline Field (Dynamic and Scrollable)",5,1); - F[5] = new NCursesFormField(1,18,3,1); - F[6] = new NCursesFormField(1,12,3,21); - F[7] = new NCursesFormField(1,12,3,35); - F[8] = new NCursesFormField(4,46,6,1,2); - F[9] = new NCursesFormField(); - - InitForm(F,TRUE,TRUE); - boldframe(); - - F[5]->set_fieldtype(*eft); - F[6]->set_fieldtype(*ift); - - F[7]->set_fieldtype(*mft); - F[7]->set_maximum_growth(20); // max. 20 characters - F[7]->options_off(O_STATIC); // make field dynamic - - F[8]->set_maximum_growth(10); // max. 10 lines - F[8]->options_off(O_STATIC); // make field dynamic - } - - ~TestForm() { - delete mft; - delete ift; - delete eft; - } -}; - -const char* TestForm::weekdays[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", - "Friday", "Saturday", (const char *)0 }; -// -// ------------------------------------------------------------------------- -// -class FormAction : public NCursesMenuItem -{ -public: - FormAction(const char *s) : NCursesMenuItem(s) { - } - - bool action() { - TestForm F; - Soft_Label_Key_Set* S = new Soft_Label_Key_Set; - for(int i=1; i <= S->labels(); i++) { - char buf[5]; - ::sprintf(buf,"Frm%02d",i); - (*S)[i] = buf; // Text - (*S)[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification - } - NCursesApplication::getApplication()->push(*S); - F(); - NCursesApplication::getApplication()->pop(); - return FALSE; - } -}; -// -// ------------------------------------------------------------------------- -// -class PadAction : public NCursesMenuItem -{ -public: - PadAction(const char* s) : NCursesMenuItem(s) { - } - - bool action() { - const int GRIDSIZE = 3; - const int PADSIZE = 200; - unsigned gridcount = 0; - - NCursesPanel std; - NCursesPanel P(std.lines()-2,std.cols()-2,1,1); - NCursesFramedPad FP(P,PADSIZE,PADSIZE); - - 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(' '); - } - } - - P.label("Pad Demo",NULL); - FP(); - P.clear(); - return FALSE; - } -}; - -// -// ------------------------------------------------------------------------- -// -class PassiveItem : public NCursesMenuItem { -public: - PassiveItem(const char* text) : NCursesMenuItem(text) { - 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; - } -}; - -// -// ------------------------------------------------------------------------- -// -class MyMenu : public NCursesMenu -{ -private: - NCursesPanel* P; - NCursesMenuItem** I; - UserData *u; - #define n_items 7 - -public: - MyMenu () - : NCursesMenu (n_items+2, 8, (lines()-10)/2, (cols()-10)/2) - { - u = new UserData(1); - I = new NCursesMenuItem*[1+n_items]; - I[0] = new PassiveItem("One"); - I[1] = new PassiveItem("Two"); - I[2] = new MyAction ("Silly", u); - I[3] = new FormAction("Form"); - I[4] = new PadAction("Pad"); - I[5] = new ScanAction("Scan"); - I[6] = new QuitItem(); - I[7] = new NCursesMenuItem(); // Terminating empty item - - InitMenu(I,TRUE,TRUE); - - P = new NCursesPanel(1,n_items,LINES-1,1); - boldframe("Demo","Silly"); - P->show(); - } - - ~MyMenu() - { - P->hide(); - delete P; - delete u; - } - - virtual void On_Menu_Init() - { - NCursesWindow W(::stdscr); - P->move(0,0); - P->clrtoeol(); - for(int i=1; i<=count(); i++) - P->addch('0' + i); - P->bkgd(W.getbkgd()); - refresh(); - } - - virtual void On_Menu_Termination() - { - P->move(0,0); - P->clrtoeol(); - refresh(); - } - - virtual void On_Item_Init(NCursesMenuItem& item) - { - P->move(0,item.index()); - P->attron(A_REVERSE); - P->printw("%1d",1+item.index()); - P->attroff(A_REVERSE); - refresh(); - } - - virtual void On_Item_Termination(NCursesMenuItem& item) - { - P->move(0,item.index()); - P->attroff(A_REVERSE); - P->printw("%1d",1+item.index()); - refresh(); - } -}; -// -// ------------------------------------------------------------------------- -// -class TestApplication : public NCursesApplication { -protected: - int titlesize() const { return 1; } - void title(); - Soft_Label_Key_Set::Label_Layout useSLKs() const { - return Soft_Label_Key_Set::PC_Style_With_Index; - } - void init_labels(Soft_Label_Key_Set& S) const; - -public: - TestApplication() : NCursesApplication(TRUE) { - } - - int run(); -}; - -void TestApplication::init_labels(Soft_Label_Key_Set& S) const { - for(int i=1; i <= S.labels(); i++) { - char buf[5]; - ::sprintf(buf,"Key%02d",i); - S[i] = buf; // Text - S[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification - } -} - -void TestApplication::title() { - const char * const title = "Simple C++ Binding Demo"; - const int len = ::strlen(title); - - titleWindow->bkgd(screen_titles()); - titleWindow->addstr(0,(titleWindow->cols()-len)/2,title); - titleWindow->noutrefresh(); -} - - -int TestApplication::run() { - MyMenu M; - M(); - return 0; -} - -// -// ------------------------------------------------------------------------- -// -static TestApplication Demo; diff --git a/contrib/ncurses/c++/edit_cfg.sh b/contrib/ncurses/c++/edit_cfg.sh deleted file mode 100644 index 30c9485056..0000000000 --- a/contrib/ncurses/c++/edit_cfg.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# $Id: edit_cfg.sh,v 1.13 2003/12/20 13:14:25 tom Exp $ -############################################################################## -# Copyright (c) 1998-2001,2003 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 1997 -# -# Edit the default value of the etip.h file based on the autoconf-generated -# values: -# -# $1 = ncurses_cfg.h -# $2 = etip.h -# -echo "substituting autoconf'd values from $1 into $2" -for name in \ - CPP_HAS_PARAM_INIT \ - ETIP_NEEDS_MATH_EXCEPTION \ - ETIP_NEEDS_MATH_H \ - HAVE_BUILTIN_H \ - HAVE_GPP_BUILTIN_H \ - HAVE_GXX_BUILTIN_H \ - HAVE_STRSTREAM_H \ - HAVE_TYPEINFO \ - HAVE_VALUES_H \ - USE_STRSTREAM_VSCAN \ - USE_STRSTREAM_VSCAN_CAST -do - rm -f $2.bak - mv $2 $2.bak - if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) - then - value=1 - sed -e 's/define '$name'.*$/define '$name' 1/' $2.bak >$2 - else - value=0 - sed -e 's/define '$name'.*$/define '$name' 0/' $2.bak >$2 - fi - if (cmp -s $2 $2.bak) - then - echo '... '$name $value - mv $2.bak $2 - else - echo '... '$name $value - rm -f $2.bak - fi -done diff --git a/contrib/ncurses/c++/etip.h.in b/contrib/ncurses/c++/etip.h.in deleted file mode 100644 index 2ddc292add..0000000000 --- a/contrib/ncurses/c++/etip.h.in +++ /dev/null @@ -1,291 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * 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 * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: etip.h.in,v 1.25 2003/10/25 15:05:58 tom Exp $ - -#ifndef NCURSES_ETIP_H_incl -#define NCURSES_ETIP_H_incl 1 - -// These are substituted at configure/build time -#ifndef HAVE_BUILTIN_H -#define HAVE_BUILTIN_H 0 -#endif - -#ifndef HAVE_GXX_BUILTIN_H -#define HAVE_GXX_BUILTIN_H 0 -#endif - -#ifndef HAVE_GPP_BUILTIN_H -#define HAVE_GPP_BUILTIN_H 0 -#endif - -#ifndef HAVE_STRSTREAM_H -#define HAVE_STRSTREAM_H 0 -#endif - -#ifndef HAVE_TYPEINFO -#define HAVE_TYPEINFO 0 -#endif - -#ifndef HAVE_VALUES_H -#define HAVE_VALUES_H 0 -#endif - -#ifndef ETIP_NEEDS_MATH_H -#define ETIP_NEEDS_MATH_H 0 -#endif - -#ifndef ETIP_NEEDS_MATH_EXCEPTION -#define ETIP_NEEDS_MATH_EXCEPTION 0 -#endif - -#ifndef CPP_HAS_PARAM_INIT -#define CPP_HAS_PARAM_INIT 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 -# include -# endif -# endif -#endif - -#if defined(__GNUG__) -# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H -# if ETIP_NEEDS_MATH_H -# if ETIP_NEEDS_MATH_EXCEPTION -# undef exception -# define exception math_exception -# endif -# include -# endif -# undef exception -# define exception builtin_exception -# if HAVE_GPP_BUILTIN_H -# include -# elif HAVE_GXX_BUILTIN_H -# include -# else -# include -# endif -# undef exception -# endif -#elif defined (__SUNPRO_CC) -# include -# include -#else -# include -#endif - -#include - -extern "C" { -#if HAVE_VALUES_H -# include -#endif - -#include -#include -#include -} - -// Language features -#if CPP_HAS_PARAM_INIT -#define NCURSES_PARAM_INIT(value) = value -#else -#define NCURSES_PARAM_INIT(value) /*nothing*/ -#endif - -// Forward Declarations -class NCURSES_IMPEXP NCursesPanel; -class NCURSES_IMPEXP NCursesMenu; -class NCURSES_IMPEXP NCursesForm; - -class NCURSES_IMPEXP NCursesException -{ -public: - const char *message; - int errorno; - - NCursesException (const char* msg, int err) - : message(msg), errorno (err) - {}; - - NCursesException (const char* msg) - : message(msg), errorno (E_SYSTEM_ERROR) - {}; - - virtual const char *classname() const { - return "NCursesWindow"; - } -}; - -class NCURSES_IMPEXP NCursesPanelException : public NCursesException -{ -public: - const NCursesPanel* p; - - NCursesPanelException (const char *msg, int err) : - NCursesException (msg, err), - p ((NCursesPanel*)0) - {}; - - NCursesPanelException (const NCursesPanel* panel, - const char *msg, - int err) : - NCursesException (msg, err), - p (panel) - {}; - - NCursesPanelException (int err) : - NCursesException ("panel library error", err), - p ((NCursesPanel*)0) - {}; - - NCursesPanelException (const NCursesPanel* panel, - int err) : - NCursesException ("panel library error", err), - p (panel) - {}; - - virtual const char *classname() const { - return "NCursesPanel"; - } - -}; - -class NCURSES_IMPEXP NCursesMenuException : public NCursesException -{ -public: - const NCursesMenu* m; - - NCursesMenuException (const char *msg, int err) : - NCursesException (msg, err), - m ((NCursesMenu *)0) - {}; - - NCursesMenuException (const NCursesMenu* menu, - const char *msg, - int err) : - NCursesException (msg, err), - m (menu) - {}; - - NCursesMenuException (int err) : - NCursesException ("menu library error", err), - m ((NCursesMenu *)0) - {}; - - NCursesMenuException (const NCursesMenu* menu, - int err) : - NCursesException ("menu library error", err), - m (menu) - {}; - - virtual const char *classname() const { - return "NCursesMenu"; - } - -}; - -class NCURSES_IMPEXP NCursesFormException : public NCursesException -{ -public: - const NCursesForm* f; - - NCursesFormException (const char *msg, int err) : - NCursesException (msg, err), - f ((NCursesForm*)0) - {}; - - NCursesFormException (const NCursesForm* form, - const char *msg, - int err) : - NCursesException (msg, err), - f (form) - {}; - - NCursesFormException (int err) : - NCursesException ("form library error", err), - f ((NCursesForm*)0) - {}; - - NCursesFormException (const NCursesForm* form, - int err) : - NCursesException ("form library error", err), - f (form) - {}; - - virtual const char *classname() const { - return "NCursesForm"; - } - -}; - -#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC)) -# include - extern "C" void exit(int); -#endif - -inline void THROW(const NCursesException *e) { -#if defined(__GNUG__) && defined(__EXCEPTIONS) -# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) - (*lib_error_handler)(e?e->classname():"",e?e->message:""); -#else - 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); -#endif -} - -#define THROWS(s) - -#endif // NCURSES_ETIP_H_incl diff --git a/contrib/ncurses/c++/headers b/contrib/ncurses/c++/headers deleted file mode 100644 index 3470386adf..0000000000 --- a/contrib/ncurses/c++/headers +++ /dev/null @@ -1,39 +0,0 @@ -# C++ headers -# $Id: headers,v 1.2 1998/02/11 12:13:40 tom Exp $ -############################################################################## -# Copyright (c) 1998 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 1997 -# -$(srcdir)/cursesapp.h -$(srcdir)/cursesf.h -$(srcdir)/cursesm.h -$(srcdir)/cursesp.h -$(srcdir)/cursesw.h -$(srcdir)/cursslk.h -etip.h diff --git a/contrib/ncurses/c++/internal.h b/contrib/ncurses/c++/internal.h deleted file mode 100644 index 921389c81f..0000000000 --- a/contrib/ncurses/c++/internal.h +++ /dev/null @@ -1,49 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2002,2003 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: internal.h,v 1.10 2003/10/25 15:04:46 tom Exp $ - -#ifndef NCURSES_CPLUS_INTERNAL_H -#define NCURSES_CPLUS_INTERNAL_H 1 - -#include - -#if USE_RCS_IDS -#define MODULE_ID(id) static const char Ident[] = id; -#else -#define MODULE_ID(id) /*nothing*/ -#endif - -#define CTRL(x) ((x) & 0x1f) - -#endif // NCURSES_CPLUS_INTERNAL_H diff --git a/contrib/ncurses/c++/modules b/contrib/ncurses/c++/modules deleted file mode 100644 index 0709805847..0000000000 --- a/contrib/ncurses/c++/modules +++ /dev/null @@ -1,43 +0,0 @@ -# Program modules -# $Id: modules,v 1.6 1999/07/31 09:46:54 juergen Exp $ -############################################################################## -# Copyright (c) 1998 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 1995,1997 -# - -@ base -cursesf c++ $(srcdir) $(cursesf_h) $(cursesapp_h) -cursesm c++ $(srcdir) $(cursesm_h) $(cursesapp_h) -cursesp c++ $(srcdir) $(cursesp_h) -cursesw c++ $(srcdir) $(cursesw_h) -cursespad c++ $(srcdir) $(cursesw_h) -cursslk c++ $(srcdir) $(cursslk_h) $(cursesapp_h) -cursesapp c++ $(srcdir) $(cursesapp_h) -cursesmain c++ $(srcdir) $(cursesapp_h) -demo c++ $(srcdir) $(cursesf_h) $(cursesm_h) $(cursesapp_h) diff --git a/contrib/ncurses/configure.in b/contrib/ncurses/configure.in deleted file mode 100644 index 02fd45cd57..0000000000 --- a/contrib/ncurses/configure.in +++ /dev/null @@ -1,1352 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 1998-2003,2004 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl Author: Thomas E. Dickey 1995-on -dnl -dnl $Id: configure.in,v 1.312 2004/01/24 19:29:13 tom Exp $ -dnl Process this file with autoconf to produce a configure script. -dnl -dnl See http://invisible-island.net/autoconf/ for additional information. -dnl -dnl --------------------------------------------------------------------------- -AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.312 $) -AC_INIT(ncurses/base/lib_initscr.c) -AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) - -CF_SUBST_NCURSES_VERSION - -CF_WITH_REL_VERSION(NCURSES) -CF_WITH_ABI_VERSION - -CF_CHECK_CACHE([AC_CANONICAL_SYSTEM]) -AC_ARG_WITH(system-type, -[ --with-system-type=XXX test: override derived host system-type], -[AC_MSG_WARN(overriding system type to $withval) - cf_cv_system_name=$withval]) - -### Save the given $CFLAGS to allow user-override. -cf_user_CFLAGS="$CFLAGS" - -### Default install-location -CF_CFG_DEFAULTS - -### Checks for programs. -AC_PROG_CC -CF_GCC_VERSION - -AC_PROG_CPP -AC_PROG_GCC_TRADITIONAL -AC_ISC_POSIX -CF_ANSI_CC_REQD -CF_PROG_EXT -CF_PROG_LDCONFIG - -dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the -dnl configure script by not letting us test if C++ -dnl is present, making this option necessary. -AC_MSG_CHECKING(if you want to ensure bool is consistent with C++) -AC_ARG_WITH(cxx, - [ --without-cxx do not adjust ncurses bool to match C++], - [cf_with_cxx=$withval], - [cf_with_cxx=yes]) -AC_MSG_RESULT($cf_with_cxx) -if test "X$cf_with_cxx" = Xno ; then - CXX="" - GXX="" -else - # with autoconf 2.13, we can change the error to a warning: - pushdef([AC_MSG_ERROR], - [AC_MSG_RESULT(no) - AC_MSG_WARN([You don't have any C++ compiler, too bad]) - cf_with_cxx=no; CXX=""; GXX="";])dnl - AC_PROG_CXX - popdef([AC_MSG_ERROR])dnl - # autoconf 2.5x removed the error - by hardcoding it to g++. - if test "$CXX" = "g++" ; then - AC_PATH_PROG(CXX,g++) - fi - if test "$CXX" = "g++" ; then - AC_MSG_WARN(ignoring hardcoded g++) - cf_with_cxx=no; CXX=""; GXX=""; - fi -fi - -CF_GXX_VERSION -case $GXX_VERSION in -1*|2.[[0-6]]*) - GXX=""; CXX=""; ac_cv_prog_gxx=no - cf_cxx_library=no - AC_MSG_WARN(templates do not work) - ;; -esac - -AC_MSG_CHECKING(if you want to build C++ binding and demo) -AC_ARG_WITH(cxx-binding, - [ --without-cxx-binding do not build C++ binding and demo], - [cf_with_cxx_binding=$withval], - [cf_with_cxx_binding=$cf_with_cxx]) -AC_MSG_RESULT($cf_with_cxx_binding) - -AC_MSG_CHECKING(if you want to build with Ada95) -AC_ARG_WITH(ada, - [ --without-ada suppress check for Ada95, don't build demo], - [cf_with_ada=$withval], - [cf_with_ada=yes]) -AC_MSG_RESULT($cf_with_ada) - -AC_MSG_CHECKING(if you want to build programs such as tic) -AC_ARG_WITH(progs, - [ --without-progs suppress build with programs (e.g., tic)], - [cf_with_progs=$withval], - [cf_with_progs=yes]) -AC_MSG_RESULT($cf_with_progs) - -AC_MSG_CHECKING(if you wish to install curses.h) -AC_ARG_WITH(curses-h, - [ --without-curses-h install curses.h as ncurses.h only], - [with_curses_h=$withval], - [with_curses_h=yes]) -AC_MSG_RESULT($with_curses_h) - -modules_to_build="ncurses" -if test "X$cf_with_progs" != Xno ; then -modules_to_build="$modules_to_build progs tack" -fi -modules_to_build="$modules_to_build panel menu form" - -AC_ARG_PROGRAM -AC_PROG_AWK -AC_PROG_MAKE_SET -CF_PROG_INSTALL -AC_SYS_LONG_FILE_NAMES -CF_MIXEDCASE_FILENAMES -AC_PROG_LN_S -CF_MAKE_TAGS -AC_CHECK_PROGS(LINT, tdlint lint alint) -AC_CHECK_PROGS(MAN, man man_db) -AC_SUBST(LINT_OPTS) - -dnl These are standard among *NIX systems, but not when cross-compiling -AC_CHECK_TOOL(RANLIB, ranlib, ':') -AC_CHECK_TOOL(LD, ld, ld) -AC_CHECK_TOOL(AR, ar, ar) -CF_SUBST(archiver options,AR_OPTS,rv) - -CF_MAKEFLAGS - -dnl Special option for use by system-builders: the install-prefix is used to -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 ($DESTDIR)], - [case "$withval" in #(vi - yes|no) #(vi - ;; - *) DESTDIR="$withval" - ;; - esac]) -AC_MSG_RESULT($DESTDIR) -AC_SUBST(DESTDIR) - -############################################################################### -CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:) -# If we're cross-compiling, allow the user to override the tools and their -# options. The configure script is oriented toward identifying the host -# compiler, etc., but we need a build compiler to generate parts of the source. -: ${BUILD_CC:='$(CC)'} -: ${BUILD_CFLAGS:='$(CFLAGS)'} -: ${BUILD_CPPFLAGS:='$(CPPFLAGS)'} -: ${BUILD_LDFLAGS:='$(LDFLAGS)'} -: ${BUILD_LIBS:='$(LIBS)'} -: ${BUILD_EXEEXT:='$x'} -if test "$cross_compiling" = yes ; then - AC_ARG_WITH(build-cc, - [ --with-build-cc=XXX the build C compiler ($BUILD_CC)], - [BUILD_CC="$withval"], - [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)]) - AC_ARG_WITH(build-cflags, - [ --with-build-cflags=XXX the build C compiler-flags], - [BUILD_CFLAGS="$withval"]) - AC_ARG_WITH(build-cppflags, - [ --with-build-cppflags=XXX the build C preprocessor-flags], - [BUILD_CPPFLAGS="$withval"]) - AC_ARG_WITH(build-ldflags, - [ --with-build-ldflags=XXX the build linker-flags], - [BUILD_LDFLAGS="$withval"]) - AC_ARG_WITH(build-libs, - [ --with-build-libs=XXX the build libraries], - [BUILD_LIBS="$withval"]) - BUILD_EXEEXT= -fi -AC_SUBST(BUILD_CC) -AC_SUBST(BUILD_CFLAGS) -AC_SUBST(BUILD_CPPFLAGS) -AC_SUBST(BUILD_LDFLAGS) -AC_SUBST(BUILD_LIBS) -AC_SUBST(BUILD_EXEEXT) - -############################################################################### -CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) - -### Options to allow the user to specify the set of libraries which are used. -### Use "--without-normal --with-shared" to allow the default model to be -### shared, for example. -cf_list_models="" -AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug") - -CF_WITH_LIBTOOL -if test "$with_libtool" != "no" ; then - -cf_list_models="$cf_list_models libtool" - -else - -AC_MSG_CHECKING(if you want to build shared libraries) -AC_ARG_WITH(shared, - [ --with-shared generate shared-libraries], - [with_shared=$withval], - [with_shared=no]) -AC_MSG_RESULT($with_shared) -test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" - -AC_MSG_CHECKING(if you want to build static libraries) -AC_ARG_WITH(normal, - [ --with-normal generate normal-libraries (default)], - [with_normal=$withval], - [with_normal=yes]) -AC_MSG_RESULT($with_normal) -test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" - -AC_MSG_CHECKING(if you want to build debug libraries) -AC_ARG_WITH(debug, - [ --with-debug generate debug-libraries (default)], - [with_debug=$withval], - [with_debug=yes]) -AC_MSG_RESULT($with_debug) -test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" - -AC_MSG_CHECKING(if you want to build profiling libraries) -AC_ARG_WITH(profile, - [ --with-profile generate profile-libraries], - [with_profile=$withval], - [with_profile=no]) -AC_MSG_RESULT($with_profile) -test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" - -fi - -############################################################################### - -AC_MSG_CHECKING(for specified models) -test -z "$cf_list_models" && cf_list_models=normal -dnl If we use libtool to generate libraries, then it must be the only -dnl specified model. -test "$with_libtool" != "no" && cf_list_models=libtool -AC_MSG_RESULT($cf_list_models) - -### Use the first model as the default, and save its suffix for use in building -### up test-applications. -AC_MSG_CHECKING(for default model) -DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` -AC_MSG_RESULT($DFT_LWR_MODEL) - -CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl - -AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal") -AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL") - -TINFO_NAME=tinfo -AC_SUBST(TINFO_NAME) - -LIB_NAME=ncurses -AC_SUBST(LIB_NAME) - -LIB_DIR=../lib -CF_LIB_PREFIX(cf_prefix) -LIB_PREFIX=$cf_prefix -AC_SUBST(LIB_PREFIX) - -LIB_SUFFIX= -AC_SUBST(LIB_SUFFIX) - -############################################################################### - -AC_MSG_CHECKING(if you want to build a separate terminfo library) -AC_ARG_WITH(termlib, - [ --with-termlib generate separate terminfo library], - [with_termlib=$withval], - [with_termlib=no]) -AC_MSG_RESULT($with_termlib) - -### Checks for special libraries, must be done up-front. -CF_WITH_DBMALLOC -CF_WITH_DMALLOC - -SHLIB_LIST="" -AC_MSG_CHECKING(if you want to link with the gpm mouse library) -AC_ARG_WITH(gpm, - [ --with-gpm use Alessandro Rubini's GPM library], - [with_gpm=$withval], - [with_gpm=no]) -AC_MSG_RESULT($with_gpm) -if test "$with_gpm" = yes ; then - AC_CHECK_LIB(gpm,Gpm_Open,[ - EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS" - SHLIB_LIST="-lgpm $SHLIB_LIST" - AC_DEFINE(HAVE_LIBGPM) - AC_CHECK_HEADERS(gpm.h) - ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ)) -fi - -CF_WITH_SYSMOUSE - -dnl Not all ports of gcc support the -g option - -if test X"$CC_G_OPT" = X"" ; then - CC_G_OPT='-g' - test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT='' -fi -AC_SUBST(CC_G_OPT) - -if test X"$CXX_G_OPT" = X"" ; then - CXX_G_OPT='-g' - test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' -fi -AC_SUBST(CXX_G_OPT) - -AC_MSG_CHECKING(for default loader flags) -case $DFT_LWR_MODEL in -libtool) LD_MODEL='' ;; -normal) LD_MODEL='' ;; -debug) LD_MODEL=$CC_G_OPT ;; -profile) LD_MODEL='-pg';; -shared) LD_MODEL='' ;; -esac -AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg) -AC_MSG_RESULT($LD_MODEL) - -AC_MSG_CHECKING(if rpath option should be used) -AC_ARG_ENABLE(rpath, -[ --enable-rpath use rpath option when generating shared libraries], -[cf_cv_ld_rpath=$enableval], -[cf_cv_ld_rpath=no]) -AC_MSG_RESULT($cf_cv_ld_rpath) - -CF_SHARED_OPTS -if test "$CC_SHARED_OPTS" = "unknown"; then - for model in $cf_list_models; do - if test "$model" = "shared"; then - AC_ERROR(Shared libraries are not supported in this version) - fi - done -fi - -############################################################################### -CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) - -### use option --disable-overwrite to leave out the link to -lcurses -AC_MSG_CHECKING(if you wish to install ncurses overwriting curses) -AC_ARG_ENABLE(overwrite, - [ --disable-overwrite leave out the link to -lcurses], - [with_overwrite=$enableval], - [if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi]) -AC_MSG_RESULT($with_overwrite) - -AC_MSG_CHECKING(if external terminfo-database is used) -AC_ARG_ENABLE(database, - [ --disable-database do not use terminfo, only fallbacks/termcap], - [use_database=$enableval], - [use_database=yes]) -AC_MSG_RESULT($use_database) - -case $host_os in #(vi -os2*) #(vi - TERMINFO_SRC='${top_srcdir}/misc/emx.src' - ;; -*) #(vi - TERMINFO_SRC='${top_srcdir}/misc/terminfo.src' - ;; -esac -AC_SUBST(TERMINFO_SRC) - -CF_PATHSEP -if test "$use_database" != no ; then - AC_DEFINE(USE_DATABASE) - AC_MSG_CHECKING(which terminfo source-file will be installed) - AC_ARG_ENABLE(database, - [ --with-database=XXX specify terminfo source to install], - [TERMINFO_SRC=$withval]) - AC_MSG_RESULT($TERMINFO_SRC) -fi - -AC_MSG_CHECKING(for list of fallback descriptions) -AC_ARG_WITH(fallbacks, - [ --with-fallbacks=XXX specify list of fallback terminal descriptions], - [with_fallback=$withval], - [with_fallback=]) -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 - TERMINFO="${datadir}/terminfo" - MAKE_TERMINFO="#" -else - -AC_MSG_CHECKING(for list of terminfo directories) -CF_WITH_PATHLIST(terminfo-dirs, - [ --with-terminfo-dirs=XXX specify list of terminfo directories], - TERMINFO_DIRS, - DATADIR/terminfo, - ${datadir}/terminfo) -AC_MSG_RESULT($TERMINFO_DIRS) -test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS") - -AC_MSG_CHECKING(for default terminfo directory) -CF_WITH_PATH(default-terminfo-dir, - [ --with-default-terminfo-dir=DIR default terminfo directory], - TERMINFO, - DATADIR/terminfo, - ${datadir}/terminfo) -AC_MSG_RESULT($TERMINFO) -AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO") - -fi - -AC_SUBST(TERMINFO) -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. -AC_MSG_CHECKING(if big-core option selected) -AC_ARG_ENABLE(big-core, - [ --disable-big-core assume machine has little memory], - [with_big_core=$enableval], - [AC_TRY_RUN([ -#include -#include -int main() { - unsigned long n = 6000000L; - char *s = malloc(n); - if (s != 0) - s[0] = s[n-1] = 0; - exit(s == 0); -}], - [with_big_core=yes], - [with_big_core=no], - [with_big_core=no])]) -AC_MSG_RESULT($with_big_core) -test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE) - -### use option --enable-termcap to compile in the termcap fallback support -AC_MSG_CHECKING(if you want termcap-fallback support) -AC_ARG_ENABLE(termcap, - [ --enable-termcap compile in termcap fallback support], - [with_termcap=$enableval], - [with_termcap=no]) -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, - [ --enable-getcap fast termcap load, no xrefs to terminfo], - [with_getcap=$enableval], - [with_getcap=no]) -AC_MSG_RESULT($with_getcap) -test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP) - -AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo) -AC_ARG_ENABLE(getcap-cache, - [ --enable-getcap-cache cache translated termcaps in ~/.terminfo], - [with_getcap_cache=$enableval], - [with_getcap_cache=no]) -AC_MSG_RESULT($with_getcap_cache) -test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE) - -fi - -### Use option --disable-home-terminfo to completely remove ~/.terminfo -AC_MSG_CHECKING(if ~/.terminfo is wanted) -AC_ARG_ENABLE(home-terminfo, - [ --disable-home-terminfo drop ~/.terminfo from terminfo search-path], - [with_home_terminfo=$enableval], - [with_home_terminfo=yes]) -test "$with_home_terminfo" = "yes" && AC_DEFINE(USE_HOME_TERMINFO) - -### Use option --enable-symlinks to make tic use symlinks, not hard links -### to reduce storage requirements for the terminfo database. -CF_LINK_FUNCS - -with_links=no -with_symlinks=no - -if test "$ac_cv_func_link" != yes ; then - AC_MSG_CHECKING(if tic should use symbolic links) - if test "$ac_cv_func_symlink" = yes ; then - with_symlinks=yes - else - with_symlinks=no - fi - AC_MSG_RESULT($with_symlinks) -elif test "$ac_cv_func_symlink" != yes ; then - AC_MSG_CHECKING(if tic should use hard links) - if test "$ac_cv_func_link" = yes ; then - with_links=yes - else - with_links=no - fi - AC_MSG_RESULT($with_links) -else - AC_MSG_CHECKING(if tic should use symbolic links) - AC_ARG_ENABLE(symlinks, - [ --enable-symlinks make tic use symbolic links not hard links], - [with_symlinks=$enableval], - [with_symlinks=no]) - AC_MSG_RESULT($with_symlinks) -fi - -test "$with_links" = yes && AC_DEFINE(USE_LINKS) -test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS) - -### use option --enable-broken-linker to force on use of broken-linker support -AC_MSG_CHECKING(if you want broken-linker support code) -AC_ARG_ENABLE(broken_linker, - [ --enable-broken_linker compile with broken-linker support code], - [with_broken_linker=$enableval], - [with_broken_linker=${BROKEN_LINKER-no}]) -AC_MSG_RESULT($with_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=short]) -AC_MSG_RESULT($NCURSES_OSPEED) -AC_SUBST(NCURSES_OSPEED) - -### use option --enable-bsdpad to have tputs process BSD-style prefix padding -AC_MSG_CHECKING(if tputs should process BSD-style prefix padding) -AC_ARG_ENABLE(bsdpad, - [ --enable-bsdpad recognize BSD-style prefix padding], - [with_bsdpad=$enableval], - [with_bsdpad=no]) -AC_MSG_RESULT($with_bsdpad) -test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS) - -### Enable compiling-in rcs id's -AC_MSG_CHECKING(if RCS identifiers should be compiled-in) -AC_ARG_WITH(rcs-ids, - [ --with-rcs-ids compile-in RCS identifiers], - [with_rcs_ids=$withval], - [with_rcs_ids=no]) -AC_MSG_RESULT($with_rcs_ids) -test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) - -############################################################################### -CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) - -############################################################################### -CF_HELP_MESSAGE(Extensions:) - -### Note that some functions (such as const) are normally disabled anyway. -AC_MSG_CHECKING(if you want to build with function extensions) -AC_ARG_ENABLE(ext-funcs, - [ --disable-ext-funcs disable function-extensions], - [with_ext_funcs=$enableval], - [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_RESIZE_TERM) - 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) -AC_ARG_ENABLE(const, - [ --enable-const compile with extra/non-standard const], - [with_ext_const=$enableval], - [with_ext_const=no]) -AC_MSG_RESULT($with_ext_const) -NCURSES_CONST='/*nothing*/' -if test "$with_ext_const" = yes ; then - NCURSES_CONST=const -fi -AC_SUBST(NCURSES_CONST) - -AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code) -AC_ARG_ENABLE(no-padding, - [ --enable-no-padding compile with $NCURSES_NO_PADDING code], - [with_no_padding=$enableval], - [with_no_padding=$with_ext_funcs]) -AC_MSG_RESULT($with_no_padding) -test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING) - -### use option --enable-sigwinch to turn on use of SIGWINCH logic -AC_MSG_CHECKING(if you want SIGWINCH handler) -AC_ARG_ENABLE(sigwinch, - [ --enable-sigwinch compile with SIGWINCH handler], - [with_sigwinch=$enableval], - [with_sigwinch=$with_ext_funcs]) -AC_MSG_RESULT($with_sigwinch) -test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH) - -### use option --enable-tcap-names to allow user to define new capabilities -AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap) -AC_ARG_ENABLE(tcap-names, - [ --enable-tcap-names compile with user-definable terminal capabilities], - [with_tcap_names=$enableval], - [with_tcap_names=$with_ext_funcs]) -AC_MSG_RESULT($with_tcap_names) -NCURSES_XNAMES=0 -test "$with_tcap_names" = yes && NCURSES_XNAMES=1 -AC_SUBST(NCURSES_XNAMES) - -############################################################################### -# These options are relatively safe to experiment with. -CF_HELP_MESSAGE(Development Code:) -AC_MSG_CHECKING(if you want all development code) -AC_ARG_WITH(develop, - [ --with-develop enable all development options], - [with_develop=$withval], - [with_develop=no]) -AC_MSG_RESULT($with_develop) - -### use option --enable-hard-tabs to turn on use of hard-tabs optimize -AC_MSG_CHECKING(if you want hard-tabs code) -AC_ARG_ENABLE(hard-tabs, - [ --enable-hard-tabs compile with hard-tabs code], - [with_hardtabs=$enableval], - [with_hardtabs=$with_develop]) -AC_MSG_RESULT($with_hardtabs) -test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS) - -AC_MSG_CHECKING(if you want to use restrict environment when running as root) -AC_ARG_ENABLE(root-environ, - [ --disable-root-environ limit environment when running as root], - [with_root_environ=$enableval], - [with_root_environ=yes]) -AC_MSG_RESULT($with_root_environ) -test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON) - -### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -AC_MSG_CHECKING(if you want limited support for xmc) -AC_ARG_ENABLE(xmc-glitch, - [ --enable-xmc-glitch compile with limited support for xmc], - [with_xmc_glitch=$enableval], - [with_xmc_glitch=$with_develop]) -AC_MSG_RESULT($with_xmc_glitch) -test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT) - -############################################################################### -# These are just experimental, probably should not be in a package: -CF_HELP_MESSAGE(Experimental Code:) - -AC_MSG_CHECKING(if you do not want to assume colors are white-on-black) -AC_ARG_ENABLE(assumed-color, - [ --disable-assumed-color do not assume anything about default-colors], - [with_assumed_color=$enableval], - [with_assumed_color=yes]) -AC_MSG_RESULT($with_assumed_color) -test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR) - -### use option --enable-hashmap to turn on use of hashmap scrolling logic -AC_MSG_CHECKING(if you want hashmap scrolling-optimization code) -AC_ARG_ENABLE(hashmap, - [ --disable-hashmap compile without hashmap scrolling-optimization], - [with_hashmap=$enableval], - [with_hashmap=yes]) -AC_MSG_RESULT($with_hashmap) -test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) - -### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -AC_MSG_CHECKING(if you want colorfgbg code) -AC_ARG_ENABLE(colorfgbg, - [ --enable-colorfgbg compile with $COLORFGBG code], - [with_colorfgbg=$enableval], - [with_colorfgbg=no]) -AC_MSG_RESULT($with_colorfgbg) -test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) - -AC_MSG_CHECKING(if you want experimental safe-sprintf code) -AC_ARG_ENABLE(safe-sprintf, - [ --enable-safe-sprintf compile with experimental safe-sprintf code], - [with_safe_sprintf=$enableval], - [with_safe_sprintf=no]) -AC_MSG_RESULT($with_safe_sprintf) -test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF) - -### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic -# when hashmap is used scroll hints are useless -if test "$with_hashmap" = no ; then -AC_MSG_CHECKING(if you want to experiment without scrolling-hints code) -AC_ARG_ENABLE(scroll-hints, - [ --disable-scroll-hints compile without scroll-hints code], - [with_scroll_hints=$enableval], - [with_scroll_hints=yes]) -AC_MSG_RESULT($with_scroll_hints) -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 - -NEED_WCHAR_H=0 -NCURSES_MBSTATE_T=0 -NCURSES_WCHAR_T=0 -NCURSES_WINT_T=0 - -# Check to define _XOPEN_SOURCE "automatically" -CF_XOPEN_SOURCE - -# use these variables to work around a defect in gcc's fixincludes. -NCURSES_OK_WCHAR_T= -NCURSES_OK_WINT_T= - -AC_MSG_CHECKING(if you want experimental wide-character code) -AC_ARG_ENABLE(widec, - [ --enable-widec compile with experimental wide-char/UTF-8 code], - [with_widec=$enableval], - [with_widec=no]) -AC_MSG_RESULT($with_widec) -if test "$with_widec" = yes ; then - LIB_SUFFIX="w${LIB_SUFFIX}" - AC_DEFINE(USE_WIDEC_SUPPORT) - CF_PREDEFINE(_XOPEN_SOURCE,500) - CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) - # with_overwrite=no - NCURSES_CH_T=cchar_t - AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc) - if test "$ac_cv_func_putwc" != yes ; then - CF_LIBUTF8 - if test "$cf_cv_libutf8" = yes ; then - NCURSES_LIBUTF8=1 - fi - fi - CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T) - CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T) - CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T) -fi -AC_SUBST(NCURSES_CH_T) -AC_SUBST(NCURSES_LIBUTF8) - -AC_SUBST(NEED_WCHAR_H) -AC_SUBST(NCURSES_MBSTATE_T) -AC_SUBST(NCURSES_WCHAR_T) -AC_SUBST(NCURSES_WINT_T) - -AC_SUBST(NCURSES_OK_WCHAR_T) -AC_SUBST(NCURSES_OK_WINT_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:) - -### use option --disable-echo to suppress full display compiling commands -AC_MSG_CHECKING(if you want to display full commands during build) -AC_ARG_ENABLE(echo, - [ --enable-echo build: display "compiling" commands (default)], - [with_echo=$enableval], - [with_echo=yes]) -if test "$with_echo" = yes; then - ECHO_LINK= -else - ECHO_LINK='@ echo linking $@ ... ;' - test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" -fi -AC_MSG_RESULT($with_echo) -AC_SUBST(ECHO_LINK) - -### use option --enable-warnings to turn on all gcc warnings -AC_MSG_CHECKING(if you want to see compiler warnings) -AC_ARG_ENABLE(warnings, - [ --enable-warnings build: turn on GCC compiler warnings], - [with_warnings=$enableval]) -AC_MSG_RESULT($with_warnings) - -if test -n "$with_warnings"; then - ADAFLAGS="$ADAFLAGS -gnatg" - CF_GCC_WARNINGS -fi -CF_GCC_ATTRIBUTES - -### use option --enable-assertions to turn on generation of assertion code -AC_MSG_CHECKING(if you want to enable runtime assertions) -AC_ARG_ENABLE(assertions, - [ --enable-assertions test: turn on generation of assertion code], - [with_assertions=$enableval], - [with_assertions=no]) -AC_MSG_RESULT($with_assertions) -if test -n "$GCC" -then - if test "$with_assertions" = no - then - AC_DEFINE(NDEBUG) - CPPFLAGS="$CPPFLAGS -DNDEBUG" - else - ADAFLAGS="$ADAFLAGS -gnata" - fi -fi - -### use option --disable-leaks to suppress "permanent" leaks, for testing -AC_ARG_ENABLE(leaks, - [ --disable-leaks test: suppress permanent memory-leaks], - [test "$enableval" = no && AC_DEFINE(NO_LEAKS)]) -AC_DEFINE(HAVE_NC_ALLOC_H) - -### use option --enable-expanded to generate certain macros as functions -AC_ARG_ENABLE(expanded, - [ --enable-expanded test: generate functions for certain macros], - [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)]) - -### use option --disable-macros to suppress macros in favor of functions -AC_ARG_ENABLE(macros, - [ --disable-macros test: use functions rather than macros], - [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)]) - -# Normally we only add trace() to the debug-library. Allow this to be -# extended to all models of the ncurses library: -cf_all_traces=no -case "$CFLAGS $CPPFLAGS" in -*-DTRACE*) - cf_all_traces=yes - ;; -esac - -AC_MSG_CHECKING(whether to add trace feature to all models) -AC_ARG_WITH(trace, -[ --with-trace test: add trace() function to all models of ncurses], -[cf_with_trace=$withval], -[cf_with_trace=$cf_all_traces]) -AC_MSG_RESULT($with_trace) - -if test "$cf_with_trace" = yes ; then - LIB_TRACING=all - ADA_TRACE=TRUE - CF_ADD_CFLAGS(-DTRACE) -else - LIB_TRACING=DEBUG - ADA_TRACE=FALSE -fi - -AC_SUBST(ADA_TRACE) - -### Checks for libraries. -AC_CHECK_FUNC(gettimeofday, - AC_DEFINE(HAVE_GETTIMEOFDAY),[ - -AC_CHECK_LIB(bsd, gettimeofday, - AC_DEFINE(HAVE_GETTIMEOFDAY) - LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday - -CF_MATH_LIB(MATH_LIB,sin(x)) -AC_SUBST(MATH_LIB) - -### Checks for header files. -AC_STDC_HEADERS -AC_HEADER_DIRENT -AC_HEADER_TIME -CF_REGEX - -dnl These are some other potentially nonportable headers. -AC_CHECK_HEADERS( \ -fcntl.h \ -getopt.h \ -libc.h \ -limits.h \ -locale.h \ -poll.h \ -sys/bsdtypes.h \ -sys/ioctl.h \ -sys/param.h \ -sys/poll.h \ -sys/select.h \ -sys/time.h \ -sys/times.h \ -ttyent.h \ -unistd.h \ -wctype.h ) - -# check for ISC (this may also define _POSIX_SOURCE) -# Note: even non-Posix ISC needs to declare fd_set -if test "$ISC" = yes ; then - AC_CHECK_LIB(cposix,main) - AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()' -fi - -CF_SYS_TIME_SELECT - -### checks for compiler characteristics -AC_LANG_C -AC_C_CONST -AC_C_INLINE -test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) - -CF_TYPEOF_CHTYPE - -### Checks for external-data -CF_ERRNO -CF_LINK_DATAONLY - -### Checks for library functions. -AC_CHECK_FUNCS( \ -getcwd \ -getegid \ -geteuid \ -getttynam \ -issetugid \ -memccpy \ -nanosleep \ -poll \ -remove \ -select \ -setbuf \ -setbuffer \ -setvbuf \ -sigaction \ -sigvec \ -strdup \ -strstr \ -tcgetpgrp \ -times \ -vsnprintf \ -) -if test "$with_getcap" = "yes" ; then - CF_CGETENT -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 - AC_MSG_WARN(cross compiling: assume setvbuf params not reversed) -else - AC_FUNC_SETVBUF_REVERSED -fi -AC_TYPE_SIGNAL -CF_TYPE_SIGACTION -CF_SIZECHANGE -CF_FUNC_MEMMOVE -CF_FUNC_POLL - -dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS -if test -z "$cf_user_CFLAGS" ; then - CF_STRIP_G_OPT(CFLAGS) - CF_STRIP_G_OPT(CXXFLAGS) -fi - -# Just in case, check if the C compiler has a bool type. -CF_BOOL_DECL(cf_cv_cc_bool_type) - -# Check for C++ compiler characteristics (and ensure that it's there!) -if test -n "$CXX" ; then - AC_LANG_CPLUSPLUS - CF_STDCPP_LIBRARY - - case $GXX_VERSION in - 1*|2.[0-6]*) - cf_cxx_library=yes - ;; - *-2.7*|2.7*) - CF_GPP_LIBRARY - ;; - *) - cf_cxx_library=no - ;; - esac - - AC_CHECK_HEADERS(typeinfo) - - CF_BOOL_DECL - CF_BOOL_SIZE - CF_ETIP_DEFINES - CF_CPP_PARAM_INIT - CF_CPP_VSCAN_FUNC - - CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' - case $cf_cv_system_name in #(vi - 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 - - # Just because we are not configuring against C++ right now does not - # mean that a user will not want to use C++. Some distributors disable - # the C++ portion of this configuration as a shortcut (or just to avoid - # compiling the demo in the c++ directory). So we need a reasonable - # default for the 'bool' type. - # - # Caveat: since the storage of the bool type is not standardized, it - # may change. - - 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) - -# If the C compiler did not declare bool, and we did not determine that the C++ -# compiler does not declare bool, turn on an ifdef in curses.h that makes the -# ncurses library use the same type as C++ bool. Note that this allows one to -# specify the type of bool in a configure-script option and postpone -# integration with the C++ compiler provided that the types are compatible. -USE_CXX_BOOL=1 -if test $cf_cv_cc_bool_type = 1 -then - # oops: C has a bool. Unlikely, but C++ could differ. - USE_CXX_BOOL=0 -elif test $cf_cv_builtin_bool = 0 -then - # C++ has no bool - USE_CXX_BOOL=0 -else - # this is the normal case - USE_CXX_BOOL='defined(__cplusplus)' -fi -AC_SUBST(USE_CXX_BOOL) - -CF_HELP_MESSAGE(Ada95 Binding Options:) - -dnl Check for availability of GNU Ada Translator (GNAT). -dnl At the moment we support no other Ada95 compiler. -if test "$cf_with_ada" != "no" ; then -cf_ada_make=gnatmake -AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) -if test "$ac_cv_prog_gnat_exists" = no; then - cf_ada_make= -else - CF_GNAT_VERSION - AC_CHECK_PROG(M4_exists, m4, yes, no) - if test "$ac_cv_prog_M4_exists" = no; then - cf_cv_prog_gnat_correct=no - echo Ada95 binding required program m4 not found. Ada95 binding disabled. - fi - if test "$cf_cv_prog_gnat_correct" = yes; then - AC_MSG_CHECKING(if GNAT works) - CF_GNAT_TRY_RUN([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is -begin - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) - AC_MSG_RESULT($cf_cv_prog_gnat_correct) - fi -fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - - AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], - [cf_ada_compiler=$withval], - [cf_ada_compiler=gnatmake]) - - cf_ada_package=terminal_interface - - AC_SUBST(cf_ada_make) - AC_SUBST(cf_ada_compiler) - AC_SUBST(cf_ada_package) - AC_SUBST(ADAFLAGS) - AC_SUBST(cf_compile_generics) - AC_SUBST(cf_generic_objects) - - CF_WITH_PATH(ada-include, - [ --with-ada-include=DIR Ada includes are in DIR], - ADA_INCLUDE, - PREFIX/lib/ada/adainclude, - [$]prefix/lib/ada/adainclude) - AC_SUBST(ADA_INCLUDE) - - CF_WITH_PATH(ada-objects, - [ --with-ada-objects=DIR Ada objects are in DIR], - ADA_OBJECTS, - PREFIX/lib/ada/adalib, - [$]prefix/lib/ada/adalib) - AC_SUBST(ADA_OBJECTS) - -fi -fi - -### Construct the library-subsets, if any, from this set of keywords: -### none, base, ext_funcs, ext_tinfo, termlib, widechar (see CF_LIB_RULES). -AC_MSG_CHECKING(for library subsets) -if test "$with_termlib" = yes ; then - LIB_SUBSETS="termlib" - test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" - LIB_SUBSETS="${LIB_SUBSETS} " -else - LIB_SUBSETS="termlib+" - test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}ext_tinfo+" -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) - -### Construct the list of include-directories to be generated -CF_INCLUDE_DIRS -CF_ADA_INCLUDE_DIRS - -### Build up pieces for makefile rules -AC_MSG_CHECKING(default library suffix) -CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl -AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("") -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) - -AC_MSG_CHECKING(default object directory) -CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl -AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj") -AC_MSG_RESULT($DFT_OBJ_SUBDIR) - -# libtool thinks it can make c++ shared libraries (perhaps only g++) -if test "$cf_with_cxx" = yes ; then -AC_MSG_CHECKING(c++ library-dependency suffix) -if test "$with_libtool" != "no"; then - CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX -else - CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library -fi -AC_MSG_RESULT($CXX_LIB_SUFFIX) -AC_SUBST(CXX_LIB_SUFFIX) -fi - -TINFO_LIST="$SHLIB_LIST" -if test "$with_libtool" = no ; then - test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" -fi - -AC_MSG_CHECKING(where we will install curses.h) -test "$with_overwrite" = no && \ -test "x$includedir" = 'x${prefix}/include' && \ - includedir='$(prefix)/include/ncurses'${LIB_SUFFIX} -AC_MSG_RESULT($includedir) - -### Resolve a conflict between normal and wide-curses by forcing applications -### that will need libutf8 to add it to their configure script. -if test "$with_overwrite" != no ; then -if test "$NCURSES_LIBUTF8" = 1 ; then - NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' - AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h) -fi -fi - -AC_SUBST(EXTRA_LIBS) -AC_SUBST(TINFO_LIST) -AC_SUBST(SHLIB_LIST) - -### Set up low-level terminfo dependencies for makefiles. Note that we -### could override this. -if test "$with_termlib" = yes ; then - TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}" - if test "$DFT_LWR_MODEL" = "libtool"; then - TEST_ARGS="${TEST_DEPS}" - else - TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}" - fi -fi -PROG_DEPS="$TEST_DEPS" -PROG_ARGS="$TEST_ARGS" - -### predefined stuff for the test programs -AC_DEFINE(HAVE_SLK_COLOR) - -### Construct the list of subdirectories for which we'll customize makefiles -### with the appropriate compile-rules. - -CF_SRC_MODULES($modules_to_build) -CF_DIRS_TO_MAKE - -AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') - -AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}") - -### Now that we're done running tests, add the compiler-warnings, if any -CF_ADD_CFLAGS($EXTRA_CFLAGS) - -################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" -AC_OUTPUT( \ - include/MKterm.h.awk \ - include/curses.head:include/curses.h.in \ - include/termcap.h \ - include/unctrl.h \ - $SUB_MAKEFILES \ - Makefile,[ -CF_LIB_RULES -],[ -### Special initialization commands, used to pass information from the -### configuration-run into config.status - -AWK="$AWK" -CF_LIST_MODELS="$cf_list_models" -DFT_LWR_MODEL="$DFT_LWR_MODEL" -LDCONFIG="$LDCONFIG" -LIB_NAME="$LIB_NAME" -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" -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" -host="$host" -target="$target" - -],cat)dnl -${MAKE-make} preinstall diff --git a/contrib/ncurses/convert_configure.pl b/contrib/ncurses/convert_configure.pl deleted file mode 100644 index dea92ca5d8..0000000000 --- a/contrib/ncurses/convert_configure.pl +++ /dev/null @@ -1,90 +0,0 @@ -extproc perl -S -w - -# The converted script is written to stdout, so run this script as -# convert_configure configure > configure.cmd -# -# When the converted script runs, it expects that /tmp dir is -# available (so we create it). -# -# run the result like this: -# .\configure - -# Some frequent manual intervention: -# a) Some makefiles hardwire SHELL = /bin/sh ==> change to: sh -# b) Some makefiles recognize that exe files terminate on .exe -# You need to give this script -no-zexe option... - -shift, $no_zexe = 1 if @ARGV and $ARGV[0] eq '-no-zexe'; - -mkdir '/tmp', 0777 unless -d '/tmp'; - -print <) { - if (/for\s+(\w+)\s+in\s*\$(PATH|ac_dummy)\s*;/) { - $checking_path = 1; - $varname = $1; - $subst= < $@ - -ANNOUNCE : doc/html/announce.html - $(DUMP) doc/html/announce.html > $@ - -doc/ncurses-intro.doc: doc/html/ncurses-intro.html - $(DUMP2) doc/html/ncurses-intro.html > $@ -doc/hackguide.doc: doc/html/hackguide.html - $(DUMP2) doc/html/hackguide.html > $@ - -MANPROG = tbl | nroff -man - -manhtml: MANIFEST - @rm -f doc/html/man/*.html - @mkdir -p doc/html/man - @rm -f subst.tmp ; - @for f in man/*.[0-9]*; do \ - m=`basename $$f` ;\ - x=`echo $$m | awk -F. '{print $$2;}'` ;\ - xu=`echo $$x | dd conv=ucase 2>/dev/null` ;\ - if [ "$${x}" != "$${xu}" ]; then \ - echo "s/$${xu}/$${x}/g" >> subst.tmp ;\ - fi ;\ - done - # change some things to make weblint happy: - @echo 's///g' >> subst.tmp - @echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp - @echo 's///g' >> subst.tmp - @echo 's/<\/I>/<\/EM>/g' >> subst.tmp - @misc/csort < subst.tmp | uniq > subst.sed - @echo '/<\/TITLE>/a\' >> subst.sed - @echo '\' >> subst.sed - @echo '' >> 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" ;\ - echo '' > doc/html/man/$$g ;\ - echo '' >> doc/html/man/$$g ;\ - man/edit_man.sh normal 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 ;\ - done - @rm -f subst.sed - @sed -e "\%./doc/html/man/%d" < MANIFEST > MANIFEST.tmp - @find ./doc/html/man -type f -print >> MANIFEST.tmp - @chmod u+w MANIFEST - @misc/csort -u < MANIFEST.tmp > MANIFEST - @rm -f MANIFEST.tmp - -# -# Please note that this target can only be properly built if the build of the -# Ada95 subdir has been done. The reason is, that the gnathtml tool uses the -# .ali files generated by the Ada95 compiler during the build process. These -# .ali files contain cross referencing information required by gnathtml. -adahtml: MANIFEST - if [ ! -z "$(GNATHTML)" ]; then \ - (cd ./Ada95/gen ; make html) ;\ - sed -e "\%./doc/html/ada/%d" < MANIFEST > MANIFEST.tmp ;\ - find ./doc/html/ada -type f -print >> MANIFEST.tmp ;\ - misc/csort -u < MANIFEST.tmp > MANIFEST ;\ - rm -f MANIFEST.tmp ;\ - fi - -# Prepare distribution for version control -vcprepare: - find . -type d -exec mkdir {}/RCS \; - -# Write-lock almost all files not under version control. -ADA_EXCEPTIONS=$(shell eval 'a="\\\\\|";for x in Ada95/gen/terminal*.m4; do echo -n $${a}Ada95/ada_include/`basename $${x} .m4`; done') -EXCEPTIONS = 'announce.html$\\|ANNOUNCE\\|misc/.*\\.doc\\|man/terminfo.5\\|lib_gen.c'$(ADA_EXCEPTIONS) -writelock: - for x in `grep -v $(EXCEPTIONS) MANIFEST`; do if [ ! -f `dirname $$x`/RCS/`basename $$x`,v ]; then chmod a-w $${x}; fi; done - -# This only works on a clean source tree, of course. -MANIFEST: - -rm -f $@ - touch $@ - find . -type f -print |misc/csort | fgrep -v .lsm |fgrep -v .spec >$@ - -TAGS: - etags */*.[ch] - -# Makefile ends here diff --git a/contrib/ncurses/doc/hackguide.doc b/contrib/ncurses/doc/hackguide.doc deleted file mode 100644 index a352430168..0000000000 --- a/contrib/ncurses/doc/hackguide.doc +++ /dev/null @@ -1,687 +0,0 @@ - - A Hacker's Guide to NCURSES - - Contents - - * Abstract - * Objective of the Package - + Why System V Curses? - + How to Design Extensions - * Portability and Configuration - * Documentation Conventions - * How to Report Bugs - * A Tour of the Ncurses Library - + Library Overview - + The Engine Room - + Keyboard Input - + Mouse Events - + Output and Screen Updating - * The Forms and Menu Libraries - * A Tour of the Terminfo Compiler - + Translation of Non-use Capabilities - + Use Capability Resolution - + Source-Form Translation - * Other Utilities - * Style Tips for Developers - * Porting Hints - - Abstract - - This document is a hacker's tour of the ncurses library and utilities. - It discusses design philosophy, implementation methods, and the - conventions used for coding and documentation. It is recommended - reading for anyone who is interested in porting, extending or - improving the package. - - Objective of the Package - - The objective of the ncurses package is to provide a free software API - for character-cell terminals and terminal emulators with the following - characteristics: - * Source-compatible with historical curses implementations - (including the original BSD curses and System V curses. - * Conformant with the XSI Curses standard issued as part of XPG4 by - X/Open. - * High-quality -- stable and reliable code, wide portability, good - packaging, superior documentation. - * Featureful -- should eliminate as much of the drudgery of C - interface programming as possible, freeing programmers to think at - a higher level of design. - - These objectives are in priority order. So, for example, source - compatibility with older version must trump featurefulness -- we - cannot add features if it means breaking the portion of the API - corresponding to historical curses versions. - -Why System V Curses? - - We used System V curses as a model, reverse-engineering their API, in - order to fulfill the first two objectives. - - System V curses implementations can support BSD curses programs with - just a recompilation, so by capturing the System V API we also capture - BSD's. - - More importantly for the future, the XSI Curses standard issued by - X/Open is explicitly and closely modeled on System V. So conformance - with System V took us most of the way to base-level XSI conformance. - -How to Design Extensions - - The third objective (standards conformance) requires that it be easy - to condition source code using ncurses so that the absence of - nonstandard extensions does not break the code. - - Accordingly, we have a policy of associating with each nonstandard - extension a feature macro, so that ncurses client code can use this - macro to condition in or out the code that requires the ncurses - extension. - - For example, there is a macro NCURSES_MOUSE_VERSION which XSI Curses - does not define, but which is defined in the ncurses library header. - You can use this to condition the calls to the mouse API calls. - - Portability and Configuration - - Code written for ncurses may assume an ANSI-standard C compiler and - POSIX-compatible OS interface. It may also assume the presence of a - System-V-compatible select(2) call. - - We encourage (but do not require) developers to make the code friendly - to less-capable UNIX environments wherever possible. - - We encourage developers to support OS-specific optimizations and - methods not available under POSIX/ANSI, provided only that: - * All such code is properly conditioned so the build process does - not attempt to compile it under a plain ANSI/POSIX environment. - * Adding such implementation methods does not introduce - incompatibilities in the ncurses API between platforms. - - We use GNU autoconf(1) as a tool to deal with portability issues. The - right way to leverage an OS-specific feature is to modify the autoconf - specification files (configure.in and aclocal.m4) to set up a new - feature macro, which you then use to condition your code. - - Documentation Conventions - - There are three kinds of documentation associated with this package. - Each has a different preferred format: - * Package-internal files (README, INSTALL, TO-DO etc.) - * Manual pages. - * Everything else (i.e., narrative documentation). - - Our conventions are simple: - 1. Maintain package-internal files in plain text. The expected viewer - for them more(1) or an editor window; there's no point in - elaborate mark-up. - 2. Mark up manual pages in the man macros. These have to be viewable - through traditional man(1) programs. - 3. Write everything else in HTML. - - When in doubt, HTMLize a master and use lynx(1) to generate plain - ASCII (as we do for the announcement document). - - The reason for choosing HTML is that it's (a) well-adapted for on-line - browsing through viewers that are everywhere; (b) more easily readable - as plain text than most other mark-ups, if you don't have a viewer; - and (c) carries enough information that you can generate a - nice-looking printed version from it. Also, of course, it make - exporting things like the announcement document to WWW pretty trivial. - - How to Report Bugs - - The reporting address for bugs is bug-ncurses@gnu.org. This is a - majordomo list; to join, write to bug-ncurses-request@gnu.org with a - message containing the line: - subscribe @ - - The ncurses code is maintained by a small group of volunteers. While - we try our best to fix bugs promptly, we simply don't have a lot of - hours to spend on elementary hand-holding. We rely on intelligent - cooperation from our users. If you think you have found a bug in - ncurses, there are some steps you can take before contacting us that - will help get the bug fixed quickly. - - In order to use our bug-fixing time efficiently, we put people who - show us they've taken these steps at the head of our queue. This means - that if you don't, you'll probably end up at the tail end and have to - wait a while. - 1. Develop a recipe to reproduce the bug. - Bugs we can reproduce are likely to be fixed very quickly, often - within days. The most effective single thing you can do to get a - quick fix is develop a way we can duplicate the bad behavior -- - ideally, by giving us source for a small, portable test program - that breaks the library. (Even better is a keystroke recipe using - one of the test programs provided with the distribution.) - 2. Try to reproduce the bug on a different terminal type. - In our experience, most of the behaviors people report as library - bugs are actually due to subtle problems in terminal descriptions. - This is especially likely to be true if you're using a traditional - asynchronous terminal or PC-based terminal emulator, rather than - xterm or a UNIX console entry. - It's therefore extremely helpful if you can tell us whether or not - your problem reproduces on other terminal types. Usually you'll - have both a console type and xterm available; please tell us - whether or not your bug reproduces on both. - If you have xterm available, it is also good to collect xterm - reports for different window sizes. This is especially true if you - normally use an unusual xterm window size -- a surprising number - of the bugs we've seen are either triggered or masked by these. - 3. Generate and examine a trace file for the broken behavior. - Recompile your program with the debugging versions of the - libraries. Insert a trace() call with the argument set to - TRACE_UPDATE. (See "Writing Programs with NCURSES" for details on - trace levels.) Reproduce your bug, then look at the trace file to - see what the library was actually doing. - Another frequent cause of apparent bugs is application coding - errors that cause the wrong things to be put on the virtual - screen. Looking at the virtual-screen dumps in the trace file will - tell you immediately if this is happening, and save you from the - possible embarrassment of being told that the bug is in your code - and is your problem rather than ours. - If the virtual-screen dumps look correct but the bug persists, - it's possible to crank up the trace level to give more and more - information about the library's update actions and the control - sequences it issues to perform them. The test directory of the - distribution contains a tool for digesting these logs to make them - less tedious to wade through. - Often you'll find terminfo problems at this stage by noticing that - the escape sequences put out for various capabilities are wrong. - If not, you're likely to learn enough to be able to characterize - any bug in the screen-update logic quite exactly. - 4. Report details and symptoms, not just interpretations. - If you do the preceding two steps, it is very likely that you'll - discover the nature of the problem yourself and be able to send us - a fix. This will create happy feelings all around and earn you - good karma for the first time you run into a bug you really can't - characterize and fix yourself. - If you're still stuck, at least you'll know what to tell us. - Remember, we need details. If you guess about what is safe to - leave out, you are too likely to be wrong. - If your bug produces a bad update, include a trace file. Try to - make the trace at the least voluminous level that pins down the - bug. Logs that have been through tracemunch are OK, it doesn't - throw away any information (actually they're better than - un-munched ones because they're easier to read). - If your bug produces a core-dump, please include a symbolic stack - trace generated by gdb(1) or your local equivalent. - Tell us about every terminal on which you've reproduced the bug -- - and every terminal on which you can't. Ideally, sent us terminfo - sources for all of these (yours might differ from ours). - Include your ncurses version and your OS/machine type, of course! - You can find your ncurses version in the curses.h file. - - If your problem smells like a logic error or in cursor movement or - scrolling or a bad capability, there are a couple of tiny test frames - for the library algorithms in the progs directory that may help you - isolate it. These are not part of the normal build, but do have their - own make productions. - - The most important of these is mvcur, a test frame for the - cursor-movement optimization code. With this program, you can see - directly what control sequences will be emitted for any given cursor - movement or scroll/insert/delete operations. If you think you've got a - bad capability identified, you can disable it and test again. The - program is command-driven and has on-line help. - - If you think the vertical-scroll optimization is broken, or just want - to understand how it works better, build hashmap and read the header - comments of hardscroll.c and hashmap.c; then try it out. You can also - test the hardware-scrolling optimization separately with hardscroll. - - There's one other interactive tester, tctest, that exercises - translation between termcap and terminfo formats. If you have a - serious need to run this, you probably belong on our development team! - - A Tour of the Ncurses Library - -Library Overview - - Most of the library is superstructure -- fairly trivial convenience - interfaces to a small set of basic functions and data structures used - to manipulate the virtual screen (in particular, none of this code - does any I/O except through calls to more fundamental modules - described below). The files - - lib_addch.c lib_bkgd.c lib_box.c lib_chgat.c lib_clear.c - lib_clearok.c lib_clrbot.c lib_clreol.c lib_colorset.c lib_data.c - lib_delch.c lib_delwin.c lib_echo.c lib_erase.c lib_gen.c - lib_getstr.c lib_hline.c lib_immedok.c lib_inchstr.c lib_insch.c - lib_insdel.c lib_insstr.c lib_instr.c lib_isendwin.c lib_keyname.c - lib_leaveok.c lib_move.c lib_mvwin.c lib_overlay.c lib_pad.c - lib_printw.c lib_redrawln.c lib_scanw.c lib_screen.c lib_scroll.c - lib_scrollok.c lib_scrreg.c lib_set_term.c lib_slk.c - lib_slkatr_set.c lib_slkatrof.c lib_slkatron.c lib_slkatrset.c - lib_slkattr.c lib_slkclear.c lib_slkcolor.c lib_slkinit.c - lib_slklab.c lib_slkrefr.c lib_slkset.c lib_slktouch.c lib_touch.c - lib_unctrl.c lib_vline.c lib_wattroff.c lib_wattron.c lib_window.c - - are all in this category. They are very unlikely to need change, - barring bugs or some fundamental reorganization in the underlying data - structures. - - These files are used only for debugging support: - - lib_trace.c lib_traceatr.c lib_tracebits.c lib_tracechr.c - lib_tracedmp.c lib_tracemse.c trace_buf.c - - It is rather unlikely you will ever need to change these, unless you - want to introduce a new debug trace level for some reasoon. - - There is another group of files that do direct I/O via tputs(), - computations on the terminal capabilities, or queries to the OS - environment, but nevertheless have only fairly low complexity. These - include: - - lib_acs.c lib_beep.c lib_color.c lib_endwin.c lib_initscr.c - lib_longname.c lib_newterm.c lib_options.c lib_termcap.c lib_ti.c - lib_tparm.c lib_tputs.c lib_vidattr.c read_entry.c. - - They are likely to need revision only if ncurses is being ported to an - environment without an underlying terminfo capability representation. - - These files have serious hooks into the tty driver and signal - facilities: - - lib_kernel.c lib_baudrate.c lib_raw.c lib_tstp.c lib_twait.c - - If you run into porting snafus moving the package to another UNIX, the - problem is likely to be in one of these files. The file lib_print.c - uses sleep(2) and also falls in this category. - - Almost all of the real work is done in the files - - hardscroll.c hashmap.c lib_addch.c lib_doupdate.c lib_getch.c - lib_mouse.c lib_mvcur.c lib_refresh.c lib_setup.c lib_vidattr.c - - Most of the algorithmic complexity in the library lives in these - files. If there is a real bug in ncurses itself, it's probably here. - We'll tour some of these files in detail below (see The Engine Room). - - Finally, there is a group of files that is actually most of the - terminfo compiler. The reason this code lives in the ncurses library - is to support fallback to /etc/termcap. These files include - - alloc_entry.c captoinfo.c comp_captab.c comp_error.c comp_hash.c - comp_parse.c comp_scan.c parse_entry.c read_termcap.c write_entry.c - - We'll discuss these in the compiler tour. - -The Engine Room - - Keyboard Input - - All ncurses input funnels through the function wgetch(), defined in - lib_getch.c. This function is tricky; it has to poll for keyboard and - mouse events and do a running match of incoming input against the set - of defined special keys. - - The central data structure in this module is a FIFO queue, used to - match multiple-character input sequences against special-key - capabilities; also to implement pushback via ungetch(). - - The wgetch() code distinguishes between function key sequences and the - same sequences typed manually by doing a timed wait after each input - character that could lead a function key sequence. If the entire - sequence takes less than 1 second, it is assumed to have been - generated by a function key press. - - Hackers bruised by previous encounters with variant select(2) calls - may find the code in lib_twait.c interesting. It deals with the - problem that some BSD selects don't return a reliable time-left value. - The function timed_wait() effectively simulates a System V select. - - Mouse Events - - If the mouse interface is active, wgetch() polls for mouse events each - call, before it goes to the keyboard for input. It is up to - lib_mouse.c how the polling is accomplished; it may vary for different - devices. - - Under xterm, however, mouse event notifications come in via the - keyboard input stream. They are recognized by having the kmous - capability as a prefix. This is kind of klugey, but trying to wire in - recognition of a mouse key prefix without going through the - function-key machinery would be just too painful, and this turns out - to imply having the prefix somewhere in the function-key capabilities - at terminal-type initialization. - - This kluge only works because kmous isn't actually used by any - historic terminal type or curses implementation we know of. Best guess - is it's a relic of some forgotten experiment in-house at Bell Labs - that didn't leave any traces in the publicly-distributed System V - terminfo files. If System V or XPG4 ever gets serious about using it - again, this kluge may have to change. - - Here are some more details about mouse event handling: - - The lib_mouse()code is logically split into a lower level that accepts - event reports in a device-dependent format and an upper level that - parses mouse gestures and filters events. The mediating data structure - is a circular queue of event structures. - - Functionally, the lower level's job is to pick up primitive events and - put them on the circular queue. This can happen in one of two ways: - either (a) _nc_mouse_event() detects a series of incoming mouse - reports and queues them, or (b) code in lib_getch.c detects the kmous - prefix in the keyboard input stream and calls _nc_mouse_inline to - queue up a series of adjacent mouse reports. - - In either case, _nc_mouse_parse() should be called after the series is - accepted to parse the digested mouse reports (low-level events) into a - gesture (a high-level or composite event). - - Output and Screen Updating - - With the single exception of character echoes during a wgetnstr() call - (which simulates cooked-mode line editing in an ncurses window), the - library normally does all its output at refresh time. - - The main job is to go from the current state of the screen (as - represented in the curscr window structure) to the desired new state - (as represented in the newscr window structure), while doing as little - I/O as possible. - - The brains of this operation are the modules hashmap.c, hardscroll.c - and lib_doupdate.c; the latter two use lib_mvcur.c. Essentially, what - happens looks like this: - - The hashmap.c module tries to detect vertical motion changes between - the real and virtual screens. This information is represented by the - oldindex members in the newscr structure. These are modified by - vertical-motion and clear operations, and both are re-initialized - after each update. To this change-journalling information, the hashmap - code adds deductions made using a modified Heckel algorithm on hash - values generated from the line contents. - - The hardscroll.c module computes an optimum set of scroll, insertion, - and deletion operations to make the indices match. It calls - _nc_mvcur_scrolln() in lib_mvcur.c to do those motions. - - Then lib_doupdate.c goes to work. Its job is to do line-by-line - transformations of curscr lines to newscr lines. Its main tool is the - routine mvcur() in lib_mvcur.c. This routine does cursor-movement - optimization, attempting to get from given screen location A to given - location B in the fewest output characters posible. - - If you want to work on screen optimizations, you should use the fact - that (in the trace-enabled version of the library) enabling the - TRACE_TIMES trace level causes a report to be emitted after each - screen update giving the elapsed time and a count of characters - emitted during the update. You can use this to tell when an update - optimization improves efficiency. - - In the trace-enabled version of the library, it is also possible to - disable and re-enable various optimizations at runtime by tweaking the - variable _nc_optimize_enable. See the file include/curses.h.in for - mask values, near the end. - - The Forms and Menu Libraries - - The forms and menu libraries should work reliably in any environment - you can port ncurses to. The only portability issue anywhere in them - is what flavor of regular expressions the built-in form field type - TYPE_REGEXP will recognize. - - The configuration code prefers the POSIX regex facility, modeled on - System V's, but will settle for BSD regexps if the former isn't - available. - - Historical note: the panels code was written primarily to assist in - porting u386mon 2.0 (comp.sources.misc v14i001-4) to systems lacking - panels support; u386mon 2.10 and beyond use it. This version has been - slightly cleaned up for ncurses. - - A Tour of the Terminfo Compiler - - The ncurses implementation of tic is rather complex internally; it has - to do a trying combination of missions. This starts with the fact - that, in addition to its normal duty of compiling terminfo sources - into loadable terminfo binaries, it has to be able to handle termcap - syntax and compile that too into terminfo entries. - - The implementation therefore starts with a table-driven, dual-mode - lexical analyzer (in comp_scan.c). The lexer chooses its mode (termcap - or terminfo) based on the first `,' or `:' it finds in each entry. The - lexer does all the work of recognizing capability names and values; - the grammar above it is trivial, just "parse entries till you run out - of file". - -Translation of Non-use Capabilities - - Translation of most things besides use capabilities is pretty - straightforward. The lexical analyzer's tokenizer hands each - capability name to a hash function, which drives a table lookup. The - table entry yields an index which is used to look up the token type in - another table, and controls interpretation of the value. - - One possibly interesting aspect of the implementation is the way the - compiler tables are initialized. All the tables are generated by - various awk/sed/sh scripts from a master table include/Caps; these - scripts actually write C initializers which are linked to the - compiler. Furthermore, the hash table is generated in the same way, so - it doesn't have to be generated at compiler startup time (another - benefit of this organization is that the hash table can be in - shareable text space). - - Thus, adding a new capability is usually pretty trivial, just a matter - of adding one line to the include/Caps file. We'll have more to say - about this in the section on Source-Form Translation. - -Use Capability Resolution - - The background problem that makes tic tricky isn't the capability - translation itself, it's the resolution of use capabilities. Older - versions would not handle forward use references for this reason (that - is, a using terminal always had to follow its use target in the source - file). By doing this, they got away with a simple implementation - tactic; compile everything as it blows by, then resolve uses from - compiled entries. - - This won't do for ncurses. The problem is that that the whole - compilation process has to be embeddable in the ncurses library so - that it can be called by the startup code to translate termcap entries - on the fly. The embedded version can't go promiscuously writing - everything it translates out to disk -- for one thing, it will - typically be running with non-root permissions. - - So our tic is designed to parse an entire terminfo file into a - doubly-linked circular list of entry structures in-core, and then do - use resolution in-memory before writing everything out. This design - has other advantages: it makes forward and back use-references equally - easy (so we get the latter for free), and it makes checking for name - collisions before they're written out easy to do. - - And this is exactly how the embedded version works. But the - stand-alone user-accessible version of tic partly reverts to the - historical strategy; it writes to disk (not keeping in core) any entry - with no use references. - - This is strictly a core-economy kluge, implemented because the - terminfo master file is large enough that some core-poor systems swap - like crazy when you compile it all in memory...there have been reports - of this process taking three hours, rather than the twenty seconds or - less typical on the author's development box. - - So. The executable tic passes the entry-parser a hook that immediately - writes out the referenced entry if it has no use capabilities. The - compiler main loop refrains from adding the entry to the in-core list - when this hook fires. If some other entry later needs to reference an - entry that got written immediately, that's OK; the resolution code - will fetch it off disk when it can't find it in core. - - Name collisions will still be detected, just not as cleanly. The - write_entry() code complains before overwriting an entry that - postdates the time of tic's first call to write_entry(), Thus it will - complain about overwriting entries newly made during the tic run, but - not about overwriting ones that predate it. - -Source-Form Translation - - Another use of tic is to do source translation between various termcap - and terminfo formats. There are more variants out there than you might - think; the ones we know about are described in the captoinfo(1) manual - page. - - The translation output code (dump_entry() in ncurses/dump_entry.c) is - shared with the infocmp(1) utility. It takes the same internal - representation used to generate the binary form and dumps it to - standard output in a specified format. - - The include/Caps file has a header comment describing ways you can - specify source translations for nonstandard capabilities just by - altering the master table. It's possible to set up capability aliasing - or tell the compiler to plain ignore a given capability without - writing any C code at all. - - For circumstances where you need to do algorithmic translation, there - are functions in parse_entry.c called after the parse of each entry - that are specifically intended to encapsulate such translations. This, - for example, is where the AIX box1 capability get translated to an - acsc string. - - Other Utilities - - The infocmp utility is just a wrapper around the same entry-dumping - code used by tic for source translation. Perhaps the one interesting - aspect of the code is the use of a predicate function passed in to - dump_entry() to control which capabilities are dumped. This is - necessary in order to handle both the ordinary De-compilation case and - entry difference reporting. - - The tput and clear utilities just do an entry load followed by a - tputs() of a selected capability. - - Style Tips for Developers - - See the TO-DO file in the top-level directory of the source - distribution for additions that would be particularly useful. - - The prefix _nc_ should be used on library public functions that are - not part of the curses API in order to prevent pollution of the - application namespace. If you have to add to or modify the function - prototypes in curses.h.in, read ncurses/MKlib_gen.sh first so you can - avoid breaking XSI conformance. Please join the ncurses mailing list. - See the INSTALL file in the top level of the distribution for details - on the list. - - Look for the string FIXME in source files to tag minor bugs and - potential problems that could use fixing. - - Don't try to auto-detect OS features in the main body of the C code. - That's the job of the configuration system. - - To hold down complexity, do make your code data-driven. Especially, if - you can drive logic from a table filtered out of include/Caps, do it. - If you find you need to augment the data in that file in order to - generate the proper table, that's still preferable to ad-hoc code -- - that's why the fifth field (flags) is there. - - Have fun! - - Porting Hints - - The following notes are intended to be a first step towards DOS and - Macintosh ports of the ncurses libraries. - - The following library modules are `pure curses'; they operate only on - the curses internal structures, do all output through other curses - calls (not including tputs() and putp()) and do not call any other - UNIX routines such as signal(2) or the stdio library. Thus, they - should not need to be modified for single-terminal ports. - - lib_addch.c lib_addstr.c lib_bkgd.c lib_box.c lib_clear.c - lib_clrbot.c lib_clreol.c lib_delch.c lib_delwin.c lib_erase.c - lib_inchstr.c lib_insch.c lib_insdel.c lib_insstr.c lib_keyname.c - lib_move.c lib_mvwin.c lib_newwin.c lib_overlay.c lib_pad.c - lib_printw.c lib_refresh.c lib_scanw.c lib_scroll.c lib_scrreg.c - lib_set_term.c lib_touch.c lib_tparm.c lib_tputs.c lib_unctrl.c - lib_window.c panel.c - - This module is pure curses, but calls outstr(): - - lib_getstr.c - - These modules are pure curses, except that they use tputs() and - putp(): - - lib_beep.c lib_color.c lib_endwin.c lib_options.c lib_slk.c - lib_vidattr.c - - This modules assist in POSIX emulation on non-POSIX systems: - - sigaction.c - signal calls - - The following source files will not be needed for a - single-terminal-type port. - - alloc_entry.c captoinfo.c clear.c comp_captab.c comp_error.c - comp_hash.c comp_main.c comp_parse.c comp_scan.c dump_entry.c - infocmp.c parse_entry.c read_entry.c tput.c write_entry.c - - The following modules will use open()/read()/write()/close()/lseek() - on files, but no other OS calls. - - lib_screen.c - used to read/write screen dumps - - lib_trace.c - used to write trace data to the logfile - - Modules that would have to be modified for a port start here: - - The following modules are `pure curses' but contain assumptions - inappropriate for a memory-mapped port. - - lib_longname.c - assumes there may be multiple terminals - - lib_acs.c - assumes acs_map as a double indirection - - lib_mvcur.c - assumes cursor moves have variable cost - - lib_termcap.c - assumes there may be multiple terminals - - lib_ti.c - assumes there may be multiple terminals - - The following modules use UNIX-specific calls: - - lib_doupdate.c - input checking - - lib_getch.c - read() - - lib_initscr.c - getenv() - - lib_newterm.c - lib_baudrate.c - lib_kernel.c - various tty-manipulation and system calls - - lib_raw.c - various tty-manipulation calls - - lib_setup.c - various tty-manipulation calls - - lib_restart.c - various tty-manipulation calls - - lib_tstp.c - signal-manipulation calls - - lib_twait.c - gettimeofday(), select(). - _________________________________________________________________ - - - Eric S. Raymond - - (Note: This is not the bug address!) diff --git a/contrib/ncurses/doc/html/Ada95.html b/contrib/ncurses/doc/html/Ada95.html deleted file mode 100644 index 043b9de5d2..0000000000 --- a/contrib/ncurses/doc/html/Ada95.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - -Ada95 Binding for ncurses - - -

Ada95 Binding for ncurses

-by Jürgen Pfeifer. - -
-

General Remarks

-
    -
  • This document describes Version 01.00 of the binding.
  • -
  • The functionality is modeled to be compatible with the ncurses -package, a clone of the SVr4 curses model.
    -I did the development on an Intel box running the latest stable release of -Linux, ncurses and the most recent released -GNU Ada Translator -gnat versions. For any older versions of ncurses and gnat -it is not guaranteed to work.
  • -
  • You must have the m4 macroprocessor to build this package. -If you don't have this program, you can get the FSF version -here.
  • -
  • Ada programs are supposed to be readable. One of my -favorite methods to make code readable is to use expressive -names for the identifiers. You can find a list of a mapping -of the cryptic curses names to the Ada names in this table.
  • -
  • This is not a typical one-to-one interface mapping. It is -close to one-to-one on the functional level. Each (n)curses function -has it's counterpart with a more or less similar formal parameter list -in the binding. It is not one-to-one with respect to the datatypes. -I tried to make records out of the flat chtype and similar structures, -so you don't have to do bit operations to mark an attributed character -as bold. Just make the boolean member bold of the record -true. The binding also hides the structures like WINDOW, PANEL, MENU, FORM -etc. ! It's a pure functional API.
  • -
  • I try to do as much error checking as possible and feasible -in the binding. I will raise an Ada exception when something -went wrong in the low-level curses. This has the effect that - at least -first time in my life - (n)curses programs have now a very rigid error -checking, but - thanks to Ada - you don't have to code the orgiastic -error checking style of C.
  • -
  • Support for wide characters is currently not in the binding, as it -is not really in ncurses at this point in time.
  • -
- -

Limitations

-
    -
  • I provide no SCREEN datatype and functions to set a new screen. -If you need this (mostly for debugging I guess), write a small -C routine doing all this and import it into your Ada program.
  • -
  • I provide no functions to switch on/off curses tracing options. -Same suggestion as above.
  • -
  • Although Ada95 is an OO Language, this binding doesn't provide -an OO abstraction of the (n)curses functionality. As mentioned above -it's a thin binding for the (n)curses functions. But without any -doubt it would be nice to build on top of this an OO abstraction -of (n)curses functionality.
    -The only exception is the method how fieldtypes are represented in -this Binding. We provide an abstract tagged type Field_Type from -which the various fieldtypes are derived.
  • -
  • I currently do not support the link_fieldtype functionality of the -forms subsystem.
  • -
  • The *_IO packages are currently output only.
  • -
- -

Hierarchy of packages

- -If you want to navigate through the html pages of the package specs, click here. -

Implementation Details

-

Behind the abstraction

-All the new types like Window, Panel, -Menu, Form etc. are just -opaque representations of the pointers to the corresponding -low level (n)curses structures like -WINDOW *, PANEL *, -MENU * or FORM *. -So you can safely pass them to C routines that expect a pointer -to one of those structures. -

Extended ripoffline() usage

-The official documentation of (n)curses says, that the line parameter -determines only whether or not exactly one line is -stolen from the top or bottom of the screen. So essentially only the -sign of the parameter is evaluated. ncurses has internally implemented -it in a way, that uses the line parameter also to control the amount of -lines to steal. This mechanism is used in the Rip_Off_Lines -routine of the binding. -

How user defined field types work

-TBD -

Enumeration fields handling

-The (n)curses documentation says, that the String arrays to be passed to -an TYPE_ENUM fieldtype must not be automatic variables. This is not true -in this binding, because it is internally arranged to safely copy these -values. -

Using other Ada compilers

-This should basically not be a problem. -

Port to other curses implementations

-Basically it should not be too hard to make all this run on a regular SVr4 -implementation of curses. The problems are probably these:
-
    -
  • ncurses has some additional features which are presented in this binding. You -have two choices to deal with this: -
      -
    • Emulate the feature in this binding
    • -
    • Raise an exception for non implemented features
    • -
    -Most likely you will follow a mixed approach. Some features are easy to simulate, -others will be hard if not impossible.
  • -
-I'm quite sure I forgot something. - - diff --git a/contrib/ncurses/doc/html/ada/files.htm b/contrib/ncurses/doc/html/ada/files.htm deleted file mode 100644 index 682207c077..0000000000 --- a/contrib/ncurses/doc/html/ada/files.htm +++ /dev/null @@ -1,5 +0,0 @@ - - -

Files

-[T] - \ No newline at end of file diff --git a/contrib/ncurses/doc/html/ada/files/T.htm b/contrib/ncurses/doc/html/ada/files/T.htm deleted file mode 100644 index b99789411e..0000000000 --- a/contrib/ncurses/doc/html/ada/files/T.htm +++ /dev/null @@ -1,77 +0,0 @@ -T - -

Files - T

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs.htm b/contrib/ncurses/doc/html/ada/funcs.htm deleted file mode 100644 index 96e0b14471..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs.htm +++ /dev/null @@ -1,27 +0,0 @@ - - -

Functions/Procedures

-[ ] -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] - \ No newline at end of file diff --git a/contrib/ncurses/doc/html/ada/funcs/A.htm b/contrib/ncurses/doc/html/ada/funcs/A.htm deleted file mode 100644 index c59849d810..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/A.htm +++ /dev/null @@ -1,8 +0,0 @@ -A - -

Functions - A

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/B.htm b/contrib/ncurses/doc/html/ada/funcs/B.htm deleted file mode 100644 index d23957e1db..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/B.htm +++ /dev/null @@ -1,10 +0,0 @@ -B - -

Functions - B

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/C.htm b/contrib/ncurses/doc/html/ada/funcs/C.htm deleted file mode 100644 index 949508ddd4..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/C.htm +++ /dev/null @@ -1,33 +0,0 @@ -C - -

Functions - C

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/D.htm b/contrib/ncurses/doc/html/ada/funcs/D.htm deleted file mode 100644 index fa010bc74b..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/D.htm +++ /dev/null @@ -1,21 +0,0 @@ -D - -

Functions - D

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/E.htm b/contrib/ncurses/doc/html/ada/funcs/E.htm deleted file mode 100644 index 933c74ad46..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/E.htm +++ /dev/null @@ -1,9 +0,0 @@ -E - -

Functions - E

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/F.htm b/contrib/ncurses/doc/html/ada/funcs/F.htm deleted file mode 100644 index 5a95433f38..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/F.htm +++ /dev/null @@ -1,42 +0,0 @@ -F - -

Functions - F

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/G.htm b/contrib/ncurses/doc/html/ada/funcs/G.htm deleted file mode 100644 index 1a57040da8..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/G.htm +++ /dev/null @@ -1,32 +0,0 @@ -G - -

Functions - G

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/H.htm b/contrib/ncurses/doc/html/ada/funcs/H.htm deleted file mode 100644 index c3aa478945..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/H.htm +++ /dev/null @@ -1,13 +0,0 @@ -H - -

Functions - H

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/I.htm b/contrib/ncurses/doc/html/ada/funcs/I.htm deleted file mode 100644 index 4968d3c2bf..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/I.htm +++ /dev/null @@ -1,28 +0,0 @@ -I - -

Functions - I

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/K.htm b/contrib/ncurses/doc/html/ada/funcs/K.htm deleted file mode 100644 index ad419ef3a2..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/K.htm +++ /dev/null @@ -1,10 +0,0 @@ -K - -

Functions - K

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/L.htm b/contrib/ncurses/doc/html/ada/funcs/L.htm deleted file mode 100644 index b97a815e9d..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/L.htm +++ /dev/null @@ -1,14 +0,0 @@ -L - -

Functions - L

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/M.htm b/contrib/ncurses/doc/html/ada/funcs/M.htm deleted file mode 100644 index 37297ae05f..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/M.htm +++ /dev/null @@ -1,43 +0,0 @@ -M - -

Functions - M

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/N.htm b/contrib/ncurses/doc/html/ada/funcs/N.htm deleted file mode 100644 index 10345d6ae0..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/N.htm +++ /dev/null @@ -1,27 +0,0 @@ -N - -

Functions - N

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/O.htm b/contrib/ncurses/doc/html/ada/funcs/O.htm deleted file mode 100644 index a4e4d3b7cd..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/O.htm +++ /dev/null @@ -1,9 +0,0 @@ -O - -

Functions - O

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/P.htm b/contrib/ncurses/doc/html/ada/funcs/P.htm deleted file mode 100644 index 2e5fc912b1..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/P.htm +++ /dev/null @@ -1,43 +0,0 @@ -P - -

Functions - P

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/Q.htm b/contrib/ncurses/doc/html/ada/funcs/Q.htm deleted file mode 100644 index 8164ad3e9e..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/Q.htm +++ /dev/null @@ -1,7 +0,0 @@ -Q - -

Functions - Q

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/R.htm b/contrib/ncurses/doc/html/ada/funcs/R.htm deleted file mode 100644 index eb6817b1e4..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/R.htm +++ /dev/null @@ -1,19 +0,0 @@ -R - -

Functions - R

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/S.htm b/contrib/ncurses/doc/html/ada/funcs/S.htm deleted file mode 100644 index 9e68099fd2..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/S.htm +++ /dev/null @@ -1,97 +0,0 @@ -S - -

Functions - S

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/T.htm b/contrib/ncurses/doc/html/ada/funcs/T.htm deleted file mode 100644 index 3988e33847..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/T.htm +++ /dev/null @@ -1,30 +0,0 @@ -T - -

Functions - T

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/U.htm b/contrib/ncurses/doc/html/ada/funcs/U.htm deleted file mode 100644 index 1d8b8756f4..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/U.htm +++ /dev/null @@ -1,11 +0,0 @@ -U - -

Functions - U

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/V.htm b/contrib/ncurses/doc/html/ada/funcs/V.htm deleted file mode 100644 index 1562c4a34c..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/V.htm +++ /dev/null @@ -1,7 +0,0 @@ -V - -

Functions - V

-[index] - diff --git a/contrib/ncurses/doc/html/ada/funcs/W.htm b/contrib/ncurses/doc/html/ada/funcs/W.htm deleted file mode 100644 index 00fd97694c..0000000000 --- a/contrib/ncurses/doc/html/ada/funcs/W.htm +++ /dev/null @@ -1,55 +0,0 @@ -W - -

Functions - W

-[index] - diff --git a/contrib/ncurses/doc/html/ada/index.htm b/contrib/ncurses/doc/html/ada/index.htm deleted file mode 100644 index 79c9f4a419..0000000000 --- a/contrib/ncurses/doc/html/ada/index.htm +++ /dev/null @@ -1,41 +0,0 @@ - -Source Browser - - -

Files

-[T] - -
-

Functions/Procedures

-[ ] -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] - -
- - - - - - - diff --git a/contrib/ncurses/doc/html/ada/main.htm b/contrib/ncurses/doc/html/ada/main.htm deleted file mode 100644 index 464a4f8574..0000000000 --- a/contrib/ncurses/doc/html/ada/main.htm +++ /dev/null @@ -1,70 +0,0 @@ - - -

[No frame version is here]

Files

-[T] - -

Functions/Procedures

-[ ] -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] - -
-You should start your browsing with one of these files: -